bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

portability of fopen and 'e' (O_CLOEXEC) flag


From: Tim Rühsen
Subject: portability of fopen and 'e' (O_CLOEXEC) flag
Date: Mon, 11 May 2020 16:49:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

Hi,

i would like to ask for your expert knowledge.

How to prevent file descriptor leaks in a multi-threaded application
that fork+exec. Quick answer is surely "use O_CLOEXEC" to close those
file descriptors on exec.

But how does this work with fopen in a portable way ?
GNU libc has the 'e' flag for exactly this.

How about other non-GNU OSes / alternative C libraries ?

Regards, Tim

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]