diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2018-03-20 14:52:26 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2018-03-20 14:52:26 +0000 |
commit | 26c5fee82736e56cff3d114ff9d6e3969d1ce061 (patch) | |
tree | a43283438dc8d22b339cda86b0d80c58ef86bf4d /src/include | |
parent | 1747a0f5142f0c36a61b37786368f05bcb3060f3 (diff) | |
download | s6-26c5fee82736e56cff3d114ff9d6e3969d1ce061.tar.gz s6-26c5fee82736e56cff3d114ff9d6e3969d1ce061.tar.xz s6-26c5fee82736e56cff3d114ff9d6e3969d1ce061.zip |
Add death tally support to s6-supervise, throttling support to s6_svstatus_t
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/s6/s6-supervise.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/include/s6/s6-supervise.h b/src/include/s6/s6-supervise.h index bbd8539..187bc20 100644 --- a/src/include/s6/s6-supervise.h +++ b/src/include/s6/s6-supervise.h @@ -11,6 +11,8 @@ #define S6_SVSCAN_CTLDIR ".s6-svscan" #define S6_SVSTATUS_FILENAME S6_SUPERVISE_CTLDIR "/status" #define S6_SVSTATUS_SIZE 35 +#define S6_DTALLY_FILENAME S6_SUPERVISE_CTLDIR "/death_tally" +#define S6_MAX_DEATH_TALLY 4096 extern int s6_svc_ok (char const *) ; extern int s6_svc_write (char const *, char const *, size_t) ; @@ -32,6 +34,7 @@ struct s6_svstatus_s unsigned int flagwant : 1 ; /* unused */ unsigned int flagwantup : 1 ; unsigned int flagready : 1 ; + unsigned int flagthrottled : 1 ; } ; #define S6_SVSTATUS_ZERO \ @@ -44,7 +47,8 @@ struct s6_svstatus_s .flagfinishing = 0, \ .flagwant = 1, \ .flagwantup = 1, \ - .flagready = 1 \ + .flagready = 1, \ + .flagthrottled = 0 \ } extern void s6_svstatus_pack (char *, s6_svstatus_t const *) ; @@ -56,4 +60,20 @@ extern int s6_svstatus_write (char const *, s6_svstatus_t const *) ; extern int s6_supervise_lock (char const *) ; extern int s6_supervise_lock_mode (char const *, unsigned int, unsigned int) ; +typedef struct s6_dtally_s s6_dtally_t, *s6_dtally_ref ; +struct s6_dtally_s +{ + tain_t stamp ; + unsigned char exitcode ; + unsigned char sig ; +} ; +#define S6_DTALLY_ZERO { .stamp = TAIN_ZERO, .exitcode = 0, .sig = 0 } + +#define S6_DTALLY_PACK (TAIN_PACK + 2) + +extern void s6_dtally_pack (char *, s6_dtally_t const *) ; +extern void s6_dtally_unpack (char const *, s6_dtally_t *) ; +extern ssize_t s6_dtally_read (char const *, s6_dtally_t *, size_t) ; +extern int s6_dtally_write (char const *, s6_dtally_t const *, size_t) ; + #endif |