LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-20-2006, 04:25 AM   #1
moonz
LQ Newbie
 
Registered: Sep 2005
Posts: 11

Rep: Reputation: 0
difference between _exit and exit???


I copied some rows from the vfork man page.
"The vfork() function can normally be used just like fork(). It does not work, however, to return while running in the child's context from the caller of vfork() since the eventual return from vfork() would then return to a no longer existent stack frame. Be careful, also, to call _exit() rather than exit() if you cannot exec, since exit() flushes and closes standard I/O channels, thereby damaging the parent process' standard I/O data structures. (Even with fork(), it is wrong to call exit(), since buffered data would then be flushed twice.)"

I don't understand the difference between _exit and exit could some one please tell me?
Thanks moonz
 
Old 01-20-2006, 08:17 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Found this in a Google search:
http://linux.about.com/library/cmd/blcmdl2_exit.htm
 
Old 01-20-2006, 08:24 AM   #3
moonz
LQ Newbie
 
Registered: Sep 2005
Posts: 11

Original Poster
Rep: Reputation: 0
Hi thank you for your replie!
But according to this document there isn't any difference, but there is.
I found this searching the web with google
For a discussion on the effects of an exit, the transmission of exit
status, zombie processes, signals sent, etc., see exit(3).

The function _exit() is like exit(), but does not call any functions
registered with atexit() or on_exit(). Whether it flushes standard I/O
buffers and removes temporary files created with tmpfile(3) is imple-
mentation dependent. On the other hand, _exit() does close open file
descriptors, and this may cause an unknown delay, waiting for pending
output to finish. If the delay is undesired, it may be useful to call
functions like tcflush() before calling _exit(). Whether any pending
I/O is cancelled, and which pending I/O may be cancelled upon _exit(),
is implementation-dependent.


At this location http://man-wiki.net/index.php/2:_exit
Sorry that i wasted your time!
Moonz
 
Old 01-20-2006, 12:05 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,151

Rep: Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203Reputation: 2203
It is often the case, in the Linux/Unix world, that names beginning with "_" refer to internal or primitive routines.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
difference between exit 1 and exit kushalkoolwal Programming 6 10-20-2005 04:56 PM
_exit() and exit() greghua Programming 3 10-08-2005 02:23 PM
Exit X Risetaker2003 Linux - Software 5 09-30-2003 09:10 PM
exit X ? w00t Linux - Newbie 11 06-01-2003 09:04 PM


All times are GMT -5. The time now is 10:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration