Home | History | Annotate | Download | only in solaris
      1 /* Scalar test for commands A_GETSTAT and A_SETSTAT for auditon(2) subcode
      2    of the auditsys() syscall. Available on Solaris 11 and illumos,
      3    removed in Solaris 12. */
      4 
      5 #include "scalar.h"
      6 
      7 #include <bsm/audit.h>
      8 
      9 __attribute__((noinline))
     10 static void sys_auditsys(void)
     11 {
     12    GO(SYS_auditsys, "(BSM_AUDITCTL,A_GETSTAT) 3s 1m");
     13    SY(SYS_auditsys, x0 + BSM_AUDITCTL, x0 + A_GETSTAT, x0); FAIL;
     14 }
     15 
     16 __attribute__((noinline))
     17 static void sys_auditsys2(void)
     18 {
     19    GO(SYS_auditsys, "(BSM_AUDITCTL,A_SETSTAT) 3s 1m");
     20    SY(SYS_auditsys, x0 + BSM_AUDITCTL, x0 + A_SETSTAT, x0); FAIL;
     21 }
     22 
     23 int main(void)
     24 {
     25    /* Uninitialised, but we know px[0] is 0x0. */
     26    long *px = malloc(sizeof(long));
     27    x0 = px[0];
     28 
     29    /* SYS_auditsys              186 */
     30    sys_auditsys();
     31    sys_auditsys2();
     32 
     33    return 0;
     34 }
     35 
     36