BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002074 [uClibc] Other minor always 02-07-08 19:49 04-12-08 17:15
Reporter michael_d View Status public  
Assigned To uClibc
Priority normal Resolution open  
Status assigned   Product Version
Summary 0002074: poll() does not work on Linux 2.0.40
Description When compiled for Linux 2.0.40, the poll() function will not work, always returning ENOSYS.

While that kernel does not implement the poll syscall, there is a complete emulation within uClibc's source, which works fine but is not normally compiled in.

The problem is that this kernel's <asm/unistd.h> defines __NR_poll, even though it does not implement the syscall. uClibc blindly assumes that the call will work if its number is defined, and discards the emulation to save space.

To fix this, the library needs to check for the presence of the <asm/poll.h> header, rather than just seeing if the syscall number is defined.

I've worked around this locally by editing <asm/unistd.h> to remove __NR_poll.

(Note that fixes for issues 0001874 and 0002064 must be applied before compilation of uClibc is possible on this platform.)
Additional Information
Attached Files  uClibc-0.9.29-pollfix.diff [^] (1,653 bytes) 03-13-08 05:15
 uClibc-0.9.29-pollfix2.diff [^] (1,762 bytes) 04-12-08 17:12

- Relationships

- Notes
(0004924)
vapier
02-15-08 15:39

please see the FAQ:
http://uclibc.org/FAQ.html#upstream_versions [^]

in other words, please post a patch that addresses the issue for you
 
(0005704)
michael_d
03-13-08 05:18

I've uploaded a patch, which checks whether the kernel headers include <asm/poll.h>. If that header is not present, it's unlikely the kernel really supports the syscall.
 
(0005824)
vapier
03-21-08 00:02

erm, no, lets not do that ... just add a check via KERNEL_VERSION() and LINUX_VERSION_CODE
 
(0006474)
khem
04-08-08 23:30

kernel should not export NR_poll if it does not implement the syscall. So fix in the kernel headers what you did is right thing to do. Nothing is needed to be done in uclibc in my opinion.
 
(0006594)
michael_d
04-12-08 17:15

I dislike hardcoding things via the kernel version, since that assumes things do not get backported. Sure, it's unlikely with an old kernel, but a poll() "backport" for 2.0.* actually existed at one time in the form of the LiS patches.

I've uploaded a new version, which compromises a little. I've created a central header <bits/uClibc_khpresence.h>, which holds information on which kernel headers are actually present.

However, while this header could be generated with a little shell/find/sed magic, for know it's just faked using LINUX_VERSION_CODE, and only for headers of interest.

(The header also covers <asm/ipcbuf.h>, which while not needed for the immediate problem, will help with a solution to 0002084.)
 

- Issue History
Date Modified Username Field Change
02-07-08 19:49 michael_d New Issue
02-07-08 19:49 michael_d Status new => assigned
02-07-08 19:49 michael_d Assigned To  => uClibc
02-15-08 15:39 vapier Note Added: 0004924
03-13-08 05:15 michael_d File Added: uClibc-0.9.29-pollfix.diff
03-13-08 05:18 michael_d Note Added: 0005704
03-21-08 00:02 vapier Note Added: 0005824
04-08-08 23:30 khem Note Added: 0006474
04-12-08 17:12 michael_d File Added: uClibc-0.9.29-pollfix2.diff
04-12-08 17:15 michael_d Note Added: 0006594


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker