*BSD News Article 49286


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!pravda.aa.msen.com!spool.mu.edu!howland.reston.ans.net!tank.news.pipex.net!pipex!dispatch.news.demon.net!demon!jraynard.demon.co.uk!jraynard.demon.co.uk!not-for-mail
From: james@jraynard.demon.co.uk (James Raynard)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Bug in shmget()???
Date: 22 Aug 1995 22:35:08 -0000
Organization: A FreeBSD box
Lines: 32
Message-ID: <41dm2s$u8@jraynard.demon.co.uk>
References: <419adk$k60@botan.shimane-u.ac.jp>
NNTP-Posting-Host: localhost
X-NNTP-Posting-Host: jraynard.demon.co.uk

In article <419adk$k60@botan.shimane-u.ac.jp>,
Makoto Idzumi <idzumi@shimane-u.ac.jp> wrote:
>The followings are a simple test program to check 
>  shmget( shmkey, sizeof( some_data ), IPC_CREAT | IPC_EXCL | 0666 );
>and a log when it runs.  Please look at them ...:
[...]
>bash$ ./shmtest 1
>shmkey = 1
>shmid = 196608     /* <--- Why not EOF ????? */

According to Stevens' Advanced Programming in the Unix Environment,
shmget returns -1 if it fails, otherwise a positive number. It seems
to have succeeded here - were you expecting it to fail?

>Additionally, two more questions: 
>1. Why no definition of IPC_ALLOC (=0100000) in sys/ipc.h ?

Is it a standard value? Stevens doesn't mention it.

>2. Why no man pages on shmget(), shmat(), msgget(), ... ?

An oversight? I believe that -current now has them.

>Thank you.

Not sure if I was much help (IPC not being one of my strong points).

James
-- 
"If English was good enough for Jesus Christ, it's good enough for me."
[Southern US Congressman]