Building udev-142 w/o inotify or ppoll
I'm building udev-142 on a Linux 2.6.27.26 system, but unfortunately the version of uClibc (0.9.28) that we're using supports neither inotify nor ppoll.
We had been using 115.
Is there a workaround for this?
Thanks.
-Philip
Quoted 7 lines · Philip A. Prindeville
I'm building udev-142 on a Linux 2.6.27.26 system, but unfortunately the version of uClibc (0.9.28) that we're using supports neither inotify nor ppoll.
We had been using 115.
Is there a workaround for this?
They are required. More recent udev versions also need signalfd. Inotify can probably be patched out without too much trouble, but ppoll() and singalfd() will need to be added to the libc or emulated locally.
Kay
Quoted 6 lines · Kay Sievers
Quoted 4 lines · Philip A. Prindeville
I'm building udev-142 on a Linux 2.6.27.26 system, but unfortunately the version of uClibc (0.9.28) that we're using supports neither inotify nor ppoll.
Quoted 8 lines
Quoted 3 lines
We had been using 115.
Is there a workaround for this?
They are required. More recent udev versions also need signalfd. Inotify can probably be patched out without too much trouble, but
ppoll()andsingalfd()will need to be added to the libc or emulated locally.
Yeah, I was complaining about signalfd a while ago too.
I ended up using the "fake" sys/signalfd.h header below. (I don't know if you can do the same with ppoll or not; my glibc at least provides a wrapper for it, even though it may still have the ppoll race condition. I suspect you can do the same with inotify fairly easily.) Most of this is copied from the kernel sources, some from newer glibc versions.
#ifndef _SYS_SIGNALFD_H
#define _SYS_SIGNALFD_H 1
#include <stdint.h>
#include <errno.h>
#include <unistd.h>
#include <signal.h>
struct signalfd_siginfo {
uint32_t ssi_signo; /* Signal number */ int32_t ssi_errno; /* Error number (unused) */ int32_t ssi_code; /* Signal code */ uint32_t ssi_pid; /* PID of sender */ uint32_t ssi_uid; /* Real UID of sender */ int32_t ssi_fd; /* File descriptor (SIGIO) */ uint32_t ssi_tid; /* Kernel timer ID (POSIX timers) */ uint32_t ssi_band; /* Band event (SIGIO) */
uint32_t ssi_overrun; /* POSIX timer overrun count */ uint32_t ssi_trapno; /* Trap number that caused signal */ int32_t ssi_status; /* Exit status or signal (SIGCHLD) */
int32_t ssi_int; /* Integer sent by sigqueue(2) */
uint64_t ssi_ptr; /* Pointer sent by sigqueue(2) */
uint64_t ssi_utime; /* User CPU time consumed (SIGCHLD) */
uint64_t ssi_stime; /* System CPU time consumed (SIGCHLD) */
uint64_t ssi_addr; /* Address that generated signal
(for hardware-generated signals) */
uint8_t pad[48]; /* Pad size to 128 bytes (allow for
additional fields in the future) */
};
#if __x86_64__
# define __NR_signalfd4 289 # define __NR_signalfd 282 #elif __i386__ # define __NR_signalfd4 327 # define __NR_signalfd 321 #else #error "Unknown architecture..." #endif
static inline int signalfd(int fd, sigset_t *mask, uint32_t flags)
{
int rv = syscall(__NR_signalfd4, fd, mask, (size_t)8, flags);
if(rv < 0) {
if(flags != 0) {
errno = EINVAL;
return -1;
}
return syscall(__NR_signalfd, fd, mask, (size_t)8);
}
else
return rv;
}#undef __NR_signalfd4
#undef __NR_signalfd
#endif /* _SYS_SIGNALFD_H */