Home | History | Annotate | Download | only in solaris
      1 /* Test for utimesys() syscall which is available on illumos
      2    and older Solaris.
      3  */
      4 
      5 #include "scalar.h"
      6 
      7 __attribute__((noinline))
      8 static void sys_utimesys(void)
      9 {
     10    GO(SYS_utimesys, "(FUTIMENS) 3s 1m");
     11    SY(SYS_utimesys, x0 + 0, x0 - 1, x0 + 1); FAIL;
     12 }
     13 
     14 __attribute__((noinline))
     15 static void sys_utimesys2(void)
     16 {
     17    GO(SYS_utimesys, "(FUTIMENS) 3s 0m");
     18    SY(SYS_utimesys, x0 + 0, x0 - 1, x0 + NULL); FAIL;
     19 }
     20 
     21 __attribute__((noinline))
     22 static void sys_utimesys3(void)
     23 {
     24    GO(SYS_utimesys, "(UTIMENSAT) 5s 2m");
     25    SY(SYS_utimesys, x0 + 1, x0 - 1, x0 + 1, x0 + 1, x0); FAIL;
     26 }
     27 
     28 __attribute__((noinline))
     29 static void sys_utimesys4(void)
     30 {
     31    GO(SYS_utimesys, "(UTIMENSAT) 5s 0m");
     32    SY(SYS_utimesys, x0 + 1, x0 - 1, x0 + NULL, x0 + NULL, x0); FAIL;
     33 }
     34 
     35 int main(void)
     36 {
     37    /* Uninitialised, but we know px[0] is 0x0. */
     38    long *px = malloc(sizeof(long));
     39    x0 = px[0];
     40 
     41    /* SYS_utimesys             110 */
     42    sys_utimesys();
     43    sys_utimesys2();
     44    sys_utimesys3();
     45    sys_utimesys4();
     46 
     47    return 0;
     48 }
     49 
     50