From: Roland McGrath Date: Thu, 7 Oct 2004 18:51:19 +0000 (+0000) Subject: 2004-10-07 Roland McGrath X-Git-Tag: v4.5.18~496 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df13e8f4cae0e57786cf5cd9d0304d6f9f2715d5;p=strace 2004-10-07 Roland McGrath * file.c [LINUX && (I386 || X86_64)] (sys_fadvise64, sys_fadvise64_64): New functions. * linux/syscall.h: Declare them. * linux/syscallent.h: Handle fadvise64 and fadvise64_64 using those. From Ulrich Drepper . --- diff --git a/file.c b/file.c index bbbebe8a..4428a5b9 100644 --- a/file.c +++ b/file.c @@ -2472,3 +2472,56 @@ struct tcb *tcp; } return 0; } + + +static const struct xlat advise[] = { + { POSIX_FADV_NORMAL, "POSIX_FADV_NORMAL" }, + { POSIX_FADV_RANDOM, "POSIX_FADV_RANDOM" }, + { POSIX_FADV_SEQUENTIAL, "POSIX_FADV_SEQUENTIAL" }, + { POSIX_FADV_WILLNEED, "POSIX_FADV_WILLNEED" }, + { POSIX_FADV_DONTNEED, "POSIX_FADV_DONTNEED" }, + { POSIX_FADV_NOREUSE, "POSIX_FADV_NOREUSE" }, + { 0, NULL } +}; + + +#if defined LINUX && (defined I386 || defined X86_64) +int +sys_fadvise64(tcp) +struct tcb *tcp; +{ + if (entering(tcp)) { + tprintf("%ld, %lld, %ld, ", + tcp->u_arg[0], +# if defined IA64 || defined X86_64 || defined ALPHA + (long long int) tcp->u_arg[1], tcp->u_arg[2]); + printxval(advise, tcp->u_arg[3], "POSIX_FADV_???"); +#else + ((long long int) tcp->u_arg[2] << 32) | tcp->u_arg[1], + tcp->u_arg[3]); + printxval (advise, tcp->u_arg[4], "POSIX_FADV_???"); +#endif + } + return 0; +} +#endif + + +int +sys_fadvise64_64(tcp) +struct tcb *tcp; +{ + if (entering(tcp)) { + tprintf("%ld, %lld, %lld, ", + tcp->u_arg[0], +# if defined IA64 || defined X86_64 || defined ALPHA + (long long int) tcp->u_arg[1], (long long int) tcp->u_arg[2]); + printxval(advise, tcp->u_arg[3], "POSIX_FADV_???"); +#else + ((long long int) tcp->u_arg[2] << 32) | tcp->u_arg[1], + ((long long int) tcp->u_arg[4] << 32) | tcp->u_arg[3]); + printxval(advise, tcp->u_arg[5], "POSIX_FADV_???"); +#endif + } + return 0; +} diff --git a/linux/syscall.h b/linux/syscall.h index 0afdc700..bcbe8277 100644 --- a/linux/syscall.h +++ b/linux/syscall.h @@ -97,7 +97,7 @@ int sys_semtimedop(), sys_statfs64(), sys_fstatfs64(), sys_tgkill(); int sys_mq_open(), sys_mq_timedsend(), sys_mq_timedreceive(); int sys_mq_notify(), sys_mq_getsetattr(); int sys_epoll_create(), sys_epoll_ctl(), sys_epoll_wait(); -int sys_waitid(); +int sys_waitid(), sys_fadvise64(), sys_fadvise64_64(); /* sys_socketcall subcalls */ diff --git a/linux/syscallent.h b/linux/syscallent.h index 7fcaf6d3..9cceccfa 100644 --- a/linux/syscallent.h +++ b/linux/syscallent.h @@ -296,7 +296,7 @@ { 5, 0, printargs, "io_getevents" }, /* 247 */ { 3, 0, printargs, "io_submit" }, /* 248 */ { 3, 0, printargs, "io_cancel" }, /* 249 */ - { 5, 0, printargs, "SYS_250" }, /* 250 */ + { 5, TF, sys_fadvise64, "fadvise64" }, /* 250 */ { 5, 0, printargs, "SYS_251" }, /* 251 */ { 1, TP, sys_exit, "exit_group" }, /* 252 */ { 4, 0, printargs, "lookup_dcookie"}, /* 253 */ @@ -315,10 +315,10 @@ { 2, 0, sys_clock_getres, "clock_getres" }, /* 266 */ { 4, 0, sys_clock_nanosleep, "clock_nanosleep"}, /* 267 */ { 3, TF, sys_statfs64, "statfs64" }, /* 268 */ - { 3, 0, sys_fstatfs64, "fstatfs64" }, /* 269 */ + { 3, TF, sys_fstatfs64, "fstatfs64" }, /* 269 */ { 3, TS, sys_tgkill, "tgkill" }, /* 270 */ { 2, TF, sys_utimes, "utimes" }, /* 271 */ - { 5, 0, printargs, "SYS_272" }, /* 272 */ + { 6, TF, sys_fadvise64_64, "fadvise64_64" }, /* 272 */ { 5, 0, printargs, "SYS_273" }, /* 273 */ { 5, 0, printargs, "SYS_274" }, /* 274 */ { 5, 0, printargs, "SYS_275" }, /* 275 */