xref: /titanic_44/usr/src/test/libc-tests/tests/quick_exit_status.c (revision d1c5dc47e23888b05d4095e8983ccf62acbc69fa)
1*d1c5dc47SRobert Mustacchi /*
2*d1c5dc47SRobert Mustacchi  * This file and its contents are supplied under the terms of the
3*d1c5dc47SRobert Mustacchi  * Common Development and Distribution License ("CDDL"), version 1.0.
4*d1c5dc47SRobert Mustacchi  * You may only use this file in accordance with the terms of version
5*d1c5dc47SRobert Mustacchi  * 1.0 of the CDDL.
6*d1c5dc47SRobert Mustacchi  *
7*d1c5dc47SRobert Mustacchi  * A full copy of the text of the CDDL should have accompanied this
8*d1c5dc47SRobert Mustacchi  * source.  A copy of the CDDL is also available via the Internet at
9*d1c5dc47SRobert Mustacchi  * http://www.illumos.org/license/CDDL.
10*d1c5dc47SRobert Mustacchi  */
11*d1c5dc47SRobert Mustacchi 
12*d1c5dc47SRobert Mustacchi /*
13*d1c5dc47SRobert Mustacchi  * Copyright 2016 Joyent, Inc.
14*d1c5dc47SRobert Mustacchi  */
15*d1c5dc47SRobert Mustacchi 
16*d1c5dc47SRobert Mustacchi /*
17*d1c5dc47SRobert Mustacchi  * quick_exit() with the status code indicated in our arguments.
18*d1c5dc47SRobert Mustacchi  */
19*d1c5dc47SRobert Mustacchi 
20*d1c5dc47SRobert Mustacchi #include <stdlib.h>
21*d1c5dc47SRobert Mustacchi 
22*d1c5dc47SRobert Mustacchi int
main(int argc,const char * argv[])23*d1c5dc47SRobert Mustacchi main(int argc, const char *argv[])
24*d1c5dc47SRobert Mustacchi {
25*d1c5dc47SRobert Mustacchi 	int status;
26*d1c5dc47SRobert Mustacchi 
27*d1c5dc47SRobert Mustacchi 	if (argc != 2)
28*d1c5dc47SRobert Mustacchi 		abort();
29*d1c5dc47SRobert Mustacchi 
30*d1c5dc47SRobert Mustacchi 	status = atoi(argv[1]);
31*d1c5dc47SRobert Mustacchi 	quick_exit(status);
32*d1c5dc47SRobert Mustacchi 	abort();
33*d1c5dc47SRobert Mustacchi }
34