2005-05-09 Roland McGrath <roland@redhat.com>

* desc.c (sys_io_setup, sys_io_submit, sys_io_cancel,
	sys_io_getevents, sys_io_destroy): New functions.
	* linux/syscall.h: Declare them.
	* linux/syscallent.h: Use those for io_* syscalls.
	* linux/alpha/syscallent.h: Likewise.
	* linux/hppa/syscallent.h: Likewise.
	* linux/ia64/syscallent.h: Likewise.
	* linux/mips/syscallent.h: Likewise.
	* linux/powerpc/syscallent.h: Likewise.
	* linux/s390/syscallent.h: Likewise.
	* linux/s390x/syscallent.h: Likewise.
	* linux/x86_64/syscallent.h: Likewise.
	From Zach Brown <zach.brown@oracle.com>.
	Fixes RH#155065.
This commit is contained in:
Roland McGrath
2005-05-09 08:02:00 +00:00
parent bc718ed396
commit 37b9f8480c
11 changed files with 206 additions and 45 deletions

160
desc.c
View File

@ -40,6 +40,9 @@
#ifdef HAVE_SYS_EPOLL_H
#include <sys/epoll.h>
#endif
#ifdef HAVE_LIBAIO_H
#include <libaio.h>
#endif
#if HAVE_LONG_LONG_OFF_T
/*
@ -703,6 +706,163 @@ struct tcb *tcp;
}
return 0;
}
int
sys_io_setup(tcp)
struct tcb *tcp;
{
if (entering(tcp))
tprintf("%ld, ", tcp->u_arg[0]);
else {
if (syserror(tcp))
tprintf("0x%0lx", tcp->u_arg[1]);
else {
unsigned long user_id;
if (umove(tcp, tcp->u_arg[1], &user_id) == 0)
tprintf("{%lu}", user_id);
else
tprintf("{...}");
}
}
return 0;
}
int
sys_io_destroy(tcp)
struct tcb *tcp;
{
if (entering(tcp))
tprintf("%lu", tcp->u_arg[0]);
return 0;
}
int
sys_io_submit(tcp)
struct tcb *tcp;
{
long nr;
if (entering(tcp)) {
tprintf("%lu, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
nr = tcp->u_arg[1];
/* and if nr is negative? */
if (nr == 0)
tprintf("{}");
else {
#ifdef HAVE_LIBAIO_H
long i;
struct iocb *iocbp, **iocbs = (void *)tcp->u_arg[2];
for (i = 0; i < nr; i++, iocbs++) {
struct iocb iocb;
if (i == 0)
tprintf("{");
else
tprintf(", ");
if (umove(tcp, (unsigned long)iocbs, &iocbp) ||
umove(tcp, (unsigned long)iocbp, &iocb)) {
tprintf("{...}");
continue;
}
tprintf("{%p, %u, %hu, %hu, %d}",
iocb.data, iocb.key,
iocb.aio_lio_opcode,
iocb.aio_reqprio, iocb.aio_fildes);
}
if (i)
tprintf("}");
#else
tprintf("{...}");
#endif
}
}
return 0;
}
int
sys_io_cancel(tcp)
struct tcb *tcp;
{
if (entering(tcp)) {
#ifdef HAVE_LIBAIO_H
struct iocb iocb;
#endif
tprintf("%lu, ", tcp->u_arg[0]);
#ifdef HAVE_LIBAIO_H
if (umove(tcp, tcp->u_arg[1], &iocb) == 0) {
tprintf("{%p, %u, %hu, %hu, %d}, ",
iocb.data, iocb.key,
iocb.aio_lio_opcode,
iocb.aio_reqprio, iocb.aio_fildes);
} else
#endif
tprintf("{...}, ");
} else {
if (tcp->u_rval < 0)
tprintf("{...}");
else {
#ifdef HAVE_LIBAIO_H
struct io_event event;
if (umove(tcp, tcp->u_arg[2], &event) == 0)
tprintf("{%p, %p, %ld, %ld}",
event.data, event.obj,
event.res, event.res2);
else
#endif
tprintf("{...}");
}
}
return 0;
}
int
sys_io_getevents(tcp)
struct tcb *tcp;
{
if (entering(tcp)) {
tprintf("%ld, %ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1],
tcp->u_arg[2]);
} else {
if (tcp->u_rval == 0) {
tprintf("{}");
} else {
#ifdef HAVE_LIBAIO_H
struct io_event *events = (void *)tcp->u_arg[3];
long i, nr = tcp->u_rval;
for (i = 0; i < nr; i++, events++) {
struct io_event event;
if (i == 0)
tprintf("{");
else
tprintf(", ");
if (umove(tcp, (unsigned long)events, &event) != 0) {
tprintf("{...}");
continue;
}
tprintf("{%p, %p, %ld, %ld}", event.data,
event.obj, event.res, event.res2);
}
tprintf("}, ");
#else
tprintf("{...}");
#endif
}
if (tcp->u_arg[4] == 0)
tprintf("NULL");
else {
struct timespec to;
if (umove(tcp, tcp->u_arg[4], &to) == 0)
tprintf("{%lu, %lu}", to.tv_sec, to.tv_nsec);
else
tprintf("{...}");
}
}
return 0;
}
#endif /* LINUX */
int

View File

@ -426,11 +426,11 @@
{ 3, 0, sys_sched_setaffinity, "sched_setaffinity" }, /* 395 */
{ 3, 0, sys_sched_getaffinity, "sched_getaffinity" }, /* 396 */
{ 5, 0, printargs, "tuxcall" }, /* 397 */
{ 2, 0, printargs, "io_setup" }, /* 398 */
{ 1, 0, printargs, "io_destroy" }, /* 399 */
{ 5, 0, printargs, "io_getevents" }, /* 400 */
{ 3, 0, printargs, "io_submit" }, /* 401 */
{ 3, 0, printargs, "io_cancel" }, /* 402 */
{ 2, 0, sys_io_setup, "io_setup" }, /* 398 */
{ 1, 0, sys_io_destroy, "io_destroy" }, /* 399 */
{ 5, 0, sys_io_getevents, "io_getevents" }, /* 400 */
{ 3, 0, sys_io_submit, "io_submit" }, /* 401 */
{ 3, 0, sys_io_cancel, "io_cancel" }, /* 402 */
{ 5, 0, printargs, "SYS_403" }, /* 403 */
{ 5, 0, printargs, "SYS_404" }, /* 404 */
{ 1, TP, sys_exit, "exit_group" }, /* 405 */

View File

@ -220,11 +220,11 @@
{ 3, 0, sys_sched_getaffinity, "sched_getaffinity" }, /* 212 */
{ 5, 0, printargs, "set_thread_area" }, /* 213 */
{ 5, 0, printargs, "get_thread_area" }, /* 214 */
{ 2, 0, printargs, "io_setup" }, /* 215 */
{ 1, 0, printargs, "io_destroy" }, /* 216 */
{ 5, 0, printargs, "io_getevents" }, /* 217 */
{ 3, 0, printargs, "io_submit" }, /* 218 */
{ 4, 0, printargs, "io_cancel" }, /* 219 */
{ 2, 0, sys_io_setup, "io_setup" }, /* 215 */
{ 1, 0, sys_io_destroy, "io_destroy" }, /* 216 */
{ 5, 0, sys_io_getevents, "io_getevents" }, /* 217 */
{ 3, 0, sys_io_submit, "io_submit" }, /* 218 */
{ 4, 0, sys_io_cancel, "io_cancel" }, /* 219 */
{ 5, 0, printargs, "alloc_hugepages" }, /* 220 */
{ 1, 0, printargs, "free_hugepages" }, /* 221 */
{ 1, TP, sys_exit, "exit_group" }, /* 222 */

View File

@ -1141,11 +1141,11 @@
{ 3, TS, sys_tgkill, "tgkill" }, /* 1235 */
{ 1, TP, sys_exit, "exit_group" }, /* 1236 */
{ 4, 0, printargs, "lookup_dcookie"}, /* 1237 */
{ 2, 0, printargs, "io_setup" }, /* 1238 */
{ 1, 0, printargs, "io_destroy" }, /* 1239 */
{ 5, 0, printargs, "io_getevents" }, /* 1240 */
{ 3, 0, printargs, "io_submit" }, /* 1241 */
{ 3, 0, printargs, "io_cancel" }, /* 1242 */
{ 2, 0, sys_io_setup, "io_setup" }, /* 1238 */
{ 1, 0, sys_io_destroy, "io_destroy" }, /* 1239 */
{ 5, 0, sys_io_getevents, "io_getevents" }, /* 1240 */
{ 3, 0, sys_io_submit, "io_submit" }, /* 1241 */
{ 3, 0, sys_io_cancel, "io_cancel" }, /* 1242 */
{ 1, 0, sys_epoll_create, "epoll_create" }, /* 1243 */
{ 4, 0, sys_epoll_ctl, "epoll_ctl" }, /* 1244 */
{ 4, 0, sys_epoll_wait, "epoll_wait" }, /* 1245 */

View File

@ -4239,11 +4239,11 @@
{ 6, 0, sys_futex, "futex" }, /* 4238 */
{ 3, 0, sys_sched_setaffinity, "sched_setaffinity"}, /* 4239 */
{ 3, 0, sys_sched_getaffinity, "sched_getaffinity"}, /* 4240 */
{ 2, 0, printargs, "io_setup" }, /* 4241 */
{ 1, 0, printargs, "io_destroy" }, /* 4242 */
{ 5, 0, printargs, "io_getevents" }, /* 4243 */
{ 3, 0, printargs, "io_submit" }, /* 4244 */
{ 3, 0, printargs, "io_cancel" }, /* 4245 */
{ 2, 0, sys_io_setup, "io_setup" }, /* 4241 */
{ 1, 0, sys_io_destroy, "io_destroy" }, /* 4242 */
{ 5, 0, sys_io_getevents, "io_getevents" }, /* 4243 */
{ 3, 0, sys_io_submit, "io_submit" }, /* 4244 */
{ 3, 0, sys_io_cancel, "io_cancel" }, /* 4245 */
{ 1, TP, sys_exit, "exit_group" }, /* 4246 */
{ 3, 0, printargs, "lookup_dcookie"}, /* 4247 */
{ 1, 0, sys_epoll_create, "epoll_create" }, /* 4248 */

View File

@ -256,11 +256,11 @@
{ 5, 0, printargs, "SYS_224" }, /* 224 */
{ 5, 0, printargs, "tux" }, /* 225 */
{ 4, TF, sys_sendfile64, "sendfile64" }, /* 226 */
{ 2, 0, printargs, "io_setup" }, /* 227 */
{ 1, 0, printargs, "io_destroy" }, /* 228 */
{ 5, 0, printargs, "io_getevents" }, /* 229 */
{ 3, 0, printargs, "io_submit" }, /* 230 */
{ 3, 0, printargs, "io_cancel" }, /* 231 */
{ 2, 0, sys_io_setup, "io_setup" }, /* 227 */
{ 1, 0, sys_io_destroy, "io_destroy" }, /* 228 */
{ 5, 0, sys_io_getevents, "io_getevents" }, /* 229 */
{ 3, 0, sys_io_submit, "io_submit" }, /* 230 */
{ 3, 0, sys_io_cancel, "io_cancel" }, /* 231 */
{ 1, 0, printargs, "set_tid_address" }, /* 232 */
{ 6, TF, sys_fadvise64, "fadvise64" }, /* 233 */
{ 1, TP, sys_exit, "exit_group" }, /* 234 */

View File

@ -271,11 +271,11 @@
{ 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 240 */
{ -1, 0, printargs, "SYS_241" }, /* 241 */
{ -1, 0, printargs, "SYS_242" }, /* 242 */
{ 2, 0, printargs, "io_setup" }, /* 243 */
{ 1, 0, printargs, "io_destroy" }, /* 244 */
{ 5, 0, printargs, "io_getevents" }, /* 245 */
{ 3, 0, printargs, "io_submit" }, /* 246 */
{ 3, 0, printargs, "io_cancel" }, /* 247 */
{ 2, 0, sys_io_setup, "io_setup" }, /* 243 */
{ 1, 0, sys_io_destroy, "io_destroy" }, /* 244 */
{ 5, 0, sys_io_getevents, "io_getevents" }, /* 245 */
{ 3, 0, sys_io_submit, "io_submit" }, /* 246 */
{ 3, 0, sys_io_cancel, "io_cancel" }, /* 247 */
{ 1, TP, sys_exit, "exit_group" }, /* 248 */
{ 1, 0, sys_epoll_create, "epoll_create" }, /* 249 */
{ 4, 0, sys_epoll_ctl, "epoll_ctl" }, /* 250 */

View File

@ -270,11 +270,11 @@
{ 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 240 */
{ -1, 0, printargs, "SYS_241" }, /* 241 */
{ -1, 0, printargs, "SYS_242" }, /* 242 */
{ 2, 0, printargs, "io_setup" }, /* 243 */
{ 1, 0, printargs, "io_destroy" }, /* 244 */
{ 5, 0, printargs, "io_getevents" }, /* 245 */
{ 3, 0, printargs, "io_submit" }, /* 246 */
{ 3, 0, printargs, "io_cancel" }, /* 247 */
{ 2, 0, sys_io_setup, "io_setup" }, /* 243 */
{ 1, 0, sys_io_destroy, "io_destroy" }, /* 244 */
{ 5, 0, sys_io_getevents, "io_getevents" }, /* 245 */
{ 3, 0, sys_io_submit, "io_submit" }, /* 246 */
{ 3, 0, sys_io_cancel, "io_cancel" }, /* 247 */
{ 1, TP, sys_exit, "exit_group" }, /* 248 */
{ 1, 0, sys_epoll_create, "epoll_create" }, /* 249 */
{ 4, 0, sys_epoll_ctl, "epoll_ctl" }, /* 250 */

View File

@ -100,6 +100,7 @@ int sys_epoll_create(), sys_epoll_ctl(), sys_epoll_wait();
int sys_waitid(), sys_fadvise64(), sys_fadvise64_64();
int sys_mbind(), sys_get_mempolicy(), sys_set_mempolicy();
int sys_arch_prctl();
int sys_io_setup(), sys_io_submit(), sys_io_cancel(), sys_io_getevents(), sys_io_destroy();
/* sys_socketcall subcalls */

View File

@ -291,11 +291,11 @@
{ 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 242 */
{ 1, 0, sys_set_thread_area, "set_thread_area" }, /* 243 */
{ 1, 0, sys_get_thread_area, "get_thread_area" }, /* 244 */
{ 2, 0, printargs, "io_setup" }, /* 245 */
{ 1, 0, printargs, "io_destroy" }, /* 246 */
{ 5, 0, printargs, "io_getevents" }, /* 247 */
{ 3, 0, printargs, "io_submit" }, /* 248 */
{ 3, 0, printargs, "io_cancel" }, /* 249 */
{ 2, 0, sys_io_setup, "io_setup" }, /* 245 */
{ 1, 0, sys_io_destroy, "io_destroy" }, /* 246 */
{ 5, 0, sys_io_getevents, "io_getevents" }, /* 247 */
{ 3, 0, sys_io_submit, "io_submit" }, /* 248 */
{ 3, 0, sys_io_cancel, "io_cancel" }, /* 249 */
{ 5, TF, sys_fadvise64, "fadvise64" }, /* 250 */
{ 5, 0, printargs, "SYS_251" }, /* 251 */
{ 1, TP, sys_exit, "exit_group" }, /* 252 */

View File

@ -204,11 +204,11 @@
{ 3, 0, sys_sched_setaffinity, "sched_setaffinity" },/* 203 */
{ 3, 0, sys_sched_getaffinity, "sched_getaffinity" },/* 204 */
{ 1, 0, sys_set_thread_area, "set_thread_area" }, /* 205 */
{ 2, 0, printargs, "io_setup" }, /* 206 */
{ 1, 0, printargs, "io_destroy" }, /* 207 */
{ 5, 0, printargs, "io_getevents" }, /* 208 */
{ 3, 0, printargs, "io_submit" }, /* 209 */
{ 3, 0, printargs, "io_cancel" }, /* 210 */
{ 2, 0, sys_io_setup, "io_setup" }, /* 206 */
{ 1, 0, sys_io_destroy, "io_destroy" }, /* 207 */
{ 5, 0, sys_io_getevents, "io_getevents" }, /* 208 */
{ 3, 0, sys_io_submit, "io_submit" }, /* 209 */
{ 3, 0, sys_io_cancel, "io_cancel" }, /* 210 */
{ 1, 0, sys_get_thread_area, "get_thread_area" }, /* 211 */
{ 4, 0, printargs, "lookup_dcookie"}, /* 212 */
{ 1, 0, sys_epoll_create, "epoll_create" }, /* 213 */