Skip to content

Commit

Permalink
Add closefrom declarations for freebsd, glibc, and, openbsd
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Horodniceanu <[email protected]>
  • Loading branch information
the-horo authored and dlang-bot committed Aug 23, 2024
1 parent df377af commit 90c4145
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions druntime/src/core/sys/freebsd/unistd.d
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ extern(C):
nothrow:

int getosreldate() pure @trusted;

void closefrom(int);
4 changes: 4 additions & 0 deletions druntime/src/core/sys/linux/unistd.d
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public import core.sys.posix.unistd;
version (linux):
extern(C):
nothrow:
@nogc:

// Additional seek constants for sparse file handling
// from Linux's unistd.h, stdio.h, and linux/fs.h
Expand All @@ -21,3 +22,6 @@ char* getpass(const(char)* prompt);

// Exit all threads in a process
void exit_group(int status);

/// Close all open file descriptors greater or equal to `lowfd`
void closefrom(int lowfd);
2 changes: 2 additions & 0 deletions druntime/src/core/sys/openbsd/unistd.d
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ int getthrname(pid_t, char*, size_t);
int pledge(const scope char*, const scope char*);
int setthrname(pid_t, const scope char*);
int unveil(const scope char*, const scope char*);

int closefrom(int);

0 comments on commit 90c4145

Please sign in to comment.