From f11b493c115700bf01f9ba16a3b069de69671c6a Mon Sep 17 00:00:00 2001 From: Steve Lau Date: Sun, 2 Feb 2025 18:24:45 +0800 Subject: [PATCH 1/2] docs: doc that signal-unsafe fns can be called after execve --- src/pty.rs | 6 +++--- src/unistd.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pty.rs b/src/pty.rs index a41f817594..0c7e7c1062 100644 --- a/src/pty.rs +++ b/src/pty.rs @@ -334,9 +334,9 @@ feature! { /// # Safety /// /// In a multithreaded program, only [async-signal-safe] functions like `pause` -/// and `_exit` may be called by the child (the parent isn't restricted). Note -/// that memory allocation may **not** be async-signal-safe and thus must be -/// prevented. +/// and `_exit` may be called by the child (the parent isn't restricted) until +/// a call of `execve(2)`. Note that memory allocation may **not** be +/// async-signal-safe and thus must be prevented. /// /// Those functions are only a small subset of your operating system's API, so /// special care must be taken to only invoke code you can control and audit. diff --git a/src/unistd.rs b/src/unistd.rs index 9c803d8c9a..4bb715b707 100644 --- a/src/unistd.rs +++ b/src/unistd.rs @@ -265,9 +265,9 @@ impl ForkResult { /// # Safety /// /// In a multithreaded program, only [async-signal-safe] functions like `pause` -/// and `_exit` may be called by the child (the parent isn't restricted). Note -/// that memory allocation may **not** be async-signal-safe and thus must be -/// prevented. +/// and `_exit` may be called by the child (the parent isn't restricted) until +/// a call of `execve(2)`. Note that memory allocation may **not** be +/// async-signal-safe and thus must be prevented. /// /// Those functions are only a small subset of your operating system's API, so /// special care must be taken to only invoke code you can control and audit. From 1aa9205a0a6c77160709d21073742f0657557ae9 Mon Sep 17 00:00:00 2001 From: Steve Lau Date: Sun, 2 Feb 2025 19:11:38 +0800 Subject: [PATCH 2/2] style: fmt --- src/pty.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pty.rs b/src/pty.rs index 0c7e7c1062..ab449e4ab7 100644 --- a/src/pty.rs +++ b/src/pty.rs @@ -335,7 +335,7 @@ feature! { /// /// In a multithreaded program, only [async-signal-safe] functions like `pause` /// and `_exit` may be called by the child (the parent isn't restricted) until -/// a call of `execve(2)`. Note that memory allocation may **not** be +/// a call of `execve(2)`. Note that memory allocation may **not** be /// async-signal-safe and thus must be prevented. /// /// Those functions are only a small subset of your operating system's API, so