_cexit
raw OCR
Perform exit cleanup without terminating the program.
Defined in header <process.h>
Syntax
#include <process.h>
void _cexit(void);
Portability
| DOS | UNIX | Windows | ANSI C | C++ only |
|---|---|---|---|---|
| ■ | ■ |
Remarks
_cexit performs the same cleanup as exit, except that it does not close files or terminate the calling process. Buffered output (waiting to be output) is written, any registered "exit functions" (posted with atexit) are called, and interrupt vectors altered by the startup code are restored.
Return value
None.
See also
Example
#include <process.h>
#include <io.h>
#include <fcntl.h>
#include <stdio.h>
#include <dos.h>
mainO
1f
int fd;
char c;
if ((fd = open("_cexit.c",0_RDONLY)) < 0) {
printf ("Unable to open _cexit.c for reading\n") ;
return 1;
}
if (read(fd,&c,l) != 1)
printf ("Unable to read from open file handle %d before _cexit\n",fd);
else
printf ("Successfully read from open file handle %d before _cexit\n",fd) ;
printf ( "Interrupt zero vector before _cexit = %Fp\n",_dos_getvect(0));
_cexit 0 ;
if (read(fd,&c,l) != 1)
printf ("Unable to read from open file handle %d after _cexit\n",fd);
else
printf ("Successfully read from open file handle %d after _cexit\n",fd);
printf ("Interrupt zero vector after _cexit = %Fp\n" ,_dos_getvect(0));
return 0;
Differences from modern implementations
Nothing recorded yet.
Modern references
These are search links, not yet checked by hand.
Extraction notes
- heading `cexit` read as `_cexit`
Stable link: /3.1/process.h/_cexit/
· short form /3.1/_cexit/