#include <XrdOucSxeq.hh>
|
| static const int | Lock = 0x0008 |
| |
| static const int | noWait = 0x0001 |
| |
| static const int | Share = 0x0002 |
| |
| static const int | Unlink = 0x0004 |
| |
Definition at line 33 of file XrdOucSxeq.hh.
◆ XrdOucSxeq() [1/2]
| XrdOucSxeq::XrdOucSxeq |
( |
int |
sOpts, |
|
|
const char * |
path |
|
) |
| |
Definition at line 48 of file XrdOucSxeq.cc.
50 static const int AMode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
56 if ((lokFD =
open(lokFN, O_CREAT|O_RDWR, AMode)) < 0) lokRC = errno;
int Serialize(int Opts=0)
References open, and Serialize().
◆ XrdOucSxeq() [2/2]
| XrdOucSxeq::XrdOucSxeq |
( |
const char * |
sfx, |
|
|
const char * |
sfx1 = 0, |
|
|
const char * |
Dir = "/tmp/" |
|
) |
| |
Definition at line 64 of file XrdOucSxeq.cc.
66 static const int AMode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
67 char pbuff[MAXPATHLEN+1], *pP;
72 pP = pbuff + strlen(
Dir);
73 if (*sfx1 !=
'/' && *(pP-1) !=
'/') *pP++ =
'/';
75 if (sfx2) strcpy(pP+strlen(sfx1), sfx2);
76 lokFN = strdup(pbuff);
81 if ((lokFD =
open(lokFN, O_CREAT|O_RDWR, AMode)) < 0) lokRC = errno;
References Dir, and open.
◆ ~XrdOucSxeq()
| XrdOucSxeq::~XrdOucSxeq |
( |
| ) |
|
◆ Detach()
| int XrdOucSxeq::Detach |
( |
| ) |
|
|
inline |
◆ lastError()
| int XrdOucSxeq::lastError |
( |
| ) |
|
|
inline |
◆ Release() [1/2]
| int XrdOucSxeq::Release |
( |
| ) |
|
Definition at line 106 of file XrdOucSxeq.cc.
113 if (lokFD < 0)
return 0;
117 bzero(&lock_args,
sizeof(lock_args));
118 lock_args.l_type = F_UNLCK;
122 do {rc = fcntl(lokFD, F_SETLKW, &lock_args);}
123 while(rc < 0 && errno == EINTR);
127 if (rc < 0) {lokRC = errno;
return 0;}
References FLOCK_t.
Referenced by XrdFrcXLock::~XrdFrcXLock().
◆ Release() [2/2]
| int XrdOucSxeq::Release |
( |
int |
fileD | ) |
|
|
static |
Definition at line 137 of file XrdOucSxeq.cc.
144 if (fileD < 0)
return EBADF;
148 bzero(&lock_args,
sizeof(lock_args));
149 lock_args.l_type = F_UNLCK;
153 do {rc = fcntl(fileD, F_SETLKW, &lock_args);}
154 while(rc < 0 && errno == EINTR);
158 return (rc ? errno : 0);
References FLOCK_t.
◆ Serialize() [1/2]
| int XrdOucSxeq::Serialize |
( |
int |
fileD, |
|
|
int |
Opts |
|
) |
| |
|
static |
Definition at line 200 of file XrdOucSxeq.cc.
206 if (fileD < 0)
return EBADF;
210 bzero(&lock_args,
sizeof(lock_args));
211 if (
opts &
Share) lock_args.l_type = F_RDLCK;
212 else lock_args.l_type = F_WRLCK;
216 if (fcntl(fileD, (
opts &
noWait ? F_SETLK : F_SETLKW), &lock_args))
References FLOCK_t, noWait, opts, and Share.
◆ Serialize() [2/2]
| int XrdOucSxeq::Serialize |
( |
int |
Opts = 0 | ) |
|
◆ Lock
| const int XrdOucSxeq::Lock = 0x0008 |
|
static |
◆ noWait
| const int XrdOucSxeq::noWait = 0x0001 |
|
static |
◆ Share
| const int XrdOucSxeq::Share = 0x0002 |
|
static |
◆ Unlink
| const int XrdOucSxeq::Unlink = 0x0004 |
|
static |
The documentation for this class was generated from the following files: