diff options
author | William Douglas <william.r.douglas@gmail.com> | 2011-06-16 14:21:11 -0700 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-06-20 17:54:17 +0200 |
commit | 4160ec67ba40eee5d14c5b96d37c89a3a5356f34 (patch) | |
tree | 89859eae2e7fff8f4b95d3355926a6936e47cec1 /src/sd-daemon.h | |
parent | 8003c705f2d1000abaf87ebe56f022b8324d78cc (diff) |
sd-daemon: Add sd_is_special for special file descriptors
With the addition of ListenSpecial as a socket option we need the
the usual sd_is_ functions for special files. This patch does
that.
Diffstat (limited to 'src/sd-daemon.h')
-rw-r--r-- | src/sd-daemon.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sd-daemon.h b/src/sd-daemon.h index 884c36107d..46dc7fd7e5 100644 --- a/src/sd-daemon.h +++ b/src/sd-daemon.h @@ -125,6 +125,18 @@ int sd_is_fifo(int fd, const char *path); /* Helper call for identifying a passed file descriptor. Returns 1 if + the file descriptor is a special character device on the file + system stored under the specified path, 0 otherwise. + If path is NULL a path name check will not be done and the call + only verifies if the file descriptor refers to a special character. + Returns a negative errno style error code on failure. + + See sd_is_special(3) for more information. +*/ +int sd_is_special(int fd, const char *path); + +/* + Helper call for identifying a passed file descriptor. Returns 1 if the file descriptor is a socket of the specified family (AF_INET, ...) and type (SOCK_DGRAM, SOCK_STREAM, ...), 0 otherwise. If family is 0 a socket family check will not be done. If type is 0 a |