2002-04-27 07:21:29 +08:00
|
|
|
/* libc/sys/linux/io64.c - large file input/output system calls */
|
|
|
|
|
|
|
|
/* Copyright 2002, Red Hat Inc. */
|
|
|
|
|
|
|
|
|
|
|
|
#define __KERNEL_PROTOTYPES
|
|
|
|
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/uio.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/ioctl.h>
|
|
|
|
#include <machine/syscall.h>
|
|
|
|
|
2002-04-30 06:33:10 +08:00
|
|
|
_syscall2(int,fstat64,int,fd,struct stat64 *,st)
|
|
|
|
_syscall2(int,lstat64,const char *,name,struct stat64 *,st)
|
2002-04-27 07:21:29 +08:00
|
|
|
_syscall2(int,stat64,const char *,name,struct stat64 *,st)
|
|
|
|
|
|
|
|
static _syscall5(void,_llseek,int,fd,off_t,hi,off_t,lo,loff_t *,pos,int,whence)
|
|
|
|
|
|
|
|
loff_t lseek64(int fd, loff_t offset, int whence)
|
|
|
|
{
|
|
|
|
loff_t pos;
|
|
|
|
_llseek(fd, offset >> 32, offset & 0xffffffff, &pos, whence);
|
|
|
|
return pos;
|
|
|
|
}
|
|
|
|
|
|
|
|
int open64(const char *path, int oflag, ...)
|
|
|
|
{
|
|
|
|
mode_t mode = 0;
|
|
|
|
if (oflag & O_CREAT)
|
|
|
|
{
|
|
|
|
va_list list;
|
|
|
|
va_start(list, oflag);
|
|
|
|
mode = va_arg(list, int);
|
|
|
|
va_end(list);
|
|
|
|
}
|
|
|
|
return open(path, oflag | O_LARGEFILE, mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
|