xref: /illumos-gate/usr/src/test/os-tests/tests/saveargs/functional/big-struct-ret.c (revision 64859aa91949443e6dbb84b2d15400a12437046d)
1b41e2fb6SRichard Lowe /*
2b41e2fb6SRichard Lowe  * This file and its contents are supplied under the terms of the
3b41e2fb6SRichard Lowe  * Common Development and Distribution License ("CDDL"), version 1.0.
4b41e2fb6SRichard Lowe  * You may only use this file in accordance with the terms of version
5b41e2fb6SRichard Lowe  * 1.0 of the CDDL.
6b41e2fb6SRichard Lowe  *
7b41e2fb6SRichard Lowe  * A full copy of the text of the CDDL should have accompanied this
8b41e2fb6SRichard Lowe  * source.  A copy of the CDDL is also available via the Internet at
9b41e2fb6SRichard Lowe  * http://www.illumos.org/license/CDDL.
10b41e2fb6SRichard Lowe  */
11b41e2fb6SRichard Lowe 
12b41e2fb6SRichard Lowe /*
13b41e2fb6SRichard Lowe  * Copyright 2012, Richard Lowe.
14b41e2fb6SRichard Lowe  */
15b41e2fb6SRichard Lowe 
16b41e2fb6SRichard Lowe #include <stdio.h>
17b41e2fb6SRichard Lowe #include <unistd.h>
18b41e2fb6SRichard Lowe 
19b41e2fb6SRichard Lowe struct foo {
20b41e2fb6SRichard Lowe 	long a;
21b41e2fb6SRichard Lowe 	long b;
22b41e2fb6SRichard Lowe 	long c;
23b41e2fb6SRichard Lowe };
24b41e2fb6SRichard Lowe 
25b41e2fb6SRichard Lowe struct foo
test(long a,long b,long c,long d)26b41e2fb6SRichard Lowe test(long a, long b, long c, long d)
27b41e2fb6SRichard Lowe {
28b41e2fb6SRichard Lowe 	struct foo f = {0};
29b41e2fb6SRichard Lowe 	printf("%ld %ld %ld %ld\n", a, b, c, d);
30*64859aa9SToomas Soome 	(void) fflush(stdout);
31b41e2fb6SRichard Lowe 
32b41e2fb6SRichard Lowe 	for (;;)
33b41e2fb6SRichard Lowe 		(void) sleep(60);
34b41e2fb6SRichard Lowe 
35b41e2fb6SRichard Lowe 	/* not reached */
36b41e2fb6SRichard Lowe 	return (f);
37b41e2fb6SRichard Lowe }
38b41e2fb6SRichard Lowe 
39b41e2fb6SRichard Lowe int
main(int argc,char ** argv)40b41e2fb6SRichard Lowe main(int argc, char **argv)
41b41e2fb6SRichard Lowe {
42b41e2fb6SRichard Lowe 	(void) test(1, 2, 3, 4);
43b41e2fb6SRichard Lowe 	return (0);
44b41e2fb6SRichard Lowe }
45