missing: Add a wrapper for close_range()

This is not the same as systemd's, because systemd's disagrees
with glibc on the signedness of the arguments
(https://github.com/systemd/systemd/issues/31270).

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie
2024-02-09 16:46:21 +00:00
parent 9d66aa7375
commit debdea2907

View File

@@ -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