Searched defs:lockfd (Results 1 - 11 of 11) sorted by relevance

/illumos-gate/usr/src/lib/pam_modules/authtok_check/
H A Ddict.c35 static int lockfd = -1; variable
69 if ((lockfd = open(dblock, O_WRONLY|O_CREAT|O_EXCL, 0400)) == -1) {
71 lockfd = open(dblock, O_WRONLY);
72 if (lockfd == -1) {
83 retval = fcntl(lockfd, F_SETLK, &flock);
106 if (lockfd != -1) {
108 (void) fcntl(lockfd, F_SETLK, &flock);
109 (void) close(lockfd);
110 lockfd = -1;
/illumos-gate/usr/src/cmd/filesync/
H A Dmain.c96 static int lockfd; /* file descriptor for locking baseline */ variable
550 lockfd = creat(file_base, 0666);
552 lockfd = open(file_base, O_RDWR);
554 if (lockfd < 0) {
559 ret = lockf(lockfd, F_TLOCK, 0L);
595 (void) lockf(lockfd, F_ULOCK, 0);
/illumos-gate/usr/src/lib/lvm/libmeta/common/
H A Dmeta_setup.c143 #define META_LOCK_FD(sp) ((sp)->lockfd)
155 int lockfd = META_LOCK_FD(sp); local
159 if (lockfd >= 0)
161 assert(lockfd == MD_NO_LOCK);
164 if ((lockfd = open(lockname, O_WRONLY, 0)) < 0) {
166 lockfd = MD_NO_LOCK;
173 if ((lockfd = open(lockname, (O_WRONLY|O_CREAT),
178 if (fchmod(lockfd, 0644) != 0) {
188 META_LOCK_FD(sp) = lockfd;
195 if (lockfd >
231 int lockfd = META_LOCK_FD(sp); local
258 int lockfd; local
311 int lockfd; local
361 int lockfd; local
[all...]
/illumos-gate/usr/src/lib/libc/port/gen/
H A Dgetutx.c1080 int lockfd; local
1082 if ((lockfd = open(UTMPX_FILE, O_RDWR|O_CREAT, 0644)) < 0)
1085 if (lockf(lockfd, F_LOCK, 0) < 0) {
1086 (void) close(lockfd);
1091 fd = lockfd;
/illumos-gate/usr/src/cmd/allocate/
H A Dallocate3.c644 static int lockfd = -1; local
664 if ((lockfd == -1) &&
665 (lockfd = open(lockfile, O_RDWR | O_CREAT, 0600)) == -1) {
671 if (lseek(lockfd, offset, SEEK_SET) == -1) {
680 ret = lockf(lockfd, F_TLOCK, size);
682 return (lockfd);
/illumos-gate/usr/src/lib/libshare/common/
H A Dlibshare.c833 int lockfd; local
880 lockfd = open(DFS_LOCK_FILE, O_RDWR);
881 if (lockfd >= 0) {
884 (void) lockf(lockfd, F_LOCK, 0);
925 (void) lockf(lockfd, F_ULOCK,
927 (void) close(lockfd);
976 (void) lockf(lockfd,
978 (void) close(lockfd);
1006 (void) lockf(lockfd, F_ULOCK, 0);
1007 (void) close(lockfd);
[all...]
/illumos-gate/usr/src/lib/libbsm/common/
H A Ddevalloc.c1173 int lockfd = -1; local
1192 if ((lockfd = open(lockfile, O_RDWR | O_CREAT, 0600)) == -1)
1196 (void) fchown(lockfd, DA_UID, DA_GID);
1198 if (lseek(lockfd, (off_t)0, SEEK_SET) == -1) {
1200 (void) close(lockfd);
1207 ret = lockf(lockfd, F_TLOCK, 0);
1210 return (lockfd);
1214 (void) close(lockfd);
1243 int lockfd = -1; local
1260 if ((lockfd
1434 int rc = 0, lockfd = 0, tmpfd = 0; local
1502 int lockfd = -1; local
[all...]
/illumos-gate/usr/src/cmd/zlogin/
H A Dzlogin.c1401 release_lock_file(int lockfd) argument
1403 (void) close(lockfd);
1407 grab_lock_file(const char *zone_name, int *lockfd) argument
1421 if ((*lockfd = open(pathbuf, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
1433 if (fcntl(*lockfd, F_SETLKW, &flock) < 0) {
1436 release_lock_file(*lockfd);
1446 int pstatus = 0, error = -1, lockfd, doorfd; local
1452 if (grab_lock_file(zone_name, &lockfd) != Z_OK)
1500 release_lock_file(lockfd);
/illumos-gate/usr/src/cmd/zoneadm/
H A Dzoneadm.c2923 int lockfd; local
3045 if (zonecfg_grab_lock_file(target_zone, &lockfd) != Z_OK) {
3066 zonecfg_release_lock_file(target_zone, lockfd);
3118 zonecfg_release_lock_file(target_zone, lockfd);
3549 int lockfd; local
3670 if (zonecfg_grab_lock_file(target_zone, &lockfd) != Z_OK) {
3838 zonecfg_release_lock_file(target_zone, lockfd);
3973 int lockfd; local
4095 if (zonecfg_grab_lock_file(target_zone, &lockfd) != Z_OK) {
4191 zonecfg_release_lock_file(target_zone, lockfd);
4294 int lockfd = -1; local
4632 int lockfd = -1; local
4905 int lockfd, answer; local
5167 int err, lockfd; local
[all...]
/illumos-gate/usr/src/cmd/fs.d/ufs/mkfs/
H A Dmkfs.c5171 int lockfd; variable
5189 if (ioctl(lockfd, _FIOLFSS, &lockfs) == -1) {
5208 if (ioctl(lockfd, _FIOLFS, &lockfs) == -1) {
5226 if ((lockfd = open64(directory, O_RDONLY)) == -1) {
5234 if (ioctl(lockfd, _FIOLFSS, &lockfs) == -1) {
5244 if (ioctl(lockfd, _FIOLFS, &lockfs) == -1) {
/illumos-gate/usr/src/lib/libzonecfg/common/
H A Dlibzonecfg.c7383 zonecfg_release_lock_file(const char *zone_name, int lockfd) argument
7396 assert(lockfd == -1);
7405 assert(lockfd >= 0);
7406 (void) close(lockfd);
7410 zonecfg_grab_lock_file(const char *zone_name, int *lockfd) argument
7424 *lockfd = -1;
7453 if ((*lockfd = open(pathbuf, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR)) < 0) {
7465 if ((fcntl(*lockfd, F_SETLKW, &flock) < 0) ||
7469 zonecfg_release_lock_file(zone_name, *lockfd);
7477 zonecfg_lock_file_held(int *lockfd) argument
7529 int doorfd, lockfd; local
[all...]

Completed in 154 milliseconds