1 /* libc/sys/linux/io64.c - large file input/output system calls */
3 /* Copyright 2002, Red Hat Inc. */
6 #define __KERNEL_PROTOTYPES
11 #include <sys/types.h>
14 #include <sys/ioctl.h>
15 #include <machine/syscall.h>
17 #define __NR___truncate64 __NR_truncate64
18 #define __NR___ftruncate64 __NR_ftruncate64
20 _syscall2(int,fstat64,int,fd,struct stat64 *,st)
21 _syscall2(int,lstat64,const char *,name,struct stat64 *,st)
22 _syscall2(int,stat64,const char *,name,struct stat64 *,st)
24 static _syscall3(int,__truncate64,const char *,name,int,high,int,low)
26 int __libc_truncate64(const char *name, off64_t length)
28 return __truncate64(name,(length >> 32), (length & 0xffffffff));
30 weak_alias(__libc_truncate64,truncate64)
32 static _syscall3(int,__ftruncate64,int,fd,int,high,int,low);
34 int __libc_ftruncate64(int fd, off64_t length)
36 return __ftruncate64(fd,(length >> 32),(length & 0xffffffff));
38 weak_alias(__libc_ftruncate64,ftruncate64)
40 static _syscall5(void,_llseek,int,fd,off_t,hi,off_t,lo,loff_t *,pos,int,whence)
42 loff_t __libc_lseek64(int fd, loff_t offset, int whence)
45 __libc__llseek(fd, offset >> 32, offset & 0xffffffff, &pos, whence);
48 weak_alias(__libc_lseek64,lseek64);
49 weak_alias(__libc_lseek64,_lseek64);
51 int __libc_open64(const char *path, int oflag, ...)
57 va_start(list, oflag);
58 mode = va_arg(list, int);
61 return __libc_open(path, oflag | O_LARGEFILE, mode);
63 weak_alias(__libc_open64,open64);
64 weak_alias(__libc_open64,_open64);
65 weak_alias(__libc_open64,__open64);
66 weak_alias(__libc_fstat64,_fstat64);
67 weak_alias(__libc_stat64,_stat64);