From owner-freebsd-standards@FreeBSD.ORG Mon Jul 16 11:09:30 2012 Return-Path: Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BE166106566C for ; Mon, 16 Jul 2012 11:09:30 +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 8E04F8FC12 for ; Mon, 16 Jul 2012 11:09:30 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6GB9U2o094148 for ; Mon, 16 Jul 2012 11:09:30 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6GB9Svg094144 for freebsd-standards@FreeBSD.org; Mon, 16 Jul 2012 11:09:28 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 16 Jul 2012 11:09:28 GMT Message-Id: <201207161109.q6GB9Svg094144@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, 16 Jul 2012 11:09:30 -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/169697 standards syslogd(8) is not BOM aware o stand/166349 standards Support the assignment-allocation character for fscanf o stand/165236 standards The NONE Wi-Fi regulatory restricts use of channels 12 o stand/164787 standards dirfd() function not available when _POSIX_C_SOURCE is o kern/164674 standards [patch] [libc] vfprintf/vfwprintf return error (EOF) o o stand/162434 standards getaddrinfo: addrinfo.ai_family is an address family, o stand/154842 standards invalid request authenticator in the second and subseq o stand/150093 standards C++ std::locale support is broken 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) 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 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 33 problems total. From owner-freebsd-standards@FreeBSD.ORG Wed Jul 18 08:50:11 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7589106566B for ; Wed, 18 Jul 2012 08:50:11 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A01AF8FC0C for ; Wed, 18 Jul 2012 08:50:11 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6I8oBFm098816 for ; Wed, 18 Jul 2012 08:50:11 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6I8oBWu098815; Wed, 18 Jul 2012 08:50:11 GMT (envelope-from gnats) Resent-Date: Wed, 18 Jul 2012 08:50:11 GMT Resent-Message-Id: <201207180850.q6I8oBWu098815@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-standards@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Jukka Ukkonen Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 025911065687 for ; Wed, 18 Jul 2012 08:40:26 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id D84E38FC0A for ; Wed, 18 Jul 2012 08:40:25 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q6I8ePf3056274 for ; Wed, 18 Jul 2012 08:40:25 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id q6I8ePQh056273; Wed, 18 Jul 2012 08:40:25 GMT (envelope-from nobody) Message-Id: <201207180840.q6I8ePQh056273@red.freebsd.org> Date: Wed, 18 Jul 2012 08:40:25 GMT From: Jukka Ukkonen To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: standards/169962: fcntl() to support F_DUPFD_CLOEXEC specified in POSIX.1-2008 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, 18 Jul 2012 08:50:11 -0000 >Number: 169962 >Category: standards >Synopsis: fcntl() to support F_DUPFD_CLOEXEC specified in POSIX.1-2008 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-standards >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 18 08:50:11 UTC 2012 >Closed-Date: >Last-Modified: >Originator: Jukka Ukkonen >Release: FreeBSD 9.1-PRERELEASE >Organization: ----- >Environment: FreeBSD sleipnir 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0: Wed Jul 18 10:49:35 EEST 2012 root@sleipnir:/usr/obj/usr/src/sys/Sleipnir amd64 >Description: The attached patch adds the flag F_DUPFD_CLOEXEC to fcntl() to allow duplication of file descriptors such that FD_CLOEXEC will be automatically and atomically set for the new fd. While in the process of adding F_DUPFD_CLOEXEC which is required by POSIX.1-2008 I also added F_DUP2FD_CLOEXEC for symmetry and analogy with F_DUPFD<->F_DUP2FD. >How-To-Repeat: See full description above. >Fix: Find a patch attached. Patch attached with submission follows: --- sys/sys/fcntl.h.orig 2012-07-18 10:37:07.000000000 +0300 +++ sys/sys/fcntl.h 2012-07-18 10:42:27.000000000 +0300 @@ -225,6 +225,8 @@ #define F_SETLK_REMOTE 14 /* debugging support for remote locks */ #define F_READAHEAD 15 /* read ahead */ #define F_RDAHEAD 16 /* Darwin compatible read ahead */ +#define F_DUPFD_CLOEXEC 17 /* POSIX.1-2008 */ +#define F_DUP2FD_CLOEXEC 18 /* Symmetry DUPFD<->DUP2FD */ /* file descriptor flags (F_GETFD, F_SETFD) */ #define FD_CLOEXEC 1 /* close-on-exec flag */ --- sys/kern/kern_descrip.c.orig 2012-07-18 10:33:57.000000000 +0300 +++ sys/kern/kern_descrip.c 2012-07-18 10:34:45.000000000 +0300 @@ -113,6 +113,7 @@ /* Flags for do_dup() */ #define DUP_FIXED 0x1 /* Force fixed allocation */ #define DUP_FCNTL 0x2 /* fcntl()-style errors */ +#define DUP_CLOEXEC 0x4 /* Atomically set FD_CLOEXEC. */ static int do_dup(struct thread *td, int flags, int old, int new, register_t *retval); @@ -490,6 +491,18 @@ error = do_dup(td, DUP_FIXED, fd, tmp, td->td_retval); break; + case F_DUPFD_CLOEXEC: + tmp = arg; + error = do_dup(td, (DUP_FCNTL|DUP_CLOEXEC), + fd, tmp, td->td_retval); + break; + + case F_DUP2FD_CLOEXEC: + tmp = arg; + error = do_dup(td, (DUP_FIXED|DUP_CLOEXEC), + fd, tmp, td->td_retval); + break; + case F_GETFD: FILEDESC_SLOCK(fdp); if ((fp = fdtofp(fd, fdp)) == NULL) { @@ -826,6 +839,19 @@ } if (flags & DUP_FIXED && old == new) { *retval = new; + + /* + * NOTICE! - We err on the safe side. + * The principle is least surprise, least confusion. + * If we dup the fd to itself explicitly requesting CLOEXEC, + * the flag shall be added. + * If there is no explicit request to set CLOEXEC but + * the fd already had it set, we shall not touch it. + */ + + if (flags & DUP_CLOEXEC) + fdp->fd_ofileflags[new] |= UF_EXCLOSE; + FILEDESC_XUNLOCK(fdp); return (0); } @@ -911,7 +937,12 @@ * Duplicate the source descriptor */ fdp->fd_ofiles[new] = fp; - fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] &~ UF_EXCLOSE; + + if (flags & DUP_CLOEXEC) + fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] | UF_EXCLOSE; + else + fdp->fd_ofileflags[new] = fdp->fd_ofileflags[old] &~ UF_EXCLOSE; + if (new > fdp->fd_lastfile) fdp->fd_lastfile = new; *retval = new; >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-standards@FreeBSD.ORG Wed Jul 18 14:56:50 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C202106564A; Wed, 18 Jul 2012 14:56:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 605B68FC0A; Wed, 18 Jul 2012 14:56:50 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6IEuoVb054124; Wed, 18 Jul 2012 14:56:50 GMT (envelope-from kib@freefall.freebsd.org) Received: (from kib@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6IEuoT3054120; Wed, 18 Jul 2012 14:56:50 GMT (envelope-from kib) Date: Wed, 18 Jul 2012 14:56:50 GMT Message-Id: <201207181456.q6IEuoT3054120@freefall.freebsd.org> To: kib@FreeBSD.org, freebsd-standards@FreeBSD.org, kib@FreeBSD.org From: kib@FreeBSD.org Cc: Subject: Re: standards/169962: fcntl() to support F_DUPFD_CLOEXEC specified in POSIX.1-2008 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, 18 Jul 2012 14:56:50 -0000 Synopsis: fcntl() to support F_DUPFD_CLOEXEC specified in POSIX.1-2008 Responsible-Changed-From-To: freebsd-standards->kib Responsible-Changed-By: kib Responsible-Changed-When: Wed Jul 18 14:56:36 UTC 2012 Responsible-Changed-Why: Take. http://www.freebsd.org/cgi/query-pr.cgi?pr=169962 From owner-freebsd-standards@FreeBSD.ORG Thu Jul 19 17:35:22 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6B8CB1065670; Thu, 19 Jul 2012 17:35:22 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3D83F8FC14; Thu, 19 Jul 2012 17:35:22 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6JHZM7V085510; Thu, 19 Jul 2012 17:35:22 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6JHZMmj085506; Thu, 19 Jul 2012 17:35:22 GMT (envelope-from linimon) Date: Thu, 19 Jul 2012 17:35:22 GMT Message-Id: <201207191735.q6JHZMmj085506@freefall.freebsd.org> To: dfilter@FreeBSD.ORG, linimon@FreeBSD.org, gnats-admin@FreeBSD.org, freebsd-standards@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: standards/169995: Re: standards/169962: commit references a PR 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: Thu, 19 Jul 2012 17:35:22 -0000 Old Synopsis: Re: standard/169962: commit references a PR New Synopsis: Re: standards/169962: commit references a PR State-Changed-From-To: open->closed State-Changed-By: linimon State-Changed-When: Thu Jul 19 17:34:12 UTC 2012 State-Changed-Why: Misfiled followup to standards/169962 content migrated. Responsible-Changed-From-To: gnats-admin->freebsd-standards Responsible-Changed-By: linimon Responsible-Changed-When: Thu Jul 19 17:34:12 UTC 2012 Responsible-Changed-Why: http://www.freebsd.org/cgi/query-pr.cgi?pr=169995