Skip to content

Commit

Permalink
missing: Add a wrapper for close_range()
Browse files Browse the repository at this point in the history
This is not the same as systemd's, because systemd's disagrees
with glibc on the signedness of the arguments
(systemd/systemd#31270).

Signed-off-by: Simon McVittie <smcv@collabora.com>
  • Loading branch information
smcv committed Feb 9, 2024
1 parent 9d66aa7 commit debdea2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions glnx-missing-syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,3 +224,15 @@ G_STATIC_ASSERT(__NR_close_range == systemd_NR_close_range);
# endif
# endif
#endif

#if !defined(HAVE_CLOSE_RANGE) && defined(__NR_close_range)
static inline int
inline_close_range (unsigned int low,
unsigned int high,
int flags)
{
return syscall (__NR_close_range, low, high, flags);
}
#define close_range(low, high, flags) inline_close_range(low, high, flags)
#define HAVE_CLOSE_RANGE
#endif

0 comments on commit debdea2

Please sign in to comment.