Home
last modified time | relevance | path

Searched refs:lock_fd (Results 1 – 19 of 19) sorted by relevance

/illumos-gate/usr/src/lib/libzonecfg/common/
H A Dgetzoneent.c201 int lock_fd; in lock_index_file() local
214 if (lock_fd == -1) in lock_index_file()
223 (void) close(lock_fd); in lock_index_file()
227 return (lock_fd); in lock_index_file()
231 unlock_index_file(int lock_fd) in unlock_index_file() argument
243 if (close(lock_fd) == -1) in unlock_index_file()
273 int tmp_file_desc, lock_fd, err; in putzoneent() local
306 (void) unlock_index_file(lock_fd); in putzoneent()
316 (void) unlock_index_file(lock_fd); in putzoneent()
472 if (unlock_index_file(lock_fd) != Z_OK) in putzoneent()
[all …]
/illumos-gate/usr/src/lib/libdladm/common/
H A Dlibdlflow.c83 int lock_fd; in i_dladm_flow_lock_db() local
96 (void) close(lock_fd); in i_dladm_flow_lock_db()
100 return (lock_fd); in i_dladm_flow_lock_db()
326 int nfd, fn_rc, lock_fd; in i_dladm_flow_walk_rw_db() local
350 i_dladm_flow_unlock_db(lock_fd); in i_dladm_flow_walk_rw_db()
357 i_dladm_flow_unlock_db(lock_fd); in i_dladm_flow_walk_rw_db()
365 i_dladm_flow_unlock_db(lock_fd); in i_dladm_flow_walk_rw_db()
419 i_dladm_flow_unlock_db(lock_fd); in i_dladm_flow_walk_rw_db()
426 i_dladm_flow_unlock_db(lock_fd); in i_dladm_flow_walk_rw_db()
490 int lock_fd; in i_dladm_flow_create_db() local
[all …]
H A Dlibdladm.c598 int lock_fd; in i_dladm_lock_db() local
613 (void) close(lock_fd); in i_dladm_lock_db()
618 return (lock_fd); in i_dladm_lock_db()
735 int nfd, lock_fd; in i_dladm_rw_db() local
748 if ((lock_fd = i_dladm_lock_db in i_dladm_rw_db()
756 i_dladm_unlock_db(lock, lock_fd); in i_dladm_rw_db()
769 i_dladm_unlock_db(lock, lock_fd); in i_dladm_rw_db()
777 i_dladm_unlock_db(lock, lock_fd); in i_dladm_rw_db()
809 i_dladm_unlock_db(lock, lock_fd); in i_dladm_rw_db()
813 i_dladm_unlock_db(lock, lock_fd); in i_dladm_rw_db()
[all …]
/illumos-gate/usr/src/cmd/svr4pkg/libinst/
H A Dlockinst.c76 static int lock_fd, lock_is_applied; variable
194 lock_fd = fd; in lockinst()
256 (void) wrlockdata(lock_fd, lock_pid, lock_name, lock_pkg, place, in lockupd()
268 (void) wrlockdata(lock_fd, lock_pid, lock_name, lock_pkg, in unlockinst()
276 if (close(lock_fd) != -1) in unlockinst()
H A Docfile.c106 static int lock_fd; /* fd of LOCKFILE. */ variable
569 lock_fd = open(lockpath, O_RDWR|O_CREAT|O_TRUNC|O_EXCL, 0644); in pkgWlock()
570 if (lock_fd < 0) { in pkgWlock()
575 (void) fchmod(lock_fd, 0644); /* force perms. */ in pkgWlock()
578 if ((lock_fd = open(lockpath, O_RDWR)) == -1) { in pkgWlock()
590 if (lockf(lock_fd, F_LOCK, 0)) { in pkgWlock()
632 if (close(lock_fd)) in pkgWunlock()
/illumos-gate/usr/src/cmd/sendmail/libsmdb/
H A Dsmdb.c318 smdb_lock_file(lock_fd, db_name, mode, sff, extension) in smdb_lock_file() argument
319 int *lock_fd; in smdb_lock_file()
333 *lock_fd = safeopen(file_name, mode & ~O_TRUNC, DBMMODE, sff);
334 if (*lock_fd < 0)
352 smdb_unlock_file(lock_fd) in smdb_unlock_file() argument
353 int lock_fd; in smdb_unlock_file()
357 result = close(lock_fd);
H A Dsmdb1.c461 int lock_fd; local
492 lock_fd = -1;
493 result = smdb_lock_file(&lock_fd, db_name, mode, sff,
510 (void) smdb_unlock_file(lock_fd);
515 db1->smdb1_lock_fd = lock_fd;
H A Dsmndbm.c499 int lock_fd; local
527 lock_fd = -1;
528 result = smdb_lock_file(&lock_fd, db_name, mode, sff,
542 (void) close(lock_fd);
562 db->smndbm_lock_fd = lock_fd;
H A Dsmdb2.c579 int lock_fd; local
605 lock_fd = -1;
611 result = smdb_lock_file(&lock_fd, db_name, mode, sff,
626 smdb_unlock_file(lock_fd);
631 db2->smdb2_lock_fd = lock_fd;
/illumos-gate/usr/src/cmd/lp/cmd/lpsched/
H A Dlpsched.c46 int lock_fd = -1; variable
211 if ((lock_fd = open_locked(Lp_Schedlock, "a", 0664)) < 0) in startup()
216 close(lock_fd); in startup()
223 if ((lock_fd = open_locked(Lp_Schedlock, "w", 0664)) < 0) in startup()
282 (void) close(lock_fd); in lpshut()
H A Dlpsched.h397 extern int lock_fd;
H A Dexec.c81 (void)Fcntl (lock_fd, F_SETLK, &l); in relock()
/illumos-gate/usr/src/cmd/allocate/
H A Dallocate3.c1149 int *lock_fd) in _allocate_dev() argument
1356 int lock_fd = -1; in allocate() local
1378 &lock_fd); in allocate()
1416 if (lock_fd != -1) in allocate()
1417 (void) close(lock_fd); in allocate()
1434 int lock_fd = -1; in deallocate() local
1459 zonename, &lock_fd); in deallocate()
1482 zonename, &lock_fd); in deallocate()
1533 &lock_fd); in deallocate()
1547 if (lock_fd != -1) in deallocate()
[all …]
/illumos-gate/usr/src/cmd/syseventadm/
H A Dsyseventadm.c87 static int lock_fd; variable
229 lock_fd = open(lock_file, O_CREAT|O_RDWR, 0644); in enter_lock()
230 if (lock_fd < 0) { in enter_lock()
242 if (fcntl(lock_fd, F_SETLKW, &lock) == -1) { in enter_lock()
245 (void) close(lock_fd); in enter_lock()
263 if (fcntl(lock_fd, F_SETLK, &lock) == -1) { in exit_lock()
268 if (close(lock_fd) == -1) { in exit_lock()
/illumos-gate/usr/src/cmd/syseventd/modules/sysevent_conf_mod/
H A Dsysevent_conf_mod.c809 int lock_fd; in enter_lock() local
813 if (lock_fd < 0) { in enter_lock()
825 if (fcntl(lock_fd, F_SETLKW, &lock) == -1) { in enter_lock()
828 (void) close(lock_fd); in enter_lock()
834 return (lock_fd); in enter_lock()
839 exit_lock(int lock_fd, char *lock_file) in exit_lock() argument
848 if (fcntl(lock_fd, F_SETLK, &lock) == -1) { in exit_lock()
853 if (close(lock_fd) == -1) { in exit_lock()
2154 int lock_fd; in slm_init() local
2221 if ((lock_fd = enter_lock(lock_file)) == -1) { in slm_init()
[all …]
H A Dsysevent_conf_mod.h146 static void exit_lock(int lock_fd, char *lock_file);
/illumos-gate/usr/src/cmd/krb5/slave/
H A Dkpropd.c530 int lock_fd; local
658 lock_fd = open(temp_file_name, O_RDWR|O_CREAT, 0600);
660 retval = krb5_lock_file(doit_context, lock_fd,
683 retval = krb5_lock_file(doit_context, lock_fd, KRB5_LOCKMODE_SHARED);
691 retval = krb5_lock_file(doit_context, lock_fd, KRB5_LOCKMODE_UNLOCK);
697 (void)close(lock_fd);
/illumos-gate/usr/src/lib/libdevinfo/
H A Ddevinfo_devlink.c411 proto.lock_fd = -1; in handle_alloc()
1093 assert(hdp->lock_fd == -1); in handle_free()
3085 assert(hdp->lock_fd < 0); in enter_db_lock()
3144 hdp->lock_fd = fd; in enter_db_lock()
3166 if (hdp->lock_fd < 0) { in exit_db_lock()
3177 if (fcntl(hdp->lock_fd, F_SETLK, &unlock) == -1) { in exit_db_lock()
3182 (void) close(hdp->lock_fd); in exit_db_lock()
3184 hdp->lock_fd = -1; in exit_db_lock()
H A Ddevinfo_devlink.h147 int lock_fd; /* lock file for updates */ member