Skip to content

Commit 52719f9

Browse files
committed
Fix build on the GNU Hurd.
SYS_* system call numbers are not defined on the Hurd system. Three of them, SYS_mbind, SYS_set_mempolicy, and SYS_gettid, are used in "common_linux.h". The first two are about setting NUMA (Non‐Uniform Memory Access) policy. NUMA is not supported by the Hurd for now. The third one refers to the Linux specific model of threads. Therefore it is safe to simply disable these syscalls on the GNU Hurd.
1 parent 277ef78 commit 52719f9

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎common_linux.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ extern long int syscall (long int __sysno, ...);
7070
static inline int my_mbind(void *addr, unsigned long len, int mode,
7171
unsigned long *nodemask, unsigned long maxnode,
7272
unsigned flags) {
73-
#if defined (__LSB_VERSION__) || defined(ARCH_ZARCH) || defined(__PIZLONATOR_WAS_HERE__)
73+
#if defined (__LSB_VERSION__) || defined(ARCH_ZARCH) || defined(__PIZLONATOR_WAS_HERE__) \
74+
|| defined(__gnu_hurd__)
7475
// So far, LSB (Linux Standard Base) don't support syscall().
7576
// https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3482
7677
return 0;
@@ -82,7 +83,7 @@ static inline int my_mbind(void *addr, unsigned long len, int mode,
8283
}
8384

8485
static inline int my_set_mempolicy(int mode, const unsigned long *addr, unsigned long flag) {
85-
#if defined (__LSB_VERSION__) || defined(ARCH_ZARCH)
86+
#if defined (__LSB_VERSION__) || defined(ARCH_ZARCH) || defined(__gnu_hurd__)
8687
// So far, LSB (Linux Standard Base) don't support syscall().
8788
// https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3482
8889
return 0;

0 commit comments

Comments
 (0)