paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

Functions
close_on_fork.c File Reference

Manage a list of fds that should be closed on fork. More...

#include <regex.h>
#include "para.h"
#include "list.h"
#include "string.h"
#include "close_on_fork.h"

Functions

void add_close_on_fork_list (int fd)
 Add one file descriptor to the close-on-fork list. More...
 
void del_close_on_fork_list (int fd)
 Delete one file descriptor from the close-on-fork list. More...
 
void close_listed_fds (void)
 Close all fds in the list and destroy all list entries. More...
 
void deplete_close_on_fork_list (void)
 Remove all listed fds from the close on fork list. More...
 

Detailed Description

Manage a list of fds that should be closed on fork.

Function Documentation

◆ add_close_on_fork_list()

void add_close_on_fork_list ( int  fd)

Add one file descriptor to the close-on-fork list.

Parameters
fdThe file descriptor to add.

References alloc().

Referenced by generic_com_on().

◆ del_close_on_fork_list()

void del_close_on_fork_list ( int  fd)

Delete one file descriptor from the close-on-fork list.

Parameters
fdThe file descriptor to delete.

Noop if fd does not belong to the close-on-fork list.

Referenced by generic_com_off(), and shutdown_client().

◆ close_listed_fds()

void close_listed_fds ( void  )

Close all fds in the list and destroy all list entries.

This function calls close(3) for each fd in the close-on-fork list and empties the list afterwards.

See also
deplete_close_on_fork_list().

◆ deplete_close_on_fork_list()

void deplete_close_on_fork_list ( void  )

Remove all listed fds from the close on fork list.

This is like close_listed_fds() but does not close the fds.