2
0
mirror of git://github.com/lxc/lxc synced 2025-09-01 22:29:30 +00:00

syscall: don't fail if __NR_signalfd is not defined

lxc fails to build if __NR_signalfd is not defined since version 4.0.0
and
bed09c9cc0

However, some architectures don't define __NR_signalfd but only
__NR_signalfd4. This is the case for example for nios2 or csky:
f9ac84f92f/sysdeps/unix/sysv/linux/nios2/arch-syscall.h
f9ac84f92f/sysdeps/unix/sysv/linux/csky/arch-syscall.h

Fixes:
 - http://autobuild.buildroot.org/results/75096a48d2dbda57459523db3ed0952e63f93535

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
This commit is contained in:
Fabrice Fontaine
2020-07-28 12:31:31 +02:00
parent 79c66a2af3
commit 3341e204dc
2 changed files with 2 additions and 3 deletions

View File

@@ -228,9 +228,6 @@
#if _MIPS_SIM == _MIPS_SIM_ABI64 /* n64 */
#define __NR_signalfd 5276
#endif
#else
#define -1
#warning "__NR_signalfd not defined for your architecture"
#endif
#endif

View File

@@ -112,8 +112,10 @@ static inline int signalfd(int fd, const sigset_t *mask, int flags)
int retval;
retval = syscall(__NR_signalfd4, fd, mask, _NSIG / 8, flags);
#ifdef __NR_signalfd
if (errno == ENOSYS && flags == 0)
retval = syscall(__NR_signalfd, fd, mask, _NSIG / 8);
#endif
return retval;
}