Home | History | Annotate | Download | only in solaris
      1 /* Test for syscalls that are available on illumos but are removed on
      2    Solaris 11.  This test is compiled only on illumos. */
      3 
      4 #include "scalar.h"
      5 
      6 #include <sys/fcntl.h>
      7 
      8 __attribute__((noinline))
      9 static void sys_open(void)
     10 {
     11    GO(SYS_open, "(2-args) 2s 1m");
     12    SY(SYS_open, x0, x0); FAIL;
     13 }
     14 
     15 __attribute__((noinline))
     16 static void sys_open2(void)
     17 {
     18    GO(SYS_open, "(3-args) 3s 1m");
     19    SY(SYS_open, x0, x0 | O_CREAT, x0); FAIL;
     20 }
     21 
     22 int main(void)
     23 {
     24    /* Uninitialised, but we know px[0] is 0x0. */
     25    long *px = malloc(sizeof(long));
     26    x0 = px[0];
     27 
     28    /* SYS_open                    5 */
     29    sys_open();
     30    sys_open2();
     31 
     32    /* SYS_link                    9 */
     33    GO(SYS_link, "2s 2m");
     34    SY(SYS_link, x0, x0); FAIL;
     35 
     36    /* SYS_unlink                 10 */
     37    GO(SYS_unlink, "1s 1m");
     38    SY(SYS_unlink, x0); FAIL;
     39 
     40    /* SYS_mknod                  14 */
     41    /* XXX Missing wrapper. */
     42 
     43    /* SYS_chmod                  15 */
     44    GO(SYS_chmod, "2s 1m");
     45    SY(SYS_chmod, x0, x0); FAIL;
     46 
     47    /* SYS_chown                  16 */
     48    GO(SYS_chown, "3s 1m");
     49    SY(SYS_chown, x0, x0, x0); FAIL;
     50 
     51    /* SYS_stat                   18 */
     52    GO(SYS_stat, "2s 2m");
     53    SY(SYS_stat, x0, x0); FAIL;
     54 
     55    /* SYS_fstat                  28 */
     56    GO(SYS_fstat, "2s 1m");
     57    SY(SYS_fstat, x0, x0); FAIL;
     58 
     59    /* SYS_access                 33 */
     60    GO(SYS_access, "2s 1m");
     61    SY(SYS_access, x0, x0); FAIL;
     62 
     63    /* SYS_rmdir                  79 */
     64    GO(SYS_rmdir, "1s 1m");
     65    SY(SYS_rmdir, x0); FAIL;
     66 
     67    /* SYS_mkdir                  80 */
     68    GO(SYS_mkdir, "2s 1m");
     69    SY(SYS_mkdir, x0, x0); FAIL;
     70 
     71    /* SYS_lstat                  88 */
     72    GO(SYS_lstat, "2s 2m");
     73    SY(SYS_lstat, x0, x0); FAIL;
     74 
     75    /* SYS_symlink                89 */
     76    GO(SYS_symlink, "2s 2m");
     77    SY(SYS_symlink, x0, x0); FAIL;
     78 
     79    /* SYS_readlink               90 */
     80    GO(SYS_readlink, "3s 2m");
     81    SY(SYS_readlink, x0, x0, x0 + 1); FAIL;
     82 
     83    /* SYS_fchmod                 93 */
     84    GO(SYS_fchmod, "2s 0m");
     85    SY(SYS_fchmod, x0 - 1, x0); FAIL;
     86 
     87    /* SYS_fchown                 94 */
     88    GO(SYS_fchown, "3s 0m");
     89    SY(SYS_fchown, x0, x0, x0); FAIL;
     90 
     91    /* SYS_lchown                130 */
     92    GO(SYS_lchown, "3s 1m");
     93    SY(SYS_lchown, x0, x0, x0); FAIL;
     94 
     95    /* SYS_rename                134 */
     96    GO(SYS_rename, "2s 2m");
     97    SY(SYS_rename, x0, x0); FAIL;
     98 
     99    /* SYS_stat64                215 */
    100    /* Tested in x86-solaris/scalar_obsolete.c. */
    101 
    102    /* SYS_lstat64               216 */
    103    /* Tested in x86-solaris/scalar_obsolete.c. */
    104 
    105    /* SYS_fstat64               217 */
    106    /* Tested in x86-solaris/scalar_obsolete.c. */
    107 
    108    /* SYS_open64                225 */
    109    /* Tested in x86-solaris/scalar_obsolete.c. */
    110 
    111    return 0;
    112 }
    113 
    114