Home
last modified time | relevance | path

Searched refs:lockfd (Results 1 – 10 of 10) sorted by path

/illumos-gate/usr/src/cmd/allocate/
H A Dallocate3.c644 static int lockfd = -1; in lock_dev() local
664 if ((lockfd == -1) && in lock_dev()
665 (lockfd = open(lockfile, O_RDWR | O_CREAT, 0600)) == -1) { in lock_dev()
671 if (lseek(lockfd, offset, SEEK_SET) == -1) { in lock_dev()
680 ret = lockf(lockfd, F_TLOCK, size); in lock_dev()
682 return (lockfd); in lock_dev()
/illumos-gate/usr/src/cmd/filesync/
H A Dmain.c94 static int lockfd; /* file descriptor for locking baseline */ variable
548 lockfd = creat(file_base, 0666); in findfiles()
550 lockfd = open(file_base, O_RDWR); in findfiles()
552 if (lockfd < 0) { in findfiles()
557 ret = lockf(lockfd, F_TLOCK, 0L); in findfiles()
593 (void) lockf(lockfd, F_ULOCK, 0); in cleanup()
/illumos-gate/usr/src/cmd/fs.d/ufs/mkfs/
H A Dmkfs.c5172 int lockfd; variable
5190 if (ioctl(lockfd, _FIOLFSS, &lockfs) == -1) { in ulockfs()
5209 if (ioctl(lockfd, _FIOLFS, &lockfs) == -1) { in ulockfs()
5227 if ((lockfd = open64(directory, O_RDONLY)) == -1) { in wlockfs()
5235 if (ioctl(lockfd, _FIOLFSS, &lockfs) == -1) { in wlockfs()
5245 if (ioctl(lockfd, _FIOLFS, &lockfs) == -1) { in wlockfs()
/illumos-gate/usr/src/cmd/zlogin/
H A Dzlogin.c1402 release_lock_file(int lockfd) in release_lock_file() argument
1404 (void) close(lockfd); in release_lock_file()
1408 grab_lock_file(const char *zone_name, int *lockfd) in grab_lock_file() argument
1422 if ((*lockfd = open(pathbuf, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR)) < 0) { in grab_lock_file()
1434 if (fcntl(*lockfd, F_SETLKW, &flock) < 0) { in grab_lock_file()
1437 release_lock_file(*lockfd); in grab_lock_file()
1447 int pstatus = 0, error = -1, lockfd, doorfd; in start_zoneadmd() local
1453 if (grab_lock_file(zone_name, &lockfd) != Z_OK) in start_zoneadmd()
1501 release_lock_file(lockfd); in start_zoneadmd()
/illumos-gate/usr/src/cmd/zoneadm/
H A Dzoneadm.c2932 int lockfd; in install_func() local
3054 if (zonecfg_grab_lock_file(target_zone, &lockfd) != Z_OK) { in install_func()
3075 zonecfg_release_lock_file(target_zone, lockfd); in install_func()
3127 zonecfg_release_lock_file(target_zone, lockfd); in install_func()
3558 int lockfd; in clone_func() local
3679 if (zonecfg_grab_lock_file(target_zone, &lockfd) != Z_OK) { in clone_func()
3847 zonecfg_release_lock_file(target_zone, lockfd); in clone_func()
3982 int lockfd; in move_func() local
4104 if (zonecfg_grab_lock_file(target_zone, &lockfd) != Z_OK) { in move_func()
4200 zonecfg_release_lock_file(target_zone, lockfd); in move_func()
[all …]
/illumos-gate/usr/src/lib/libbsm/common/
H A Ddevalloc.c1173 int lockfd = -1; in _da_lock_devdb() local
1192 if ((lockfd = open(lockfile, O_RDWR | O_CREAT, 0600)) == -1) in _da_lock_devdb()
1196 (void) fchown(lockfd, DA_UID, DA_GID); in _da_lock_devdb()
1198 if (lseek(lockfd, (off_t)0, SEEK_SET) == -1) { in _da_lock_devdb()
1200 (void) close(lockfd); in _da_lock_devdb()
1207 ret = lockf(lockfd, F_TLOCK, 0); in _da_lock_devdb()
1210 return (lockfd); in _da_lock_devdb()
1214 (void) close(lockfd); in _da_lock_devdb()
1243 int lockfd = -1; in da_open_devdb() local
1260 if ((lockfd = _da_lock_devdb(rootdir)) == -1) in da_open_devdb()
[all …]
/illumos-gate/usr/src/lib/libc/port/gen/
H A Dgetutx.c1079 int lockfd; in lockutx() local
1081 if ((lockfd = open(UTMPX_FILE, O_RDWR|O_CREAT, 0644)) < 0) in lockutx()
1084 if (lockf(lockfd, F_LOCK, 0) < 0) { in lockutx()
1085 (void) close(lockfd); in lockutx()
1090 fd = lockfd; in lockutx()
/illumos-gate/usr/src/lib/libshare/common/
H A Dlibshare.c838 int lockfd; in sa_init_impl() local
888 lockfd = open(DFS_LOCK_FILE, O_RDWR); in sa_init_impl()
889 if (lockfd >= 0) { in sa_init_impl()
891 (void) lockf(lockfd, F_LOCK, 0); in sa_init_impl()
932 (void) lockf(lockfd, F_ULOCK, in sa_init_impl()
934 (void) close(lockfd); in sa_init_impl()
983 (void) lockf(lockfd, in sa_init_impl()
985 (void) close(lockfd); in sa_init_impl()
1013 (void) lockf(lockfd, F_ULOCK, 0); in sa_init_impl()
1014 (void) close(lockfd); in sa_init_impl()
/illumos-gate/usr/src/lib/libzonecfg/common/
H A Dlibzonecfg.c7385 zonecfg_release_lock_file(const char *zone_name, int lockfd) in zonecfg_release_lock_file() argument
7398 assert(lockfd == -1); in zonecfg_release_lock_file()
7407 assert(lockfd >= 0); in zonecfg_release_lock_file()
7408 (void) close(lockfd); in zonecfg_release_lock_file()
7412 zonecfg_grab_lock_file(const char *zone_name, int *lockfd) in zonecfg_grab_lock_file() argument
7426 *lockfd = -1; in zonecfg_grab_lock_file()
7455 if ((*lockfd = open(pathbuf, O_RDWR|O_CREAT, S_IRUSR|S_IWUSR)) < 0) { in zonecfg_grab_lock_file()
7467 if ((fcntl(*lockfd, F_SETLKW, &flock) < 0) || in zonecfg_grab_lock_file()
7471 zonecfg_release_lock_file(zone_name, *lockfd); in zonecfg_grab_lock_file()
7479 zonecfg_lock_file_held(int *lockfd) in zonecfg_lock_file_held() argument
[all …]
/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) { in lock_db()
71 lockfd = open(dblock, O_WRONLY); in lock_db()
72 if (lockfd == -1) { in lock_db()
83 retval = fcntl(lockfd, F_SETLK, &flock); in lock_db()
106 if (lockfd != -1) { in unlock_db()
108 (void) fcntl(lockfd, F_SETLK, &flock); in unlock_db()
109 (void) close(lockfd); in unlock_db()
110 lockfd = -1; in unlock_db()