]> granicus.if.org Git - strace/commitdiff
2004-10-07 Roland McGrath <roland@redhat.com>
authorRoland McGrath <roland@redhat.com>
Thu, 7 Oct 2004 18:51:19 +0000 (18:51 +0000)
committerRoland McGrath <roland@redhat.com>
Thu, 7 Oct 2004 18:51:19 +0000 (18:51 +0000)
* 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>.

file.c
linux/syscall.h
linux/syscallent.h

diff --git a/file.c b/file.c
index bbbebe8ac658fea5afedf13d9e421de05d15dea4..4428a5b98f87401ebea24f26789b439d1c81654a 100644 (file)
--- 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;
+}
index 0afdc70049803b74bfb238d38af2bbeb792321d0..bcbe8277af3ef0cdc48262e71d32168fe0d6cec5 100644 (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 */
 
index 7fcaf6d3ba11065689331804d0ec5a8afe3e3118..9cceccfaf1c39f0349a423d4f1eca560f76b8e88 100644 (file)
        { 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 */
        { 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 */