From owner-freebsd-arch@FreeBSD.ORG Mon Oct 31 22:16:28 2011 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35949106564A; Mon, 31 Oct 2011 22:16:28 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id EE8BB8FC0A; Mon, 31 Oct 2011 22:16:27 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 5DA2C2A28CF0; Mon, 31 Oct 2011 23:16:27 +0100 (CET) Date: Mon, 31 Oct 2011 23:16:27 +0100 From: Ed Schouten To: John Baldwin Message-ID: <20111031221627.GR2258@hoeg.nl> References: <201110281426.00013.jhb@freebsd.org> <201110311024.07580.jhb@freebsd.org> <20111031190359.GP2258@hoeg.nl> <201110311717.53476.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rKoHqF+aPLVth8b2" Content-Disposition: inline In-Reply-To: <201110311717.53476.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: arch@freebsd.org, Jilles Tjoelker Subject: Re: [PATCH] fadvise(2) system call X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Oct 2011 22:16:28 -0000 --rKoHqF+aPLVth8b2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi John, * John Baldwin , 20111031 22:17: > I also really do think that posix_*() truly is far uglier to read. In th= e=20 > worst case, imagine something like this: >=20 > char *cp; >=20 > cp =3D posix_malloc(posix_strlen(some_string) + 1); > posix_strcpy(cp, s); > posix_printf("%s\n", cp); >=20 > *blech* I do agree it's ugly, but at least it's standardized. The fact is that it's easier to explain to someone "this code doesn't build on $NONBSD, because $NONBSD lacks POSIX conformance" than saying "this code doesn't build on $NONBSD because it uses BSD-specific crap". As I mentioned previously, there is no fadvise() on Linux. There's no gain in compatibility by implementing it -- it's just syntactic sugar. Maybe we can find a compromise. My main objection is that the current patch adds some redundancy that will stay part of our ABI. Also, having two different symbols makes debugging a bit harder, because you must not forget to place multiple breakpoints, maybe even preload multiple symbols. What if we implement everything using the POSIX naming scheme, but put this in : > #if _BSD_SOURCE > #define FADV_NORMAL POSIX_FADV_NORMAL > #define ... > > static inline int > fadvise(int _fd, off_t _offset, off_t _len, int _advice) > { > > return (fadvise(_fd, _offset, _len, _advice)); > } > #endif That way userspace code still has the liberty of using the shorthand notation, without being a burden on the ABI. But please, don't let me stop you from committing your work as is. I'm happy either way. :-) --=20 Ed Schouten WWW: http://80386.nl/ --rKoHqF+aPLVth8b2 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJOrx47AAoJEG5e2P40kaK7WRAP/0+Y1XCZQsDDUXNa0khvIH5y wxUA8h+1AYXQakTNC2RienRGe85EbDedbcyQT/eqaEJEb1rK0sZwjlVO8HX0miLT wbz9diwEItQmLf+V84hY4qBAWlG0yzvK7MnfkqT7kAaujlOZC3ZUuFt2DmuzpeYu Ar+ciZHVaR61pmXuDDTTE+wgBUYLlK4KZTqhub8fyDJq7J5lSv+OXbhuXRTJmj4O uajz8P5YyFW/d/WD1LrAFQkPJlR+CPksQNKKO+WdbXE6w/0Iw21qB5uneP6f0Ek7 igwIGiy+vT0uFYa04ehACAj99i0cRsGX4yYtTL4vCa1x9QAtthk6EUa1emKfDPJO DEMoKuE5kgoHYeiNLsXF4BPHf0m9KpapzWBjjgRQS+Efoo6qCY7nAvae6qpxA9cx Xj/w+He+IdD7Esk51yjvei9ge0tLzXq9hw4uPhLA/IQknt1PswgDTdPqJuOEOzJa nyPFIHP9pqLz7GT+u1hgxI7kKN+AkTXvrcRDz++k0TAja7Ux0ReOeuQFoetGmriP F0tyYf7JeP+bkwY/hZcxErC8viWbiW/4YN4hHIwnDrMRnzw3W/shWWpwtQx1XW5E moMsz5DAzyUlAky16f/+y8eLmWFemnN3KJxN5SBhf6cl5FwY9rts3PdPM+TgLHfc /14PS2FninFw9u+OxSFc =H2f4 -----END PGP SIGNATURE----- --rKoHqF+aPLVth8b2--