| Summary: | poll() syscall emulation not compiled when needed | ||
|---|---|---|---|
| Product: | uClibc | Reporter: | Michael Deutschmann <michael> |
| Component: | Other | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | uclibc-cvs |
| Priority: | P5 | ||
| Version: | 0.9.30.1 | ||
| Target Milestone: | 0.9.30.3 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Host: | i386-pc-linux-uclibc | Target: | i386-pc-linux-uclibc |
| Build: | i386-pc-linux-uclibc | ||
| Attachments: |
Patch to fix poll() on Linux 2.0
Revised patch to prevent poll syscall use on Linux 2.0 |
||
look at how glibc implements __ASSUME_POLL_SYSCALL ... we should use the same define and implementation, and use the existing common/bits/kernel-features.h rather than adding a new uClibc_khpresence.h. (In reply to comment #1) > look at how glibc implements __ASSUME_POLL_SYSCALL ... we should use the same > define and implementation, and use the existing common/bits/kernel-features.h > rather than adding a new uClibc_khpresence.h. There is no common/bits/kernel-features.h in my copy of uClibc. There is a kernel-features.h buried in linuxthreads, but linuxthreads is expected to go away eventually. then you're using a very old copy of uClibc and you need to update to the latest (In reply to comment #3) > then you're using a very old copy of uClibc and you need to update to the > latest I'm using 0.9.30.1, which is still the latest according to the front page. And according to "find -name kernel-features.h", the only such file exists under libpthread. changes arent committed to the release. if you want *new* code to be committed, you really have to be using the latest live source tree. Created attachment 689 [details]
Revised patch to prevent poll syscall use on Linux 2.0
Modified version of my previous Linux 2.0 poll fix, which now depends on a symbol __ASSUME_POLL_SYSCALL from <bits/kernel-features.h>, instead of __HAVE_ASM_POLL_H.
I'm still using the release tree, but I've modified my patches to add a <bits/kernel-features.h> containing the symbol glibc uses, and use that file. I'm attaching the part of the patch that works on poll.h. The patch that adds kernel-features.h would not apply on top of an existing kernel-features.h, so it's not included. The symbol is __ASSUME_POLL_SYSCALL, and I set it to apply on 2.2.0 or higher. (Glibc turns it on at a precise 2.1 release I don't recall off hand.) Michael, please provide a git diff against current master. TIA fixed on master and on 0_9_30. Thanks for the report. |
Created attachment 217 [details] Patch to fix poll() on Linux 2.0 uClibc includes an emulation of the poll() syscall, but avoids compiling it if it thinks the kernel has a native poll(). It presently tests this by seeing if __NR_poll is defined. Unfortunately, Linux 2.0.*, the one version that needs this emulation, has for some time defined __NR_poll without actually implementing it, causing an unpatched uClibc to provide a poll() that always returns ENOSYS. I'm including a simple patch to fix this problem. (The patch creates one new header, "uClibc_khpresence.h", which is shared with my solution to another problem, and thus contains one definition unneeded for this specific bug.)