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--