Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[solarish/freebsd] add a few missing constants and functions #3979

Closed
wants to merge 1 commit into from

Conversation

sunshowers
Copy link
Contributor

Add:

  • O_RSYNC on Solaris and illumos, based on the source code at 1. This was added a long time ago, and the blame indicates that the constant is shared with Solaris.
  • POLLRDHUP on illumos, based on the source code at 2. This was also added a long time ago, but is not in the man page (I'll track that down separately, but it has been supported and used for many years). I cannot verify whether this is in Solaris.
  • POLLRDHUP on FreeBSD, based on this man page 3. This was added in 2021 4.
  • posix_fadvise on illumos, based on this man page 5. The related constants are on GitHub 6. posix_fadvise seems to exist on Solaris 7 but I haven't been able to verify any of the constants so I've left it out of this PR.
  • posix_fallocate on illumos (man page 8) and Solaris (man page 9).

(backport #3936)
(cherry picked from commit 52e81a8)

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

Add:

* `O_RSYNC` on Solaris and illumos, based on the source code at [1]. This was
  added a long time ago, and the blame indicates that the constant is shared
  with Solaris.
* `POLLRDHUP` on illumos, based on the source code at [2]. This was also added
  a long time ago, but is not in the man page (I'll track that down separately,
  but it has been supported and used for many years). I cannot verify whether
  this is in Solaris.
* `POLLRDHUP` on FreeBSD, based on this man page [3]. This was added in 2021 [4].
* `posix_fadvise` on illumos, based on this man page [5]. The related constants
  are on GitHub [6]. `posix_fadvise` seems to exist on Solaris [7] but I
  haven't been able to verify any of the constants so I've left it out of this
  PR.
* `posix_fallocate` on illumos (man page [8]) and Solaris (man page [9]).

[1]: https://github.com/illumos/illumos-gate/blame/f389e29fb4a3b48598f4e25151eb570247c6deed/usr/src/uts/common/sys/fcntl.h#L70
[2]: https://github.com/illumos/illumos-gate/blame/f389e29fb4a3b48598f4e25151eb570247c6deed/usr/src/uts/common/sys/poll.h#L66
[3]: https://man.freebsd.org/cgi/man.cgi?poll
[4]: https://cgit.freebsd.org/src/commit/sys/sys/poll.h?id=3aaaa2efde896e19d229ee2cf09fe7e6ab0fbf6e
[5]: https://illumos.org/man/3C/posix_fadvise
[6]: https://github.com/illumos/illumos-gate/blob/f389e29fb4a3b48598f4e25151eb570247c6deed/usr/src/uts/common/sys/fcntl.h#L407-L412
[7]: https://docs.oracle.com/cd/E88353_01/html/E37843/posix-fadvise-3c.html
[8]: https://illumos.org/man/3C/posix_fallocate
[9]: https://docs.oracle.com/cd/E88353_01/html/E37843/posix-fallocate-3c.html

(backport <rust-lang#3936>)
(cherry picked from commit 52e81a8)
@rustbot
Copy link
Collaborator

rustbot commented Oct 16, 2024

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot
Copy link
Collaborator

rustbot commented Oct 16, 2024

Some changes occurred in solarish module

cc @jclulow, @pfmooney

@sunshowers
Copy link
Contributor Author

This is a backport of #3936, which has already landed on main.

@sunshowers
Copy link
Contributor Author

Ah, taken care of by #3980.

@sunshowers sunshowers closed this Oct 16, 2024
@sunshowers sunshowers deleted the illumos-fns-02 branch October 16, 2024 19:54
@tgross35
Copy link
Contributor

Oh thanks for jumping on this. I usually do a few backports at a time in batches, nothing for the author to worry about (unless it turns out to be conflict-heavy)

@sunshowers
Copy link
Contributor Author

No prob, thanks for getting the new release out!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants