From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11149 invoked by alias); 9 Feb 2014 19:29:03 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 11137 invoked by uid 89); 9 Feb 2014 19:29:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: calimero.vinschen.de Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 09 Feb 2014 19:29:01 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 8ECF852085D; Sun, 9 Feb 2014 20:28:59 +0100 (CET) Date: Sun, 09 Feb 2014 19:50:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: spawnv() unlocks files in the calling program Message-ID: <20140209192859.GG2821@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <040201cf25c4$54e9cd20$febd6760$@lbmsys.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CuZtzLgFeSWyzOuB" Content-Disposition: inline In-Reply-To: <040201cf25c4$54e9cd20$febd6760$@lbmsys.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-02/txt/msg00186.txt.bz2 --CuZtzLgFeSWyzOuB Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 761 On Feb 9 13:25, Steven Bardwell wrote: > I have a simple programs that show the following issue: >=20 > 1) program locks a file (in my test /tmp/yyy) > 2) program then calls spawnv() (in my test "/bin/sh -c /bin/touch > /tmp/xxx"). > 3) after the spawnv(), the file /tmp/yyy is no longer locked. How do you test that? You're calling fcntl(F_SETLKW) exactly once at the start of your test application, but never again later. We're talking advisory file locking here, so, where's the next fcntl call waiting for the lock? I debugged your test app and the lock still exists after the spawn call. Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --CuZtzLgFeSWyzOuB Content-Type: application/pgp-signature Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJS99b7AAoJEPU2Bp2uRE+gsQoP/1dC4PmdbU+KPoBCNhbKsCV5 g4aW096bha014SqdJtm1yc5KrrOtM73gtJ2+wtEksF18wOHvSmOOijPVhoTwSY2+ fCECSxFpuhyvLONV2Q5CRcYGKaFZ5Zxn34A4+UrGIvX5mYPxWQMV6HEtgUHKfM+P 9C27fLdb7igi/dDOjz2bckCt3lCi4AvMAjmsRgcSngO52biVtMmIgLEZgWTp23SW YSXKKcOB+UP7yO8CEuDTtBDKlFg3uGcrgpRIx+96dlmd6q7uXtPeFaNdVG610ciG Vd387hem/VbHBHebi7ZLeowwD6wZu/xGyabfm/gVXTrzHwBKOjwM3KIcy15w1uds XYK9PdiRP4TI7rsKTR1ELzZNGd9aEm1D49eqZycsn95hJaEl7S+4i5ly/Lv1FC8J 2QoH6ycJfW2spVzv5x6T626Z2Gv8YHcqI7ix3HtahMOB2kVFYrlZlt0/cCz9mNjo 4CROWul+hOpO1CxjKdBdew4DnV1reLMkGptp4Oue6SWuxyuGLGkl6yO1NH/2xGVC yXXhYun3DAlpTLJFp3apnD/FuvK9RaaB2jMPiXNNET9bu8eH/CXrdvs8ZJLf/Pvc 2cQJd9E464AUHPIGy20Jee2qoceMWKugp25jvXdHMfoUf5pvlCQ+EYipw69AF88l Crd+QFSv09ma9StKppZh =SGb7 -----END PGP SIGNATURE----- --CuZtzLgFeSWyzOuB--