#ifndef _EMACS_SOCKET_H #define _EMACS_SOCKET_H 1 #include #include #include #include #include #include #include #include #include #include /* Systemd's first passed file descriptor */ #define SD_LISTEN_FDS_START 3 /* Helper call for identifying a passed file descriptor. Returns 1 if the file descriptor is a socket of type (SOCK_DGRAM, SOCK_STREAM, ...), 0 otherwise. If type is 0 a socket type check will not be done and the call only verifies if the file descriptor refers to a socket. If listening is > 0 it is verified that the socket is in listening mode. (i.e. listen() has been called) If listening is == 0 it is verified that the socket is not in listening mode. If listening is < 0 no listening mode check is done. Returns a negative errno style error code on failure. See https://www.freedesktop.org/software/systemd/man/devel/sd_is_socket.html for more information. */ int sd_is_socket(int fd, int type, int listening); /* Tells systemd that daemon startup or daemon reload is finished. See https://www.freedesktop.org/software/systemd/man/devel/sd_notify.html#Notes for more information. */ int sd_notify_ready(void); /* Tells systemd that the daemon is about to go down. See https://www.freedesktop.org/software/systemd/man/devel/sd_notify.html#Notes for more information. */ int sd_notify_stopping(void); #endif