Opened 4 years ago

Closed 4 years ago

#7708 closed bug (fixed)

sys/cpuset.h cannot be found on FreeBSD

Reported by: kazu-yamamoto Owned by:
Priority: normal Milestone:
Component: Build System Version: 7.7
Keywords: Cc:
Operating System: FreeBSD Architecture: Unknown/Multiple
Type of failure: Building GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Current "" cannot detect "sys/cpuset.h" even if it exists on FreeBSD 9.1:

checking sys/cpuset.h presence... yes
configure: WARNING: sys/cpuset.h: present but cannot be compiled
configure: WARNING: sys/cpuset.h:     check for missing prerequisite headers?
configure: WARNING: sys/cpuset.h: see the Autoconf documentation
configure: WARNING: sys/cpuset.h:     section "Present But Cannot Be Compiled"
configure: WARNING: sys/cpuset.h: proceeding with the compiler's result
configure: WARNING:     ## ----------------------------------------------- ##
configure: WARNING:     ## Report this to ##
configure: WARNING:     ## ----------------------------------------------- ##
checking for sys/cpuset.h... no

This is because sys/param.h should be included in the test.

Attachments (1)

DIFF (1.1 KB) - added by kazu-yamamoto 4 years ago.
a patch for

Download all attachments as: .zip

Change History (8)

Changed 4 years ago by kazu-yamamoto

Attachment: DIFF added

a patch for

comment:1 Changed 4 years ago by kazu-yamamoto

The attached patch fixes this.

comment:2 Changed 4 years ago by igloo

difficulty: Unknown
Status: newpatch

comment:3 Changed 4 years ago by kazu-yamamoto

What stops merging this patch?

comment:4 Changed 4 years ago by ezyang

I think probably people want to test the patch independently and make sure it works, but I don't have a BSD box handy for that :(

Question about a hunk:

+AC_CHECK_HEADERS([sys/cpuset.h], [], [],
+# include <sys/param.h>

What is going on here?

comment:5 Changed 4 years ago by kazu-yamamoto

Manpage of cpuset_getaffinity() says:

#include <sys/param.h>
#include <sys/cpuset.h>

This bug happens because the check program only includes sys/cpuset.h. The patch first checks whether or not sys/param.h exist. If exists, check whether or not sys/cpuset.h exist with sys/param.h included.

comment:6 Changed 4 years ago by ian@…

commit 4a8e254cbc16b3a4f264c4dda15d8eeddd13abc7

Author: Ian Lynagh <>
Date:   Fri Mar 1 00:50:47 2013 +0000

    Fix sys/cpuset.h on FreeBSD 9.1; patch from kazu-yamamoto; fixes #7708 |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

comment:7 Changed 4 years ago by igloo

Resolution: fixed
Status: patchclosed

Applied, thanks!

Note: See TracTickets for help on using tickets.