RAD Studio
ContentsIndex
PreviousUpNext
_c_exit

Header File 

process.h  

Category 

Process Control Routines 

Prototype 

void _c_exit(void); 

Description 

Performs _exit cleanup without terminating the program. 

_c_exit performs the same cleanup as _exit, except that it does not terminate the calling process. 

Return Value 

None. 

Example  

#include <process.h>
#include <io.h>
#include <fcntl.h>
#include <stdio.h>
main()
{
  int fd;
  char c;
 
  if ((fd = open("_c_exit.c",O_RDONLY)) < 0)
  {
    printf("Unable to open _c_exit.c for reading\n");
    return 1;
  }
  if (read(fd,&c,1) != 1)
    printf("Unable to read from open file handle %d before _c_exit\n",fd);
  else
    printf("Successfully read from open file handle %d before _c_exit\n",fd);
  _c_exit();
  if (read(fd,&c,1) != 1)
    printf("Unable to read from open file handle %d after _c_exit\n",fd);
  else
    printf("Successfully read from open file handle %d after _c_exit\n",fd);
 return 0;
}

Portability

POSIX 
Win32 
ANSI C 
ANSI C++ 
 
 
 
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!