From owner-freebsd-current@freebsd.org Wed Aug 9 20:02:37 2017 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FFBFDD5097 for ; Wed, 9 Aug 2017 20:02:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CB48845EF for ; Wed, 9 Aug 2017 20:02:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 80C14138C5 for ; Wed, 9 Aug 2017 20:02:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 5E8828D55 for ; Wed, 9 Aug 2017 20:02:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id CjXChCXG99Vt for ; Wed, 9 Aug 2017 20:02:28 +0000 (UTC) Subject: Re: Would O_APPEND for /dev/null be possible? DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 767A48D46 To: freebsd-current@freebsd.org References: <20170807213656.FwzOG%steffen@sdaoden.eu> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <768c55f1-6a10-868b-9cd5-6ca5f93aaca3@FreeBSD.org> Date: Wed, 9 Aug 2017 13:02:27 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170807213656.FwzOG%steffen@sdaoden.eu> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="iS6pG5SvkHhjUq4VvCFtjx49NqrFtJJ0t" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Aug 2017 20:02:37 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iS6pG5SvkHhjUq4VvCFtjx49NqrFtJJ0t Content-Type: multipart/mixed; boundary="9mV7xWJwjgepgpEk2bXMD2w9Oj7vON47w"; protected-headers="v1" From: Bryan Drewery To: freebsd-current@freebsd.org Message-ID: <768c55f1-6a10-868b-9cd5-6ca5f93aaca3@FreeBSD.org> Subject: Re: Would O_APPEND for /dev/null be possible? References: <20170807213656.FwzOG%steffen@sdaoden.eu> In-Reply-To: <20170807213656.FwzOG%steffen@sdaoden.eu> --9mV7xWJwjgepgpEk2bXMD2w9Oj7vON47w Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 8/7/2017 2:36 PM, Steffen Nurpmeso wrote: > I can open a file with "a+", which, for this software, means > "O_RDWR | O_APPEND | O_CREAT | n_O_NOFOLLOW" on Linux, Solaris and > OpenBSD, but FreeBSD complains, i think because O_APPEND. (I > think only because the VM does not survive resumes and other > pauses here, which frustrated me over time. It is old VM.) > I mean, it seems i have to sprinkle more /dev/null string > comparisons all over the place, but i wonder whether that really > belongs there.. for /dev/null? > # cat uh.c > #include > #include >=20 > int main() { > int fd; >=20 > fd =3D open("/dev/null", O_RDWR | O_APPEND | O_CREAT | O_NOFOLL= OW); > if (fd =3D=3D -1) > err(1, "open"); > return 0; > } > # truss ./uh =2E.. > openat(AT_FDCWD,"/dev/null",O_RDWR|O_APPEND|O_NOFOLLOW|O_CREAT,03777776= 2520) =3D 3 (0x3) Seems to work fine. --=20 Regards, Bryan Drewery --9mV7xWJwjgepgpEk2bXMD2w9Oj7vON47w-- --iS6pG5SvkHhjUq4VvCFtjx49NqrFtJJ0t Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJZi2pUAAoJEDXXcbtuRpfPOqwH/jQu+jSABr2y9CGxTgShYuYg idfnbs1MYaIndLGD/fwVvIUcqE0RnTy8Mv+pWO3IYB1tccfc9rBGUqfD/plq5c+0 qFXEWBPhOMnOa7OB+UXP5dhI8BBpfD2hVla01mwG93JOy6zw0iX4DhYKgXwYFKk5 u8cct4ER0VMpXItKtx/o2tJ3mIUq58+Bo3HzLYJRCs3okV5gUx4Jea1u5ixuNvdA xdYRqf0DnjCWeG2i5PXjarZNAs6/zrAm+SU9NI2xJVNJMA7TtqqbXF0nuCnm3Hep Z4GHbqODTpK89Va+9eHT64H4aQt39csFTnCtUZz+YzAVjjH3ub8NiwEcwjItH1g= =sEgD -----END PGP SIGNATURE----- --iS6pG5SvkHhjUq4VvCFtjx49NqrFtJJ0t--