Glibc 2.34 Adds "_Fork" Function Ahead Of Future POSIX Revision

Written by Michael Larabel in GNU on 28 June 2021 at 06:55 PM EDT. 14 Comments
GNU
The GNU C Library (Glibc) has landed its _Fork function implementation as an async-signal-safe fork replacement that is also expected to be made part of the next POSIX standards revision.

Going back to 2007 has been Glibc Bug 4737 of the fork function not being signal safe with glibc, unlike some BSDs and other platforms. Various developers have commented on it over the years due to deadlocks occurring in their programs such as if using fork() within a signal handler and other conditions met.

While last year Glibc finally made progress in making their fork function async-signal-safe, that only applies to single-threaded processes. But with the Austin Group that is behind POSIX dropping the async-signal-safe requirement from fork and instead going with the safe _Fork replacement, Glibc is finally getting around to implementing their recommendation.

Within this ticket for the Austin Group bugs the matter was already talked about last decade:
The _Fork() function shall be equivalent to fork(), except that fork handlers established by means of the pthread_atfork() function shall not be called and _Fork() shall be async-signal-safe.

Now finally merged today mid-way through 2021 is Glibc's _Fork support. This _Fork patch by Linaro's Adhemerval Zanella will in turn be with the Glibc 2.34 release for those needing an async-signal-safe fork on Linux and other Glibc-supported environments.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week