mirror of
git://github.com/lxc/lxc
synced 2025-09-01 20:29:29 +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 andbed09c9cc0
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:
@@ -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
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user