Andy Knight (KnighA@tetraworld.com) wrote: : > 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. If you had not cliped the line before th eone you quoted it would be obvious. The missing line is: exit (-1); So the program exit status is being talked about. Not the exit status from msgget(). -- Stephen Baynes MBCS CEng Stephen.Baynes@soton.sc.philips.com Philips Semiconductors Ltd Southampton SO15 0DJ +44 (01703) 316431 United Kingdom My views are my own. Do you use ISO8859-1? Yes if you see � as copyright, � as division and � as 1/2.