i3
sd-daemon.c File Reference
#include "sd-daemon.h"
#include <errno.h>
#include <netinet/in.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/fcntl.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
Include dependency graph for sd-daemon.c:

Go to the source code of this file.

Data Structures

union  sockaddr_union
 

Macros

#define _GNU_SOURCE
 

Functions

int sd_listen_fds (int unset_environment)
 
int sd_is_fifo (int fd, const char *path)
 
static int sd_is_socket_internal (int fd, int type, int listening)
 
int sd_is_socket (int fd, int family, int type, int listening)
 
int sd_is_socket_inet (int fd, int family, int type, int listening, uint16_t port)
 
int sd_is_socket_unix (int fd, int type, int listening, const char *path, size_t length)
 
int sd_notify (int unset_environment, const char *state)
 
int sd_notifyf (int unset_environment, const char *format,...)
 
int sd_booted (void)
 

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE

Definition at line 28 of file sd-daemon.c.

Function Documentation

◆ sd_booted()

int sd_booted ( void )

Definition at line 454 of file sd-daemon.c.

◆ sd_is_fifo()

int sd_is_fifo ( int fd,
const char * path )

Definition at line 124 of file sd-daemon.c.

◆ sd_is_socket()

int sd_is_socket ( int fd,
int family,
int type,
int listening )

Definition at line 219 of file sd-daemon.c.

References sockaddr_union::sa, and sd_is_socket_internal().

Here is the call graph for this function:

◆ sd_is_socket_inet()

int sd_is_socket_inet ( int fd,
int family,
int type,
int listening,
uint16_t port )

Definition at line 251 of file sd-daemon.c.

References sockaddr_union::in4, sockaddr_union::in6, sockaddr_union::sa, and sd_is_socket_internal().

Here is the call graph for this function:

◆ sd_is_socket_internal()

static int sd_is_socket_internal ( int fd,
int type,
int listening )
static

Definition at line 159 of file sd-daemon.c.

Referenced by sd_is_socket(), sd_is_socket_inet(), and sd_is_socket_unix().

◆ sd_is_socket_unix()

int sd_is_socket_unix ( int fd,
int type,
int listening,
const char * path,
size_t length )

Definition at line 305 of file sd-daemon.c.

References sockaddr_union::sa, sd_is_socket_internal(), and sockaddr_union::un.

Here is the call graph for this function:

◆ sd_listen_fds()

int sd_listen_fds ( int unset_environment)

Definition at line 47 of file sd-daemon.c.

References SD_LISTEN_FDS_START.

Referenced by main().

◆ sd_notify()

int sd_notify ( int unset_environment,
const char * state )

Definition at line 353 of file sd-daemon.c.

References sockaddr_union::sa, state, and sockaddr_union::un.

Referenced by main(), and sd_notifyf().

◆ sd_notifyf()

int sd_notifyf ( int unset_environment,
const char * format,
... )

Definition at line 431 of file sd-daemon.c.

References sd_notify().

Here is the call graph for this function: