feat: add missing lch* syscalls to *BSD platforms - #5400
Conversation
|
Some changes occurred in a NetBSD-like module cc @semarie |
02cb97b to
7678592
Compare
|
Diff looks reasonable but could you please add source permalinks to the commit message? https://github.com/rust-lang/libc/blob/main/CONTRIBUTING.md#source-links |
I added links to the BSD manpages (they have historical notes for when syscalls were added) instead of source on GitHub--which may or may not change in the future or might be pointing to out-of-date or unofficial readonly mirrors. macOS ... is another beast entirely (partly because they don't publish their documentation as much), so I've linked the actual header source as mentioned in CONTRIBUTING.md . |
332fdda to
ee9a957
Compare
Manpages are of course fine to include but I always need to check against headers (since sometimes they show more details or don't actually line up), so linking them is really just a way to save me from going hunting. I'll make that more clear in the docs. As far as I'm aware, the BSD mirrors are official, and asking specifically for permalinks is how we know they're accurate at some point of time. If there's a non-mirror web viewer then that's fine too but they seem to often give problems (e.g. sourceware is flaky, https://svnweb.freebsd.org/ is currently a 503 for me, I'm not even sure if DragonFly has a viewer for their repo...). Anyway, I already peeked so: |
ee9a957 to
f858263
Compare
FreeBSD moved to cgit over a year ago [1]. There was recent discussion about shutting down svnweb on the internal developers list, but there's no timeframe for when that might happen.
|
This change adds the following system calls to various 4.4BSD
derivatives:
* FreeBSD(-like)
* lchmod ([DragonFlyBSD][1], [FreeBSD][2])
* macOS
* [lchflags][3]
* [lchmod][4]
* NetBSD
* [lchmod][5]
These system calls are available on all ancient versions of *BSD
(4.4BSD, FreeBSD 3.0, etc). More specific historical information
about when the functions were added is available in the manpages
and headers referenced.
This change also adds *chflags and *chmod to macos' semver file
(additional syscalls are missing from that file).
1: https://leaf.dragonflybsd.org/cgi/web-man?command=lchmod
2: https://man.freebsd.org/cgi/man.cgi?query=lchmod
3: https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/bsd/sys/stat.h#L597
4: https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/bsd/sys/stat.h#L598
5: https://man.netbsd.org/lchmod.2
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
f858263 to
5eac8d9
Compare
PS My FreeBSD.org handle is: ngie, FYI. |
|
Thanks for all the info, I'll pull that all into our docs at the next update. Also looks like a rather cool project. |
|
(I see @tgross35 already added the Ad hoc libc-0.2 GHA CI/CD run.
|
I just compared my GitHub fork against NetBSD's, and it look like they rewrote their history sometime in the not so distant past (my trunk has different hashes from their's). So, I would strongly advise not using their GitHub readonly mirror as a valid source of truth :/... |
This change adds the following system calls to various 4.4BSD derivatives:
These system calls are available on all ancient versions of *BSD (4.4BSD, FreeBSD 3.0, etc). More specific historical information about when the functions were added is available in the manpages and headers referenced.
1: https://leaf.dragonflybsd.org/cgi/web-man?command=lchmod
2: https://man.freebsd.org/cgi/man.cgi?query=lchmod
3: https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/bsd/sys/stat.h#L597
4: https://github.com/apple-oss-distributions/xnu/blob/f6217f891ac0bb64f3d375211650a4c1ff8ca1ea/bsd/sys/stat.h#L598
5: https://man.netbsd.org/lchmod.2