From owner-freebsd-stable@FreeBSD.ORG Tue Oct 16 19:53:52 2007 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 536E516A41B; Tue, 16 Oct 2007 19:53:52 +0000 (UTC) (envelope-from is@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.freebsd.org (Postfix) with ESMTP id 11A4C13C469; Tue, 16 Oct 2007 19:53:51 +0000 (UTC) (envelope-from is@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id DE81F95C1; Tue, 16 Oct 2007 23:53:50 +0400 (MSD) Received: from localhost (is1.park.rambler.ru [81.19.64.121]) by relay0.rambler.ru (Postfix) with ESMTP id BC57C951A; Tue, 16 Oct 2007 23:53:50 +0400 (MSD) Date: Tue, 16 Oct 2007 23:53:43 +0400 From: Igor Sysoev To: Peter Jeremy Message-ID: <20071016195343.GK57989@rambler-co.ru> References: <20071015141714.GL24828@rambler-co.ru> <20071016193843.GD1184@turion.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20071016193843.GD1184@turion.vk2pj.dyndns.org> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: No virus found Cc: freebsd-current@freebsd.org, freebsd-stable@freebsd.org Subject: Re: 2G+ sysv shm segments X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2007 19:53:52 -0000 On Wed, Oct 17, 2007 at 05:38:43AM +1000, Peter Jeremy wrote: > On 2007-Oct-15 18:17:14 +0400, Igor Sysoev wrote: > >more than 2G. The attached patches against 6.x and 7.x allow to create 2G+ > >segments. > > Useful, thanks. > > >--- src/sys/sys/shm.h 2007-09-12 23:33:39.000000000 +0400 > >+++ src/sys/sys/shm.h 2007-10-15 17:42:38.000000000 +0400 > >@@ -77,7 +77,7 @@ > > > > struct shmid_ds { > > struct ipc_perm shm_perm; /* operation permission structure */ > >- int shm_segsz; /* size of segment in bytes */ > >+ size_t shm_segsz; /* size of segment in bytes */ > ... > >--- src/usr.bin/ipcs/ipcs.c 2007-09-12 23:32:25.000000000 +0400 > >+++ src/usr.bin/ipcs/ipcs.c 2007-10-15 17:29:06.000000000 +0400 > >@@ -439,7 +439,7 @@ > > kshmptr->u.shm_nattch); > > > > if (option & BIGGEST) > >- printf(" %12d", > >+ printf(" %12ld", > > kshmptr->u.shm_segsz); > > Note that size_t is always 'unsigned' and translates to 'int' rather > than 'long' on i386 so this printf will report a warning. I suggest > printf(" %12lu", (unsigned long)kshmptr->u.shm_segsz); or similar. Here should be %zu. However, this patch can not be commited even to 7/8, because it does not preserve binary compatibility for shmctl(IPC_STAT). It seems that should be new shmctl syscall. -- Igor Sysoev http://sysoev.ru/en/