From: John Hughes Date: Tue, 6 Mar 2001 16:50:41 +0000 (+0000) Subject: Implement truncate64 & ftruncate64 for them that wants 'em X-Git-Tag: v4.5.18~1094 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96f5147037554b188575d215d840f594a457afa9;p=strace Implement truncate64 & ftruncate64 for them that wants 'em --- diff --git a/file.c b/file.c index 3ec97e31..090d78d0 100644 --- a/file.c +++ b/file.c @@ -411,7 +411,7 @@ struct tcb *tcp; } #endif -#if _LFS_LARGEFILE +#if _LFS64_LARGEFILE int sys_lseek64 (tcp) struct tcb *tcp; @@ -443,6 +443,19 @@ struct tcb *tcp; return 0; } +#if _LFS64_LARGEFILE +int +sys_truncate64(tcp) +struct tcb *tcp; +{ + if (entering(tcp)) { + printpath(tcp, tcp->u_arg[0]); + tprintf(", %llu", get64(tcp->u_arg[1],tcp->u_arg[2])); + } + return 0; +} +#endif + int sys_ftruncate(tcp) struct tcb *tcp; @@ -458,6 +471,19 @@ struct tcb *tcp; return 0; } +#if _LFS64_LARGEFILE +int +sys_ftruncate64(tcp) +struct tcb *tcp; +{ + if (entering(tcp)) { + tprintf("%ld, %llu", tcp->u_arg[0], + get64(tcp->u_arg[1] ,tcp->u_arg[2])); + } + return 0; +} +#endif + /* several stats */ static struct xlat modetypes[] = { diff --git a/svr4/dummy.h b/svr4/dummy.h index 86fed562..73c4cce3 100644 --- a/svr4/dummy.h +++ b/svr4/dummy.h @@ -271,13 +271,13 @@ #define sys_getrlimit64 printargs #define sys_pread64 printargs #define sys_pwrite64 printargs +#define sys_ftruncate64 printargs +#define sys_truncate64 printargs #endif /* unimplemented 64-bit stuff */ #define sys_statvfs64 printargs #define sys_fstatvfs64 printargs -#define sys_ftruncate64 printargs -#define sys_truncate64 printargs /* like another call */ #define sys_creat64 sys_creat diff --git a/svr4/syscall.h b/svr4/syscall.h index f0c5d9c6..21cf8d31 100644 --- a/svr4/syscall.h +++ b/svr4/syscall.h @@ -311,6 +311,8 @@ extern int sys_getksym (); #endif #if UNIXWARE >= 7 extern int sys_lseek64 (); +extern int sys_truncate64 (); +extern int sys_ftruncate64 (); extern int sys_xsocket (); extern int sys_xsocketpair (); extern int sys_xbind ();