summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/include/skalibs/djbunix.h1
-rw-r--r--src/libstddjb/lock_unx.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/src/include/skalibs/djbunix.h b/src/include/skalibs/djbunix.h
index f4cac8a..4dc534e 100644
--- a/src/include/skalibs/djbunix.h
+++ b/src/include/skalibs/djbunix.h
@@ -39,6 +39,7 @@ 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 open2 (char const *, unsigned int) ;
extern int open3 (char const *, unsigned int, unsigned int) ;
extern int open_read (char const *) ;
diff --git a/src/libstddjb/lock_unx.c b/src/libstddjb/lock_unx.c
new file mode 100644
index 0000000..d2f8483
--- /dev/null
+++ b/src/libstddjb/lock_unx.c
@@ -0,0 +1,11 @@
+/* ISC license. */
+
+#include <errno.h>
+#include <skalibs/djbunix.h>
+
+void lock_unx (int fd)
+{
+ int e = errno ;
+ lock_un(fd) ;
+ errno = e ;
+}