Implement truncate64 & ftruncate64 for them that wants 'em

This commit is contained in:
John Hughes 2001-03-06 16:50:41 +00:00
parent 3deafe2865
commit 96f5147037
3 changed files with 31 additions and 3 deletions

28
file.c
View File

@ -411,7 +411,7 @@ struct tcb *tcp;
} }
#endif #endif
#if _LFS_LARGEFILE #if _LFS64_LARGEFILE
int int
sys_lseek64 (tcp) sys_lseek64 (tcp)
struct tcb *tcp; struct tcb *tcp;
@ -443,6 +443,19 @@ struct tcb *tcp;
return 0; 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 int
sys_ftruncate(tcp) sys_ftruncate(tcp)
struct tcb *tcp; struct tcb *tcp;
@ -458,6 +471,19 @@ struct tcb *tcp;
return 0; 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 */ /* several stats */
static struct xlat modetypes[] = { static struct xlat modetypes[] = {

View File

@ -271,13 +271,13 @@
#define sys_getrlimit64 printargs #define sys_getrlimit64 printargs
#define sys_pread64 printargs #define sys_pread64 printargs
#define sys_pwrite64 printargs #define sys_pwrite64 printargs
#define sys_ftruncate64 printargs
#define sys_truncate64 printargs
#endif #endif
/* unimplemented 64-bit stuff */ /* unimplemented 64-bit stuff */
#define sys_statvfs64 printargs #define sys_statvfs64 printargs
#define sys_fstatvfs64 printargs #define sys_fstatvfs64 printargs
#define sys_ftruncate64 printargs
#define sys_truncate64 printargs
/* like another call */ /* like another call */
#define sys_creat64 sys_creat #define sys_creat64 sys_creat

View File

@ -311,6 +311,8 @@ extern int sys_getksym ();
#endif #endif
#if UNIXWARE >= 7 #if UNIXWARE >= 7
extern int sys_lseek64 (); extern int sys_lseek64 ();
extern int sys_truncate64 ();
extern int sys_ftruncate64 ();
extern int sys_xsocket (); extern int sys_xsocket ();
extern int sys_xsocketpair (); extern int sys_xsocketpair ();
extern int sys_xbind (); extern int sys_xbind ();