<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>


<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<p style="color: #777777;">
<a href="https://gitlab.com/Courmisch">Remi Denis-Courmont</a>
commented:
</p>
<div style="">
<p dir="auto">As far as I know, there are two ways to solve this (and none else):</p>
<ul dir="auto">
<li>use the "e" flag to <code>fopen()</code> (specified in POSIX.next if I understood correctly, originating in glibc), or</li>
<li>use <code>open() with the </code>O_CLOEXEC<code>flag followed by</code>fdopen()` (specified in POSIX.2008 already).</li>
</ul>
<p dir="auto">As to portability, you have four cases:</p>
<ol dir="auto">
<li>The OS does not support <code>fork()</code> (e.g. Windows): no need to do anything.</li>
<li>The OS supports <code>fork()</code>, lacks POSIX.2008: this is broken beyond repair.</li>
<li>The OS supports <code>fork()</code> and POSIX.2008: using <code>open()</code> then <code>fdopen()</code> is the only solution.</li>
<li>The OS supports both solutions.</li>
</ol>
</div>


</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #777;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/issues/985#note_341226072">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/-/sent_notifications/65475b6e878d2ac133202ecc6dfd0710/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/-/issues/985#note_341226072"}}</script>


</p>
</div>
</body>
</html>