summaryrefslogtreecommitdiff
path: root/LibC/fcntl.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2018-11-13 01:36:31 +0100
committerAndreas Kling <awesomekling@gmail.com>2018-11-13 01:36:31 +0100
commit97c799576a478d3881bfff1196f0fa829d736994 (patch)
treefb9d43820e7e65318c2f0e3d9f67932aee3a78ae /LibC/fcntl.h
parent19b9401487e87dcbb43b52c6fe194e3b0e49f842 (diff)
downloadserenity-97c799576a478d3881bfff1196f0fa829d736994.zip
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.
Diffstat (limited to 'LibC/fcntl.h')
-rw-r--r--LibC/fcntl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/LibC/fcntl.h b/LibC/fcntl.h
index e0ee379b1d..c717acdc1a 100644
--- a/LibC/fcntl.h
+++ b/LibC/fcntl.h
@@ -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