}
}
-PRE(poll)
+// XXX: x86-specific, due to pollfd struct
+PREx(sys_poll, MayBlock)
{
/* struct pollfd {
int fd; -- file descriptor
*/
UInt i;
struct vki_pollfd* ufds = (struct vki_pollfd *)arg1;
- PRINT("poll ( %p, %d, %d )\n",arg1,arg2,arg3);
+ PRINT("sys_poll ( %p, %d, %d )\n", arg1,arg2,arg3);
+ PRE_REG_READ3(long, "poll",
+ struct pollfd *, ufds, unsigned int, nfds, long, timeout);
for (i = 0; i < arg2; i++) {
// 'fd' and 'events' field are inputs; 'revents' is output.
}
}
-POST(poll)
+POSTx(sys_poll)
{
if (res > 0) {
UInt i;
}
}
-PRE(epoll_create)
+PREx(sys_epoll_create, 0)
{
- /* int epoll_create(int size) */
- PRINT("epoll_create ( %d )", arg1);
+ PRINT("sys_epoll_create ( %d )", arg1);
+ PRE_REG_READ1(long, "epoll_create", int, size);
}
-POST(epoll_create)
+POSTx(sys_epoll_create)
{
- if (!fd_allowed(res, "open", tid, True)) {
+ if (!fd_allowed(res, "epoll_create", tid, True)) {
VG_(close)(res);
set_result( -VKI_EMFILE );
} else {
}
}
-PRE(epoll_ctl)
+PREx(sys_epoll_ctl, 0)
{
- /* int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event) */
static const char* epoll_ctl_s[3] = {
"EPOLL_CTL_ADD",
"EPOLL_CTL_DEL",
"EPOLL_CTL_MOD"
};
- PRINT("epoll_ctl ( %d, %s, %d, %p )",
- arg1, ( arg2<3 ? epoll_ctl_s[arg2] : "?" ), arg3, arg4);
+ PRINT("sys_epoll_ctl ( %d, %s, %d, %p )",
+ arg1, ( arg2<3 ? epoll_ctl_s[arg2] : "?" ), arg3, arg4);
+ PRE_REG_READ4(long, "epoll_ctl",
+ int, epfd, int, op, int, fd, struct epoll_event *, event);
PRE_MEM_READ( "epoll_ctl(event)", arg4, sizeof(struct epoll_event) );
}
-PRE(epoll_wait)
+PREx(sys_epoll_wait, MayBlock)
{
- /* int epoll_wait(int epfd, struct epoll_event * events,
- int maxevents, int timeout) */
- PRINT("epoll_wait ( %d, %p, %d, %d )", arg1, arg2, arg3, arg4);
+ PRINT("sys_epoll_wait ( %d, %p, %d, %d )", arg1, arg2, arg3, arg4);
+ PRE_REG_READ4(long, "epoll_wait",
+ int, epfd, struct epoll_event *, events,
+ int, maxevents, int, timeout);
PRE_MEM_WRITE( "epoll_wait(events)", arg2, sizeof(struct epoll_event)*arg3);
}
-POST(epoll_wait)
+POSTx(sys_epoll_wait)
{
if (res > 0)
POST_MEM_WRITE( arg2, sizeof(struct epoll_event)*res ) ;
SYSXY(__NR_getresuid, sys_getresuid16), // 165 ## L
// (__NR_vm86, sys_vm86), // 166 (x86) L
SYSX_(__NR_query_module, sys_ni_syscall), // 167 * P -- unimplemented
- SYSBA(__NR_poll, sys_poll, MayBlock), // 168 *
+ SYSXY(__NR_poll, sys_poll), // 168 * (XPG4-UNIX)
// (__NR_nfsservctl, sys_nfsservctl), // 169 * L
SYSX_(__NR_setresgid, sys_setresgid16), // 170 ## (non-standard)
SYSX_(251, sys_ni_syscall), // 251 * P -- unused
SYSX_(__NR_exit_group, sys_exit_group), // 252 *
SYSXY(__NR_lookup_dcookie, sys_lookup_dcookie), // 253 (*/32/64) L
- SYSBA(__NR_epoll_create, sys_epoll_create, 0), // 254 *
+ SYSXY(__NR_epoll_create, sys_epoll_create), // 254 * L
- SYSB_(__NR_epoll_ctl, sys_epoll_ctl, 0), // 255 *
- SYSBA(__NR_epoll_wait, sys_epoll_wait, MayBlock), // 256 *
+ SYSX_(__NR_epoll_ctl, sys_epoll_ctl), // 255 * L
+ SYSXY(__NR_epoll_wait, sys_epoll_wait), // 256 * L
// (__NR_remap_file_pages, sys_remap_file_pages), // 257 * L
SYSX_(__NR_set_tid_address, sys_set_tid_address), // 258 * ?
SYSBA(__NR_timer_create, sys_timer_create, 0), // 259
SY(__NR_clone, x0|CLONE_PARENT_SETTID|SIGCHLD, x0, x0, x0);
// __NR_setdomainname 121
- //GO(__NR_setdomainname, ".s .m");
- //SY(__NR_setdomainname);
+ // (Not yet handled by Valgrind)
// __NR_uname 122
GO(__NR_uname, "1s 1m");
GO(__NR_query_module, "0e");
SY(__NR_query_module);
- // __NR_poll 168
- //GO(__NR_poll, ".s .m");
- //SY(__NR_poll);
+ // __NR_poll 168 --> sys_poll()
+ GO(__NR_poll, "3s 1m");
+ SY(__NR_poll, x0, x0+1, x0);
// __NR_nfsservctl 169
//GO(__NR_nfsservctl, ".s .m");
GO(__NR_lookup_dcookie, "4s 1m");
SY(__NR_lookup_dcookie, x0, x0, x0, x0+1);
- // __NR_epoll_create 254
- //GO(__NR_epoll_create, ".s .m");
- //SY(__NR_epoll_create);
+ // __NR_epoll_create 254 --> sys_epoll_create()
+ GO(__NR_epoll_create, "1s 0m");
+ SY(__NR_epoll_create, x0);
- // __NR_epoll_ctl 255
- //GO(__NR_epoll_ctl, ".s .m");
- //SY(__NR_epoll_ctl);
+ // __NR_epoll_ctl 255 --> sys_epoll_ctl()
+ GO(__NR_epoll_ctl, "4s 1m");
+ SY(__NR_epoll_ctl, x0, x0, x0, x0);
- // __NR_epoll_wait 256
- //GO(__NR_epoll_wait, ".s .m");
- //SY(__NR_epoll_wait);
+ // __NR_epoll_wait 256 --> sys_epoll_wait()
+ GO(__NR_epoll_wait, "4s 1m");
+ SY(__NR_epoll_wait, x0, x0, x0+1, x0);
// __NR_remap_file_pages 257
//GO(__NR_remap_file_pages, ".s .m");
167: __NR_query_module 0e
-----------------------------------------------------
-----------------------------------------------------
+168: __NR_poll 3s 1m
+-----------------------------------------------------
+
+Syscall param poll(ufds) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param poll(nfds) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param poll(timeout) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param poll(ufds) points to unaddressable byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+-----------------------------------------------------
170: __NR_setresgid 3s 0m
-----------------------------------------------------
by 0x........: ...
Address 0x........ is not stack'd, malloc'd or (recently) free'd
-----------------------------------------------------
+254: __NR_epoll_create 1s 0m
+-----------------------------------------------------
+
+Syscall param epoll_create(size) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+-----------------------------------------------------
+255: __NR_epoll_ctl 4s 1m
+-----------------------------------------------------
+
+Syscall param epoll_ctl(epfd) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param epoll_ctl(op) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param epoll_ctl(fd) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param epoll_ctl(event) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param epoll_ctl(event) points to unaddressable byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+-----------------------------------------------------
+256: __NR_epoll_wait 4s 1m
+-----------------------------------------------------
+
+Syscall param epoll_wait(epfd) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param epoll_wait(events) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param epoll_wait(maxevents) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param epoll_wait(timeout) contains uninitialised byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+
+Syscall param epoll_wait(events) points to unaddressable byte(s)
+ at 0x........: syscall (in /...libc...)
+ by 0x........: __libc_start_main (...libc...)
+ by 0x........: ...
+ Address 0x........ is not stack'd, malloc'd or (recently) free'd
+-----------------------------------------------------
258:__NR_set_tid_address 1s 0m
-----------------------------------------------------