[uClibc 0002074]: poll() does not work on Linux 2.0.40

bugs at busybox.net bugs at busybox.net
Sun Apr 13 00:15:13 UTC 2008


A NOTE has been added to this issue. 
====================================================================== 
http://busybox.net/bugs/view.php?id=2074 
====================================================================== 
Reported By:                michael_d
Assigned To:                uClibc
====================================================================== 
Project:                    uClibc
Issue ID:                   2074
Category:                   Other
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
====================================================================== 
Date Submitted:             02-07-2008 19:49 PST
Last Modified:              04-12-2008 17:15 PDT
====================================================================== 
Summary:                    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 http://busybox.net/bugs/view.php?id=1874 and
http://busybox.net/bugs/view.php?id=2064 must be applied before
compilation of uClibc is possible on this platform.)
====================================================================== 

---------------------------------------------------------------------- 
 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 

---------------------------------------------------------------------- 
 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. 

---------------------------------------------------------------------- 
 vapier - 03-21-08 00:02  
---------------------------------------------------------------------- 
erm, no, lets not do that ... just add a check via KERNEL_VERSION() and
LINUX_VERSION_CODE 

---------------------------------------------------------------------- 
 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. 

---------------------------------------------------------------------- 
 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
http://busybox.net/bugs/view.php?id=2084.) 

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                          
======================================================================




More information about the uClibc-cvs mailing list