delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
X-SWARE-Spam-Status: | No, hits=-7.3 required=5.0 tests=AWL,BAYES_00,KHOP_PGP_SIGNED,KHOP_THREADED,RP_MATCHES_RCVD,SPF_HELO_PASS |
X-Spam-Check-By: | sourceware.org |
Message-ID: | <503C666A.5080501@dancol.org> |
Date: | Mon, 27 Aug 2012 23:34:18 -0700 |
From: | Daniel Colascione <dancol AT dancol DOT org> |
User-Agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 |
MIME-Version: | 1.0 |
To: | cygwin AT cygwin DOT com |
Subject: | Re: fork() and file descriptors with un-flushed output |
References: | <1346135219441-92349 DOT post AT n5 DOT nabble DOT com> |
In-Reply-To: | <1346135219441-92349.post@n5.nabble.com> |
X-IsSubscribed: | yes |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
--------------enigF024317FE99FD2A6918A9FD3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 8/27/2012 11:26 PM, thoni56 wrote: > Is this a known behaviour? Unavoidable in cygwin? (Obviously not, if I'm = on > the right track with my guesswork...) If it is a bug, will it be fixed? This behavior isn't Cygwin-specific. In fact, it's longstanding Unix behavi= or. (The buffering problem is one reason you should, generally speaking, use _exit(2), not exit(3), in a forked child.) Calling fflush(NULL) before the = fork will flush all stdio buffers for you and eliminate the problem, assuming yo= u're single-threaded. --------------enigF024317FE99FD2A6918A9FD3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (Cygwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlA8Zm4ACgkQ17c2LVA10VuGdQCdGBagWwEBnBUv87nVbF+G6Y5V EkwAoI3HFVCMiZq//h+YX/ZoC/JI7jgW =Bmhv -----END PGP SIGNATURE----- --------------enigF024317FE99FD2A6918A9FD3--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |