Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Mar 2024 07:50:48 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 2ce23b1f7672 - main - libc posix_spawn(): explain why rtld can be used after fork
Message-ID:  <202403060750.4267omhK054444@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=2ce23b1f76721e44646fc98ba4e24a113a6d5972

commit 2ce23b1f76721e44646fc98ba4e24a113a6d5972
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-03-06 07:24:22 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-03-06 07:25:14 +0000

    libc posix_spawn(): explain why rtld can be used after fork
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
---
 lib/libc/gen/posix_spawn.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/libc/gen/posix_spawn.c b/lib/libc/gen/posix_spawn.c
index d405517ba68d..ee2ce05ff317 100644
--- a/lib/libc/gen/posix_spawn.c
+++ b/lib/libc/gen/posix_spawn.c
@@ -325,6 +325,11 @@ do_posix_spawn(pid_t *pid, const char *path,
 	 * ideal vfork(2) if we get an EINVAL from rfork -- this should only
 	 * happen with newer libc on older kernel that doesn't accept
 	 * RFSPAWN.
+	 *
+	 * Combination of vfork() (or its equivalent rfork() form) and
+	 * a special property of the libthr rtld locks ensure that
+	 * rtld is operational in the child.  In particular, libthr
+	 * rtld locks do not store owner' tid into the lock word.
 	 */
 #ifdef _RFORK_THREAD_STACK_SIZE
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202403060750.4267omhK054444>