1 /* Test for lwp_name syscall which is available on newer Solaris. */ 2 3 #include "scalar.h" 4 5 __attribute__((noinline)) 6 static void sys_lwp_name(void) 7 { 8 GO(SYS_lwp_name, "(lwp_setname) 3s 1m"); 9 SY(SYS_lwp_name, x0 + 0, x0, x0 + 1); FAIL; 10 } 11 12 __attribute__((noinline)) 13 static void sys_lwp_name2(void) 14 { 15 GO(SYS_lwp_name, "(lwp_getname) 4s 1m"); 16 SY(SYS_lwp_name, x0 + 1, x0, x0 + 1, x0 + 2); FAIL; 17 } 18 19 int main(void) 20 { 21 /* Uninitialised, but we know px[0] is 0x0. */ 22 long *px = malloc(sizeof(long)); 23 x0 = px[0]; 24 25 /* SYS_lwp_name 79 */ 26 sys_lwp_name(); 27 sys_lwp_name2(); 28 29 return 0; 30 } 31 32