Re: System-imposed maximum for requested size of shared memory segment
- From: Don Morris <dgmorris@xxxxxxxxxxxxx>
- Date: Mon, 11 Feb 2008 03:41:43 -0800
Alex Vinokur wrote:
On Feb 11, 12:26 pm, Alex Vinokur <ale...@xxxxxxxxxxxxxxxxxxxxx>
wrote:
HP-UX B.11.23 U ia64
HP-UX 11i Version 2: August 2003
From man for shmget:
-------------------------
shmget() fails if any of the following conditions are encountered:
[EINVAL] size is less than the system-imposed minimum or
greater than the system-imposed maximum.
-------------------------
Where can we find those minimum and maximum?
64 GB according to shmmax(5)
sys/shm.h holds 'struct shmifo'
struct shminfo {
long shmmax; /* max shared memory segment size */
long shmmin; /* min shared memory segment size */
int shmmni; /* # of shared memory identifiers */
int shmseg; /* max attached shared memory segments per
process */
};
But where are the members set?
By the kernel dynamic tunable handlers for shmmax, shmmni and
shmseg [all of which are dynamic in v2]. shmmin isn't adjustable
and in practice anything positive and non-zero will pass it.
>
> I would like to write in my program something like:
> assert (requested_size <= shmmax);
man gettune() if you want to ask the kernel for the current
tunable values, man shmmax, man shmmni and man shmseg for
more details on the tunables.
Don
.
- References:
- System-imposed maximum for requested size of shared memory segment
- From: Alex Vinokur
- Re: System-imposed maximum for requested size of shared memory segment
- From: Alex Vinokur
- System-imposed maximum for requested size of shared memory segment
- Prev by Date: Re: System-imposed maximum for requested size of shared memory segment
- Next by Date: Re: System-imposed maximum for requested size of shared memory segment
- Previous by thread: Re: System-imposed maximum for requested size of shared memory segment
- Next by thread: Re: System-imposed maximum for requested size of shared memory segment
- Index(es):