Skip to content

Commit

Permalink
fix freebsd build
Browse files Browse the repository at this point in the history
  • Loading branch information
Mic92 committed Sep 19, 2024
1 parent 799abea commit 3b218b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/libutil/unix/file-descriptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,14 @@ void Pipe::create()

//////////////////////////////////////////////////////////////////////

#if __linux__ || __FreeBSD__
#if __linux__
// In future we can use a syscall wrapper, but at the moment musl and older glibc version don't support it.
static int unix_close_range(unsigned int first, unsigned int last, int flags)
{
return syscall(SYS_close_range, first, last, (unsigned int)flags);
}
#elif __FreeBSD__
#define unix_close_range close_range
#endif

void unix::closeExtraFDs()
Expand Down

0 comments on commit 3b218b0

Please sign in to comment.