Thread: implementaion of exit function

  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    19

    Question implementaion of exit function

    hi all,

    Can any one tel me how exit() in C is implemented?

    Thanks in advance

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Nothing a bit of research wouldn't cure. http://www.opengroup.org/onlinepubs/...ions/exit.html

  3. #3
    Registered User
    Join Date
    May 2007
    Posts
    19
    can i know how this exit() function is defined

  4. #4
    Linux is where it's at movl0x1's Avatar
    Join Date
    May 2007
    Posts
    72
    void exit(int status)

  5. #5
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by msenthil View Post
    hi all,

    Can any one tel me how exit() in C is implemented?

    Thanks in advance
    It is OS-dependent. In general, exit() first runs any exit handler functions that have been registered using atexit(), then it initiates a C library teardown routine (flushes any data remaining in open file handles, releases any specially-acquired resources, etc.). Finally, it makes a system call (OS-dependent) which actually terminates the process.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Odd memory leaks
    By VirtualAce in forum C++ Programming
    Replies: 11
    Last Post: 05-25-2006, 12:56 AM
  2. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  3. Why wont my function exit correctly?
    By LightsOut06 in forum C Programming
    Replies: 2
    Last Post: 10-09-2005, 09:23 PM
  4. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  5. Replies: 5
    Last Post: 02-08-2003, 07:42 PM