1 /* Scalar test for new spawn syscall available on Solaris 11. */
5 #include <sys/spawn_impl.h>
7 __attribute__((noinline
))
8 static void sys_spawn(void)
10 GO(SYS_spawn
, "5s 7m");
11 SY(SYS_spawn
, x0
+ 1, x0
+ 1, x0
- 1, x0
+ 1, x0
- 1); FAIL
;
14 __attribute__((noinline
))
15 static void sys_spawn2(void)
18 ksa
.ksa_version
= x0
+ SPAWN_VERSION
;
19 ksa
.ksa_size
= x0
+ sizeof(ksa
);
20 ksa
.ksa_attr_off
= x0
+ 0;
21 ksa
.ksa_path_off
= x0
+ 0;
22 ksa
.ksa_shell_off
= x0
+ 0;
25 GO(SYS_spawn
, "9s 1m");
26 SY(SYS_spawn
, x0
+ 1, x0
+ &ksa
, sizeof(ksa
), x0
+ argenv
, x0
+ 1); FAIL
;
29 __attribute__((noinline
))
30 static void sys_spawn3(void)
33 ksa
.ksa_version
= x0
+ SPAWN_VERSION
;
34 ksa
.ksa_size
= x0
+ 0xbadcaffe;
35 ksa
.ksa_attr_off
= x0
+ 0xbadcaffe;
36 ksa
.ksa_attr_size
= x0
+ 1;
37 ksa
.ksa_path_off
= x0
+ 0xdeadcaffe;
38 ksa
.ksa_path_size
= x0
+ 2;
39 ksa
.ksa_shell_off
= x0
+ 0xdeadcaffe;
40 ksa
.ksa_shell_size
= x0
+ 3;
41 char *argenv
= "\1arg1\0\1arg2\0\1arg3\0\0\1env1\0\1env2\0\0";
43 GO(SYS_spawn
, "13s 4m");
44 SY(SYS_spawn
, x0
+ 1, x0
+ &ksa
, x0
+ 0xbadcaffe,
45 x0
+ argenv
, x0
+ sizeof(argenv
)); FAIL
;
48 __attribute__((noinline
))
49 static void sys_spawn4(void)
51 char path
[] = "/bin/sh";
52 char *argenv
= "\2arg1\0\0";
54 GO(SYS_spawn
, "4s 0m");
55 SY(SYS_spawn
, path
, x0
, x0
, x0
+ argenv
, x0
+ sizeof(argenv
));
61 /* Uninitialised, but we know px[0] is 0x0. */
62 long *px
= malloc(sizeof(long));