message queue questions

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

 



Hi,

I have made a program that uses fork to split it into
two processes,
and they use a message queue to communicated with each
other. But it
is not working and I have some questions.

1. First the child process creates this queue with the
following
command

if( ( queueID = msgget( theKey, IPC_CREAT | S_IRUSR |
S_IWUSR ) ) < 0
){ ... }

I think this command will create the queue, and give
read and write
permitions to this and any other processes owned by
this user that
needs to read or write into this queue. Right?

2. Then the parent issues the same command to create
the queue, and as
it already exists ( I added a sleep of 1 second to
assure that the
child will be executed first ) the parent's queueID
will be the same
as the child's queueID.

3. When I excute this program both child and parent
are unable to
create the queue, and the errno returned is EACCES (
Permission Denied
). What is wrong with the permissions?

Thanks,

Andre

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux