From: John Hughes Date: Wed, 7 Mar 2001 16:53:07 +0000 (+0000) Subject: FreeBSD uses 64 bit off_t, fix stat&fcntl(flock) X-Git-Tag: v4.5.18~1082 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8c9f77c6d2d9350d26705ff6b200e54d1ca66cc;p=strace FreeBSD uses 64 bit off_t, fix stat&fcntl(flock) --- diff --git a/ChangeLog b/ChangeLog index 725141e0..9e991879 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-03-07 John Hughes + + * 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 * file.c: merge missing part of Harald Böhme's solaris patches, diff --git a/desc.c b/desc.c index e1c43fb1..b9d8d352 100644 --- a/desc.c +++ b/desc.c @@ -35,6 +35,12 @@ #include #include +#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 f1c8f3ab..ee6bc9e9 100644 --- a/file.c +++ b/file.c @@ -130,6 +130,9 @@ struct stat { #include #include #include + +#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) diff --git a/freebsd/i386/syscall.h b/freebsd/i386/syscall.h index 2d7c50d2..c09e5a2b 100644 --- a/freebsd/i386/syscall.h +++ b/freebsd/i386/syscall.h @@ -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(); diff --git a/freebsd/i386/syscallent.h b/freebsd/i386/syscallent.h index f8b1e4e2..b45ee364 100644 --- a/freebsd/i386/syscallent.h +++ b/freebsd/i386/syscallent.h @@ -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 */ @@ -190,9 +190,9 @@ { -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 */ diff --git a/freebsd/syscalls.print b/freebsd/syscalls.print index 3461f437..fe0336d7 100644 --- a/freebsd/syscalls.print +++ b/freebsd/syscalls.print @@ -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