From owner-freebsd-standards@FreeBSD.ORG Mon Apr 25 11:07:09 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 43F3C1065674 for ; Mon, 25 Apr 2011 11:07:09 +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 273858FC12 for ; Mon, 25 Apr 2011 11:07:09 +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 p3PB790r084701 for ; Mon, 25 Apr 2011 11:07:09 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p3PB78au084699 for freebsd-standards@FreeBSD.org; Mon, 25 Apr 2011 11:07:08 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 25 Apr 2011 11:07:08 GMT Message-Id: <201104251107.p3PB78au084699@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, 25 Apr 2011 11:07:09 -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/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 stand/147210 standards xmmintrin.h and cstdlib conflicts with each other with 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/116826 standards [patch] sh support for POSIX character classes 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 35 problems total. From owner-freebsd-standards@FreeBSD.ORG Mon Apr 25 20:09:18 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 1D9EE1065677 for ; Mon, 25 Apr 2011 20:09:18 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id AE6F38FC12 for ; Mon, 25 Apr 2011 20:09:17 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id BF04C1DD683; Mon, 25 Apr 2011 22:09:16 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id AB23C1730D; Mon, 25 Apr 2011 22:09:16 +0200 (CEST) Date: Mon, 25 Apr 2011 22:09:16 +0200 From: Jilles Tjoelker To: Garrett Cooper Message-ID: <20110425200916.GA96366@stack.nl> References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="LQksG6bCIzRHxTLp" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: standards@freebsd.org Subject: Re: shmatt_t not present in FreeBSD? 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, 25 Apr 2011 20:09:18 -0000 --LQksG6bCIzRHxTLp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Jun 19, 2010 at 11:38:33PM -0700, Garrett Cooper wrote: > I'm making some good progress on fixing up open_posix_testsuite to be > more POSIX compliant and I noticed that shmatt_t is missing on > FreeBSD. Is there any particular reason why it's missing? > http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/shm.h.html Probably because it was not added yet. The attached patch builds, but I am not sure if the change from signed to unsigned will break anything. -- Jilles Tjoelker --LQksG6bCIzRHxTLp Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="shmatt_t.patch" Index: lib/libc/sys/shmctl.2 =================================================================== --- lib/libc/sys/shmctl.2 (revision 220954) +++ lib/libc/sys/shmctl.2 (working copy) @@ -102,7 +102,7 @@ size_t shm_segsz; /* size of segment in bytes */ pid_t shm_lpid; /* process ID of last shared memory op */ pid_t shm_cpid; /* process ID of creator */ - int shm_nattch; /* number of current attaches */ + shmatt_t shm_nattch; /* number of current attaches */ time_t shm_atime; /* time of last shmat() */ time_t shm_dtime; /* time of last shmdt() */ time_t shm_ctime; /* time of last change by shmctl() */ Index: sys/compat/freebsd32/freebsd32_ipc.h =================================================================== --- sys/compat/freebsd32/freebsd32_ipc.h (revision 220954) +++ sys/compat/freebsd32/freebsd32_ipc.h (working copy) @@ -72,7 +72,7 @@ int32_t shm_segsz; pid_t shm_lpid; pid_t shm_cpid; - int shm_nattch; + unsigned int shm_nattch; int32_t shm_atime; int32_t shm_dtime; int32_t shm_ctime; Index: sys/sys/shm.h =================================================================== --- sys/sys/shm.h (revision 220954) +++ sys/sys/shm.h (working copy) @@ -90,12 +90,14 @@ }; #endif +typedef unsigned int shmatt_t; + struct shmid_ds { struct ipc_perm shm_perm; /* operation permission structure */ size_t shm_segsz; /* size of segment in bytes */ pid_t shm_lpid; /* process ID of last shared memory op */ pid_t shm_cpid; /* process ID of creator */ - int shm_nattch; /* number of current attaches */ + shmatt_t shm_nattch; /* number of current attaches */ time_t shm_atime; /* time of last shmat() */ time_t shm_dtime; /* time of last shmdt() */ time_t shm_ctime; /* time of last change by shmctl() */ Index: usr.bin/ipcs/ipcs.c =================================================================== --- usr.bin/ipcs/ipcs.c (revision 220954) +++ usr.bin/ipcs/ipcs.c (working copy) @@ -448,7 +448,7 @@ group_from_gid(kshmptr->u.shm_perm.cgid, 0)); if (option & OUTSTANDING) - printf(" %12d", + printf(" %12u", kshmptr->u.shm_nattch); if (option & BIGGEST) --LQksG6bCIzRHxTLp-- From owner-freebsd-standards@FreeBSD.ORG Fri Apr 29 13:17:48 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 7B31C1065673 for ; Fri, 29 Apr 2011 13:17:48 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 39A968FC15 for ; Fri, 29 Apr 2011 13:17:47 +0000 (UTC) Received: by qwc9 with SMTP id 9so2190579qwc.13 for ; Fri, 29 Apr 2011 06:17:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=JAnblh2ML4PM5qUQnRZwz6Ri19MbJxczU80N0a7UiJ0=; b=tTUMT8p5JmwI/K58XmgfArEPViGNPy0ZEnDGhIRzGDaM5TcqHWWmA9Ox8rTqGjBop+ oPEsfDiViQlcdGajEhDxa3Ol7wikC/fhSmgh+c0mTDEBevKw9R1+0l6sWJUwC8qGsdTF dhLRgsYAktbEbYyIJvebyhE3uv92f+okJpE5c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=wGDJ2uzqE9MvbK+P9aYj/nUP5ETZ1Qi2oLiHeTbp53KcsFM1RuIUvMM7g4ewS41G5Z mNcnwXgPSuzrErn0aao5L8ONs1xLK1utC37jeDfpvdb86ZA1ue4zTgadZxKFxtUz1/WF 1sJSCYiKwCU6PSybYa//fOR9Uo7rWhGuTFvEk= MIME-Version: 1.0 Received: by 10.229.62.198 with SMTP id y6mr3750034qch.290.1304081498451; Fri, 29 Apr 2011 05:51:38 -0700 (PDT) Received: by 10.229.97.146 with HTTP; Fri, 29 Apr 2011 05:51:38 -0700 (PDT) Date: Fri, 29 Apr 2011 16:51:38 +0400 Message-ID: From: Sergey Kandaurov To: freebsd-standards@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: O_ACCMODE doesn't respect O_EXEC 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: Fri, 29 Apr 2011 13:17:48 -0000 Hi. As of now, O_ACCMODE is a conjunction of O_{RDONLY,WRONLY,RDWR} flags as it was from the beginning. Its definition hasn't changed with addition of O_EXEC. POSIX states: O_ACCMODE - Mask for file access modes. O_EXEC falls into this access modes category, so I think O_ACCMODE should include O_EXEC. This may require review of O_ACCMODE usage throughout the kernel, though.. This simple test demonstrates the problem: flags: 0x0 flags: 0x0 flags: 0x1 flags: 0x1 flags: 0x2 flags: 0x2 flags: 0x3ffff flags: 0x3 ^^ decremented due OFLAGS macro that also doesn't respect new access mode flag(s) ^^ correct version would show 0x40000 int main(void) { test_with(O_RDONLY); test_with(O_WRONLY); test_with(O_RDWR); test_with(O_EXEC); return (0); } static void test_with(int openflag) { int fd, flags; if ((fd = open("file", openflag)) < 0) err(1, "open"); if ((flags = fcntl(fd, F_GETFL)) < 0) err(1, "fcntl(fd, GETFL)"); printf("flags: 0x%x\n", flags); printf("flags: 0x%x\n", flags&O_ACCMODE); close(fd); } -- wbr, pluknet From owner-freebsd-standards@FreeBSD.ORG Fri Apr 29 22:30:31 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 54ABA1065672 for ; Fri, 29 Apr 2011 22:30:31 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id E6CED8FC17 for ; Fri, 29 Apr 2011 22:30:30 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 016931DD415; Sat, 30 Apr 2011 00:30:29 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id DDF5C173FE; Sat, 30 Apr 2011 00:30:29 +0200 (CEST) Date: Sat, 30 Apr 2011 00:30:29 +0200 From: Jilles Tjoelker To: Sergey Kandaurov Message-ID: <20110429223029.GB10840@stack.nl> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-standards@freebsd.org Subject: Re: O_ACCMODE doesn't respect O_EXEC 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: Fri, 29 Apr 2011 22:30:31 -0000 On Fri, Apr 29, 2011 at 04:51:38PM +0400, Sergey Kandaurov wrote: > As of now, O_ACCMODE is a conjunction of O_{RDONLY,WRONLY,RDWR} flags > as it was from the beginning. Its definition hasn't changed with > addition of O_EXEC. > POSIX states: > O_ACCMODE - Mask for file access modes. > O_EXEC falls into this access modes category, so I think O_ACCMODE > should include O_EXEC. I agree. > This may require review of O_ACCMODE usage throughout the kernel, though.. > This simple test demonstrates the problem: > flags: 0x0 > flags: 0x0 > flags: 0x1 > flags: 0x1 > flags: 0x2 > flags: 0x2 > flags: 0x3ffff > flags: 0x3 > ^^ decremented due OFLAGS macro that also doesn't respect new access > mode flag(s) > ^^ correct version would show 0x40000 Indeed. kern_openat() has a hack that does not apply the FFLAGS macro if O_EXEC is specified, to work around FFLAGS/OFLAGS not knowing O_EXEC. Instead, it seems more appropriate to use something like #define FFLAGS(oflags) (((oflags) & O_EXEC) != 0 ? (oflags) : (oflags) + 1) #define OFLAGS(fflags) (((fflags) & O_EXEC) != 0 ? (fflags) : (fflags) - 1) With also the O_ACCMODE change, kern_openat()'s check can be changed to switch (flags & O_ACCMODE) { case O_RDONLY: case O_WRONLY: case O_RDWR: case O_EXEC: break; default: return (EINVAL); } with an unconditional flags = FFLAGS(flags); > int > main(void) > { > > test_with(O_RDONLY); > test_with(O_WRONLY); > test_with(O_RDWR); > test_with(O_EXEC); > > return (0); > } > > static void > test_with(int openflag) > { > int fd, flags; > > if ((fd = open("file", openflag)) < 0) > err(1, "open"); > if ((flags = fcntl(fd, F_GETFL)) < 0) > err(1, "fcntl(fd, GETFL)"); > printf("flags: 0x%x\n", flags); > printf("flags: 0x%x\n", flags&O_ACCMODE); > close(fd); > } -- Jilles Tjoelker