summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-07-12 18:22:55 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-07-12 18:22:55 +0000
commitf7c2e436ed0144d09cff0e3ac90f510a47f0aeac (patch)
tree2306f029b468623ed316ac3df40a4df8d13c5c5e /src/include
parentf80dbef73f98ae1a801078e5f69a071651e6b52d (diff)
downloads6-f7c2e436ed0144d09cff0e3ac90f510a47f0aeac.tar.xz
Add s6_svc_lock_take() and s6_svc_lock_release()
Allows fixing a race condition in s6-rc-init. s6-supervise also creates event/ before supervise/ so that locking the servicedir ensures event/ can be used.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/s6/s6-supervise.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/s6/s6-supervise.h b/src/include/s6/s6-supervise.h
index f0b08e7..541c30d 100644
--- a/src/include/s6/s6-supervise.h
+++ b/src/include/s6/s6-supervise.h
@@ -5,6 +5,7 @@
#include <sys/types.h>
#include <skalibs/tai.h>
+#include <skalibs/djbunix.h>
#define S6_SUPERVISE_CTLDIR "supervise"
#define S6_SUPERVISE_EVENTDIR "event"
@@ -17,6 +18,9 @@ extern int s6_svc_write (char const *, char const *, size_t) ;
extern int s6_svc_writectl (char const *, char const *, char const *, size_t) ;
extern int s6_svc_main (int, char const *const *, char const *, char const *, char const *) ;
+extern int s6_svc_lock_take (char const *) ;
+#define s6_svc_lock_release(fdlock) lock_un(fdlock)
+
typedef struct s6_svstatus_s s6_svstatus_t, *s6_svstatus_t_ref ;
struct s6_svstatus_s
{