mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-15 02:09:19 +08:00
fa4a16a17a
* configure.host: Add support for machine subdirectory of sys subdirectory. * configure.in: Add check for sys machine subdirectory. * Makefile.am: Ditto. * configure: Regenerated. * Makefile.in: Ditto. * libc/sys/linux/crt0.c: Moved to machine/i386 directory. * libc/sys/linux/sys/syscall.h: Ditto. * libc/sys/linux/sleep.c: New file. * libc/sys/linux/socket.c: Ditto. * libc/sys/linux/sockops.h: Ditto. * libc/sys/linux/stack.c: Ditto. * libc/sys/linux/usleep.c: Ditto. * libc/sys/linux/machine/Makefile.am: Ditto. * libc/sys/linux/machine/Makefile.in: Ditto. * libc/sys/linux/machine/aclocal.m4: Ditto. * libc/sys/linux/machine/configure: Ditto. * libc/sys/linux/machine/configure.in: Ditto. * libc/sys/linux/machine/i386/Makefile.am: Ditto. * libc/sys/linux/machine/i386/Makefile.in: Ditto. * libc/sys/linux/machine/i386/aclocal.m4: Ditto. * libc/sys/linux/machine/i386/configure: Ditto. * libc/sys/linux/machine/i386/configure.in: Ditto. * libc/sys/linux/machine/i386/crt0.c: Ditto. * libc/sys/linux/machine/i386/sigset.c: Ditto. * libc/sys/linux/machine/i386/sigstack.h: Ditto. * libc/sys/linux/machine/i386/socketcall.h: Ditto. * libc/sys/linux/machine/i386/syscall.h: Ditto. * libc/sys/linux/sys/select.h: Ditto. * libc/sys/linux/configure.in: Add support for machine directory. * libc/sys/linux/Makefile.am: Ditto plus add new files above. * libc/sys/linux/Makefile.in: Regenerated. * libc/sys/linux/configure: Ditto. * libc/sys/linux/brk.c: Use machine/syscall.h instead of sys/syscall.h. * libc/sys/linux/inode.c: Ditto. * libc/sys/linux/linux.c: Ditto. * libc/sys/linux/process.c: Ditto. * libc/sys/linux/systat.c: Ditto. * libc/sys/linux/time.c: Ditto. * libc/sys/linux/wait.c: Ditto. * libc/sys/linux/ids.c: Change header plus add setfsgid/setfsuid. * libc/sys/linux/io.c: Change header plus add readv/writev. * libc/sys/linux/signal.c: Change header plus change sigsuspend to use __sigsuspend syscall. * libc/sys/linux/select.c: Change header plus change select to use _newselect syscall. * libc/sys/linux/sys/cdefs.h: Add a number of standard definitions used by glibc header files. * libc/sys/linux/sys/types.h: Add __socklen_t and __useconds_t types.
58 lines
1.3 KiB
C
58 lines
1.3 KiB
C
/* libc/sys/linux/io.c - Basic input/output system calls */
|
|
|
|
/* Written 2000 by Werner Almesberger */
|
|
|
|
|
|
#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>
|
|
|
|
|
|
#define __NR___ioctl __NR_ioctl
|
|
#define __NR___flock __NR_flock
|
|
|
|
_syscall3(int,read,int,fd,void *,buf,size_t,count)
|
|
_syscall3(ssize_t,readv,int,fd,const struct iovec *,vec,int,count)
|
|
_syscall3(int,write,int,fd,const void *,buf,size_t,count)
|
|
_syscall3(ssize_t,writev,int,fd,const struct iovec *,buf,int,count)
|
|
_syscall3(int,open,const char *,file,int,flag,mode_t,mode)
|
|
_syscall1(int,close,int,fd)
|
|
_syscall3(off_t,lseek,int,fd,off_t,offset,int,count)
|
|
_syscall0(int,sync)
|
|
_syscall1(int,dup,int,fd)
|
|
_syscall2(int,dup2,int,oldfd,int,newfd)
|
|
_syscall3(int,fcntl,int,fd,int,cmd,long,arg)
|
|
|
|
|
|
static _syscall3(int,__ioctl,int,fd,int,request,void *,arg)
|
|
|
|
|
|
int ioctl(int fd,int request,...)
|
|
{
|
|
va_list ap;
|
|
int res;
|
|
|
|
va_start(ap,request);
|
|
res = __ioctl(fd,request,va_arg(ap,void *));
|
|
va_end(ap);
|
|
return res;
|
|
}
|
|
|
|
|
|
/* Why are all the types gratuituously different ? */
|
|
|
|
static _syscall2(long,__flock,unsigned int,fd,unsigned int,cmd)
|
|
|
|
|
|
int flock(int fd,int operation)
|
|
{
|
|
return __flock(fd,operation);
|
|
}
|