OSDN Git Service

2002-04-26 Jeff Johnston <jjohnstn@redhat.com>
authorjjohnstn <jjohnstn>
Fri, 26 Apr 2002 23:21:28 +0000 (23:21 +0000)
committerjjohnstn <jjohnstn>
Fri, 26 Apr 2002 23:21:28 +0000 (23:21 +0000)
        *  libc/sys/linux/Makefile.am: Add io64.c.
        *  libc/sys/linux/Makefile.in: Regenerated.
        *  libc/sys/linux/io.c(mkfifo, fsync, fdatasync): Added syscalls.
        *  libc/sys/linux/signal.c (sigwaitinfo, sigtimedwait): Ditto.
        *  libc/sys/linux/io64.c: New file.

newlib/ChangeLog
newlib/libc/sys/linux/Makefile.am
newlib/libc/sys/linux/Makefile.in
newlib/libc/sys/linux/io.c
newlib/libc/sys/linux/io64.c [new file with mode: 0644]
newlib/libc/sys/linux/signal.c

index 689e326..37a7a11 100644 (file)
@@ -1,5 +1,13 @@
 2002-04-26  Jeff Johnston  <jjohnstn@redhat.com>
 
+       *  libc/sys/linux/Makefile.am: Add io64.c.
+       *  libc/sys/linux/Makefile.in: Regenerated.
+       *  libc/sys/linux/io.c(mkfifo, fsync, fdatasync): Added syscalls.
+       *  libc/sys/linux/signal.c (sigwaitinfo, sigtimedwait): Ditto. 
+       *  libc/sys/linux/io64.c: New file.
+
+2002-04-26  Jeff Johnston  <jjohnstn@redhat.com>
+
        * configure.in (CC_FOR_NEWLIB): New variable that
        bases on $(CC) and adds targ-include and libc/include as
        -isystem directives if they are not already part of $(CC).
index fec5592..6b919da 100644 (file)
@@ -8,7 +8,7 @@ SUBDIRS = machine .
 SUBLIBS = $(LINUX_MACH_LIB)
 
 LIB_SOURCES = \
-       brk.c getoptlong.c ids.c inode.c io.c linux.c mmap.c \
+       brk.c getoptlong.c ids.c inode.c io.c io64.c linux.c mmap.c \
        process.c realpath.c sched.c \
        select.c signal.c siglongjmp.c socket.c sleep.c stack.c \
        sysconf.c systat.c termios.c time.c \
index f13defa..e4f840b 100644 (file)
@@ -97,7 +97,7 @@ SUBDIRS = machine .
 SUBLIBS = $(LINUX_MACH_LIB)
 
 LIB_SOURCES = \
-       brk.c getoptlong.c ids.c inode.c io.c linux.c mmap.c \
+       brk.c getoptlong.c ids.c inode.c io.c io64.c linux.c mmap.c \
        process.c realpath.c sched.c \
        select.c signal.c siglongjmp.c socket.c sleep.c stack.c \
        sysconf.c systat.c termios.c time.c \
@@ -132,15 +132,15 @@ DEFS = @DEFS@ -I. -I$(srcdir)
 CPPFLAGS = @CPPFLAGS@
 LIBS = @LIBS@
 @USE_LIBTOOL_FALSE@lib_a_OBJECTS =  brk.o getoptlong.o ids.o inode.o \
-@USE_LIBTOOL_FALSE@io.o linux.o mmap.o process.o realpath.o sched.o \
-@USE_LIBTOOL_FALSE@select.o signal.o siglongjmp.o socket.o sleep.o \
-@USE_LIBTOOL_FALSE@stack.o sysconf.o systat.o termios.o time.o usleep.o \
-@USE_LIBTOOL_FALSE@wait.o
+@USE_LIBTOOL_FALSE@io.o io64.o linux.o mmap.o process.o realpath.o \
+@USE_LIBTOOL_FALSE@sched.o select.o signal.o siglongjmp.o socket.o \
+@USE_LIBTOOL_FALSE@sleep.o stack.o sysconf.o systat.o termios.o time.o \
+@USE_LIBTOOL_FALSE@usleep.o wait.o
 LTLIBRARIES =  $(noinst_LTLIBRARIES)
 
 @USE_LIBTOOL_TRUE@liblinux_la_DEPENDENCIES = 
 @USE_LIBTOOL_TRUE@liblinux_la_OBJECTS =  brk.lo getoptlong.lo ids.lo \
-@USE_LIBTOOL_TRUE@inode.lo io.lo linux.lo mmap.lo process.lo \
+@USE_LIBTOOL_TRUE@inode.lo io.lo io64.lo linux.lo mmap.lo process.lo \
 @USE_LIBTOOL_TRUE@realpath.lo sched.lo select.lo signal.lo \
 @USE_LIBTOOL_TRUE@siglongjmp.lo socket.lo sleep.lo stack.lo sysconf.lo \
 @USE_LIBTOOL_TRUE@systat.lo termios.lo time.lo usleep.lo wait.lo
index 9b39e12..31b9da7 100644 (file)
@@ -17,6 +17,7 @@
 
 #define __NR___ioctl __NR_ioctl
 #define __NR___flock __NR_flock
+#define __NR___mknod __NR_mknod
 
 _syscall3(int,read,int,fd,void *,buf,size_t,count)
 _syscall3(ssize_t,readv,int,fd,const struct iovec *,vec,int,count)
@@ -29,10 +30,12 @@ _syscall0(int,sync)
 _syscall1(int,dup,int,fd)
 _syscall2(int,dup2,int,oldfd,int,newfd)
 _syscall3(int,fcntl,int,fd,int,cmd,long,arg)
+_syscall1(int,fdatasync,int,fd)
+_syscall1(int,fsync,int,fd)
 
-
+static _syscall2(long,__flock,unsigned int,fd,unsigned int,cmd)
 static _syscall3(int,__ioctl,int,fd,int,request,void *,arg)
-
+static _syscall3(int,__mknod,const char *,path,mode_t,mode,dev_t *,dev)
 
 int ioctl(int fd,int request,...)
 {
@@ -45,13 +48,14 @@ int ioctl(int fd,int request,...)
     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);
 }
+
+int mkfifo(const char *path, mode_t mode)
+{
+   dev_t dev = 0;
+   return __mknod(path, mode | S_IFIFO, &dev);
+}
+
diff --git a/newlib/libc/sys/linux/io64.c b/newlib/libc/sys/linux/io64.c
new file mode 100644 (file)
index 0000000..c18854b
--- /dev/null
@@ -0,0 +1,41 @@
+/* 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>
+
+_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);
+}
+
+
index 813b9d9..7b8f0f4 100644 (file)
@@ -12,6 +12,7 @@
 #define __NR___sgetmask __NR_sgetmask
 #define __NR___ssetmask __NR_ssetmask
 #define __NR___sigsuspend __NR_sigsuspend
+#define __NR___rt_sigtimedwait __NR_rt_sigtimedwait
 
 _syscall2(int,kill,pid_t,pid,int,sig)
 _syscall2(__sighandler_t,signal,int,signum,__sighandler_t,handler)
@@ -25,6 +26,7 @@ _syscall3(int,sigprocmask,int,how,const sigset_t *,set,sigset_t *,oldset)
 static _syscall0(int,__sgetmask)
 static _syscall1(int,__ssetmask,int,newmask)
 static _syscall3(int,__sigsuspend,int,arg1,int,arg2,int,mask)
+static _syscall4(int,__rt_sigtimedwait,const sigset_t *,set,siginfo_t *,info,struct timespec *,timeout,size_t,size)
 
 int sigsuspend (const sigset_t *mask)
 {
@@ -54,6 +56,16 @@ int raise(int sig)
     return kill(getpid(),sig);
 }
 
+int sigtimedwait(const sigset_t *set, siginfo_t *info,
+                 struct timespec *timeout)
+{
+  return __rt_sigtimedwait(set, info, timeout, sizeof(sigset_t));
+}
+
+int sigwaitinfo(const sigset_t *set, siginfo_t *info)
+{
+  return __rt_sigtimedwait(set, info, NULL, sizeof(sigset_t));
+}
 
 const char *const sys_siglist[] = {
 #include "siglist.inc"