tmacd8
tmacd8

Reputation: 73

Setting exit value from Chapel

Is it possible to set the exit status when terminating a Chapel program? I can always use:

extern "exit" proc c_exit(status:c_int);

The following does the trick.

extern "exit" proc c_exit(status:c_int);


module M {

    proc main() {

        writeln("hello, world");
        c_exit(1);
    }
}

This sets the exit status to 1 - just wondering if there's a way that doesn't require a call into the C library.

Upvotes: 4

Views: 70

Answers (1)

Vass
Vass

Reputation: 431

You can just call exit(1). See proc exit in chapel docs .

Upvotes: 1

Related Questions