Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 213690 - sys-kernel/linux-headers-2.4.26-r1 - __NR_waitpid should not be defined in linux/include/asm-arm/unistd.h
Summary: sys-kernel/linux-headers-2.4.26-r1 - __NR_waitpid should not be defined in li...
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: ARM Linux
: High critical (vote)
Assignee: Gentoo Toolchain Maintainers
URL: http://www.nabble.com/%28ARM%29-small...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-03-17 12:58 UTC by Christopher Friedt
Modified: 2008-04-25 17:50 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
removes __NR_waitpid from include/asm-arm/unistd.h in the kernel headers / sources (linux-headers-asm-arm-nowaitpid.patch,533 bytes, patch)
2008-03-17 13:00 UTC, Christopher Friedt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Friedt 2008-03-17 12:58:54 UTC
The waitpid system call in linux is not implemented for the ARM architecture. Therefore, any application or library that is glibc-linked that invokes waitpid will receive errno 38 (ENOSYS / Function not implemented), if the linux-headers-2.4.26-r1 are included during the glibc build.



Reproducible: Always

Steps to Reproduce:
1.see URL above
2.
3.

Actual Results:  
errno 38 results

Expected Results:  
waitpid should be properly functional via a static inline wrapper that re-calls wait4 with the appropriate arguments (i.e. waitpid should not fail).

See the attached patch for sys-kernel/linux-headers-2.4.26-r1.

__NOTE__: This likely also affects sys-kernel/*-sources-2.4* as long as the kernel is being compiled for the ARM architecture, although I haven't filed any bugs for those.
Comment 1 Christopher Friedt 2008-03-17 13:00:14 UTC
Created attachment 146391 [details, diff]
removes __NR_waitpid from include/asm-arm/unistd.h in the kernel headers / sources
Comment 2 Christopher Friedt 2008-03-17 13:02:39 UTC
I haven't added the URL yet because I thought I would just redirect to my message on the gentoo-embedded list. 

See Subj. "(ARM) small patch for linux / headers 2.4.26-r1", sent on 20080317
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2008-03-17 20:30:21 UTC
Sorry, 2.4 kernels/linux-headers are completely unsupported, move on.
Comment 4 Christopher Friedt 2008-03-17 20:57:30 UTC
(In reply to comment #3)
> Sorry, 2.4 kernels/linux-headers are completely unsupported, move on.
> 

I don't care if you don't support the 2.4 kernel - I unfortunately have to. And there are probably hundreds of people that could benefit from this patch, not just myself. http://tech.groups.yahoo.com/group/ts-7000/

Haven't you forgotten something? Isn't this whole Gentoo thing supposed to be a community driven effort in the first place? By the people, for the people? 

This is a bug that wasn't fixed in the 2.4.26-rc1 kernel before it became stable. It's a _very_ obvious bug for anyone who uses an ARM processor. Look at the notes by Russel King - waitpid is NOT IMPLEMENTED. It should not be defined in include/asm-arm/unistd.h

At least be intelligent enough to accept a bugfix that you don't have to do any work for instead of complaining that you don't want to do any work.
Comment 5 Christopher Friedt 2008-03-17 21:42:45 UTC
If you fetch =sys-kernel/linux-headers-2.4.26-r1, and unpack it, you'll notice that __NR_waitpid is defined in include/asm-arm/unistd.h . This list is what defines the system calls for the linux operating system and is pivotal for having a functional libc.

According to the release notes from Russel King[2], who is basically the father of the ARM / Linux project, waitpid is _NOT_ implemented in the arm-linux kernel. If you scroll further down in include/asm-arm/unistd.h, you'll notice that waitpid is a static inline function that acts as a wrapper for wait4. That is further proof that waitpid is _not_ implemented. Hence, __NR_waitpid should _NOT_ be defined in asm-arm/unistd.h . If you look at your own 2.6 linux sources, you will find that __NR_waitpid is also not defined there. This is no coincidence, and it is not defined for a reason. Glibc will break if compiled against the 2.4.26-r1 kernel headers as they are, resulting in ENOSYS (errno # 38 / Function not implemented) every time that waitpid or popen is called. 
Comment 6 Jakub Moc (RETIRED) gentoo-dev 2008-03-17 21:44:00 UTC
Re-read Comment #3 a couple of times, please.
Comment 7 SpanKY gentoo-dev 2008-03-18 12:22:33 UTC
re-assign to the right people ...
Comment 8 Christopher Friedt 2008-03-18 13:15:47 UTC
(In reply to comment #7)
> re-assign to the right people ...
> 

Thanks SpanKy - I'm glad that its been properly redirected.
Comment 9 SpanKY gentoo-dev 2008-04-12 22:47:10 UTC
added to the 2.4.36 headers, thanks
Comment 10 Christopher Friedt 2008-04-25 17:50:55 UTC
Thanks :)