
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [tlug] shmget fails with error code = 22
Hi,
In a typical case, shmget() returns EINVAL when the second
parameter(size) is invalid.
But, anyway make sure ShmKey and mem_size are correct
as Takeshi pointed out.
Regards,
Masanori
From: "Nguyen Vu Hung" <vuhung16plus@example.com>
Subject: [tlug] shmget fails with error code = 22
Date: Tue, 15 Jan 2008 20:32:50 +0900
> Hi,
>
> 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.
>
> The thing I don't know is: what argument is invalid? This code runs
> "tamatama" almost perfect until today.
>
> A reboot resolves the problem.
>
> [vuhung@example.com ]$uname -a
> Linux vuhung 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686 GNU/Linux
> [vuhung@example.com ]$cat /etc/redhat-release
> Red Hat Enterprise Linux ES release 4 (Nahant Update 4)
> [vuhung@example.com ]$gcc --version | grep GCC
> gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)
Home |
Main Index |
Thread Index