01-30-07 12:29 PM
On Jan 29, 8:58 pm, Giorgos Keramidas <keram...@ceid.upatras.gr>
wrote:
> On 29 Jan 2007 07:05:13 -0800, "shaanxxx" <shaan...@yahoo.com> wrote:
>
>
> I don't have a 64-bit Linux system around, but I tried the following
> program on FreeBSD/i386, FreeBSD/amd64, Solaris/i386 and Solaris/amd64:
>
> ------------------------------------------------------------------------
> #include <stdio.h>
> #include <stdlib.h>
>
> static void opensystem(void);
> static void closesystem(void);
> static void autoclose(void);
>
> static void
> autoclose(void)
> {
> closesystem();
>
> }
>
> int
> main(void)
> {
> opensystem();
> if (atexit(autoclose) != 0) {
> perror("atexit");
> }
> return EXIT_SUCCESS;
>
> }
>
> void
> opensystem(void)
> {
> printf("in %s\n", __func__);
>
> }
>
> void
> closesystem(void)
> {
> printf("in %s\n", __func__);}
>
> ------------------------------------------------------------------------
>
> In all the systems mentioned above, the exit code of the program is zero.
> I'm not sure why or even *if* Linux/amd64 is different.
>
> Are you sure closesystem() in your implementation doesn't terminate the
> program by calling exit(), or a similar function, with a non-zero
> program status?
No, it doesnt do exit() in sysclose() function.
>
> - Giorgos
[ Post a follow-up to this message ]
|