1 /* Scalar test for new labelsys syscall subcodes TSOL_GETCLEARANCE
2 and TSOL_SETCLEARANCE available on Solaris 11. */
6 #include <sys/syscall.h>
7 #include <sys/tsol/tsyscall.h>
8 #include <tsol/label.h>
10 __attribute__((noinline
))
11 static void sys_labelsys(void)
13 GO(SYS_labelsys
, "(TSOL_GETCLEARANCE) 2s 1m");
14 SY(SYS_labelsys
, x0
+ TSOL_GETCLEARANCE
, x0
+ 1); FAIL
;
17 __attribute__((noinline
))
18 static void sys_labelsys2(void)
20 m_label_t
*label
= m_label_alloc(USER_CLEAR
);
22 perror("m_label_alloc");
26 GO(SYS_labelsys
, "(TSOL_GETCLEARANCE) 1s 0m");
27 SY(SYS_labelsys
, x0
+ TSOL_GETCLEARANCE
, label
); SUCC
;
32 __attribute__((noinline
))
33 static void sys_labelsys3(void)
35 GO(SYS_labelsys
, "(TSOL_SETCLEARANCE) 2s 1m");
36 SY(SYS_labelsys
, x0
+ TSOL_SETCLEARANCE
, x0
+ 1); FAIL
;
39 __attribute__((noinline
))
40 static void sys_labelsys4(void)
42 m_label_t
*label
= m_label_alloc(USER_CLEAR
);
44 perror("m_label_alloc");
48 int ret
= getclearance(label
);
50 perror("getclearance");
55 GO(SYS_labelsys
, "(TSOL_SETCLEARANCE) 1s 0m");
56 SY(SYS_labelsys
, x0
+ TSOL_SETCLEARANCE
, label
); SUCC
;
63 /* Uninitialised, but we know px[0] is 0x0. */
64 long *px
= malloc(sizeof(long));