vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On Sat, Apr 05, 2008 at 06:13:05AM +0800, Dasn wrote: > I think the shmget(2) can produce EINVAL, which is not mentioned in > its manual page. > > $ cat test.c > #include <sys/types.h> > #include <sys/ipc.h> > #include <sys/shm.h> > #include <stdio.h> > > #define SHMKEY 75 > #define K 1024 > > int > main(void) > { > int shmid; > if ((shmid = shmget(SHMKEY, 64 * K, IPC_CREAT)) == -1) > perror("shmget first"); > if ((shmid = shmget(SHMKEY, (64+1) * K, IPC_CREAT)) == -1) > perror("shmget second"); > exit(0); > } > > $ gcc test.c && ./a.out > shmget second: Invalid argument > > --- /usr/src/lib/libc/sys/shmget.2 Tue May 4 01:36:29 2004 > +++ shmget.2 Sat Apr 5 05:55:13 2008 > @@ -115,6 +115,12 @@ > .Fa shmflg , > and a shared memory segment is already associated with > .Fa key . > +.It Bq Er EINVAL > +A shared memory segment is already associated with > +.Fa key > +and its > +.Fa size > +is less than the requested size. > .It Bq Er ENOSPC > A new shared memory identifier could not be created because the system limit > for the number of shared memory identifiers has been reached. > > -- > Dasn fixed, thanks. jmc |