From 90b819c6d832046840018ff08b9bc5d0e3b69c37 Mon Sep 17 00:00:00 2001
From: Laurent Bercot Download
-
- int lock_ex (int fd)
-Gets an exclusive advisory lock on fd. fd must point to
-a regular file, open for writing. Blocks until the lock can be obtained.
-Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
-
- int lock_exnb (int fd)
-Gets an exclusive advisory lock on fd. fd must point to
-a regular file, open for writing.
-Returns 0 if it succeeds, or -1 (and sets errno) if it fails. If the lock
-is held and the function would block, it immediately returns with -1 EWOULDBLOCK.
-
- int lock_sh (int fd)
-Gets a shared advisory lock on fd. fd must point to
-a regular file, open for reading. Blocks until the lock can be obtained.
-Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
-
- int lock_shnb (int fd)
-Gets a shared advisory lock on fd. fd must point to
-a regular file, open for reading.
-Returns 0 if it succeeds, or -1 (and sets errno) if it fails. If the lock
-is held and the function would block, it immediately returns with -1 EWOULDBLOCK.
+ int fd_lock (int fd, int w, int nb)
+Gets an advisory lock on fd: shared if w is
+zero, exclusive otherwise. fd must point to
+a regular file, open for writing or reading depending on whether
+you want an exclusive lock or not. If nb is zero, the
+function blocks until the lock can be obtained; otherwise it
+returns 0 immediately. On success, the function returns 1 ; it
+returns 0 if it cannot take the lock, or -1 (and sets errno) if
+an error occurs.
- int lock_un (int fd)
+ void fd_unlock (int fd)
Releases a previously held lock on fd.
-Returns 0 if it succeeds, or -1 (and sets errno) if it fails.
- void lock_unx (int fd)
-Like lock_un, but without a return code and without
-modifying errno.
+ int fd_islocked (int fd)
+Returns 1 if a lock is currently held on fd, 0 otherwise.
+Returns -1 (and sets errno) if an error occurs.
diff --git a/doc/license.html b/doc/license.html index 9aae77e..bfc1d5f 100644 --- a/doc/license.html +++ b/doc/license.html @@ -74,7 +74,7 @@ color, or different text font.
I am aware that the previous restrictions sound completely ridiculous while the official skalibs documentation is incomplete. -As of 2.9.4.0, I'm not going to enforce those restrictions, but if you're +As of 2.10.0.0, I'm not going to enforce those restrictions, but if you're going to provide documentation for skalibs, don't keep it to yourself, please send it to me instead. :-)
diff --git a/doc/upgrade.html b/doc/upgrade.html index da2185c..8a87d7d 100644 --- a/doc/upgrade.html +++ b/doc/upgrade.html @@ -16,7 +16,7 @@ skarnet.org -