diff options
author | Max Kellermann <max@duempel.org> | 2010-08-03 18:03:55 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-08-03 18:03:55 +0200 |
commit | 68c02fc95af57a0b3be64aa214125be2d3ed1cf7 (patch) | |
tree | baf4db9e06b50ac07555a8d89d9885cdf3dce916 /src/fd_util.h | |
parent | d18c1b1a0ab57d77ba823cfedf40077d24dafbd7 (diff) | |
download | mpd-68c02fc95af57a0b3be64aa214125be2d3ed1cf7.tar.gz mpd-68c02fc95af57a0b3be64aa214125be2d3ed1cf7.tar.xz mpd-68c02fc95af57a0b3be64aa214125be2d3ed1cf7.zip |
fd_util: add function dup_cloexec()
Unfortunately, there's no "optimized" implementation here. We can't
use Linux's proprietary system call dup3(), because it would require
us to specify the new descriptor.
Diffstat (limited to 'src/fd_util.h')
-rw-r--r-- | src/fd_util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/fd_util.h b/src/fd_util.h index 80fb98703..5b80df2c7 100644 --- a/src/fd_util.h +++ b/src/fd_util.h @@ -50,6 +50,13 @@ struct sockaddr; /** + * Wrapper for dup(), which sets the CLOEXEC flag on the new + * descriptor. + */ +int +dup_cloexec(int oldfd); + +/** * Wrapper for open(), which sets the CLOEXEC flag (atomically if * supported by the OS). */ |