1 /* Basic syscall test for Solaris/x86 specific syscalls. */
3 #include "../solaris/scalar.h"
7 #include <sys/statvfs.h>
9 /* Helper functions. These are necessary if we've got two tests for a single
10 syscall. In that case, Memcheck can sometimes merge error messages. Doing
11 each test in its own function prevents that. */
12 __attribute__((noinline
))
13 static void sys_openat64(void)
15 GO(SYS_openat64
, "(3-args) 3s 1m");
16 SY(SYS_openat64
, x0
- 1, x0
, x0
); FAILx(EBADF
);
19 __attribute__((noinline
))
20 static void sys_openat642(void)
22 GO(SYS_openat64
, "(4-args) 4s 1m");
23 SY(SYS_openat64
, x0
- 1, x0
, x0
| O_CREAT
, x0
); FAILx(EBADF
);
26 __attribute__((noinline
))
27 static void sys_statvfs64(void)
29 GO(SYS_statvfs64
, "2s 2m");
30 SY(SYS_statvfs64
, x0
+ 1, x0
+ 1); FAIL
;
33 __attribute__((noinline
))
34 static int sys_statvfs642(void)
36 const char path
[] = "/";
37 struct statvfs64 stats
;
39 GO(SYS_statvfs64
, "4s 0m");
40 SY(SYS_statvfs64
, x0
+ path
, x0
+ &stats
); SUCC
;
42 size_t basetype_len
= strlen(stats
.f_basetype
);
43 size_t fstr_len
= strlen(stats
.f_fstr
);
45 /* Now check that memory after the strings is reported uninitialized. */
47 if (stats
.f_basetype
[basetype_len
+ 2] != ' ') x
= -1; else x
= -2;
48 if (stats
.f_fstr
[fstr_len
+ 2] != ' ') x
= -3; else x
= -4;
54 /* Uninitialised, but we know px[0] is 0x0. */
55 long *px
= malloc(sizeof(long));
58 /* SYS_fstatat64 67 */
59 GO(SYS_fstatat64
, "4s 2m");
60 SY(SYS_fstatat64
, x0
- 1, x0
+ 1, x0
, x0
); FAILx(EBADF
);
67 GO(SYS_llseek
, "3s 0m");
68 SY(SYS_llseek
, x0
- 1, x0
, x0
); FAILx(EBADF
);
70 /* SYS_getdents64 213 */
71 GO(SYS_getdents64
, "3s 1m");
72 SY(SYS_getdents64
, x0
, x0
, x0
+ 1); FAIL
;
75 GO(SYS_mmap64
, "7s 0m");
76 SY(SYS_mmap64
, x0
, x0
, x0
, x0
, x0
, x0
, x0
); FAILx(EINVAL
);
79 /* Tested in x86-solaris/scalar_obsolete.c. */
82 /* Tested in x86-solaris/scalar_obsolete.c. */
85 /* Tested in x86-solaris/scalar_obsolete.c. */
87 /* SYS_statvfs64 218 */
91 /* SYS_fstatvfs64 219 */
92 GO(SYS_fstatvfs64
, "2s 1m");
93 SY(SYS_fstatvfs64
, x0
- 1, x0
+ 1); FAILx(EBADF
);
95 /* SYS_setrlimit64 220 */
96 GO(SYS_setrlimit64
, "2s 1m");
97 SY(SYS_setrlimit64
, x0
, x0
); FAIL
;
99 /* SYS_getrlimit64 221 */
100 GO(SYS_getrlimit64
, "2s 1m");
101 SY(SYS_getrlimit64
, x0
, x0
); FAIL
;
103 /* SYS_pread64 222 */
104 GO(SYS_pread64
, "5s 1m");
105 SY(SYS_pread64
, x0
- 1, x0
, x0
+ 1, x0
, x0
); FAILx(EBADF
);
107 /* SYS_pwrite64 223 */
108 GO(SYS_pwrite64
, "5s 1m");
109 SY(SYS_pwrite64
, x0
- 1, x0
, x0
+ 1, x0
, x0
); FAILx(EBADF
);
112 /* Tested in x86-solaris/scalar_obsolete.c. */