08-12-2009
Quote:
"The basic difference between exit() and _exit() is that the former performs clean-up related to user-mode constructs in the library, and calls user-supplied cleanup functions, whereas the latter performs only the kernel cleanup for the process."
read more about this on the
unixguide programming page.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I'm receiving an exit code 64 in our batch scheduler (BMC product control-m) executing a PERL script on UX-HP. Can you tell me where I can find a list of exit codes and their meaning. I'm assuming the exit code is from the Unix operating system not PERL. (3 Replies)
Discussion started by: jkuchar747
3 Replies
2. Programming
What is the difference between using exit(0) and exit(1) to exit a program? Which should I use? (9 Replies)
Discussion started by: enuenu
9 Replies
3. UNIX for Dummies Questions & Answers
can u tell me what is the meaning of exit(0),exit(1),exit(2)
what is diff amonng these.
Amit (1 Reply)
Discussion started by: amitpansuria
1 Replies
4. Shell Programming and Scripting
I know that the exit codes in scripting "$*" will returns all the parameters/arguments passwd to the script.
But I also know that "$@" will also returns the same. What is the difference between those two ? (1 Reply)
Discussion started by: praveen_b744
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am getting fatal error or core dump by using this command "_exit(-1)". I need to terminate the program at a certain condition, but continous calling of this exit function, I am getting core dump. Is there any other command can be used to avoid the core dump ?? (3 Replies)
Discussion started by: ronix007
3 Replies
6. Shell Programming and Scripting
I am running HP-UX & ksh
I have several validation programs that scan log files for error messages.
One of these files scan 3 diff files, thus I have the exit value in a variable and depending on which log-file I am scanning the value changes.
I am not getting the value I expect but a... (1 Reply)
Discussion started by: vslewis
1 Replies
7. Programming
I think both write at the end of the file ......
but is there a sharp difference between those 2 instruction .....
thank you
this is my 3rd question today forgive me :D (1 Reply)
Discussion started by: fwrlfo
1 Replies
8. Shell Programming and Scripting
Hi
In one of the script I am seeing some thing like exit 7,exit 1,exit 2,exit 3,exit 9,exit6.What is the difference between all of this exit.Can anyone help here please (3 Replies)
Discussion started by: ginrkf
3 Replies
9. Shell Programming and Scripting
Hi All,
I would like to know whether is there any difference in closing the sftp connection with exit, bye and quit.
And would like to know the reliable command. (3 Replies)
Discussion started by: Girish19
3 Replies
10. Shell Programming and Scripting
In the awk I am trying to subtract the difference $3-$2 of each matching $4 before the first _ (underscore) and print that value in $13.
I think the awk will do that, but added comments. What I am not sure off is how to add a line or lines that will add sum each matching $13 value and put it in... (2 Replies)
Discussion started by: cmccabe
2 Replies
exit(2) System Calls Manual exit(2)
Name
_exit - terminate a process
Syntax
#include <stdlib.h>
void _exit(status)
int status;
Description
The function, terminates a calling process with the following consequences:
o All of the file descriptors open in the calling process are closed.
o If the parent process of the calling process is executing a it is notified of the calling process's termination and the low-order
eight bits of status are made available to it. For further information, see
o The parent process ID of all of the calling process's existing child processes and zombie processes are also set to 1. This means
that the initialization process inherits each of these processes as well. For further information, see
o Each attached shared memory segment is detached and the value of shm_nattach in the data structure associated with its shared memory
identifier is decremented by 1.
o For each semaphore for which the calling process has set a semadj value, (see ) that semadj value is added to the semval of the speci-
fied semaphore.
o If the process has a process, text, or data lock, an unlock is performed.
o An accounting record is written on the accounting file if the system's accounting routine is enabled. For more information, see
Calling directly circumvents all cleanup. Most C programs call the library routine which performs cleanup actions in the standard I/O
library before calling
Environment
POSIX, System V
The function differs from the System V as well as POSIX definition in that even if the calling process is a process group leader, the
SIGHUP signal is not sent to each process that has a process group ID equal to that of the calling process.
The function also differs in that the routine is declared as type int instead of type void.
See Also
fork(2), wait(2), exit(3), signal(3).
exit(2)