MPD

- Main Page
- Data Structures
- Files

- File List
- Globals

Functions

# src/fd_util.h File Reference

`#include <stdbool.h>`
`#include <stddef.h>`
`#include <sys/types.h>`

Go to the source code of this file.

## Functions
int | dup_cloexec (int oldfd)
| Wrapper for dup(), which sets the CLOEXEC flag on the new descriptor.
int | open_cloexec (const char *path_fs, int flags, int mode)
| Wrapper for open(), which sets the CLOEXEC flag (atomically if supported by the OS).
int | pipe_cloexec (int fd[2])
| Wrapper for pipe(), which sets the CLOEXEC flag (atomically if supported by the OS).
int | pipe_cloexec_nonblock (int fd[2])
| Wrapper for pipe(), which sets the CLOEXEC flag (atomically if supported by the OS).
int | socketpair_cloexec (int domain, int type, int protocol, int sv[2])
| Wrapper for socketpair(), which sets the CLOEXEC flag (atomically if supported by the OS).
int | socket_cloexec_nonblock (int domain, int type, int protocol)
| Wrapper for socket(), which sets the CLOEXEC and the NONBLOCK flag (atomically if supported by the OS).
int | accept_cloexec_nonblock (int fd, struct sockaddr *address, size_t *address_length_r)
| Wrapper for accept(), which sets the CLOEXEC and the NONBLOCK flags (atomically if supported by the OS).
ssize_t | recvmsg_cloexec (int sockfd, struct msghdr *msg, int flags)
| Wrapper for recvmsg(), which sets the CLOEXEC flag (atomically if supported by the OS).
int | inotify_init_cloexec (void)
| Wrapper for inotify_init(), which sets the CLOEXEC flag (atomically if supported by the OS).

## Function Documentation

int accept_cloexec_nonblock | ( | int | fd,
|  | struct sockaddr * | address,
|  | size_t * | address_length_r
| ) |  |

Wrapper for accept(), which sets the CLOEXEC and the NONBLOCK flags (atomically if supported by the OS).

int dup_cloexec | ( | int | oldfd | ) |

Wrapper for dup(), which sets the CLOEXEC flag on the new descriptor.

int inotify_init_cloexec | ( | void |  | ) |

Wrapper for inotify_init(), which sets the CLOEXEC flag (atomically if supported by the OS).

int open_cloexec | ( | const char * | path_fs,
|  | int | flags,
|  | int | mode
| ) |  |

Wrapper for open(), which sets the CLOEXEC flag (atomically if supported by the OS).

int pipe_cloexec | ( | int | fd[2] | ) |

Wrapper for pipe(), which sets the CLOEXEC flag (atomically if supported by the OS).

int pipe_cloexec_nonblock | ( | int | fd[2] | ) |

Wrapper for pipe(), which sets the CLOEXEC flag (atomically if supported by the OS).

On systems that supports it (everybody except for Windows), it also sets the NONBLOCK flag.

ssize_t recvmsg_cloexec | ( | int | sockfd,
|  | struct msghdr * | msg,
|  | int | flags
| ) |  |

Wrapper for recvmsg(), which sets the CLOEXEC flag (atomically if supported by the OS).

int socket_cloexec_nonblock | ( | int | domain,
|  | int | type,
|  | int | protocol
| ) |  |

Wrapper for socket(), which sets the CLOEXEC and the NONBLOCK flag (atomically if supported by the OS).

int socketpair_cloexec | ( | int | domain,
|  | int | type,
|  | int | protocol,
|  | int | sv[2]
| ) |  |

Wrapper for socketpair(), which sets the CLOEXEC flag (atomically if supported by the OS).