Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 331119

Summary: sys-lib/glibc-2.11.2 most *_CLOEXEC and *_NONBLOCK value invalid on hppa
Product: Gentoo Linux Reporter: Guy Martin (RETIRED) <gmsoft>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal CC: hppa, jer
Priority: High Keywords: Inclusion
Version: unspecified   
Hardware: HPPA   
OS: Linux   
URL: http://www.cygwin.com/ml/libc-ports/2010-08/msg00001.html
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 318503, 330933    
Attachments: IN_CLOEXEC patch
Fix definition of *_CLOEXEC and *_NONBLOCK on hppa

Description Guy Martin (RETIRED) gentoo-dev 2010-08-03 20:50:38 UTC
It seems that bug #294470 only fixes calls to socket().
Udev 151-r4 uses inotify_init1(IN_CLOEXEC) and fails with EINVAL.

This results in udev not working.

I'm currently testing a fix. Basically copied sys/inotify.h from the alpha port to hppa. Alpha has the right value for IN_CLOEXEC while hppa still uses the invalid x86 value.

I'll post the patch once I know it works.
Comment 1 Guy Martin (RETIRED) gentoo-dev 2010-08-03 22:06:37 UTC
Created attachment 241335 [details, diff]
IN_CLOEXEC patch

I'll send the patch upstream shortly.
Comment 2 Guy Martin (RETIRED) gentoo-dev 2010-08-04 08:01:28 UTC
Looks like other *_CLOEXEC values need some updating.
Additionally to IN_CLOEXEC, I could find the followings :

./asm-generic/fcntl.h:#define O_CLOEXEC 02000000        /* set close_on_exec */
./sys/epoll.h:    EPOLL_CLOEXEC = 02000000,
./sys/timerfd.h:    TFD_CLOEXEC = 02000000,
./sys/eventfd.h:    EFD_CLOEXEC = 02000000,
./sys/signalfd.h:    SFD_CLOEXEC = 02000000,


Not sure about the one in asm-generic since the one in  asm/fcntl.h is correct.

I'll create a new patch fixing all those values so don't apply the attached patch just yet.
Comment 3 Guy Martin (RETIRED) gentoo-dev 2010-08-04 20:11:42 UTC
Created attachment 241439 [details, diff]
Fix definition of *_CLOEXEC and *_NONBLOCK on hppa

This patch adds the following files :
glibc-2.11.2/ports/sysdeps/unix/sysv/linux/hppa/sys/epoll.h
glibc-2.11.2/ports/sysdeps/unix/sysv/linux/hppa/sys/eventfd.h
glibc-2.11.2/ports/sysdeps/unix/sysv/linux/hppa/sys/inotify.h
glibc-2.11.2/ports/sysdeps/unix/sysv/linux/hppa/sys/signalfd.h
glibc-2.11.2/ports/sysdeps/unix/sysv/linux/hppa/sys/timerfd.h

They are a copy from the common ones but with the value of _CLOEXEC and _NONBLOCK updated to the correct value for hppa.
Comment 4 Guy Martin (RETIRED) gentoo-dev 2010-08-06 12:03:24 UTC
Patch sent upstream. See [URL].
Comment 5 Guy Martin (RETIRED) gentoo-dev 2010-08-15 21:28:51 UTC
The patch is essentially correct but I'm working on finding a cleaner fix which would avoid file duplication.
However, this will probably take some time as it will touch a lot of arch in libc.

This is currently discussed in this thread : http://sources.redhat.com/ml/libc-alpha/2010-08/msg00030.html

Can this patch be applied in our tree in the meantime ?
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2010-08-26 18:01:47 UTC
Before Christmas, anyone?
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2010-09-29 16:00:33 UTC
*** Bug 335189 has been marked as a duplicate of this bug. ***
Comment 8 SpanKY gentoo-dev 2010-09-29 22:41:50 UTC
queued up in 2.11.2 and 2.12.1 patchsets