From owner-freebsd-standards@FreeBSD.ORG Sun Oct 2 22:16:05 2011 Return-Path: Delivered-To: standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A78F106566C; Sun, 2 Oct 2011 22:16:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 4F1798FC08; Sun, 2 Oct 2011 22:16:03 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p92M464I070671 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 3 Oct 2011 01:04:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id p92M45JA070919; Mon, 3 Oct 2011 01:04:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id p92M45lG070918; Mon, 3 Oct 2011 01:04:05 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 3 Oct 2011 01:04:05 +0300 From: Kostik Belousov To: standards@freebsd.org Message-ID: <20111002220405.GN1511@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="g0gRMcGSHhC9oFXc" Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: current@freebsd.org Subject: st_dev and st_ino for pipes X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2011 22:16:05 -0000 --g0gRMcGSHhC9oFXc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Our implementation of pipes does not provide useful values for st_dev and st_ino when stat(2) is done on an anonymous pipe. It was noted by the people outside the project, e.g. Perl contains a workaround in one of its modules, submitted by Debian/kFreeBSD developers, see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D537555 and the commit 16f708c9bc0dc48713b200 in the Perl git. I think this is a non-conformance, since SUSv4 explicitely states in the description of stat(2) "For all other file types defined in this volume of POSIX.1-2008, the structure members st_mode, st_ino, st_dev, st_uid, st_gid, st_atim, st_ctim, and st_mtim shall have meaningful values ...". Patch below implements the requirement, by the cost of the small overhead at the pipe creation time, and slightly bigger cost at the destruction. Any comments ? diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c index a2d3222..a111527 100644 --- a/sys/fs/devfs/devfs_devs.c +++ b/sys/fs/devfs/devfs_devs.c @@ -171,8 +171,7 @@ devfs_free(struct cdev *cdev) cdp =3D cdev2priv(cdev); if (cdev->si_cred !=3D NULL) crfree(cdev->si_cred); - if (cdp->cdp_inode > 0) - free_unr(devfs_inos, cdp->cdp_inode); + devfs_free_cdp_inode(cdp->cdp_inode); if (cdp->cdp_maxdirent > 0)=20 free(cdp->cdp_dirents, M_DEVFS2); free(cdp, M_CDEVP); @@ -394,7 +393,7 @@ devfs_delete(struct devfs_mount *dm, struct devfs_diren= t *de, int flags) mac_devfs_destroy(de); #endif if (de->de_inode > DEVFS_ROOTINO) { - free_unr(devfs_inos, de->de_inode); + devfs_free_cdp_inode(de->de_inode); de->de_inode =3D 0; } if (DEVFS_DE_DROP(de)) @@ -685,6 +684,21 @@ devfs_destroy(struct cdev *dev) devfs_generation++; } =20 +ino_t +devfs_alloc_cdp_inode(void) +{ + + return (alloc_unr(devfs_inos)); +} + +void +devfs_free_cdp_inode(ino_t ino) +{ + + if (ino > 0) + free_unr(devfs_inos, ino); +} + static void devfs_devs_init(void *junk __unused) { diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index b7ae521..2edecf2 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -93,6 +93,7 @@ __FBSDID("$FreeBSD$"); =20 #include #include +#include #include #include #include @@ -224,6 +225,8 @@ static int pipe_zone_init(void *mem, int size, int flag= s); static void pipe_zone_fini(void *mem, int size); =20 static uma_zone_t pipe_zone; +static struct unrhdr *pipeino_unr; +static ino_t pipedev_ino; =20 SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_ANY, pipeinit, NULL); =20 @@ -235,6 +238,10 @@ pipeinit(void *dummy __unused) pipe_zone_ctor, NULL, pipe_zone_init, pipe_zone_fini, UMA_ALIGN_PTR, 0); KASSERT(pipe_zone !=3D NULL, ("pipe_zone not initialized")); + pipeino_unr =3D new_unrhdr(1, INT32_MAX, NULL); + KASSERT(pipeino_unr !=3D NULL, ("pipe fake inodes not initialized")); + pipedev_ino =3D devfs_alloc_cdp_inode(); + KASSERT(pipedev_ino > 0, ("pipe dev inode not initialized")); } =20 static int @@ -562,6 +569,12 @@ pipe_create(pipe, backing) /* If we're not backing this pipe, no need to do anything. */ error =3D 0; } + if (error =3D=3D 0) { + pipe->pipe_ino =3D alloc_unr(pipeino_unr); + if (pipe->pipe_ino =3D=3D -1) + /* pipeclose will clear allocated kva */ + error =3D ENOMEM; + } return (error); } =20 @@ -1408,9 +1421,10 @@ pipe_stat(fp, ub, active_cred, td) ub->st_ctim =3D pipe->pipe_ctime; ub->st_uid =3D fp->f_cred->cr_uid; ub->st_gid =3D fp->f_cred->cr_gid; + ub->st_dev =3D pipedev_ino; + ub->st_ino =3D pipe->pipe_ino; /* - * Left as 0: st_dev, st_ino, st_nlink, st_rdev, st_flags, st_gen. - * XXX (st_dev, st_ino) should be unique. + * Left as 0: st_nlink, st_rdev, st_flags, st_gen. */ return (0); } @@ -1463,6 +1477,7 @@ pipeclose(cpipe) { struct pipepair *pp; struct pipe *ppipe; + ino_t ino; =20 KASSERT(cpipe !=3D NULL, ("pipeclose: cpipe =3D=3D NULL")); =20 @@ -1521,6 +1536,12 @@ pipeclose(cpipe) knlist_destroy(&cpipe->pipe_sel.si_note); =20 /* + * Postpone the destroy of the fake inode number allocated for + * our end, until pipe mtx is unlocked. + */ + ino =3D cpipe->pipe_ino; + + /* * If both endpoints are now closed, release the memory for the * pipe pair. If not, unlock. */ @@ -1532,6 +1553,9 @@ pipeclose(cpipe) uma_zfree(pipe_zone, cpipe->pipe_pair); } else PIPE_UNLOCK(cpipe); + + if (ino > 0) + free_unr(pipeino_unr, cpipe->pipe_ino); } =20 /*ARGSUSED*/ diff --git a/sys/sys/conf.h b/sys/sys/conf.h index 08e1582..7acd2e0 100644 --- a/sys/sys/conf.h +++ b/sys/sys/conf.h @@ -301,6 +301,9 @@ int devfs_set_cdevpriv(void *priv, cdevpriv_dtr_t dtr); void devfs_clear_cdevpriv(void); void devfs_fpdrop(struct file *fp); /* XXX This is not public KPI */ =20 +ino_t devfs_alloc_cdp_inode(void); +void devfs_free_cdp_inode(ino_t ino); + #define UID_ROOT 0 #define UID_BIN 3 #define UID_UUCP 66 diff --git a/sys/sys/pipe.h b/sys/sys/pipe.h index 2592a8d..20b1092 100644 --- a/sys/sys/pipe.h +++ b/sys/sys/pipe.h @@ -112,6 +112,7 @@ struct pipe { u_int pipe_state; /* pipe status info */ int pipe_busy; /* busy flag, mostly to handle rundown sanely */ int pipe_present; /* still present? */ + ino_t pipe_ino; /* fake inode for stat(2) */ }; =20 /* --g0gRMcGSHhC9oFXc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6I39UACgkQC3+MBN1Mb4gRTACfRK3JmXb/vJNRgg72XDbgxt2O sUMAmwdkGYERkFDj+9NJzYNDGT5TPFhm =olkY -----END PGP SIGNATURE----- --g0gRMcGSHhC9oFXc-- From owner-freebsd-standards@FreeBSD.ORG Mon Oct 3 11:07:17 2011 Return-Path: Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F39FF1065670 for ; Mon, 3 Oct 2011 11:07:16 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id C8D2C8FC18 for ; Mon, 3 Oct 2011 11:07:16 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p93B7GoI033900 for ; Mon, 3 Oct 2011 11:07:16 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p93B7GTF033898 for freebsd-standards@FreeBSD.org; Mon, 3 Oct 2011 11:07:16 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 3 Oct 2011 11:07:16 GMT Message-Id: <201110031107.p93B7GTF033898@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-standards@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-standards@FreeBSD.org X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2011 11:07:17 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o stand/157050 standards OSS implementation lacks AFMT_FLOAT o stand/154842 standards invalid request authenticator in the second and subseq o stand/150093 standards C++ std::locale support is broken a stand/149980 standards [libc] [patch] negative value integer to nanosleep(2) o docs/143472 standards gethostname(3) references undefined value: HOST_NAME_M s stand/141705 standards [libc] [request] libc lacks cexp (and friends) o stand/130067 standards Wrong numeric limits in system headers? o stand/124860 standards flockfile(3) doesn't work when the memory has been exh o stand/121921 standards [patch] Add leap second support to at(1), atrun(8) o stand/116477 standards rm(1): rm behaves unexpectedly when using -r and relat o bin/116413 standards incorrect getconf(1) handling of unsigned constants gi o stand/116081 standards make does not work with the directive sinclude p stand/107561 standards [libc] [patch] [request] Missing SUS function tcgetsid o stand/100017 standards [Patch] Add fuser(1) functionality to fstat(1) o stand/96236 standards [patch] [posix] sed(1) incorrectly describes a functio o stand/94729 standards [libc] fcntl() throws undocumented ENOTTY a stand/86484 standards [patch] mkfifo(1) uses wrong permissions o stand/82654 standards C99 long double math functions are missing o stand/81287 standards [patch] fingerd(8) might send a line not ending in CRL a stand/80293 standards sysconf() does not support well-defined unistd values o stand/79056 standards [feature request] [atch] regex(3) regression tests o stand/70813 standards [patch] ls(1) not Posix compliant o stand/66357 standards make POSIX conformance problem ('sh -e' & '+' command- s kern/64875 standards [libc] [patch] [request] add a system call: fdatasync( o stand/56476 standards [patch] cd9660 unicode support simple hack o stand/54410 standards one-true-awk not POSIX compliant (no extended REs) o stand/46119 standards Priority problems for SCHED_OTHER using pthreads o stand/44365 standards [headers] [patch] [request] introduce ulong and unchar a stand/41576 standards ln(1): replacing old dir-symlinks o stand/39256 standards snprintf/vsnprintf aren't POSIX-conformant for strings a docs/26003 standards getgroups(2) lists NGROUPS_MAX but not syslimits.h s stand/24590 standards timezone function not compatible witn Single Unix Spec o stand/21519 standards sys/dir.h should be deprecated some more s bin/14925 standards getsubopt isn't poisonous enough 34 problems total. From owner-freebsd-standards@FreeBSD.ORG Tue Oct 4 08:26:28 2011 Return-Path: Delivered-To: standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBDC6106564A for ; Tue, 4 Oct 2011 08:26:28 +0000 (UTC) (envelope-from peterjeremy@acm.org) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 6773E8FC0A for ; Tue, 4 Oct 2011 08:26:27 +0000 (UTC) Received: from mail14.syd.optusnet.com.au (mail14.syd.optusnet.com.au [211.29.132.195]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p946bVM2017338 for ; Tue, 4 Oct 2011 17:37:31 +1100 Received: from server.vk2pj.dyndns.org (c220-239-116-103.belrs4.nsw.optusnet.com.au [220.239.116.103]) by mail14.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p946bSjk025667 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 Oct 2011 17:37:28 +1100 X-Bogosity: Ham, spamicity=0.000000 Received: from server.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by server.vk2pj.dyndns.org (8.14.5/8.14.4) with ESMTP id p946bS78025218; Tue, 4 Oct 2011 17:37:28 +1100 (EST) (envelope-from peter@server.vk2pj.dyndns.org) Received: (from peter@localhost) by server.vk2pj.dyndns.org (8.14.5/8.14.4/Submit) id p946bRcF025217; Tue, 4 Oct 2011 17:37:27 +1100 (EST) (envelope-from peter) Date: Tue, 4 Oct 2011 17:37:27 +1100 From: Peter Jeremy To: Kostik Belousov Message-ID: <20111004063727.GA25129@server.vk2pj.dyndns.org> References: <20111002220405.GN1511@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="opJtzjQTFsWo+cga" Content-Disposition: inline In-Reply-To: <20111002220405.GN1511@deviant.kiev.zoral.com.ua> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.21 (2010-09-15) Cc: standards@freebsd.org, current@freebsd.org Subject: Re: st_dev and st_ino for pipes X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Oct 2011 08:26:28 -0000 --opJtzjQTFsWo+cga Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2011-Oct-03 01:04:05 +0300, Kostik Belousov wrote: >Our implementation of pipes does not provide useful values for st_dev >and st_ino when stat(2) is done on an anonymous pipe. It was noted by the =2E.. >Patch below implements the requirement, by the cost of the small overhead >at the pipe creation time, and slightly bigger cost at the destruction. Does it need to be so complex? This information isn't needed by the kernel and, to be "meaningful", all that is required is that the (st_dev,st_ino) pair is unique within the system. Given this, wouldn't it be sufficient to fake up a st_dev and then just make st_ino be a counter that starts from 0 and increments (atomically?) on every new pipe? No need to retain state or "free" anything when the pipe is destroyed. (If necessary, pick a new fake st_dev when st_ino wraps). >--- a/sys/kern/sys_pipe.c >+++ b/sys/kern/sys_pipe.c =2E.. >+static ino_t pipedev_ino; =2E. >+ ub->st_dev =3D pipedev_ino; st_dev is a dev_t and hence pipedev_ino (which seems misnamed to me) should probably be dev_t rather than ino_t --=20 Peter Jeremy --opJtzjQTFsWo+cga Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6KqacACgkQ/opHv/APuIchwgCfWM+y8Qgms2jySC5B/5UEIvPK StoAoJjtd8kZNS5qZasE0CLWMD1Z0eB+ =Y2N3 -----END PGP SIGNATURE----- --opJtzjQTFsWo+cga-- From owner-freebsd-standards@FreeBSD.ORG Tue Oct 4 10:20:59 2011 Return-Path: Delivered-To: standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CD94106566B; Tue, 4 Oct 2011 10:20:59 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id C8F798FC1F; Tue, 4 Oct 2011 10:20:58 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p94AKmAt075857 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 Oct 2011 13:20:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id p94AKmiE087031; Tue, 4 Oct 2011 13:20:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id p94AKmTu087030; Tue, 4 Oct 2011 13:20:48 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 4 Oct 2011 13:20:48 +0300 From: Kostik Belousov To: Peter Jeremy Message-ID: <20111004102048.GG1511@deviant.kiev.zoral.com.ua> References: <20111002220405.GN1511@deviant.kiev.zoral.com.ua> <20111004063727.GA25129@server.vk2pj.dyndns.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="saLunEaUy7BLkUpu" Content-Disposition: inline In-Reply-To: <20111004063727.GA25129@server.vk2pj.dyndns.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: standards@freebsd.org, current@freebsd.org Subject: Re: st_dev and st_ino for pipes X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Oct 2011 10:20:59 -0000 --saLunEaUy7BLkUpu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 04, 2011 at 05:37:27PM +1100, Peter Jeremy wrote: > On 2011-Oct-03 01:04:05 +0300, Kostik Belousov wrot= e: > >Our implementation of pipes does not provide useful values for st_dev > >and st_ino when stat(2) is done on an anonymous pipe. It was noted by the > ... > >Patch below implements the requirement, by the cost of the small overhead > >at the pipe creation time, and slightly bigger cost at the destruction. >=20 > Does it need to be so complex? This information isn't needed by the > kernel and, to be "meaningful", all that is required is that the > (st_dev,st_ino) pair is unique within the system. Given this, > wouldn't it be sufficient to fake up a st_dev and then just make > st_ino be a counter that starts from 0 and increments (atomically?) on > every new pipe? No need to retain state or "free" anything when the > pipe is destroyed. (If necessary, pick a new fake st_dev when st_ino > wraps). Yes, you described the problem. The (st_dev, st_ino) pair must be globally unique in system, not only for the pipes, but for whole domain of file descriptors. This is the reason that I allocate a value for pipe st_dev using the same devfs mechanism as it is done for device numbers. Using simple incrementing counter for pipe inodes, together with allocating yet another st_dev gives essentially the same complications wrt KPI, and feels unclean. >=20 > >--- a/sys/kern/sys_pipe.c > >+++ b/sys/kern/sys_pipe.c > ... > >+static ino_t pipedev_ino; > .. > >+ ub->st_dev =3D pipedev_ino; >=20 > st_dev is a dev_t and hence pipedev_ino (which seems misnamed to me) > should probably be dev_t rather than ino_t Fixed. Thank you. --saLunEaUy7BLkUpu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk6K3f8ACgkQC3+MBN1Mb4hTXgCfQFZL163Ze6dJs/qUcGZwcs2O vlAAn2KDt4LVMmSCcF9DyGHn5tRekUEe =3C3S -----END PGP SIGNATURE----- --saLunEaUy7BLkUpu-- From owner-freebsd-standards@FreeBSD.ORG Wed Oct 5 12:33:49 2011 Return-Path: Delivered-To: standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9247C1065672; Wed, 5 Oct 2011 12:33:49 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6A0318FC14; Wed, 5 Oct 2011 12:33:49 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 20B3446B32; Wed, 5 Oct 2011 08:33:49 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A3CBE8A02E; Wed, 5 Oct 2011 08:33:48 -0400 (EDT) From: John Baldwin To: freebsd-current@freebsd.org Date: Wed, 5 Oct 2011 08:29:10 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <20111002220405.GN1511@deviant.kiev.zoral.com.ua> In-Reply-To: <20111002220405.GN1511@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201110050829.10439.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 05 Oct 2011 08:33:48 -0400 (EDT) Cc: standards@freebsd.org, current@freebsd.org Subject: Re: st_dev and st_ino for pipes X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Oct 2011 12:33:49 -0000 On Sunday, October 02, 2011 6:04:05 pm Kostik Belousov wrote: > Our implementation of pipes does not provide useful values for st_dev > and st_ino when stat(2) is done on an anonymous pipe. It was noted by the > people outside the project, e.g. Perl contains a workaround in one > of its modules, submitted by Debian/kFreeBSD developers, see > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=537555 > and the commit 16f708c9bc0dc48713b200 in the Perl git. > > I think this is a non-conformance, since SUSv4 explicitely states > in the description of stat(2) > "For all other file types defined in this volume of POSIX.1-2008, the > structure members st_mode, st_ino, st_dev, st_uid, st_gid, st_atim, > st_ctim, and st_mtim shall have meaningful values ...". > > Patch below implements the requirement, by the cost of the small overhead > at the pipe creation time, and slightly bigger cost at the destruction. > > Any comments ? I think this is fine. -- John Baldwin