2004-10-07 Roland McGrath <roland@redhat.com>

* 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 <drepper@redhat.com>.
This commit is contained in:
Roland McGrath 2004-10-07 18:51:19 +00:00
parent 2af128bcd2
commit df13e8f4ca
3 changed files with 57 additions and 4 deletions

53
file.c
View File

@ -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;
}

View File

@ -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 */

View File

@ -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 */