mirror of
https://github.com/NixOS/nix
synced 2025-06-28 05:21:16 +02:00
Use close_range when available
This fixes the FreeBSD build of nix-util
This commit is contained in:
parent
59acf3b75c
commit
5c87c40a5e
3 changed files with 6 additions and 2 deletions
|
@ -121,10 +121,13 @@ void Pipe::create()
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if __linux__ || __FreeBSD__
|
||||
// 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)
|
||||
{
|
||||
#if !HAVE_CLOSE_RANGE
|
||||
return syscall(SYS_close_range, first, last, (unsigned int)flags);
|
||||
#else
|
||||
return close_range(first, last, flags);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue