s6

Mirror/fork of https://skarnet.org/software/s6/
git clone https://ccx.te2000.cz/git/s6
Log | Files | Refs | README | LICENSE

s6_svstatus_pack.c (508B)


      1 /* ISC license. */
      2 
      3 #include <stdint.h>
      4 #include <skalibs/uint16.h>
      5 #include <skalibs/uint64.h>
      6 #include <skalibs/tai.h>
      7 #include <s6/supervise.h>
      8 
      9 void s6_svstatus_pack (char *pack, s6_svstatus_t const *sv)
     10 {
     11   tain_pack(pack, &sv->stamp) ;
     12   tain_pack(pack + 12, &sv->readystamp) ;
     13   uint64_pack_big(pack + 24, (uint64_t)sv->pid) ;
     14   uint16_pack_big(pack + 32, (uint16_t)sv->wstat) ;
     15   pack[34] =
     16     sv->flagpaused |
     17     (sv->flagfinishing << 1) |
     18     (sv->flagwantup << 2) |
     19     (sv->flagready << 3) ;
     20 }