From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,cf7b099c99ee894b X-Google-Attributes: gidfee84,public X-Google-Thread: f678f,cf7b099c99ee894b X-Google-Attributes: gidf678f,public X-Google-Thread: fc89c,cf7b099c99ee894b X-Google-Attributes: gidfc89c,public From: "Andy Knight" Subject: Re: Digital Unix message queue programming problem!! Date: 1997/02/28 Message-ID: <01bc2556$de0d73d0$5a6480c2@5-02190>#1/1 X-Deja-AN: 222031181 X-NNTP-Posting-Host: mailgate.tetraworld.com References: <33162B5F.437B@silicon.net.my> <857065180snz@genesis.demon.co.uk> Organization: Tetra Limited Newsgroups: comp.unix.osf.osf1,comp.unix.programmer,comp.unix.osf.misc > 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