Date: Wed, 9 Aug 2017 13:02:27 -0700 From: Bryan Drewery <bdrewery@FreeBSD.org> To: freebsd-current@freebsd.org Subject: Re: Would O_APPEND for /dev/null be possible? Message-ID: <768c55f1-6a10-868b-9cd5-6ca5f93aaca3@FreeBSD.org> In-Reply-To: <20170807213656.FwzOG%steffen@sdaoden.eu> References: <20170807213656.FwzOG%steffen@sdaoden.eu>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --iS6pG5SvkHhjUq4VvCFtjx49NqrFtJJ0t Content-Type: multipart/mixed; boundary="9mV7xWJwjgepgpEk2bXMD2w9Oj7vON47w"; protected-headers="v1" From: Bryan Drewery <bdrewery@FreeBSD.org> 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 <err.h> > #include <fcntl.h> >=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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?768c55f1-6a10-868b-9cd5-6ca5f93aaca3>