Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Oct 2007 23:53:43 +0400
From:      Igor Sysoev <is@rambler-co.ru>
To:        Peter Jeremy <peterjeremy@optushome.com.au>
Cc:        freebsd-current@freebsd.org, freebsd-stable@freebsd.org
Subject:   Re: 2G+ sysv shm segments
Message-ID:  <20071016195343.GK57989@rambler-co.ru>
In-Reply-To: <20071016193843.GD1184@turion.vk2pj.dyndns.org>
References:  <20071015141714.GL24828@rambler-co.ru> <20071016193843.GD1184@turion.vk2pj.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Oct 17, 2007 at 05:38:43AM +1000, Peter Jeremy wrote:

> On 2007-Oct-15 18:17:14 +0400, Igor Sysoev <is@rambler-co.ru> 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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071016195343.GK57989>