NAME
djbunix.h - standard I/O and other Unix system calls interfaces
SYNOPSIS
#include <limb/djbunix.h>
DESCRIPTION
djbunix
offers alternative API to basic Unix concepts, dealing with I/O
operations, file descriptors, environment, child processes, and so on.
This header is a complement to skalibs' own header, intended to be used as a "replacement". However, instead of re-inventing the wheel, it depends/includes skalibs' header, and some of the functions below are actually implemented in skalibs, or macros to such functions.
Functions
The following functions/macros are defined :
Open a file for reading with O_NONBLOCK set.
Similar to open_read(3) but relative path are based on given file descriptor.
Similar to open_read(3) but clears O_NONBLOCK after opening.
Similar to open_readb(3) but relative path are based on given file descriptor.
Similar to open_read(3) but without O_NONBLOCK.
Similar to openb_read(3) but relative path are based on given file descriptor.
Similar to openb_read(3) but with O_CLOEXEC set.
Similar to openbc_read(3) but relative path are based on given file descriptor.
Similar to open_read(3) but with O_CLOEXEC set.
Similar to openc_read(3) but relative path on based on given file descriptor.
Similar to openc_read(3) but clears O_NONBLOCK after opening.
Similar to openc_readb(3) but relative path on based on given file descriptor.
Open a file for writing with O_NONBLOCK set.
Similar to open_write(3) but relative path are based on given file descriptor.
Similar to open_write(3) but clears O_NONBLOCK after opening.
Similar to open_writeb(3) but relative path are based on given file descriptor.
Similar to open_write(3) but without O_NONBLOCK.
Similar to openb_write(3) but relative path are based on given file descriptor.
Similar to openb_write(3) but with O_CLOEXEC set.
Similar to openbc_write(3) but relative path are based on given file descriptor.
Similar to open_write(3) but with O_CLOEXEC set.
Similar to openc_write(3) but relative path on based on given file descriptor.
Similar to openc_write(3) but clears O_NONBLOCK after opening.
Similar to openc_writeb(3) but relative path on based on given file descriptor.
Similar to open_write(3) but create the file if it doesn't exist.
Similar to open_create(3) but relative path are based of given file descriptor.
Similar to open_create(3) but with O_CLOEXEC set.
Similar to openc_create(3) but relative path are based of given file descriptor.
Similar to open_create(3) but fails if the file exists.
Similar to open_excl(3) but relative path are based of given file descriptor.
Similar to open_excl(3) but with O_CLOEXEC set.
Similar to openc_excl(3) but relative path are based of given file descriptor.
Similar to open_create(3) but the file is opened in append-mode.
Similar to open_append(3) but relative path are based of given file descriptor.
Similar to open_append(3) but with O_CLOEXEC set.
Similar to openc_append(3) but relative path are based of given file descriptor.
Similar to open_create(3) but truncate the file if it exists.
Similar to open_trunc(3) but relative path are based of given file descriptor.
Similar to open_trunc(3) but with O_CLOEXEC set.
Similar to openc_trunc(3) but relative path are based of given file descriptor.
Open a new temporary file for writing.
Similar to open_tmp(3) but relative path are based of given file descriptor.
Wrapper for open(3) that takes 2 arguments, and can't be interrupted by signals.
Wrapper for openat(3) that takes 2 arguments, and can't be interrupted by signals.
Wrapper for open(3) that takes 3 arguments, and can't be interrupted by signals.
Wrapper for openat(3) that takes 3 arguments, and can't be interrupted by signals.
Open a file using given open_fn then clears O_NONBLOCK.
Similar to open_b(3) but relative path are based on given file descriptor.
Return the specified file descriptor, or that of the given file name.
Ensure a file descriptor has O_CLOEXEC set.
Ensure a file descriptor has O_CLOEXEC unset.
Ensure a file descriptor has O_NONBLOCK set.
Ensure a file descriptor has O_NONBLOCK unset.
Open, read & close a file into memory.
Same as open_read_closeat(3) but relative path are based on current working directory.
Open, read & close a file into a stralloc.
Same as open_saread_closeat(3) but relative path are based on current working directory.
Open, write & close a file with data from pointed memory.
Same as open_write_closeat(3) but relative path are based on current working directory.
Open, write & close a file with data from array of vectors.
Same as open_writev_closeat(3) but relative path are based on current working directory.
Read & close a file into memory.
Read a file appending its content to a stralloc.
Similar to sa_read(3) but with a limit.
Wrapper for dup2(3) that can't be interrupted by signals.
Same as fd_copy(3) but copies two file descriptors.
Same as fd_copy (3) but closing the original file descriptor.
Same as fd_move(3) but moves two file descriptors.
Close a file descriptor without affecting errno
.
Return whether or not two file descriptors reference the same file.
Create a pipe in non-blocking mode.
Create a pipe in close-on-exec mode.
Create a pipe in non-blocking & close-on-exec modes.
Create a pipe according to specified flags.
Similar to fchdir(3) but without signal interruption.
Create a path of directories and returns the file descriptor.
Same as fd_mkdirpat(3) but relative path are based on current working directory.
Create a path of directories.
Same as mkdirpat(3) but relative path are based on current working directory.
Remove an entire directory entry, with relative path based on given file descriptor
Different interface, using the given stralloc as head-allocated temporary space.
Different interface, expecting the name to be found as NUL-terminated string inside the given stralloc
Remove the full content of a directory, with relative path based on given file descriptor.
Different interface, using the given stralloc as head-allocated temporary space.
Different interface, expecting the name to be found as NUL-terminated string inside the given stralloc.
Places the content of a symbolic link into a stralloc.
Similar to sa_readlink(3) but ensures the content is NUL-terminated.
Similar to sa_readlink(3) but relative path are based on given file descriptor.
Similar to sa_readlinkat(3) but ensures the content is NUL-terminated.
Place the canonicalized absolute pathname into the given stralloc.
Similar to sa_realpath(3) but relative path are base on given file descriptor.
Appends the names of all files in a directory into the given stralloc.
Similar to sa_ls(3) but relative path are based on given file descriptor.