Page MenuHomeFreeBSD

libc: Constify the getcap API
ClosedPublic

Authored by des on May 26 2026, 4:51 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 24, 3:17 AM
Unknown Object (File)
Tue, Jun 23, 12:12 PM
Unknown Object (File)
Sun, Jun 21, 4:48 PM
Unknown Object (File)
Sun, Jun 21, 4:06 PM
Unknown Object (File)
Sat, Jun 20, 9:02 PM
Unknown Object (File)
Sat, Jun 20, 4:32 PM
Unknown Object (File)
Sat, Jun 20, 12:27 PM
Unknown Object (File)
Wed, Jun 17, 3:48 AM
Subscribers

Details

Summary

MFC after: 1 week
Inspired by: NetBSD

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 73457
Build 70340: arc lint + arc unit

Event Timeline

des requested review of this revision.May 26 2026, 4:51 PM

* (indicating pointers) should preferably be stuck onto the next token without intervening spaces everywhere, e.g.: const char * const *db_array => const char *const *db_array, because in a declaration the presence of the first * delimits the declarator list, which means that what is after the first * is specific to the variable being declared, and not to the next one in the list (that's IMO why that's the common practice for a single *).

Otherwise, looks good.

Outer (const char *) const is painful of course, since T** is invariant by T (I think this is the right term).

lib/libc/gen/disklabel.c
71

Is the cast for name needed after your changes?

libexec/getty/subr.c
57 ↗(On Diff #178653)

Make dba static as well?

* (indicating pointers) should preferably be stuck onto the next token without intervening spaces everywhere, e.g.: const char * const *db_array => const char *const *db_array, because in a declaration the presence of the first * delimits the declarator list, which means that what is after the first * is specific to the variable being declared, and not to the next one in the list (that's IMO why that's the common practice for a single *).

The style I'm using here is the established style in our code base, see for instance fts(3), nv(9), strerror(3).

des marked 2 inline comments as done.Thu, Jun 4, 9:40 PM
This revision is now accepted and ready to land.Thu, Jun 4, 10:24 PM
This revision was automatically updated to reflect the committed changes.