]> git.pld-linux.org Git - packages/strace.git/blame - strace-getdents64.patch
missing patches from RH
[packages/strace.git] / strace-getdents64.patch
CommitLineData
de4e0a62
JR
1--- strace-4.2/linux/alpha/syscallent.h.jj Sat Aug 19 16:51:50 2000
2+++ strace-4.2/linux/alpha/syscallent.h Sat Aug 19 16:53:00 2000
3@@ -406,3 +406,4 @@
4 { 2, TF, sys_pivot_root, "pivot_root" }, /* 374 */
5 { 3, 0, sys_mincore, "mincore" }, /* 375 */
6 { 3, 0, printargs, "pciconfig_iobase"}, /* 376 */
7+ { 3, 0, sys_getdents64, "getdents64" }, /* 377 */
8--- strace-4.2/linux/sparc/syscall.h.jj Sat Aug 19 16:51:50 2000
9+++ strace-4.2/linux/sparc/syscall.h Sat Aug 19 16:56:43 2000
10@@ -87,7 +87,7 @@ int sys_aioread(), sys_aiowrite(), sys_a
11 /* 2.2 file system */
12 int sys_chdir(),sys_chroot();
13 int sys_fchdir(),sys_fchroot();
14-int sys_mkdir(),sys_rmdir(),sys_getdirentries(), sys_getdents(),sys_readdir();
15+int sys_mkdir(),sys_rmdir(),sys_getdirentries(), sys_getdents(),sys_getdents64(),sys_readdir();
16 int sys_creat(),sys_open(),sys_mknod(),sys_unlink(),sys_stat(),sys_fstat(),sys_lstat();
17 int sys_chown(),sys_fchown(),sys_chmod(),sys_fchmod(),sys_utimes();
18 int sys_link(),sys_symlink(),sys_readlink(),sys_rename();
19--- strace-4.2/linux/sparc/syscallent.h.jj Sat Aug 19 16:51:50 2000
20+++ strace-4.2/linux/sparc/syscallent.h Sat Aug 19 16:58:29 2000
21@@ -152,8 +152,8 @@
22 { 4, TN, sys_getmsg, "getmsg" }, /* 151 */
23 { 4, TN, sys_putmsg, "putmsg" }, /* 152 */
24 { 3, 0, sys_poll, "poll" }, /* 153 */
25- { 0, 0, printargs, "SYS_154" }, /* 154 */
26- { 1, 0, printargs, "nfssvc" }, /* 155 */
27+ { 3, 0, sys_getdents64, "getdents64" }, /* 154 */
28+ { 3, 0, sys_fcntl, "fcntl64" }, /* 155 */
29 { 4, 0, printargs, "getdirentries" }, /* 156 */
30 { 2, TF, sys_statfs, "statfs" }, /* 157 */
31 { 2, 0, sys_fstatfs, "fstatfs" }, /* 158 */
32--- strace-4.2/linux/ia64/syscallent.h.jj Sat Aug 19 02:31:27 2000
33+++ strace-4.2/linux/ia64/syscallent.h Sat Aug 19 16:54:25 2000
34@@ -1243,7 +1243,7 @@
35 { 8, 0, printargs, "SYS_1211" }, /* 1211 */
36 { 8, 0, printargs, "SYS_1212" }, /* 1212 */
37 { 8, 0, printargs, "SYS_1213" }, /* 1213 */
38- { 8, 0, printargs, "SYS_1214" }, /* 1214 */
39+ { 3, 0, sys_getdents64, "getdents64" }, /* 1214 */
40 { 8, 0, printargs, "SYS_1215" }, /* 1215 */
41 { 8, 0, printargs, "SYS_1216" }, /* 1216 */
42 { 8, 0, printargs, "SYS_1217" }, /* 1217 */
43--- strace-4.2/linux/syscall.h.jj Sat Aug 19 16:51:50 2000
44+++ strace-4.2/linux/syscall.h Sat Aug 19 16:52:00 2000
45@@ -69,7 +69,7 @@ int sys_delete_module(), sys_get_kernel_
46 int sys_getpgid(), sys_fchdir(), sys_bdflush();
47 int sys_sysfs(), sys_personality(), sys_afs_syscall();
48 int sys_setfsuid(), sys_setfsgid(), sys_llseek();
49-int sys_getdents(), sys_flock(), sys_msync();
50+int sys_getdents(), sys_getdents64(), sys_flock(), sys_msync();
51 int sys_readv(), sys_writev(), sys_select();
52 int sys_getsid(), sys_fdatasync(), sys_sysctl();
53 int sys_mlock(), sys_munlock(), sys_mlockall(), sys_munlockall();
54--- strace-4.2/linux/syscallent.h.jj Sat Aug 19 16:51:50 2000
55+++ strace-4.2/linux/syscallent.h Sat Aug 19 16:56:16 2000
56@@ -266,8 +266,8 @@
57 { 3, 0, sys_mincore, "mincore" }, /* 218 */
58 { 3, 0, sys_madvise, "madvise" }, /* 219 */
59
60- { 5, 0, printargs, "SYS_220" }, /* 220 */
61- { 5, 0, printargs, "SYS_221" }, /* 221 */
62+ { 3, 0, sys_getdents64, "getdents64" }, /* 220 */
63+ { 3, 0, sys_fcntl, "fcntl64" }, /* 221 */
64 { 5, 0, printargs, "SYS_222" }, /* 222 */
65 { 5, 0, printargs, "SYS_223" }, /* 223 */
66 { 5, 0, printargs, "SYS_224" }, /* 224 */
67--- strace-4.2/file.c.jj Sat Aug 19 16:51:50 2000
68+++ strace-4.2/file.c Sat Aug 19 16:52:00 2000
69@@ -35,11 +35,14 @@
70 #include <dirent.h>
71 #ifdef linux
72 #define dirent kernel_dirent
73+#define dirent64 kernel_dirent64
74 #include <linux/types.h>
75 #include <linux/dirent.h>
76 #undef dirent
77+#undef dirent64
78 #else
79 #define kernel_dirent dirent
80+#define kernel_dirent64 dirent64
81 #endif
82
83 #ifdef linux
84@@ -1622,6 +1625,53 @@ struct tcb *tcp;
85 }
86
87 #ifdef linux
88+
89+int
90+sys_getdents64(tcp)
91+struct tcb *tcp;
92+{
93+ int i, len, dents = 0;
94+ char *buf;
95+
96+ if (entering(tcp)) {
97+ tprintf("%lu, ", tcp->u_arg[0]);
98+ return 0;
99+ }
100+ if (syserror(tcp) || !verbose(tcp)) {
101+ tprintf("%#lx, %lu", tcp->u_arg[1], tcp->u_arg[2]);
102+ return 0;
103+ }
104+ len = tcp->u_rval;
105+ if ((buf = malloc(len)) == NULL) {
106+ tprintf("out of memory\n");
107+ return 0;
108+ }
109+ if (umoven(tcp, tcp->u_arg[1], len, buf) < 0) {
110+ tprintf("{...}, %lu", tcp->u_arg[2]);
111+ free(buf);
112+ return 0;
113+ }
114+ if (!abbrev(tcp))
115+ tprintf("{");
116+ for (i = 0; i < len;) {
117+ struct kernel_dirent64 *d = (struct kernel_dirent64 *) &buf[i];
118+ if (!abbrev(tcp)) {
119+ tprintf("%s{d_ino=%llu, d_off=%llu, ",
120+ i ? " " : "", d->d_ino, d->d_off);
121+ tprintf("d_reclen=%u, d_type=%u, d_name=\"%s\"}",
122+ d->d_reclen, d->d_type, d->d_name);
123+ }
124+ i += d->d_reclen;
125+ dents++;
126+ }
127+ if (!abbrev(tcp))
128+ tprintf("}");
129+ else
130+ tprintf("/* %u entries */", dents);
131+ tprintf(", %lu", tcp->u_arg[2]);
132+ free(buf);
133+ return 0;
134+}
135
136 int
137 sys_getcwd(tcp)
138--- strace-4.2/desc.c.jj Sat Aug 19 02:31:27 2000
139+++ strace-4.2/desc.c Sat Aug 19 16:52:00 2000
140@@ -58,6 +58,11 @@ static struct xlat fcntlcmds[] = {
141 #ifdef F_CNVT
142 { F_CNVT, "F_CNVT" },
143 #endif
144+#if defined(F_GETLK64) && F_GETLK64 != F_GETLK
145+ { F_GETLK64, "F_GETLK64" },
146+ { F_SETLK64, "F_SETLK64" },
147+ { F_SETLKW64, "F_SETLKW64" },
148+#endif
149 { 0, NULL },
150 };
151
152@@ -124,6 +129,31 @@ int getlk;
153 tprintf("}");
154 }
155
156+#if defined(F_GETLK64) && F_GETLK64 != F_GETLK
157+static void
158+printflock64(tcp, addr, getlk)
159+struct tcb *tcp;
160+long addr;
161+int getlk;
162+{
163+ struct flock64 fl;
164+
165+ if (umove(tcp, addr, &fl) < 0) {
166+ tprintf("{...}");
167+ return;
168+ }
169+ tprintf("{type=");
170+ printxval(lockfcmds, fl.l_type, "F_???");
171+ tprintf(", whence=");
172+ printxval(whence, fl.l_whence, "SEEK_???");
173+ tprintf(", start=%lld, len=%lld", fl.l_start, fl.l_len);
174+ if (getlk)
175+ tprintf(", pid=%lu}", (unsigned long) fl.l_pid);
176+ else
177+ tprintf("}");
178+}
179+#endif
180+
181 static char *
182 sprintflags(xlat, flags)
183 struct xlat *xlat;
184@@ -175,6 +205,12 @@ struct tcb *tcp;
185 tprintf(", ");
186 printflock(tcp, tcp->u_arg[2], 0);
187 break;
188+#if defined(F_GETLK64) && F_GETLK64 != F_GETLK
189+ case F_SETLK64: case F_SETLKW64:
190+ tprintf(", ");
191+ printflock64(tcp, tcp->u_arg[2], 0);
192+#endif
193+ break;
194 }
195 }
196 else {
197@@ -196,6 +232,12 @@ struct tcb *tcp;
198 tprintf(", ");
199 printflock(tcp, tcp->u_arg[2], 1);
200 break;
201+#if defined(F_GETLK64) && F_GETLK64 != F_GETLK
202+ case F_GETLK64:
203+ tprintf(", ");
204+ printflock64(tcp, tcp->u_arg[2], 1);
205+ break;
206+#endif
207 default:
208 tprintf(", %#lx", tcp->u_arg[2]);
209 break;
This page took 0.068339 seconds and 4 git commands to generate.