Qsmtp
0.30dev
|
declarations of functions for handling directories More...
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <errno.h>
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE /* needed for O_PATH according to manpage */ |
#define | __USE_GNU /* needed for O_PATH according to code */ |
Functions | |
static int | get_dirfd (int base, const char *dirname) |
get a file descriptor for the given directory More... | |
declarations of functions for handling directories
|
inlinestatic |
get a file descriptor for the given directory
base | a filedescriptor to a base directory |
dirname | name of the directory |
-1 | the given name cannot be opened as directory (errno is set) |
This tries to open the given name as directory. In case this returns a valid descriptor it is not guaranteed that the descriptor can be used for anything else than being an anchor point for openat() calls.
If dirname is an absolute filename base will be ignored.
The CLOEXEC flag will be set for the descriptor if supported by the underlying platform.