1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:47:44 +00:00

Add close-on-exec flag for file descriptors.

I was surprised to find that dup()'ed fds don't share the close-on-exec flag.
That means it has to be stored separately from the FileDescriptor object.
This commit is contained in:
Andreas Kling 2018-11-13 01:36:31 +01:00
parent 19b9401487
commit 97c799576a
10 changed files with 74 additions and 35 deletions

View file

@ -10,6 +10,8 @@ __BEGIN_DECLS
#define F_GETFL 3
#define F_SETFL 4
#define FD_CLOEXEC 1
int fcntl(int fd, int cmd, ...);
__END_DECLS

View file

@ -99,6 +99,7 @@ int isatty(int fd);
#define O_NONBLOCK 04000
#define O_DIRECTORY 00200000
#define O_NOFOLLOW 00400000
#define O_CLOEXEC 02000000
__END_DECLS