Home | History | Annotate | Download | only in solaris
      1 /* Scalar test for new zone syscall subcodes available on Solaris 11. */
      2 
      3 #include "scalar.h"
      4 
      5 #include <sys/zone.h>
      6 
      7 __attribute__((noinline))
      8 static void sys_zone(void)
      9 {
     10    GO(SYS_zone, "(ZONE_LIST_DEFUNCT) 3s 1m");
     11    SY(SYS_zone, x0 + ZONE_LIST_DEFUNCT, x0 + 1, x0 + 2); FAIL;
     12 }
     13 
     14 __attribute__((noinline))
     15 static void sys_zone2(void)
     16 {
     17    uint_t numzones = x0 + 1;
     18 
     19    GO(SYS_zone, "(ZONE_LIST_DEFUNCT) 2s 1m");
     20    SY(SYS_zone, x0 + ZONE_LIST_DEFUNCT, x0 + 1, &numzones); SUCC;
     21 }
     22 
     23 __attribute__((noinline))
     24 static void sys_zone3(void)
     25 {
     26    GO(SYS_zone, "(ZONE_GETATTR_DEFUNCT) 5s 2m");
     27    SY(SYS_zone, x0 + ZONE_GETATTR_DEFUNCT, x0 + 1, x0, x0 + 2, x0 + 3);
     28    FAIL;
     29 }
     30 
     31 int main(void)
     32 {
     33    /* Uninitialised, but we know px[0] is 0x0. */
     34    long *px = malloc(sizeof(long));
     35    x0 = px[0];
     36 
     37    /* SYS_zone                  227 */
     38    sys_zone();
     39    sys_zone2();
     40    sys_zone3();
     41 
     42    return 0;
     43 }
     44 
     45