[Bug 16447] New: [PATCH] fix potential FreeBSD build problem (<pthread_np.h> not included)

Bug ID 16447
Summary [PATCH] fix potential FreeBSD build problem (<pthread_np.h> not included)
Product lldb
Version unspecified
Hardware PC
OS FreeBSD
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@cs.uiuc.edu
Reporter rmh@gnu.org
CC sylvestre@debian.org
Classification Unclassified

Created attachment 10761 [details]
patch

Improper use of __FreeBSD_kernel__ in source/Host/common/Host.cpp excludes
FreeBSD from the code section it was intended for:

#elif defined (__linux__) || defined(__FreeBSD_kernel__)
[...]
#elif defined (__FreeBSD__)
[...]
#endif

Please note, that __FreeBSD_kernel__ implies a FreeBSD kernel, but it doesn't
imply anything about userland. So, when checking for this macro you may match
any system that uses the kernel of FreeBSD, including FreeBSD itself.

As recent versions of FreeBSD define this macro [1], the first code section is
being skipped, which doesn't look like what the original code intended.

A possible solution could be to split the logic for <sys/wait.h> (which is
basically kernel-related) from the logic for <pthread_np.h> (which is
determined by pthread library). See attachment.

[1] See [http://svnweb.freebsd.org/base/head/sys/sys/param.h?view=co](http://svnweb.freebsd.org/base/head/sys/sys/param.h?view=co)

emaste@freebsd.org changed bug 16447

What Removed Added
Status NEW RESOLVED
CC emaste@freebsd.org
Resolution FIXED

Comment # 1 on bug 16447 from emaste@freebsd.org

Committed as r184867.