summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-11-29 21:02:32 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-11-29 21:02:32 +0000
commit90b819c6d832046840018ff08b9bc5d0e3b69c37 (patch)
treeefea05788cc982395ee114474d84096e7fc70862 /src/include
parente6c5c984461dc4cec0ef2d68524d6bd457e23853 (diff)
downloadskalibs-90b819c6d832046840018ff08b9bc5d0e3b69c37.tar.xz
Revamp lock primitives; prepare for 2.10.0.0 instead of 2.9.4.0
flock() doesn't have a way to test for a lock without taking it. lockf() doesn't have shared locks. The only way to have both is fcntl(). So I rewrote all the locking stuff around fcntl(), and used the opportunity to change the interface. The point of changing the interface is to stop having to bother with the old one, so to hell with compatibility, let's just do a major bump.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/skalibs/djbunix.h12
-rw-r--r--src/include/skalibs/exec.h2
2 files changed, 7 insertions, 7 deletions
diff --git a/src/include/skalibs/djbunix.h b/src/include/skalibs/djbunix.h
index 885a623..1f356e1 100644
--- a/src/include/skalibs/djbunix.h
+++ b/src/include/skalibs/djbunix.h
@@ -9,7 +9,6 @@
#include <skalibs/gccattributes.h>
#include <skalibs/stralloc.h>
-#include <skalibs/exec.h> /* compat */
#define DJBUNIX_FLAG_NB 0x01U
#define DJBUNIX_FLAG_COE 0x02U
@@ -35,12 +34,11 @@ extern size_t fd_catn (int, int, size_t) ;
extern int fd_ensure_open (int, int) ;
#define fd_sanitize() (fd_ensure_open(0, 0) && fd_ensure_open(1, 1) && fd_ensure_open(2, 1))
extern void fd_shutdown (int, int) ;
-extern int lock_ex (int) ;
-extern int lock_exnb (int) ;
-extern int lock_sh (int) ;
-extern int lock_shnb (int) ;
-extern int lock_un (int) ;
-extern void lock_unx (int) ;
+
+extern int fd_lock (int, int, int) ;
+extern void fd_unlock (int) ;
+extern int fd_islocked (int) ;
+
extern int open2 (char const *, unsigned int) ;
extern int open3 (char const *, unsigned int, unsigned int) ;
extern int open_read (char const *) ;
diff --git a/src/include/skalibs/exec.h b/src/include/skalibs/exec.h
index d32d3dc..67fed27 100644
--- a/src/include/skalibs/exec.h
+++ b/src/include/skalibs/exec.h
@@ -139,6 +139,7 @@ extern void xmexec0_af (char const *, char const *const *, char const *const *,
/* Compatibility */
+#if 0
#define pathexec_run(file, argv, envp) exec_ae(file, argv, envp)
#define pathexec0_run(argv, envp) exec0_e(argv, envp)
#define xpathexec_run(file, argv, envp) xexec_ae(file, argv, envp)
@@ -156,5 +157,6 @@ extern void xmexec0_af (char const *, char const *const *, char const *const *,
#define pathexec_r(argv, envp, envlen, modif, modiflen) mexec_fm(argv, envp, envlen, modif, modiflen)
#define xpathexec_r_name(file, argv, envp, envlen, modif, modiflen) xmexec_afm(file, argv, envp, envlen, modif, modiflen)
#define xpathexec_r(argv, envp, envlen, modif, modiflen) xmexec_fm(argv, envp, envlen, modif, modiflen)
+#endif
#endif