Page MenuHomeFreeBSD

getpagesize(3): add .Xr to sysconf(3)
ClosedPublic

Authored by emaste on May 30 2022, 4:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 22, 12:30 PM
Unknown Object (File)
Sat, Sep 21, 5:59 PM
Unknown Object (File)
Sat, Sep 21, 3:09 PM
Unknown Object (File)
Thu, Sep 19, 11:16 AM
Unknown Object (File)
Thu, Aug 29, 3:40 PM
Unknown Object (File)
Wed, Aug 28, 6:56 PM
Unknown Object (File)
Wed, Aug 28, 6:56 PM
Unknown Object (File)
Aug 5 2024, 1:49 PM

Details

Summary

POSIX deprecated getpagesize(3), and sysconf(_SC_PAGESIZE) is a portable way to get the page size.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste created this revision.
emaste added a subscriber: andrew.

Add note about POSIX deprecating getpagesize

lib/libc/gen/getpagesize.3
58

Will update to _SC_PAGESIZE (leading _)

Not certain this is the best markup for this though.
I could perhaps do

.Xr sysconf 3
with the
.Ar _SC_PAGESIZE
argument

but that seems awkward.

LGTM, I would add "This replaces the deprecated getpagesize(3) function" to sysconf(3).

LGTM, I would add "This replaces the deprecated getpagesize(3) function" to sysconf(3).

Maybe in sysconf's _SC_PAGESIZE description "Portable applications should use this instead of .Xr sysconf 3 (which is deprecated by POSIX)."

Sure, that wording sounds good to me.

LGTM, I would add "This replaces the deprecated getpagesize(3) function" to sysconf(3).

Maybe in sysconf's _SC_PAGESIZE description "Portable applications should use this instead of .Xr sysconf 3 (which is deprecated by POSIX)."

I assume you meant "... instead of .Xr getpagesize 3 ..."

lib/libc/gen/getpagesize.3
31

So you're giving us 3 weeks to review? :-)

I assume you meant "... instead of .Xr getpagesize 3 ..."

Oups, yes.

It's fine as it is, but I've none the less pulled out a can of purple paint for the annual memorial day bike shed painting party.

lib/libc/gen/getpagesize.3
55

Usually we say "POSIX 2001.xx deprecated ...."

Do you know when POSIX deprecated the API?

59

"sysconf(_SC_PAGESIZE) replaces it."

might be simpler, shorter and better?

lib/libc/gen/getpagesize.3
55

I am not sure off hand...

The Linux man page says:

CONFORMING TO

SVr4, 4.4BSD, SUSv2.  In SUSv2 the getpagesize() call is labeled
LEGACY, and in POSIX.1-2001 it has been dropped; HP-UX does not
have this call.
59

I don't like something about this, maybe it's just starting with a lower case letter via the function name.

lib/libc/gen/getpagesize.3
55

.Nm
was removed in
.mumble POSIX.1-2001 .
It is replaced by
.Ql sysconf(_SC_PAGESIZE);
which should be used instead.

Since it's actually been removed from POSIX.1. Deprecated means that it is still there, but it may be removed in a future version, so we should avoid that language.

I don't have any of the POSIX standards before 2001, so it's not easy for me to go look. the opengroup website is hit or miss on older standards finding details like this, alas. I've had some luck in the past, but it's been mixed....

59

fair enough. See above for a different take then.

So it looks to be in POSIX-1.1997 as LEGACY (at least that's the version tagged on the opengroup web site), but gone in 2001. I'd just say it was removed in ".St -p1003.1-2001". and leave it at that.

This revision was not accepted when it landed; it landed in state Needs Review.Jun 1 2022, 4:17 PM
This revision was automatically updated to reflect the committed changes.