From owner-cvs-all@FreeBSD.ORG Sat Apr 7 17:06:52 2007 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC77F16A403; Sat, 7 Apr 2007 17:06:52 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 3DDC713C45B; Sat, 7 Apr 2007 17:06:51 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.13.8/8.13.8) with ESMTP id l37H6o5s010758; Sat, 7 Apr 2007 21:06:50 +0400 (MSD) (envelope-from ache@nagual.pp.ru) Received: (from ache@localhost) by nagual.pp.ru (8.13.8/8.13.8/Submit) id l37H6o3F010757; Sat, 7 Apr 2007 21:06:50 +0400 (MSD) (envelope-from ache) Date: Sat, 7 Apr 2007 21:06:50 +0400 From: Andrey Chernov To: Pawel Jakub Dawidek Message-ID: <20070407170650.GA10631@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Pawel Jakub Dawidek , src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org References: <200704071602.l37G2V1c066806@repoman.freebsd.org> <20070407164022.GA10309@nagual.pp.ru> <20070407165435.GK63916@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline In-Reply-To: <20070407165435.GK63916@garage.freebsd.pl> User-Agent: Mutt/1.5.14 (2007-02-12) Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/include stdio.h src/sys/sys unistd.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Apr 2007 17:06:52 -0000 --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Apr 07, 2007 at 06:54:35PM +0200, Pawel Jakub Dawidek wrote: > On Sat, Apr 07, 2007 at 08:40:22PM +0400, Andrey Chernov wrote: > > On Sat, Apr 07, 2007 at 04:02:31PM +0000, Pawel Jakub Dawidek wrote: > > > - Only define SEEK_DATA and SEEK_HOLE in sys/unistd.h when neither > > > _POSIX_SOURCE nor _XOPEN_SOURCE is defined. > >=20 > > 1) This new addition should be exluded for !define(_C99_SOURCE) > > !define(_ANSI_SOURCE) !define(_POSIX_C_SOURCE) too. > >=20 > > 2) We design our *_VISIBLE framework right for the reason to not mentio= n=20 > > all possible *_SOURCE each time like this, making includes unnecessary = big=20 > > and hard to adapt to the future *_SOURCE tags, but mention one *_VISIBL= E=20 > > tag instead, so please rewrite this thing using it. >=20 > That's why I asked for help. _CDDL_VISIBLE is not good, because it is > not related to CDDL license. _ZFS_VISIBLE is not good, because it is not > ZFS-specific. _{SUN,SOLARIS,OPENSOLARIS}_VISIBLE is also not good, > because it is already in Linux too. Solaris simply defines > __EXTENSIONS__. Maybe we need something like this? I don't think we need > separate _*_VISIBLE defines for every new #define in unistd.h and other > headers, so something similar to __EXTENSIONS__ makes sense to me. Ever for simple few defines *_VISIBLE framework is better because it is=20 easily extensible to new possible *_SOURCE comes without needs to edit=20 _all_ includes where namespaces user after that (i.e. without adding new=20 !defined(_XXX_SOURCE) to all there). __EXTENSIONS__ scope is too large and don't specific to be meaningful. Why _{SUN,SOLARIS,OPENSOLARIS}_VISIBLE isn't good? If it is SOLARIS=20 permanent addition, it and possible other ones from there perfectly fits=20 IMHO. The patch below using __ZFS_VISIBLE as example, feel free to change to=20 better name. --- cdefs.h.bak Sat Sep 23 18:59:06 2006 +++ cdefs.h Sat Apr 7 20:51:34 2007 @@ -492,6 +492,7 @@ #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 199506 #endif +#define __ZFS_VISIBLE 0 #endif =20 /* @@ -521,6 +522,7 @@ #define __POSIX_VISIBLE 198808 #define __ISO_C_VISIBLE 0 #endif /* _POSIX_C_SOURCE */ +#define __ZFS_VISIBLE 0 #else /*- * Deal with _ANSI_SOURCE: @@ -538,16 +540,19 @@ #define __POSIX_VISIBLE 0 #define __XSI_VISIBLE 0 #define __BSD_VISIBLE 0 +#define __ZFS_VISIBLE 0 #define __ISO_C_VISIBLE 1990 #elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ #define __POSIX_VISIBLE 0 #define __XSI_VISIBLE 0 #define __BSD_VISIBLE 0 +#define __ZFS_VISIBLE 0 #define __ISO_C_VISIBLE 1999 #else /* Default environment: show everything. */ #define __POSIX_VISIBLE 200112 #define __XSI_VISIBLE 600 #define __BSD_VISIBLE 1 +#define __ZFS_VISIBLE 1 #define __ISO_C_VISIBLE 1999 #endif #endif --- unistd.h.bak Sat Apr 7 20:02:30 2007 +++ unistd.h Sat Apr 7 20:56:06 2007 @@ -108,7 +108,7 @@ #define SEEK_CUR 1 /* set file offset to current plus offset */ #define SEEK_END 2 /* set file offset to EOF plus offset */ #endif -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) +#if __ZFS_VISIBLE #define SEEK_DATA 3 /* set file offset to next data past offset */ #define SEEK_HOLE 4 /* set file offset to next hole past offset */ #endif --=20 http://ache.pp.ru/ --+QahgC5+KEYLbs62 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (FreeBSD) iD8DBQFGF8+qVg5YK5ZEdN0RAqz2AJ9Oz/K6xrQccPlb/P5IfsHdeiM8iwCdFYuZ XECZOH4vV3afD2Rpu/Trih0= =KhIN -----END PGP SIGNATURE----- --+QahgC5+KEYLbs62--