Make all handles non-inheritable by default

The sockets are left as non-inheritable because they
never should be inherited.
This commit is contained in:
flysand7
2024-07-18 22:50:47 +11:00
parent 0bb4cc6ce5
commit 4dcb75af6d
4 changed files with 16 additions and 8 deletions
+10 -2
View File
@@ -29,7 +29,7 @@ File_Flag :: enum {
Sync,
Trunc,
Sparse,
Close_On_Exec,
Inheritable,
Unbuffered_IO,
}
@@ -43,7 +43,15 @@ O_EXCL :: File_Flags{.Excl}
O_SYNC :: File_Flags{.Sync}
O_TRUNC :: File_Flags{.Trunc}
O_SPARSE :: File_Flags{.Sparse}
O_CLOEXEC :: File_Flags{.Close_On_Exec}
/*
If specified, the file handle is inherited upon the creation of a child
process. By default all handles are created non-inheritable.
**Note**: The standard file handles (stderr, stdout and stdin) are always
initialized as inheritable.
*/
O_INHERITABLE :: File_Flags{.Inheritable}
stdin: ^File = nil // OS-Specific
stdout: ^File = nil // OS-Specific