Bug 1224977

Summary: libcap-ng: fails to include <unistd.c> in utils/proc-llist.c. Breaks POSIX.
Product: [Fedora] Fedora Reporter: Anthony G. Basile <basile>
Component: libcap-ngAssignee: Steve Grubb <sgrubb>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: sgrubb
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-05-28 01:19:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Include <unistd.h> in utils/proc-llist.c none

Description Anthony G. Basile 2015-05-26 10:42:00 UTC
Created attachment 1029854 [details]
Include <unistd.h> in utils/proc-llist.c

Description of problem:

utils/proc-llist.c references pid_t and uid_t types but does not include <unistd.h>. This works on Fedora which use glibc, and on embedded systems using uClibc, because of the way their headers stack.  But on musl (and possible other libc's) this fails. POSIX mandates that <unistd.h> provides these types. See Issue 6 at http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html.

The attached patch fixes the problem, and was tested on systems with glibc, uclibc and musl as their C standard lib.

See also: https://bugs.gentoo.org/show_bug.cgi?id=550298

Comment 1 Steve Grubb 2015-05-26 12:18:40 UTC
What version are you talking about? I added this change specifically for musl:

https://fedorahosted.org/libcap-ng/changeset/71

This went out as version 0.7.7.

Comment 2 Anthony G. Basile 2015-05-27 22:58:59 UTC
(In reply to Steve Grubb from comment #1)
> What version are you talking about? I added this change specifically for
> musl:
> 
> https://fedorahosted.org/libcap-ng/changeset/71
> 
> This went out as version 0.7.7.

Sorry we have 0.7.5 in the Gentoo repo.  I'll bump it to 0.7.7, test and close this bug if it works.

Comment 3 Steve Grubb 2015-05-27 23:10:10 UTC
OK, good. Just a FYI, I am probably going to release 0.7.8 within the next week. It fixes a compile problem when python3 is in the build root and python3's Python.h is not.

Comment 4 Anthony G. Basile 2015-05-28 01:19:22 UTC
(In reply to Steve Grubb from comment #3)
> OK, good. Just a FYI, I am probably going to release 0.7.8 within the next
> week. It fixes a compile problem when python3 is in the build root and
> python3's Python.h is not.

0.7.7 works just fine on musl.  Thanks.  I'll watch out for 0.7.8.