Page MenuHomeFreeBSD

Make new POSIX functions visible
ClosedPublic

Authored by shurd on Dec 2 2024, 3:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 17, 2:48 AM
Unknown Object (File)
Wed, Apr 16, 9:37 AM
Unknown Object (File)
Mon, Apr 7, 2:32 AM
Unknown Object (File)
Mon, Apr 7, 1:01 AM
Unknown Object (File)
Mon, Apr 7, 12:50 AM
Unknown Object (File)
Mon, Apr 7, 12:43 AM
Unknown Object (File)
Sun, Apr 6, 8:38 PM
Unknown Object (File)
Sun, Apr 6, 7:55 PM
Subscribers
None

Details

Summary

Some of the POSIX 202405L functions are already in the system, make
them visible when appropriate.

Test Plan

Whip up some simple tests that call the functions using _POSIX_C_SOURCE
Make sure they confirm to POSIX (qsort_r especially)

Diff Detail

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

Event Timeline

shurd requested review of this revision.Dec 2 2024, 3:41 AM
shurd created this revision.
shurd added inline comments.
include/dlfcn.h
87

Also, that semi-colon is UGly.

include/time.h
189

I don't understand why this macro was hidden in the first place to be honest.

So generally drop the __BSD_VISIBLE when testing for POSIX_VISIBLE. We define POSIX_VISIBLE to the the latest for bsd sources, so it's redundant.

include/dlfcn.h
87

I'd do typedef struct dl_info Dl_info_t; inside this ifdef instead of the ugly comma dance.

125

You don't need BSD_VISIBLE here. the only time you need it is when you're only showing the definition for earlier versions of posix. here it's posix-1.2024 and newer.

include/stdlib.h
239

same here and below for __BSD_VISIBLE unless I say differently.

include/string.h
66–67

Does posix require this to be visible even when memmem is a macro?

include/time.h
184

I'd replace the __BSD_VISIBLE here with

189

If it's not defined in those standards. I haven't checked, though. I. thought TIME_MONOTONIC, though, was new with c23

include/unistd.h
487

drop __BSD_VISIBLE

apart from the __BSD_VISIBLE thing, this is close to landing, there's too many of them for me to hit accept though

include/dlfcn.h
125

This was moved out of the __BSD_VISIBLE block below, so if POSIX isn't 202405, it still needs to be visible when __BSD_VISIBLE doesn't it?

include/time.h
189

I didn't think they reserved all TIME_ macros though. While those standards don't define it, I didn't think they precluded a system from defining other ones in this case.

include/dlfcn.h
125

Oh, I get it now... so there's no way to have __BSD_VISIBLE defined without also having __POSIX_VISIBLE be latest.

shurd added inline comments.
include/time.h
184

I've removed __BSD_VISIBLE, but this comment appears to have been truncated.

shurd added inline comments.
include/string.h
66–67

It states:

The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided for use with ISO C standard compilers.

include/string.h
66–67

Then we should put an extra set of parents around the function name.

include/time.h
189

The strict "only define the symbols in" mode, however, means we can't define extra. So if they aren't part of the standard, we can only defines them under __BSD_VISIBLE

shurd marked 3 inline comments as done.
  • More feedback

OK. All my nits are taken care of. There's one last comment that you may not have intended, but either way, I'm good with this being committed now.

thanks for your patience with my pickiness.

include/dlfcn.h
87

Did you mean to keep this comment?

This revision is now accepted and ready to land.Mar 19 2025, 11:35 PM
shurd marked an inline comment as done.
  • Remove extra XX comment
This revision now requires review to proceed.Mar 19 2025, 11:37 PM
This revision is now accepted and ready to land.Mar 19 2025, 11:38 PM

Thanks for the review, I'm very happy to have a picky reviewer on this one especially.

This revision was automatically updated to reflect the committed changes.