mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 10:51:54 -04:00
Portability
This commit is contained in:
parent
9005af10ad
commit
493e0118f3
2 changed files with 21 additions and 0 deletions
|
|
@ -18,6 +18,9 @@
|
|||
#define HAVE_AVX2 1
|
||||
#endif
|
||||
|
||||
/* map Windows name to POSIX name */
|
||||
#define strncasecmp _strnicmp
|
||||
|
||||
/****************************************************************************/
|
||||
/* file */
|
||||
|
||||
|
|
|
|||
|
|
@ -240,6 +240,24 @@
|
|||
#define HAVE_LOCKFILE 1
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LINUX_CLOSE_RANGE_H
|
||||
#include <linux/close_range.h>
|
||||
#endif
|
||||
|
||||
/* implement close_range for glibc 2.33 or earlier */
|
||||
#if defined(__linux__) && !defined(HAVE_CLOSE_RANGE)
|
||||
#include <sys/syscall.h>
|
||||
#ifndef __NR_close_range
|
||||
#define __NR_close_range 436
|
||||
#endif
|
||||
#define close_range close_range_impl
|
||||
static inline int close_range_impl(unsigned int first, unsigned int last, unsigned int flags)
|
||||
{
|
||||
return syscall(__NR_close_range, first, last, flags);
|
||||
}
|
||||
#define HAVE_CLOSE_RANGE 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Flags for open()
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue