Article View: comp.std.c
Article #3875Re: EXIT_FAILURE problem
From: halasz
Date: Sun, 27 Aug 1995 04:16
Date: Sun, 27 Aug 1995 04:16
36 lines
2449 bytes
2449 bytes
In article <DDt13K.K22@ukpsshp1.serigate.philips.nl>, baynes@ukpsshp1.serigate.philips.nl (Stephen Baynes) writes : .... : To what extent should the programing language change to suite the operating : system and to what extent should the operating system change to suite the : programing language? Exit codes sounds like a case where one could expect : ones OS to make sensible use of a simple integer value system rather than : try and fit the program to the system. In a sense we have this, but only : two values portable - 0/EXIT_SUCCESS and EXIT_FAILURE. It has been pointed out that not all OSes uze integer exit-codes. It is not a good idea to deeper burie C in the mire of thus restricting exit-status, and not letting that which the C program "returns" be the same as that which the OS gets. Therefore, call 0 not portable. Decreeing it portable was a mistake from the outset. : Perhaps one should have a guarentee of 128 distinguishable exit status. This is far too manie. If one restricts oneself to degree of success, then the most that I hav seen in general use amounts to full success, warning, error, and fatal/severe error, which makes the program too soon quit. In one case I hav seen a yet severer error, but that is that the program was not even started, not sumthing useful from a program that runs. If one wants also to map the notion what faild, as in VMS, this is far too few. : [I use exit-status to mean the value returned from main and OS-status as the : OS's program exit status.] This furthers the mistake, unless all of them are macros, as "EXIT_SUCCESS" and "EXIT_FAILURE" are. : .... : If you want to make use of OS specific features of its program exit status : system then you will always have to use OS specific functions or OS : specific knowlege. It is just as you do if you want to use any other OS : specific feature such as IPC or interactive graphics or special file formats. With correct dezign of "exit" and kin --all hidden under macros and types-- this need not be so.
Technical Details
Message-ID:
<41orid$mbt@caip.rutgers.edu>Path:
arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mailReferences:
<jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <DDt13K.K22@ukpsshp1.serigate.philips.nl>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mail From: halasz@caip.rutgers.edu Newsgroups: comp.std.c Subject: Re: EXIT_FAILURE problem Date: 27 Aug 1995 00:16:13 -0400 Organization: Rutgers University Message-ID: <41orid$mbt@caip.rutgers.edu> References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <DDt13K.K22@ukpsshp1.serigate.philips.nl> NNTP-Posting-Host: caip.rutgers.edu