summaryrefslogtreecommitdiffstats
path: root/vendor/rustix/src/event
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:26:03 +0000
commit9918693037dce8aa4bb6f08741b6812923486c18 (patch)
tree21d2b40bec7e6a7ea664acee056eb3d08e15a1cf /vendor/rustix/src/event
parentReleasing progress-linux version 1.75.0+dfsg1-5~progress7.99u1. (diff)
downloadrustc-9918693037dce8aa4bb6f08741b6812923486c18.tar.xz
rustc-9918693037dce8aa4bb6f08741b6812923486c18.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/rustix/src/event')
-rw-r--r--vendor/rustix/src/event/mod.rs4
-rw-r--r--vendor/rustix/src/event/pause.rs31
2 files changed, 35 insertions, 0 deletions
diff --git a/vendor/rustix/src/event/mod.rs b/vendor/rustix/src/event/mod.rs
index b0b62e0a6..b6b7f9971 100644
--- a/vendor/rustix/src/event/mod.rs
+++ b/vendor/rustix/src/event/mod.rs
@@ -9,6 +9,8 @@
mod eventfd;
#[cfg(all(feature = "alloc", bsd))]
pub mod kqueue;
+#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))]
+mod pause;
mod poll;
#[cfg(solarish)]
pub mod port;
@@ -22,4 +24,6 @@ pub use crate::backend::event::epoll;
target_os = "espidf"
))]
pub use eventfd::{eventfd, EventfdFlags};
+#[cfg(not(any(windows, target_os = "redox", target_os = "wasi")))]
+pub use pause::*;
pub use poll::{poll, PollFd, PollFlags};
diff --git a/vendor/rustix/src/event/pause.rs b/vendor/rustix/src/event/pause.rs
new file mode 100644
index 000000000..f19108490
--- /dev/null
+++ b/vendor/rustix/src/event/pause.rs
@@ -0,0 +1,31 @@
+use crate::backend;
+
+/// `pause()`
+///
+/// The POSIX `pause` interface returns an error code, but the only thing
+/// `pause` does is sleep until interrupted by a signal, so it always
+/// returns the same thing with the same error code, so in rustix, the
+/// return value is omitted.
+///
+/// # References
+/// - [POSIX]
+/// - [Linux]
+/// - [Apple]
+/// - [FreeBSD]
+/// - [NetBSD]
+/// - [OpenBSD]
+/// - [DragonFly BSD]
+/// - [illumos]
+///
+/// [POSIX]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/pause.html
+/// [Linux]: https://man7.org/linux/man-pages/man2/pause.2.html
+/// [Apple]: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/pause.3.html
+/// [FreeBSD]: https://man.freebsd.org/cgi/man.cgi?query=pause&sektion=3
+/// [NetBSD]: https://man.netbsd.org/pause.3
+/// [OpenBSD]: https://man.openbsd.org/pause.3
+/// [DragonFly BSD]: https://man.dragonflybsd.org/?command=pause&section=3
+/// [illumos]: https://illumos.org/man/2/pause
+#[inline]
+pub fn pause() {
+ backend::event::syscalls::pause()
+}