/*++ /* NAME /* myflock 3 /* SUMMARY /* lock open file /* SYNOPSIS /* #include <myflock.h> /* /* int myflock(fd, lock_style, operation) /* int fd; /* int lock_style; /* int operation; /* DESCRIPTION /* myflock() locks or unlocks an entire open file. /* /* In the case of a blocking request, a call that fails due to /* foreseeable transient problems is retried once per second. /* /* Arguments: /* .IP fd /* The open file to be locked/unlocked. /* .IP lock_style /* One of the following values: /* .RS /* .IP MYFLOCK_STYLE_FLOCK /* Use BSD-style flock() locking. /* .IP MYFLOCK_STYLE_FCNTL /* Use POSIX-style fcntl() locking. /* .RE /* .IP operation /* One of the following values: /* .RS /* .IP MYFLOCK_OP_NONE /* Release any locks the process has on the specified open file. /* .IP MYFLOCK_OP_SHARED /* Attempt to acquire a shared lock on the specified open file. /* This is appropriate for read-only access. /* .IP MYFLOCK_OP_EXCLUSIVE /* Attempt to acquire an exclusive lock on the specified open /* file. This is appropriate for write access. /* .PP /* In addition, setting the MYFLOCK_OP_NOWAIT bit causes the /* call to return immediately when the requested lock cannot /* be acquired. /* .RE /* DIAGNOSTICS /* myflock() returns 0 in case of success, -1 in case of failure. /* A problem description is returned via the global \fIerrno\fR /* variable. In the case of a non-blocking lock request the value /* EAGAIN means that a lock is claimed by someone else. /* /* Panic: attempts to use an unsupported file locking method or /* to implement an unsupported operation. /* LICENSE /* .ad /* .fi /* The Secure Mailer license must be distributed with this software. /* AUTHOR(S) /* Wietse Venema /* IBM T.J. Watson Research /* P.O. Box 704 /* Yorktown Heights, NY 10598, USA
/*--*/
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.