Last parameter of getpwent_r(3) family of functions is useless
Alejandro Colomar
alx@kernel.org
Sun Sep 28 19:28:30 GMT 2025
Hi!
I've never understood all the parameters of the getspent_r(3) family of
functions. Today, I've implemented one of these functions, and I
realized the last one is entirely useless, and thus I haven't
implemented it in my version (sgetsgent_r()).
I wonder if we could simplify the usage of these functions by allowing
the last argument to be specified as NULL. That would be a compatible
change (although not usable by programs for many years). In the long
term, it would be an improvement. Eventually (in a couple of decades),
we'd be able to document that the last argument should be a NULL pointer
for historic reasons (very much like time(2)), and simplify its
documentation.
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20250928/70b36891/attachment.sig>
More information about the Libc-alpha
mailing list