Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] shmget fails with error code = 22



Hi,

On Jan 15, 2008 8:32 PM, Nguyen Vu Hung <vuhung16plus@example.com> wrote:
> The following code has failed and the error code ( errno ) is 22.
>
>
>         shmid = shmget((key_t)ShmKey, (size_t)mem_size, 0666 | IPC_CREAT);
>         iErrorCode = errno;
>
>
> I've checked /usr/include/asm/error.h and found that
>
> #define EINVAL      22  /* Invalid argument */
>
> which is not very informative.

Read the manpage and spec first.
http://www.opengroup.org/onlinepubs/009695399/functions/shmget.html


> The thing I don't know is: what argument is invalid? This code runs
> "tamatama" almost perfect until today.
>
> A reboot resolves the problem.

See what values were actually passed as arguments when it failed.
strace(1) might be useful.

-- 
YAEGASHI Takeshi <t@example.com> <takeshi@example.com> <yaegashi@example.com>


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links