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

Bug 453634

Summary: sys-libs/uclibc-0.9.33.2: add functions dup3 and mkostemp for building sys-fs/udev-197 and above
Product: Gentoo Linux Reporter: Tibor Vago <tibor.vago>
Component: [OLD] Core systemAssignee: Embedded Gentoo Team <embedded>
Status: RESOLVED FIXED    
Severity: normal CC: tibor.vago, udev-bugs
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: http://bugs.gentoo.org/show_bug.cgi?id=443030
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build log
temporary workaround patch

Description Tibor Vago 2013-01-23 08:24:53 UTC
Can't compile udev-197 as uClibc doesn't provide dup3 and mkostemp definitions.
Comment 1 Tibor Vago 2013-01-23 08:26:08 UTC
Created attachment 336552 [details]
build log
Comment 2 Tibor Vago 2013-01-23 08:28:58 UTC
Created attachment 336554 [details, diff]
temporary workaround patch

This is a workaround patch to compile udev but I think this is not the proper way. Maybe uClibc migth have dup3 and mkostemp.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2013-01-23 17:47:42 UTC
According to Mike these should be in uclibc head so these 2 functions should be backported to the current uclibc in tree.

Reassigning to uclibc maintainers.

https://bugs.gentoo.org/show_bug.cgi?id=443030#c1
Comment 4 Anthony Basile gentoo-dev 2013-01-23 23:51:41 UTC
(In reply to comment #3)
> According to Mike these should be in uclibc head so these 2 functions should
> be backported to the current uclibc in tree.
> 
> Reassigning to uclibc maintainers.
> 
> https://bugs.gentoo.org/show_bug.cgi?id=443030#c1

Yeah there is also another problem with Tibor's patch.  You can't just do

-        fd = mkostemp(path, O_RDWR|O_CLOEXEC);
+        fd = mkstemp(path);

since these are not equivalent.  Dropping the O_CLOEXEC could lead to a race condition.  I'm not 100% sure since I don't know the threading going on there, but it is safer to do:

+        fd = mkstemp(path);
+        fcntl(fd, F_SETFD, FD_CLOEXEC);
Comment 6 Tibor Vago 2013-01-26 18:10:05 UTC
Hi SpanKY,

in the end of "03_all_dup3-1.patch" there is dup2, and not dup3...

Cheers,
oreggin
Comment 7 SpanKY gentoo-dev 2013-01-26 18:16:36 UTC
should be all set now in the tree; thanks for the report!

Commit message: Add dup3/mkostemp support
http://sources.gentoo.org/sys-libs/uclibc/uclibc-0.9.33.2-r3.ebuild?rev=1.1
Comment 8 Tibor Vago 2013-01-26 19:00:49 UTC
I've tested the patches, and works well on my machine.

Thx, SpanKY