]> granicus.if.org Git - strace/commitdiff
FreeBSD uses 64 bit off_t, fix stat&fcntl(flock)
authorJohn Hughes <john@Calva.COM>
Wed, 7 Mar 2001 16:53:07 +0000 (16:53 +0000)
committerJohn Hughes <john@Calva.COM>
Wed, 7 Mar 2001 16:53:07 +0000 (16:53 +0000)
ChangeLog
desc.c
file.c
freebsd/i386/syscall.h
freebsd/i386/syscallent.h
freebsd/syscalls.print

index 725141e042db5b776bc44dd40e73d69d6256d4fa..9e991879bbe4b0786e2fd21b2eb0f83c9cd66971 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-03-07  John Hughes <john@Calva.COM>
+
+  * desc.c: On FreeBSD flock structure uses 64 bit offsets.
+  * file.c: On FreeBSD use stat64 and pals instead of stat.
+  * freebsd/syscalls.print: use stat64, lstat64 and fstat64.
+  * freebsd/i386/syscall.h: ditto.
+  * freebsd/i386/syscallent.h: ditto.
+
 2001-03-07  John Hughes <john@Calva.COM>
 
   * file.c: merge missing part of Harald Böhme's solaris patches,
diff --git a/desc.c b/desc.c
index e1c43fb1245dcbd1b2c7b1585a95d30b6799ae38..b9d8d3520bd236b8511499ff6324221d7e192d5f 100644 (file)
--- a/desc.c
+++ b/desc.c
 #include <fcntl.h>
 #include <sys/file.h>
 
+#if FREEBSD
+#define flock64        flock           /* Horrid hack */
+#define printflock printflock64        /* Horrider hack */
+#endif
+
+
 static struct xlat fcntlcmds[] = {
        { F_DUPFD,      "F_DUPFD"       },
        { F_GETFD,      "F_GETFD"       },
@@ -172,6 +178,7 @@ static struct xlat whence[] = {
        { 0,            NULL            },
 };
 
+#ifndef FREEBSD
 /* fcntl/lockf */
 static void
 printflock(tcp, addr, getlk)
@@ -195,8 +202,9 @@ int getlk;
        else
                tprintf("}");
 }
+#endif
 
-#if _LFS64_LARGEFILE
+#if _LFS64_LARGEFILE || FREEBSD
 /* fcntl/lockf */
 static void
 printflock64(tcp, addr, getlk)
diff --git a/file.c b/file.c
index f1c8f3ab69a0c97f91f5b57cf9dd445d5a206ac2..ee6bc9e9152540e1d10c8fe96b16527677db6a8a 100644 (file)
--- a/file.c
+++ b/file.c
@@ -130,6 +130,9 @@ struct stat {
 #include <sys/param.h>
 #include <sys/mount.h>
 #include <sys/stat.h>
+
+#define stat64 stat
+#define HAVE_STAT64 1  /* Ugly hack */
 #endif
 
 #ifdef MAJOR_IN_SYSMACROS
@@ -652,6 +655,7 @@ struct tcb *tcp;
 }
 #endif
 
+#ifndef FREEBSD
 static void
 realprintstat(tcp, statbuf)
 struct tcb *tcp;
@@ -695,17 +699,7 @@ struct stat *statbuf;
     if (!abbrev(tcp)) {
            tprintf("st_atime=%s, ", sprinttime(statbuf->st_atime));
            tprintf("st_mtime=%s, ", sprinttime(statbuf->st_mtime));
-#ifndef FREEBSD
            tprintf("st_ctime=%s}", sprinttime(statbuf->st_ctime));
-#else /* FREEBSD */
-           tprintf("st_ctime=%s, ", sprinttime(statbuf->st_ctime));
-           tprintf("st_flags=");
-           if (statbuf->st_flags) {
-                   printflags(fileflags, statbuf->st_flags);
-           } else
-                   tprintf("0");
-           tprintf(", st_gen=%u}", statbuf->st_gen);
-#endif /* FREEBSD */
     }
     else
            tprintf("...}");
@@ -741,6 +735,7 @@ long addr;
 
        realprintstat(tcp, &statbuf);
 }
+#endif /* !FREEBSD */
 
 #ifdef HAVE_STAT64
 static void
@@ -817,7 +812,17 @@ long addr;
        if (!abbrev(tcp)) {
                tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
                tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
+#ifndef FREEBSD
                tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime));
+#else /* FREEBSD */
+               tprintf("st_ctime=%s, ", sprinttime(statbuf.st_ctime));
+               tprintf("st_flags=");
+               if (statbuf.st_flags) {
+                       printflags(fileflags, statbuf.st_flags);
+               } else
+                       tprintf("0");
+               tprintf(", st_gen=%u}", statbuf.st_gen);
+#endif /* FREEBSD */
        }
        else
                tprintf("...}");
@@ -879,7 +884,7 @@ long addr;
 }
 #endif /* linux && !IA64 */
 
-
+#ifndef FREEBSD
 int
 sys_stat(tcp)
 struct tcb *tcp;
@@ -892,6 +897,7 @@ struct tcb *tcp;
        }
        return 0;
 }
+#endif
 
 int
 sys_stat64(tcp)
@@ -927,6 +933,7 @@ struct tcb *tcp;
 # endif /* !IA64 */
 #endif /* linux */
 
+#ifndef FREEBSD
 int
 sys_fstat(tcp)
 struct tcb *tcp;
@@ -938,6 +945,7 @@ struct tcb *tcp;
        }
        return 0;
 }
+#endif
 
 int
 sys_fstat64(tcp)
@@ -971,6 +979,7 @@ struct tcb *tcp;
 # endif /* !IA64 */
 #endif
 
+#ifndef FREEBSD
 int
 sys_lstat(tcp)
 struct tcb *tcp;
@@ -983,6 +992,7 @@ struct tcb *tcp;
        }
        return 0;
 }
+#endif
 
 int
 sys_lstat64(tcp)
index 2d7c50d2e5da55c66ac88df3a3d718af7cf1091c..c09e5a2be47686fe1d7db3ab70e99fccdb1b3155 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Automatically generated by ./../syscalls.pl on Wed Mar  7 12:22:58 2001
+ * Automatically generated by ./../syscalls.pl on Wed Mar  7 17:11:33 2001
  */
 
 #define sys_syscall printargs
@@ -39,9 +39,9 @@ int sys_chflags();
 int sys_fchflags();
 #define sys_sync printargs
 int sys_kill();
-int sys_stat();
+int sys_stat64();
 #define sys_getppid printargs
-int sys_lstat();
+int sys_lstat64();
 int sys_dup();
 int sys_pipe();
 #define sys_getegid printargs
@@ -63,7 +63,7 @@ int sys_readlink();
 int sys_execve();
 int sys_umask();
 int sys_chroot();
-int sys_fstat();
+int sys_fstat64();
 #define sys_getkerninfo printargs
 int sys_getpagesize();
 int sys_msync();
@@ -161,9 +161,9 @@ int sys_pwrite64();
 #define sys_setgid printargs
 #define sys_setegid printargs
 #define sys_seteuid printargs
-int sys_stat();
-int sys_fstat();
-int sys_lstat();
+int sys_stat64();
+int sys_fstat64();
+int sys_lstat64();
 int sys_pathconf();
 int sys_fpathconf();
 int sys_getrlimit();
index f8b1e4e2fa6d41d4f5d30acdcb6004cfc94b75ac..b45ee364922cfce37f2ae3619bc6af70212af527 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Automatically generated by ./../syscalls.pl on Wed Mar  7 12:22:58 2001
+ * Automatically generated by ./../syscalls.pl on Wed Mar  7 17:11:33 2001
  */
 
   { 1, 0,      sys_syscall,    "syscall"       }, /* 0 */
@@ -40,9 +40,9 @@
   { 2, TF,     sys_fchflags,   "fchflags"      }, /* 35 */
   { 1, 0,      sys_sync,       "sync"  }, /* 36 */
   { 2, TS,     sys_kill,       "kill"  }, /* 37 */
-  { 2, TF,     sys_stat,       "stat"  }, /* 38 */
+  { 2, TF,     sys_stat64,     "stat"  }, /* 38 */
   { 1, 0,      sys_getppid,    "getppid"       }, /* 39 */
-  { 2, TF,     sys_lstat,      "lstat" }, /* 40 */
+  { 2, TF,     sys_lstat64,    "lstat" }, /* 40 */
   { 1, 0,      sys_dup,        "dup"   }, /* 41 */
   { 1, 0,      sys_pipe,       "pipe"  }, /* 42 */
   { 1, 0,      sys_getegid,    "getegid"       }, /* 43 */
@@ -64,7 +64,7 @@
   { 3, TF|TP,  sys_execve,     "execve"        }, /* 59 */
   { 1, 0,      sys_umask,      "umask" }, /* 60 */
   { 1, TF,     sys_chroot,     "chroot"        }, /* 61 */
-  { 2, TF,     sys_fstat,      "fstat" }, /* 62 */
+  { 2, TF,     sys_fstat64,    "fstat" }, /* 62 */
   { 4, 0,      sys_getkerninfo,        "getkerninfo"   }, /* 63 */
   { 1, 0,      sys_getpagesize,        "getpagesize"   }, /* 64 */
   { 3, 0,      sys_msync,      "msync" }, /* 65 */
   { -1,        0,      printargs,      "SYS_185"       }, /* 185 */
   { -1,        0,      printargs,      "SYS_186"       }, /* 186 */
   { -1,        0,      printargs,      "SYS_187"       }, /* 187 */
-  { 2, TF,     sys_stat,       "stat"  }, /* 188 */
-  { 2, TF,     sys_fstat,      "fstat" }, /* 189 */
-  { 2, TF,     sys_lstat,      "lstat" }, /* 190 */
+  { 2, TF,     sys_stat64,     "stat"  }, /* 188 */
+  { 2, TF,     sys_fstat64,    "fstat" }, /* 189 */
+  { 2, TF,     sys_lstat64,    "lstat" }, /* 190 */
   { 2, TF,     sys_pathconf,   "pathconf"      }, /* 191 */
   { 2, 0,      sys_fpathconf,  "fpathconf"     }, /* 192 */
   { -1,        0,      printargs,      "SYS_193"       }, /* 193 */
index 3461f4371e1b842b2e761d28f428c8324b87d209..fe0336d7cb225cd38aba72e430c54e2dd1c0e53b 100644 (file)
@@ -64,7 +64,7 @@ fcntl
 flock
 fork
 fpathconf
-fstat
+fstat          sys_fstat64
 fstatfs
 fsync
 ftruncate      sys_ftruncate64
@@ -97,7 +97,7 @@ killpg
 link
 listen
 lseek          sys_lseek64
-lstat
+lstat          sys_lstat64
 mincore
 mkdir
 mkfifo
@@ -171,7 +171,7 @@ sigsuspend
 sigvec
 socket
 socketpair
-stat
+stat           sys_stat64
 statfs
 stime
 symlink