Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: "Andy Knight" <KnighA@tetraworld.com>
Subject: Re: Digital Unix message queue programming problem!!
Date: 1997/02/28	[thread overview]
Message-ID: <01bc2556$de0d73d0$5a6480c2@5-02190> (raw)
In-Reply-To: 857065180snz@genesis.demon.co.uk


> Why -1? C defines 0, EXIT_SUCCESS and EXIT_FAILURE.

Could you explain this statement to me?

The X/Open Portability Guide says about msgget() that "On successful
completion, the function msgget() returns a non-negative integer, namely a
message queue identifier; otherwise it returns -1 and errno is set to
indicate the error".

Given that definition I would personally test for < 0 rather than == -1 but
its hard to criticise the explicit test.


-- 
Andy Knight




  reply	other threads:[~1997-02-28  5:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-27  5:00 Digital Unix message queue programming problem!! Kok Fock Seng
1997-02-27  5:00 ` Kok Fock Seng
1997-02-27  5:00 ` Charles M Richmond
1997-02-27  5:00 ` Jeremy D. Levine
1997-02-27  5:00 ` Lawrence Kirby
1997-02-28  5:00   ` Andy Knight [this message]
1997-02-28  5:00     ` Stephen Baynes
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox