Page MenuHomeFreeBSD

sys: Make priority.h and rtprio.h include all dependencies
Needs ReviewPublic

Authored by arichardson on Aug 20 2025, 4:28 AM.
Tags
None
Referenced Files
F130909663: D52041.diff
Fri, Oct 3, 9:31 AM
Unknown Object (File)
Wed, Oct 1, 12:03 PM
Unknown Object (File)
Sun, Sep 28, 12:35 PM
Unknown Object (File)
Tue, Sep 23, 12:37 PM
Unknown Object (File)
Sun, Sep 21, 6:57 AM
Unknown Object (File)
Sun, Sep 21, 3:53 AM
Unknown Object (File)
Sun, Sep 21, 2:32 AM
Unknown Object (File)
Sun, Sep 21, 1:35 AM
Subscribers
None

Details

Reviewers
emaste
imp
Summary

This ensures this header can be included without an explicit or implicit
sys/types.h include first. This causes issues building SPEC2017 which
includes sys/rtprio.h and then we get an error due to missing u_char
definition.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 67015
Build 63898: arc lint + arc unit

Event Timeline

arichardson created this revision.

Do you need sys/types.h, or sys/_types.h? The latter has less namespace pollution...

And if these are on the excluded list for check headers for buildworld, please remove them.

In D52041#1188826, @imp wrote:

Do you need sys/types.h, or sys/_types.h? The latter has less namespace pollution...

And if these are on the excluded list for check headers for buildworld, please remove them.

They both use u_char and u_short so need the full sys/types.h. Alternatively I guess I could replace them with unsigned char/uint8_t?

In D52041#1188826, @imp wrote:

Do you need sys/types.h, or sys/_types.h? The latter has less namespace pollution...

And if these are on the excluded list for check headers for buildworld, please remove them.

Also could you point me at the header checks list, I can't seem to find it.

# Ensure no regressions in self-includeability of sys/*.h and net*/*.h
test-includes: .PHONY
        ${_+_}cd ${.CURDIR}/tools/build/test-includes; \
            ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} DESTDIR=${WORLDTMP} test-includes

tools/build/test-includes/badfiles.inc has the list. Both of these files are on there.

I've often used the raw spelling for u_char/u_int etc with unsigned char, unsigned int, etc when it's only a few instances. If that works, that is. If there's a lot or other considerations, I just included sys/types.h or sys/_types.h. This looks to be more of a 'replace' than an 'include' scenario, but maybe I'm missing something.

avoid sys/types.h includes, and update test list