From: "Steve Graegert" <graegerts@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: Re: Compiling the NIST Time Client
Date: Sat, 18 Feb 2006 11:20:52 +0100 [thread overview]
Message-ID: <6a00c8d50602180220k5e1075f7ge6f2868034d05ced@mail.gmail.com> (raw)
In-Reply-To: <200602181040.20766.samjnaa@gmail.com>
On 2/18/06, Shriramana Sharma <samjnaa@gmail.com> wrote:
> Friday, 17 February 2006 18:33 samaye, Reuben D. Budiardja alekhiit:
>
> > exit() takes one argument. exit() is not the same as return. 'man 3 exit'
> > for details.
>
> All I can see is that exit mandatorily takes an argument whereas if return is
> not given an argument the return status is that of the last command executed
> in the function body.
>
> Further, exit is a function whereas return is a statement, not that that
> really makes much of a difference (does it?).
return and exit(3) have completely different effects on program
execution. While return simply returns from a function call, exit(3)
does not return. If return is called from within main, the process is
terminated with the given return code. If its called from within
another function return causes the process to return control of
execution to the function that called it in the first place. exit(3)
causes the kernel to terminate the process sending SIGCHLD to the
parent and allowing the parent to fetch the child's exit status with
wait(2) or waitpid(2).
\Steve
--
Steve Graegert <graegerts@gmail.com>
Software Consultant {C/C++ && Java && .NET}
Office: +49 9131 7123988
Mobile: +49 1520 9289212
prev parent reply other threads:[~2006-02-18 10:20 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-17 2:30 Compiling the NIST Time Client Shriramana Sharma
2006-02-17 6:24 ` Glynn Clements
2006-02-17 13:03 ` Reuben D. Budiardja
2006-02-18 5:10 ` Shriramana Sharma
2006-02-18 10:20 ` Glynn Clements
2006-02-18 10:20 ` Steve Graegert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6a00c8d50602180220k5e1075f7ge6f2868034d05ced@mail.gmail.com \
--to=graegerts@gmail.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).