diff options
Diffstat (limited to 'newlib/libc/sys')
-rw-r--r-- | newlib/libc/sys/linux/Makefile.am | 112 | ||||
-rw-r--r-- | newlib/libc/sys/linux/Makefile.in | 215 | ||||
-rw-r--r-- | newlib/libc/sys/linux/aclocal.m4 | 18 | ||||
-rw-r--r-- | newlib/libc/sys/linux/aio.c | 2 | ||||
-rwxr-xr-x | newlib/libc/sys/linux/configure | 223 | ||||
-rw-r--r-- | newlib/libc/sys/linux/ftok.c | 10 | ||||
-rw-r--r-- | newlib/libc/sys/linux/getdate.c | 10 | ||||
-rw-r--r-- | newlib/libc/sys/linux/ids.c | 9 | ||||
-rw-r--r-- | newlib/libc/sys/linux/inode.c | 36 | ||||
-rw-r--r-- | newlib/libc/sys/linux/io.c | 23 | ||||
-rw-r--r-- | newlib/libc/sys/linux/machine/i386/syscall.h | 70 | ||||
-rw-r--r-- | newlib/libc/sys/linux/process.c | 18 | ||||
-rw-r--r-- | newlib/libc/sys/linux/resource.c | 6 | ||||
-rw-r--r-- | newlib/libc/sys/linux/sched.c | 16 | ||||
-rw-r--r-- | newlib/libc/sys/linux/sig.c | 28 | ||||
-rw-r--r-- | newlib/libc/sys/linux/termios.c | 3 | ||||
-rw-r--r-- | newlib/libc/sys/linux/wait.c | 1 |
17 files changed, 497 insertions, 303 deletions
diff --git a/newlib/libc/sys/linux/Makefile.am b/newlib/libc/sys/linux/Makefile.am index 55845d4..00d189b 100644 --- a/newlib/libc/sys/linux/Makefile.am +++ b/newlib/libc/sys/linux/Makefile.am @@ -11,9 +11,8 @@ SUBLIBS = \ cmath/libcmath.la \ $(LINUX_MACH_LIB) -LIB_SOURCES = \ +GENERAL_SOURCES = \ aio.c \ - aio64.c \ brk.c \ calloc.c \ callocr.c \ @@ -22,42 +21,24 @@ LIB_SOURCES = \ clock_getres.c \ clock_gettime.c \ clock_settime.c \ - confstr.c \ - ctermid.c \ - fclean.c \ flockfile.c \ - fpathconf.c \ free.c \ freer.c \ - fstab.c \ - fstatvfs.c \ - fstatvfs64.c \ ftok.c \ - ftw.c \ - ftw64.c \ funlockfile.c \ getdate.c \ getdate_err.c \ gethostname.c \ - getoptlong.c \ getreent.c \ - getrlimit64.c \ - getwd.c \ ids.c \ inode.c \ io.c \ - io64.c \ ipc.c \ linux.c \ - malign.c \ - malignr.c \ mallinfor.c \ mallocr.c \ - malloptr.c \ mallstatsr.c \ mmap.c \ - mntent.c \ - mntent_r.c \ mq_close.c \ mq_getattr.c \ mq_notify.c \ @@ -72,29 +53,21 @@ LIB_SOURCES = \ mtrim.c \ mtrimr.c \ ntp_gettime.c \ - pathconf.c \ pread.c \ - pread64.c \ process.c \ prof-freq.c \ profile.c \ psignal.c \ - pvallocr.c \ pwrite.c \ - pwrite64.c \ raise.c \ - readdir64.c \ realloc.c \ reallocr.c \ - realpath.c \ rename.c \ resource.c \ - scandir64.c \ sched.c \ select.c \ seteuid.c \ sethostname.c \ - setrlimit64.c \ shm_open.c \ shm_unlink.c \ sig.c \ @@ -106,26 +79,74 @@ LIB_SOURCES = \ sigwait.c \ socket.c \ sleep.c \ - stack.c \ - statvfs.c \ - statvfs64.c \ strsignal.c \ strverscmp.c \ sysconf.c \ sysctl.c \ systat.c \ - system.c \ tcdrain.c \ tcsendbrk.c \ termios.c \ time.c \ - ttyname_r.c \ usleep.c \ - utimes.c \ - vallocr.c \ - versionsort.c \ - versionsort64.c \ - wait.c + versionsort.c + +ELIX_2_OBJS = \ + aio64.$(oext) \ + confstr.$(oext) \ + ctermid.$(oext) \ + fclean.$(oext) \ + fpathconf.$(oext) \ + fstab.$(oext) \ + fstatvfs.$(oext) \ + fstatvfs64.$(oext) \ + ftw.$(oext) \ + ftw64.$(oext) \ + getoptlong.$(oext) \ + getrlimit64.$(oext) \ + getwd.$(oext) \ + io64.$(oext) \ + malign.$(oext) \ + malignr.$(oext) \ + malloptr.$(oext) \ + mcheck.$(oext) \ + mntent.$(oext) \ + mntent_r.$(oext) \ + pathconf.$(oext) \ + pread64.$(oext) \ + pvallocr.$(oext) \ + pwrite64.$(oext) \ + readdir64.$(oext) \ + realpath.$(oext) \ + scandir64.$(oext) \ + setrlimit64.$(oext) \ + statvfs.$(oext) \ + statvfs64.$(oext) \ + ttyname_r.$(oext) \ + utimes.$(oext) \ + vallocr.$(oext) \ + versionsort64.$(oext) + +ELIX_3_OBJS = \ + system.$(oext) \ + wait.$(oext) + +ELIX_4_OBJS = \ + stack.$(oext) + +if ELIX_LEVEL_1 +LIB_OBJS = +else +if ELIX_LEVEL_2 +LIB_OBJS = $(ELIX_2_OBJS) +else +if ELIX_LEVEL_3 +LIB_OBJS = $(ELIX_2_OBJS) $(ELIX_3_OBJS) +else +LIB_OBJS = $(ELIX_2_OBJS) $(ELIX_3_OBJS) $(ELIX_4_OBJS) +endif +endif +endif # This will handle both /usr/src/linux-2.4/include/asm/signal.h (in Red Hat Linux 7.1) # and also /usr/src/linux/include/asm/signal.h in older versions of Red Hat Linux @@ -135,25 +156,24 @@ liblinux_la_LDFLAGS = -Xcompiler -nostdlib ADD_OBJS = \ malloc.$(oext) \ - mcheck.$(oext) \ $(LINUX_MACH_LIB) if USE_LIBTOOL noinst_LTLIBRARIES = liblinux.la -liblinux_la_SOURCES = $(LIB_SOURCES) -liblinux_la_LIBADD = $(ADD_OBJS) -liblinux_la_DEPENDENCIES = $(ADD_OBJS) +liblinux_la_SOURCES = $(GENERAL_SOURCES) +liblinux_la_LIBADD = $(ADD_OBJS) $(LIB_OBJS) +liblinux_la_DEPENDENCIES = $(ADD_OBJS) $(LIB_OBJS) LIBC_COMPILE = $(LTCOMPILE) noinst_DATA = objectlist.awk.in else noinst_LIBRARIES = lib.a -lib_a_SOURCES = $(LIB_SOURCES) -lib_a_LIBADD = $(ADD_OBJS) -lib_a_DEPENDENCIES = $(ADD_OBJS) +lib_a_SOURCES = $(GENERAL_SOURCES) +lib_a_LIBADD = $(ADD_OBJS) $(LIB_OBJS) +lib_a_DEPENDENCIES = $(ADD_OBJS) $(LIB_OBJS) LIBC_COMPILE = $(COMPILE) noinst_DATA = -lib.a: $(ADD_OBJS) $(lib_a_OBJECTS) +lib.a: $(ADD_OBJS) $(LIB_OBJS) $(lib_a_OBJECTS) rm -f $@ rm -rf tmp mkdir tmp diff --git a/newlib/libc/sys/linux/Makefile.in b/newlib/libc/sys/linux/Makefile.in index 33eb704..689edd7 100644 --- a/newlib/libc/sys/linux/Makefile.in +++ b/newlib/libc/sys/linux/Makefile.in @@ -107,9 +107,8 @@ SUBLIBS = \ $(LINUX_MACH_LIB) -LIB_SOURCES = \ +GENERAL_SOURCES = \ aio.c \ - aio64.c \ brk.c \ calloc.c \ callocr.c \ @@ -118,42 +117,24 @@ LIB_SOURCES = \ clock_getres.c \ clock_gettime.c \ clock_settime.c \ - confstr.c \ - ctermid.c \ - fclean.c \ flockfile.c \ - fpathconf.c \ free.c \ freer.c \ - fstab.c \ - fstatvfs.c \ - fstatvfs64.c \ ftok.c \ - ftw.c \ - ftw64.c \ funlockfile.c \ getdate.c \ getdate_err.c \ gethostname.c \ - getoptlong.c \ getreent.c \ - getrlimit64.c \ - getwd.c \ ids.c \ inode.c \ io.c \ - io64.c \ ipc.c \ linux.c \ - malign.c \ - malignr.c \ mallinfor.c \ mallocr.c \ - malloptr.c \ mallstatsr.c \ mmap.c \ - mntent.c \ - mntent_r.c \ mq_close.c \ mq_getattr.c \ mq_notify.c \ @@ -168,29 +149,21 @@ LIB_SOURCES = \ mtrim.c \ mtrimr.c \ ntp_gettime.c \ - pathconf.c \ pread.c \ - pread64.c \ process.c \ prof-freq.c \ profile.c \ psignal.c \ - pvallocr.c \ pwrite.c \ - pwrite64.c \ raise.c \ - readdir64.c \ realloc.c \ reallocr.c \ - realpath.c \ rename.c \ resource.c \ - scandir64.c \ sched.c \ select.c \ seteuid.c \ sethostname.c \ - setrlimit64.c \ shm_open.c \ shm_unlink.c \ sig.c \ @@ -202,27 +175,68 @@ LIB_SOURCES = \ sigwait.c \ socket.c \ sleep.c \ - stack.c \ - statvfs.c \ - statvfs64.c \ strsignal.c \ strverscmp.c \ sysconf.c \ sysctl.c \ systat.c \ - system.c \ tcdrain.c \ tcsendbrk.c \ termios.c \ time.c \ - ttyname_r.c \ usleep.c \ - utimes.c \ - vallocr.c \ - versionsort.c \ - versionsort64.c \ - wait.c - + versionsort.c + + +ELIX_2_OBJS = \ + aio64.$(oext) \ + confstr.$(oext) \ + ctermid.$(oext) \ + fclean.$(oext) \ + fpathconf.$(oext) \ + fstab.$(oext) \ + fstatvfs.$(oext) \ + fstatvfs64.$(oext) \ + ftw.$(oext) \ + ftw64.$(oext) \ + getoptlong.$(oext) \ + getrlimit64.$(oext) \ + getwd.$(oext) \ + io64.$(oext) \ + malign.$(oext) \ + malignr.$(oext) \ + malloptr.$(oext) \ + mcheck.$(oext) \ + mntent.$(oext) \ + mntent_r.$(oext) \ + pathconf.$(oext) \ + pread64.$(oext) \ + pvallocr.$(oext) \ + pwrite64.$(oext) \ + readdir64.$(oext) \ + realpath.$(oext) \ + scandir64.$(oext) \ + setrlimit64.$(oext) \ + statvfs.$(oext) \ + statvfs64.$(oext) \ + ttyname_r.$(oext) \ + utimes.$(oext) \ + vallocr.$(oext) \ + versionsort64.$(oext) + + +ELIX_3_OBJS = \ + system.$(oext) \ + wait.$(oext) + + +ELIX_4_OBJS = \ + stack.$(oext) + +@ELIX_LEVEL_1_TRUE@LIB_OBJS = +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@LIB_OBJS = @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@$(ELIX_2_OBJS) +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@LIB_OBJS = @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@$(ELIX_2_OBJS) $(ELIX_3_OBJS) +@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@LIB_OBJS = @ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@$(ELIX_2_OBJS) $(ELIX_3_OBJS) $(ELIX_4_OBJS) # This will handle both /usr/src/linux-2.4/include/asm/signal.h (in Red Hat Linux 7.1) # and also /usr/src/linux/include/asm/signal.h in older versions of Red Hat Linux @@ -232,22 +246,21 @@ liblinux_la_LDFLAGS = -Xcompiler -nostdlib ADD_OBJS = \ malloc.$(oext) \ - mcheck.$(oext) \ $(LINUX_MACH_LIB) @USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = @USE_LIBTOOL_TRUE@liblinux.la -@USE_LIBTOOL_TRUE@liblinux_la_SOURCES = @USE_LIBTOOL_TRUE@$(LIB_SOURCES) -@USE_LIBTOOL_TRUE@liblinux_la_LIBADD = @USE_LIBTOOL_TRUE@$(ADD_OBJS) -@USE_LIBTOOL_TRUE@liblinux_la_DEPENDENCIES = @USE_LIBTOOL_TRUE@$(ADD_OBJS) +@USE_LIBTOOL_TRUE@liblinux_la_SOURCES = @USE_LIBTOOL_TRUE@$(GENERAL_SOURCES) +@USE_LIBTOOL_TRUE@liblinux_la_LIBADD = @USE_LIBTOOL_TRUE@$(ADD_OBJS) $(LIB_OBJS) +@USE_LIBTOOL_TRUE@liblinux_la_DEPENDENCIES = @USE_LIBTOOL_TRUE@$(ADD_OBJS) $(LIB_OBJS) @USE_LIBTOOL_TRUE@LIBC_COMPILE = @USE_LIBTOOL_TRUE@$(LTCOMPILE) @USE_LIBTOOL_FALSE@LIBC_COMPILE = @USE_LIBTOOL_FALSE@$(COMPILE) @USE_LIBTOOL_TRUE@noinst_DATA = @USE_LIBTOOL_TRUE@objectlist.awk.in @USE_LIBTOOL_FALSE@noinst_DATA = @USE_LIBTOOL_FALSE@noinst_LIBRARIES = @USE_LIBTOOL_FALSE@lib.a -@USE_LIBTOOL_FALSE@lib_a_SOURCES = @USE_LIBTOOL_FALSE@$(LIB_SOURCES) -@USE_LIBTOOL_FALSE@lib_a_LIBADD = @USE_LIBTOOL_FALSE@$(ADD_OBJS) -@USE_LIBTOOL_FALSE@lib_a_DEPENDENCIES = @USE_LIBTOOL_FALSE@$(ADD_OBJS) +@USE_LIBTOOL_FALSE@lib_a_SOURCES = @USE_LIBTOOL_FALSE@$(GENERAL_SOURCES) +@USE_LIBTOOL_FALSE@lib_a_LIBADD = @USE_LIBTOOL_FALSE@$(ADD_OBJS) $(LIB_OBJS) +@USE_LIBTOOL_FALSE@lib_a_DEPENDENCIES = @USE_LIBTOOL_FALSE@$(ADD_OBJS) $(LIB_OBJS) AM_CFLAGS = -I $(srcdir)/../../stdio ACLOCAL_AMFLAGS = -I ../../.. @@ -261,84 +274,60 @@ LIBRARIES = $(noinst_LIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) CPPFLAGS = @CPPFLAGS@ LIBS = @LIBS@ -@USE_LIBTOOL_FALSE@lib_a_OBJECTS = aio.$(OBJEXT) aio64.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@brk.$(OBJEXT) calloc.$(OBJEXT) callocr.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@cfreer.$(OBJEXT) cfspeed.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@clock_getres.$(OBJEXT) clock_gettime.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@clock_settime.$(OBJEXT) confstr.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@ctermid.$(OBJEXT) fclean.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@flockfile.$(OBJEXT) fpathconf.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@free.$(OBJEXT) freer.$(OBJEXT) fstab.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@fstatvfs.$(OBJEXT) fstatvfs64.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@ftok.$(OBJEXT) ftw.$(OBJEXT) ftw64.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@funlockfile.$(OBJEXT) getdate.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@getdate_err.$(OBJEXT) gethostname.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@getoptlong.$(OBJEXT) getreent.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@getrlimit64.$(OBJEXT) getwd.$(OBJEXT) ids.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@inode.$(OBJEXT) io.$(OBJEXT) io64.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@ipc.$(OBJEXT) linux.$(OBJEXT) malign.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@malignr.$(OBJEXT) mallinfor.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@mallocr.$(OBJEXT) malloptr.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@mallstatsr.$(OBJEXT) mmap.$(OBJEXT) mntent.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@mntent_r.$(OBJEXT) mq_close.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@lib_a_OBJECTS = aio.$(OBJEXT) brk.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@calloc.$(OBJEXT) callocr.$(OBJEXT) cfreer.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@cfspeed.$(OBJEXT) clock_getres.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@clock_gettime.$(OBJEXT) clock_settime.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@flockfile.$(OBJEXT) free.$(OBJEXT) freer.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@ftok.$(OBJEXT) funlockfile.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@getdate.$(OBJEXT) getdate_err.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@gethostname.$(OBJEXT) getreent.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@ids.$(OBJEXT) inode.$(OBJEXT) io.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@ipc.$(OBJEXT) linux.$(OBJEXT) mallinfor.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@mallocr.$(OBJEXT) mallstatsr.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@mmap.$(OBJEXT) mq_close.$(OBJEXT) \ @USE_LIBTOOL_FALSE@mq_getattr.$(OBJEXT) mq_notify.$(OBJEXT) \ @USE_LIBTOOL_FALSE@mq_open.$(OBJEXT) mq_receive.$(OBJEXT) \ @USE_LIBTOOL_FALSE@mq_send.$(OBJEXT) mq_setattr.$(OBJEXT) \ @USE_LIBTOOL_FALSE@mq_unlink.$(OBJEXT) msize.$(OBJEXT) msizer.$(OBJEXT) \ @USE_LIBTOOL_FALSE@mstats.$(OBJEXT) mtrim.$(OBJEXT) mtrimr.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@ntp_gettime.$(OBJEXT) pathconf.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@pread.$(OBJEXT) pread64.$(OBJEXT) process.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@prof-freq.$(OBJEXT) profile.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@psignal.$(OBJEXT) pvallocr.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@pwrite.$(OBJEXT) pwrite64.$(OBJEXT) raise.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@readdir64.$(OBJEXT) realloc.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@reallocr.$(OBJEXT) realpath.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@rename.$(OBJEXT) resource.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@scandir64.$(OBJEXT) sched.$(OBJEXT) select.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@seteuid.$(OBJEXT) sethostname.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@setrlimit64.$(OBJEXT) shm_open.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@ntp_gettime.$(OBJEXT) pread.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@process.$(OBJEXT) prof-freq.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@profile.$(OBJEXT) psignal.$(OBJEXT) pwrite.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@raise.$(OBJEXT) realloc.$(OBJEXT) reallocr.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@rename.$(OBJEXT) resource.$(OBJEXT) sched.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@select.$(OBJEXT) seteuid.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@sethostname.$(OBJEXT) shm_open.$(OBJEXT) \ @USE_LIBTOOL_FALSE@shm_unlink.$(OBJEXT) sig.$(OBJEXT) \ @USE_LIBTOOL_FALSE@sigaction.$(OBJEXT) sigqueue.$(OBJEXT) \ @USE_LIBTOOL_FALSE@signal.$(OBJEXT) siglongjmp.$(OBJEXT) \ @USE_LIBTOOL_FALSE@sigset.$(OBJEXT) sigwait.$(OBJEXT) socket.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@sleep.$(OBJEXT) stack.$(OBJEXT) statvfs.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@statvfs64.$(OBJEXT) strsignal.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@sleep.$(OBJEXT) strsignal.$(OBJEXT) \ @USE_LIBTOOL_FALSE@strverscmp.$(OBJEXT) sysconf.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@sysctl.$(OBJEXT) systat.$(OBJEXT) system.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@tcdrain.$(OBJEXT) tcsendbrk.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@termios.$(OBJEXT) time.$(OBJEXT) ttyname_r.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@usleep.$(OBJEXT) utimes.$(OBJEXT) vallocr.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@versionsort.$(OBJEXT) versionsort64.$(OBJEXT) \ -@USE_LIBTOOL_FALSE@wait.$(OBJEXT) +@USE_LIBTOOL_FALSE@sysctl.$(OBJEXT) systat.$(OBJEXT) tcdrain.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@tcsendbrk.$(OBJEXT) termios.$(OBJEXT) time.$(OBJEXT) \ +@USE_LIBTOOL_FALSE@usleep.$(OBJEXT) versionsort.$(OBJEXT) LTLIBRARIES = $(noinst_LTLIBRARIES) -@USE_LIBTOOL_TRUE@liblinux_la_OBJECTS = aio.lo aio64.lo brk.lo \ -@USE_LIBTOOL_TRUE@calloc.lo callocr.lo cfreer.lo cfspeed.lo \ -@USE_LIBTOOL_TRUE@clock_getres.lo clock_gettime.lo clock_settime.lo \ -@USE_LIBTOOL_TRUE@confstr.lo ctermid.lo fclean.lo flockfile.lo \ -@USE_LIBTOOL_TRUE@fpathconf.lo free.lo freer.lo fstab.lo fstatvfs.lo \ -@USE_LIBTOOL_TRUE@fstatvfs64.lo ftok.lo ftw.lo ftw64.lo funlockfile.lo \ -@USE_LIBTOOL_TRUE@getdate.lo getdate_err.lo gethostname.lo \ -@USE_LIBTOOL_TRUE@getoptlong.lo getreent.lo getrlimit64.lo getwd.lo \ -@USE_LIBTOOL_TRUE@ids.lo inode.lo io.lo io64.lo ipc.lo linux.lo \ -@USE_LIBTOOL_TRUE@malign.lo malignr.lo mallinfor.lo mallocr.lo \ -@USE_LIBTOOL_TRUE@malloptr.lo mallstatsr.lo mmap.lo mntent.lo \ -@USE_LIBTOOL_TRUE@mntent_r.lo mq_close.lo mq_getattr.lo mq_notify.lo \ -@USE_LIBTOOL_TRUE@mq_open.lo mq_receive.lo mq_send.lo mq_setattr.lo \ -@USE_LIBTOOL_TRUE@mq_unlink.lo msize.lo msizer.lo mstats.lo mtrim.lo \ -@USE_LIBTOOL_TRUE@mtrimr.lo ntp_gettime.lo pathconf.lo pread.lo \ -@USE_LIBTOOL_TRUE@pread64.lo process.lo prof-freq.lo profile.lo \ -@USE_LIBTOOL_TRUE@psignal.lo pvallocr.lo pwrite.lo pwrite64.lo raise.lo \ -@USE_LIBTOOL_TRUE@readdir64.lo realloc.lo reallocr.lo realpath.lo \ -@USE_LIBTOOL_TRUE@rename.lo resource.lo scandir64.lo sched.lo select.lo \ -@USE_LIBTOOL_TRUE@seteuid.lo sethostname.lo setrlimit64.lo shm_open.lo \ -@USE_LIBTOOL_TRUE@shm_unlink.lo sig.lo sigaction.lo sigqueue.lo \ -@USE_LIBTOOL_TRUE@signal.lo siglongjmp.lo sigset.lo sigwait.lo \ -@USE_LIBTOOL_TRUE@socket.lo sleep.lo stack.lo statvfs.lo statvfs64.lo \ -@USE_LIBTOOL_TRUE@strsignal.lo strverscmp.lo sysconf.lo sysctl.lo \ -@USE_LIBTOOL_TRUE@systat.lo system.lo tcdrain.lo tcsendbrk.lo \ -@USE_LIBTOOL_TRUE@termios.lo time.lo ttyname_r.lo usleep.lo utimes.lo \ -@USE_LIBTOOL_TRUE@vallocr.lo versionsort.lo versionsort64.lo wait.lo +@USE_LIBTOOL_TRUE@liblinux_la_OBJECTS = aio.lo brk.lo calloc.lo \ +@USE_LIBTOOL_TRUE@callocr.lo cfreer.lo cfspeed.lo clock_getres.lo \ +@USE_LIBTOOL_TRUE@clock_gettime.lo clock_settime.lo flockfile.lo \ +@USE_LIBTOOL_TRUE@free.lo freer.lo ftok.lo funlockfile.lo getdate.lo \ +@USE_LIBTOOL_TRUE@getdate_err.lo gethostname.lo getreent.lo ids.lo \ +@USE_LIBTOOL_TRUE@inode.lo io.lo ipc.lo linux.lo mallinfor.lo \ +@USE_LIBTOOL_TRUE@mallocr.lo mallstatsr.lo mmap.lo mq_close.lo \ +@USE_LIBTOOL_TRUE@mq_getattr.lo mq_notify.lo mq_open.lo mq_receive.lo \ +@USE_LIBTOOL_TRUE@mq_send.lo mq_setattr.lo mq_unlink.lo msize.lo \ +@USE_LIBTOOL_TRUE@msizer.lo mstats.lo mtrim.lo mtrimr.lo ntp_gettime.lo \ +@USE_LIBTOOL_TRUE@pread.lo process.lo prof-freq.lo profile.lo \ +@USE_LIBTOOL_TRUE@psignal.lo pwrite.lo raise.lo realloc.lo reallocr.lo \ +@USE_LIBTOOL_TRUE@rename.lo resource.lo sched.lo select.lo seteuid.lo \ +@USE_LIBTOOL_TRUE@sethostname.lo shm_open.lo shm_unlink.lo sig.lo \ +@USE_LIBTOOL_TRUE@sigaction.lo sigqueue.lo signal.lo siglongjmp.lo \ +@USE_LIBTOOL_TRUE@sigset.lo sigwait.lo socket.lo sleep.lo strsignal.lo \ +@USE_LIBTOOL_TRUE@strverscmp.lo sysconf.lo sysctl.lo systat.lo \ +@USE_LIBTOOL_TRUE@tcdrain.lo tcsendbrk.lo termios.lo time.lo usleep.lo \ +@USE_LIBTOOL_TRUE@versionsort.lo CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -678,7 +667,7 @@ clean-generic maintainer-clean-generic clean mostlyclean distclean \ maintainer-clean -@USE_LIBTOOL_FALSE@lib.a: $(ADD_OBJS) $(lib_a_OBJECTS) +@USE_LIBTOOL_FALSE@lib.a: $(ADD_OBJS) $(LIB_OBJS) $(lib_a_OBJECTS) @USE_LIBTOOL_FALSE@ rm -f $@ @USE_LIBTOOL_FALSE@ rm -rf tmp @USE_LIBTOOL_FALSE@ mkdir tmp diff --git a/newlib/libc/sys/linux/aclocal.m4 b/newlib/libc/sys/linux/aclocal.m4 index 5133f0b..eae4b20 100644 --- a/newlib/libc/sys/linux/aclocal.m4 +++ b/newlib/libc/sys/linux/aclocal.m4 @@ -65,6 +65,18 @@ AC_ARG_ENABLE(newlib-multithread, *) AC_MSG_ERROR(bad value ${enableval} for newlib-multithread option) ;; esac], [newlib_multithread=yes])dnl +dnl Support --enable-newlib-elix-level +AC_ARG_ENABLE(newlib-elix-level, +[ --enable-newlib-elix-level supply desired elix library level (1-4)], +[case "${enableval}" in + 0) newlib_elix_level=0 ;; + 1) newlib_elix_level=1 ;; + 2) newlib_elix_level=2 ;; + 3) newlib_elix_level=3 ;; + 4) newlib_elix_level=4 ;; + *) AC_MSG_ERROR(bad value ${enableval} for newlib-elix-level option) ;; + esac], [newlib_elix_level=0])dnl + dnl Support --disable-newlib-io-float AC_ARG_ENABLE(newlib-io-float, [ --disable-newlib-io-float disable printf/scanf family float support], @@ -164,6 +176,12 @@ AC_SUBST(NEWLIB_CFLAGS) LDFLAGS=${ldflags} AC_SUBST(LDFLAGS) +AM_CONDITIONAL(ELIX_LEVEL_0, test x[$]{newlib_elix_level} = x0) +AM_CONDITIONAL(ELIX_LEVEL_1, test x[$]{newlib_elix_level} = x1) +AM_CONDITIONAL(ELIX_LEVEL_2, test x[$]{newlib_elix_level} = x2) +AM_CONDITIONAL(ELIX_LEVEL_3, test x[$]{newlib_elix_level} = x3) +AM_CONDITIONAL(ELIX_LEVEL_4, test x[$]{newlib_elix_level} = x4) + AM_CONDITIONAL(USE_LIBTOOL, test x[$]{use_libtool} = xyes) # Hard-code OBJEXT. Normally it is set by AC_OBJEXT, but we diff --git a/newlib/libc/sys/linux/aio.c b/newlib/libc/sys/linux/aio.c index 04e3d70..de988eb 100644 --- a/newlib/libc/sys/linux/aio.c +++ b/newlib/libc/sys/linux/aio.c @@ -66,8 +66,10 @@ lio_listio (int mode, struct aiocb * const list[], int nent, return -1; } +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 4 void aio_init (const struct aioinit *INIT) { errno = ENOSYS; } +#endif diff --git a/newlib/libc/sys/linux/configure b/newlib/libc/sys/linux/configure index 7b7ebed..942f074 100755 --- a/newlib/libc/sys/linux/configure +++ b/newlib/libc/sys/linux/configure @@ -22,6 +22,8 @@ ac_help="$ac_help ac_help="$ac_help --enable-newlib-multithread enable support for multiple threads" ac_help="$ac_help + --enable-newlib-elix-level supply desired elix library level (1-4)" +ac_help="$ac_help --disable-newlib-io-float disable printf/scanf family float support" ac_help="$ac_help --enable-maintainer-mode enable make rules and dependencies not useful @@ -592,7 +594,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:596: checking for a BSD compatible install" >&5 +echo "configure:598: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -645,7 +647,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:649: checking whether build environment is sane" >&5 +echo "configure:651: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -702,7 +704,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:706: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:708: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -735,12 +737,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:739: checking for Cygwin environment" >&5 +echo "configure:741: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 744 "configure" +#line 746 "configure" #include "confdefs.h" int main() { @@ -751,7 +753,7 @@ int main() { return __CYGWIN__; ; return 0; } EOF -if { (eval echo configure:755: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -768,19 +770,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:772: checking for mingw32 environment" >&5 +echo "configure:774: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 777 "configure" +#line 779 "configure" #include "confdefs.h" int main() { return __MINGW32__; ; return 0; } EOF -if { (eval echo configure:784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:786: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -857,6 +859,21 @@ else newlib_multithread=yes fi +# Check whether --enable-newlib-elix-level or --disable-newlib-elix-level was given. +if test "${enable_newlib_elix_level+set}" = set; then + enableval="$enable_newlib_elix_level" + case "${enableval}" in + 0) newlib_elix_level=0 ;; + 1) newlib_elix_level=1 ;; + 2) newlib_elix_level=2 ;; + 3) newlib_elix_level=3 ;; + 4) newlib_elix_level=4 ;; + *) { echo "configure: error: bad value ${enableval} for newlib-elix-level option" 1>&2; exit 1; } ;; + esac +else + newlib_elix_level=0 +fi + # Check whether --enable-newlib-io-float or --disable-newlib-io-float was given. if test "${enable_newlib_io_float+set}" = set; then enableval="$enable_newlib_io_float" @@ -912,7 +929,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:916: checking host system type" >&5 +echo "configure:933: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -933,7 +950,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:937: checking target system type" >&5 +echo "configure:954: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -951,7 +968,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:955: checking build system type" >&5 +echo "configure:972: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -994,7 +1011,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:998: checking for working aclocal" >&5 +echo "configure:1015: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1007,7 +1024,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1011: checking for working autoconf" >&5 +echo "configure:1028: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1020,7 +1037,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1024: checking for working automake" >&5 +echo "configure:1041: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1033,7 +1050,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1037: checking for working autoheader" >&5 +echo "configure:1054: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1046,7 +1063,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1050: checking for working makeinfo" >&5 +echo "configure:1067: checking for working makeinfo" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1071,7 +1088,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1075: checking for $ac_word" >&5 +echo "configure:1092: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1101,7 +1118,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1105: checking for $ac_word" >&5 +echo "configure:1122: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1150,7 +1167,7 @@ fi fi echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1154: checking whether we are using GNU C" >&5 +echo "configure:1171: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1159,7 +1176,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1174,7 +1191,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1178: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1195: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1205,7 +1222,7 @@ fi # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1209: checking for $ac_word" >&5 +echo "configure:1226: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1237,7 +1254,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1241: checking for $ac_word" >&5 +echo "configure:1258: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1269,7 +1286,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1273: checking for $ac_word" >&5 +echo "configure:1290: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1301,7 +1318,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1305: checking for $ac_word" >&5 +echo "configure:1322: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1346,7 +1363,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1350: checking for a BSD compatible install" >&5 +echo "configure:1367: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1400,7 +1417,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:1404: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:1421: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -1434,7 +1451,7 @@ if false; then echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1438: checking for executable suffix" >&5 +echo "configure:1455: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1444,7 +1461,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1448: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; @@ -1478,6 +1495,52 @@ LDFLAGS=${ldflags} +if test x${newlib_elix_level} = x0; then + ELIX_LEVEL_0_TRUE= + ELIX_LEVEL_0_FALSE='#' +else + ELIX_LEVEL_0_TRUE='#' + ELIX_LEVEL_0_FALSE= +fi + + +if test x${newlib_elix_level} = x1; then + ELIX_LEVEL_1_TRUE= + ELIX_LEVEL_1_FALSE='#' +else + ELIX_LEVEL_1_TRUE='#' + ELIX_LEVEL_1_FALSE= +fi + + +if test x${newlib_elix_level} = x2; then + ELIX_LEVEL_2_TRUE= + ELIX_LEVEL_2_FALSE='#' +else + ELIX_LEVEL_2_TRUE='#' + ELIX_LEVEL_2_FALSE= +fi + + +if test x${newlib_elix_level} = x3; then + ELIX_LEVEL_3_TRUE= + ELIX_LEVEL_3_FALSE='#' +else + ELIX_LEVEL_3_TRUE='#' + ELIX_LEVEL_3_FALSE= +fi + + +if test x${newlib_elix_level} = x4; then + ELIX_LEVEL_4_TRUE= + ELIX_LEVEL_4_FALSE='#' +else + ELIX_LEVEL_4_TRUE='#' + ELIX_LEVEL_4_FALSE= +fi + + + if test x${use_libtool} = xyes; then USE_LIBTOOL_TRUE= USE_LIBTOOL_FALSE='#' @@ -1574,7 +1637,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1578: checking for $ac_word" >&5 +echo "configure:1641: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1604,7 +1667,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1608: checking for $ac_word" >&5 +echo "configure:1671: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1655,7 +1718,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1659: checking for $ac_word" >&5 +echo "configure:1722: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1687,7 +1750,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1691: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1754: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1698,12 +1761,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1702 "configure" +#line 1765 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1729,12 +1792,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:1733: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1796: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:1738: checking whether we are using GNU C" >&5 +echo "configure:1801: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1743,7 +1806,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1747: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1810: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1762,7 +1825,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:1766: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1829: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1805,7 +1868,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1809: checking for ld used by GCC" >&5 +echo "configure:1872: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1835,10 +1898,10 @@ echo "configure:1809: checking for ld used by GCC" >&5 esac elif test "$with_gnu_ld" = yes; then echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 -echo "configure:1839: checking for GNU ld" >&5 +echo "configure:1902: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1842: checking for non-GNU ld" >&5 +echo "configure:1905: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1873,7 +1936,7 @@ else fi test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1877: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1940: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1890,7 +1953,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1894: checking for $LD option to reload object files" >&5 +echo "configure:1957: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1902,7 +1965,7 @@ reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1906: checking for BSD-compatible nm" >&5 +echo "configure:1969: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1940,7 +2003,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1944: checking whether ln -s works" >&5 +echo "configure:2007: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1961,7 +2024,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1965: checking how to recognise dependant libraries" >&5 +echo "configure:2028: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2134,13 +2197,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:2138: checking for object suffix" >&5 +echo "configure:2201: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:2144: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -2164,7 +2227,7 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 -echo "configure:2168: checking for ${ac_tool_prefix}file" >&5 +echo "configure:2231: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2226,7 +2289,7 @@ fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 -echo "configure:2230: checking for file" >&5 +echo "configure:2293: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2297,7 +2360,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2301: checking for $ac_word" >&5 +echo "configure:2364: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2329,7 +2392,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2333: checking for $ac_word" >&5 +echo "configure:2396: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2364,7 +2427,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2368: checking for $ac_word" >&5 +echo "configure:2431: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2396,7 +2459,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2400: checking for $ac_word" >&5 +echo "configure:2463: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2463,8 +2526,8 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2467 "configure"' > conftest.$ac_ext - if { (eval echo configure:2468: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2530 "configure"' > conftest.$ac_ext + if { (eval echo configure:2531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -2483,7 +2546,7 @@ case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo configure:2487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:2550: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *ELF-32*) HPUX_IA64_MODE="32" @@ -2501,7 +2564,7 @@ ia64-*-hpux*) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2505: checking whether the C compiler needs -belf" >&5 +echo "configure:2568: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2514,14 +2577,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <<EOF -#line 2518 "configure" +#line 2581 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:2525: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_needs_belf=yes else @@ -2551,7 +2614,7 @@ echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2555: checking for $ac_word" >&5 +echo "configure:2618: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2583,7 +2646,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2587: checking for $ac_word" >&5 +echo "configure:2650: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2618,7 +2681,7 @@ fi # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2622: checking for $ac_word" >&5 +echo "configure:2685: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2650,7 +2713,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2654: checking for $ac_word" >&5 +echo "configure:2717: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2685,7 +2748,7 @@ fi # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2689: checking for $ac_word" >&5 +echo "configure:2752: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2717,7 +2780,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2721: checking for $ac_word" >&5 +echo "configure:2784: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2753,12 +2816,12 @@ fi # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one echo $ac_n "checking if libtool should supply DllMain function""... $ac_c" 1>&6 -echo "configure:2757: checking if libtool should supply DllMain function" >&5 +echo "configure:2820: checking if libtool should supply DllMain function" >&5 if eval "test \"`echo '$''{'lt_cv_need_dllmain'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2762 "configure" +#line 2825 "configure" #include "confdefs.h" int main() { @@ -2766,7 +2829,7 @@ extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); DllMain (0, 0, 0); ; return 0; } EOF -if { (eval echo configure:2770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_need_dllmain=no else @@ -2787,19 +2850,19 @@ echo "$ac_t""$lt_cv_need_dllmain" 1>&6 SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mdll" echo $ac_n "checking how to link DLLs""... $ac_c" 1>&6 -echo "configure:2791: checking how to link DLLs" >&5 +echo "configure:2854: checking how to link DLLs" >&5 if eval "test \"`echo '$''{'lt_cv_cc_dll_switch'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2796 "configure" +#line 2859 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:2803: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_cc_dll_switch=-mdll else @@ -2913,7 +2976,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2917: checking for $ac_word" >&5 +echo "configure:2980: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3139,6 +3202,16 @@ s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g s%@MAINT@%$MAINT%g s%@EXEEXT@%$EXEEXT%g s%@NEWLIB_CFLAGS@%$NEWLIB_CFLAGS%g +s%@ELIX_LEVEL_0_TRUE@%$ELIX_LEVEL_0_TRUE%g +s%@ELIX_LEVEL_0_FALSE@%$ELIX_LEVEL_0_FALSE%g +s%@ELIX_LEVEL_1_TRUE@%$ELIX_LEVEL_1_TRUE%g +s%@ELIX_LEVEL_1_FALSE@%$ELIX_LEVEL_1_FALSE%g +s%@ELIX_LEVEL_2_TRUE@%$ELIX_LEVEL_2_TRUE%g +s%@ELIX_LEVEL_2_FALSE@%$ELIX_LEVEL_2_FALSE%g +s%@ELIX_LEVEL_3_TRUE@%$ELIX_LEVEL_3_TRUE%g +s%@ELIX_LEVEL_3_FALSE@%$ELIX_LEVEL_3_FALSE%g +s%@ELIX_LEVEL_4_TRUE@%$ELIX_LEVEL_4_TRUE%g +s%@ELIX_LEVEL_4_FALSE@%$ELIX_LEVEL_4_FALSE%g s%@USE_LIBTOOL_TRUE@%$USE_LIBTOOL_TRUE%g s%@USE_LIBTOOL_FALSE@%$USE_LIBTOOL_FALSE%g s%@OBJEXT@%$OBJEXT%g diff --git a/newlib/libc/sys/linux/ftok.c b/newlib/libc/sys/linux/ftok.c index 497754b..2f4b684 100644 --- a/newlib/libc/sys/linux/ftok.c +++ b/newlib/libc/sys/linux/ftok.c @@ -23,15 +23,21 @@ #include <sys/ipc.h> #include <sys/stat.h> +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 2 +#define STAT stat64 +#else +#define STAT stat +#endif + key_t ftok (pathname, proj_id) const char *pathname; int proj_id; { - struct stat64 st; + struct STAT st; key_t key; - if (stat64 (pathname, &st) < 0) + if (STAT (pathname, &st) < 0) return (key_t) -1; key = ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16) diff --git a/newlib/libc/sys/linux/getdate.c b/newlib/libc/sys/linux/getdate.c index 9137a2e..5c056c7 100644 --- a/newlib/libc/sys/linux/getdate.c +++ b/newlib/libc/sys/linux/getdate.c @@ -86,6 +86,12 @@ PORTABILITY #include <unistd.h> #include <sys/stat.h> +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 2 +# define STAT stat64 +#else +# define STAT stat +#endif + #define TM_YEAR_BASE 1900 extern ssize_t __getline (char **, size_t *, FILE *); @@ -171,14 +177,14 @@ getdate_r (const char *string, struct tm *tp) char *result = NULL; time_t timer; struct tm tm; - struct stat64 st; + struct STAT st; int mday_ok = 0; datemsk = getenv ("DATEMSK"); if (datemsk == NULL || *datemsk == '\0') return 1; - if (stat64 (datemsk, &st) < 0) + if (STAT (datemsk, &st) < 0) return 3; if (!S_ISREG (st.st_mode)) diff --git a/newlib/libc/sys/linux/ids.c b/newlib/libc/sys/linux/ids.c index 332ebe2..f3a95b1 100644 --- a/newlib/libc/sys/linux/ids.c +++ b/newlib/libc/sys/linux/ids.c @@ -8,16 +8,19 @@ #include <machine/syscall.h> -_syscall1(int,setuid,uid_t,uid) _syscall1(int,setfsuid,uid_t,uid) _syscall0(uid_t,getuid) -_syscall1(int,setgid,gid_t,gid) _syscall1(int,setfsgid,gid_t,gid) _syscall0(gid_t,getgid) _syscall0(uid_t,geteuid) _syscall0(gid_t,getegid) _syscall3(int,setresuid,uid_t,ruid,uid_t,euid,uid_t,suid) -_syscall2(int,getgroups,int,size,gid_t *,list) _syscall3(int,syslog,int,type,char *,bufp,int,len) +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL > 3 +_syscall2(int,getgroups,int,size,gid_t *,list) +_syscall1(int,setgid,gid_t,gid) +_syscall1(int,setuid,uid_t,uid) +#endif + weak_alias(__libc_getuid,__getuid); diff --git a/newlib/libc/sys/linux/inode.c b/newlib/libc/sys/linux/inode.c index 280d558..ed468c1 100644 --- a/newlib/libc/sys/linux/inode.c +++ b/newlib/libc/sys/linux/inode.c @@ -14,7 +14,6 @@ #define _LIBC 1 #include <sys/lock.h> -__LOCK_INIT(static, umask_lock); #define __NR___umask __NR_umask @@ -22,25 +21,33 @@ _syscall2(int,link,const char *,oldpath,const char *,newpath) _syscall1(int,unlink,const char *,pathname) _syscall1(int,chdir,const char *,path) _syscall1(int,fchdir,int,fd) -_syscall3(int,mknod,const char *,pathname,mode_t,mode,dev_t,dev) -_syscall2(int,chmod,const char *,path,mode_t,mode) -_syscall2(int,fchmod,int,filedes,mode_t,mode) -_syscall3(int,chown,const char *,path,uid_t,owner,gid_t,group) -_syscall2(int,utime,const char *,filename,const struct utimbuf *,buf) _syscall2(int,access,const char *,filename,int,mode) _syscall2(int,mkdir,const char *,pathname,mode_t,mode) _syscall1(int,rmdir,const char *,pathname) -_syscall1(int,pipe,int *,filedes) _syscall1(int,chroot,const char *,path) -_syscall2(int,symlink,const char *,oldpath,const char *,newpath) -_syscall3(int,readlink,const char *,path,char *,buf,size_t,bufsiz) _syscall2(int,stat,const char *,file_name,struct stat *,buf) _syscall2(int,statfs,const char *,file_name,struct statfs *,buf) -_syscall2(int,lstat,const char *,file_name,struct stat *,buf) _syscall2(int,fstat,int,filedes,struct stat *,buf) _syscall2(int,fstatfs,int,filedes,struct statfs *,buf) _syscall3(int,getdents,int,fd,struct dirent *,dirp,unsigned int,count) -_syscall1(mode_t,__umask,mode_t,mask) + +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 2 +_syscall2(int,chmod,const char *,path,mode_t,mode) +_syscall3(int,chown,const char *,path,uid_t,owner,gid_t,group) +_syscall2(int,fchmod,int,filedes,mode_t,mode) +_syscall2(int,lstat,const char *,file_name,struct stat *,buf) +_syscall3(int,readlink,const char *,path,char *,buf,size_t,bufsiz) +_syscall2(int,symlink,const char *,oldpath,const char *,newpath) +_syscall2(int,utime,const char *,filename,const struct utimbuf *,buf) +#endif + +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 3 +_syscall1(int,pipe,int *,filedes) +#endif + +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 4 +_syscall3(int,mknod,const char *,pathname,mode_t,mode,dev_t,dev) +#endif weak_alias(__libc_statfs,__statfs) weak_alias(__libc_fstatfs,__fstatfs) @@ -53,6 +60,12 @@ fchown (int fd, uid_t owner, gid_t group) return __libc_fchown32 (fd, owner, group); } +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 2 + +__LOCK_INIT(static, umask_lock); + +_syscall1(mode_t,__umask,mode_t,mask) + mode_t umask (mode_t mask) { @@ -81,3 +94,4 @@ getumask (void) return mask; } +#endif /* !_ELIX_LEVEL || _ELIX_LEVEL >= 2 */ diff --git a/newlib/libc/sys/linux/io.c b/newlib/libc/sys/linux/io.c index c33461f..d673114 100644 --- a/newlib/libc/sys/linux/io.c +++ b/newlib/libc/sys/linux/io.c @@ -21,9 +21,7 @@ #define __NR___mknod __NR_mknod _syscall3(ssize_t,read,int,fd,void *,buf,size_t,count) -_syscall3(ssize_t,readv,int,fd,const struct iovec *,vec,int,count) _syscall3(ssize_t,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) @@ -32,14 +30,20 @@ _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) -_syscall2(int,ftruncate,int,fd,off_t,len) -_syscall2(int,truncate,const char *,path,off_t,len) _syscall1(int,fsync,int,fd) _syscall3(int,poll,struct pollfd *,fds,nfds_t,nfds,int,timeout) -static _syscall2(long,__flock,unsigned int,fd,unsigned int,cmd) +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 2 +_syscall3(ssize_t,readv,int,fd,const struct iovec *,vec,int,count) +_syscall3(ssize_t,writev,int,fd,const struct iovec *,buf,int,count) +#endif + +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 4 +_syscall2(int,ftruncate,int,fd,off_t,len) +_syscall2(int,truncate,const char *,path,off_t,len) +#endif + 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,...) { @@ -52,16 +56,23 @@ int ioctl(int fd,int request,...) return res; } +static _syscall2(long,__flock,unsigned int,fd,unsigned int,cmd) + int flock(int fd,int operation) { return __flock(fd,operation); } +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 3 + +static _syscall3(int,__mknod,const char *,path,mode_t,mode,dev_t *,dev) + int mkfifo(const char *path, mode_t mode) { dev_t dev = 0; return __mknod(path, mode | S_IFIFO, &dev); } +#endif weak_alias(__libc_close,__close); weak_alias(__libc_fcntl,__fcntl); diff --git a/newlib/libc/sys/linux/machine/i386/syscall.h b/newlib/libc/sys/linux/machine/i386/syscall.h index b165f04..380f1bc 100644 --- a/newlib/libc/sys/linux/machine/i386/syscall.h +++ b/newlib/libc/sys/linux/machine/i386/syscall.h @@ -68,58 +68,78 @@ __asm__ volatile ("push %%ebx; lea 8(%%ebp),%%ebx; int $0x80; pop %%ebx" \ : "=a" (ret) \ : "0" (__NR_##name)); -#undef _syscall0 -#define _syscall0(type,name) \ +#undef _syscall0_base +#define _syscall0_base(type,name) \ type __libc_##name (void) \ { \ long __res; \ __inline_syscall0(name,__res) \ __syscall_return(type,__res); \ -} \ +} + +#undef _syscall0 +#define _syscall0(type,name) \ +_syscall0_base(type,name) \ weak_alias(__libc_##name,name); -#undef _syscall1 -#define _syscall1(type,name,type1,arg1) \ +#undef _syscall1_base +#define _syscall1_base(type,name,type1,arg1) \ type __libc_##name (type1 arg1) \ { \ long __res; \ __inline_syscall1(name,__res,arg1) \ __syscall_return(type,__res); \ -} \ +} + +#undef _syscall1 +#define _syscall1(type,name,type1,arg1) \ +_syscall1_base(type,name,type1,arg1) \ weak_alias(__libc_##name,name); -#undef _syscall2 -#define _syscall2(type,name,type1,arg1,type2,arg2) \ +#undef _syscall2_base +#define _syscall2_base(type,name,type1,arg1,type2,arg2) \ type __libc_##name (type1 arg1,type2 arg2) \ { \ long __res; \ __inline_syscall2(name,__res,arg1,arg2) \ __syscall_return(type,__res); \ -} \ +} + +#undef _syscall2 +#define _syscall2(type,name,type1,arg1,type2,arg2) \ +_syscall2_base(type,name,type1,arg1,type2,arg2) \ weak_alias(__libc_##name,name); -#undef _syscall3 -#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ +#undef _syscall3_base +#define _syscall3_base(type,name,type1,arg1,type2,arg2,type3,arg3) \ type __libc_##name (type1 arg1,type2 arg2,type3 arg3) \ { \ long __res; \ __inline_syscall3(name,__res,arg1,arg2,arg3) \ __syscall_return(type,__res); \ -} \ +} + +#undef _syscall3 +#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \ +_syscall3_base(type,name,type1,arg1,type2,arg2,type3,arg3) \ weak_alias(__libc_##name,name); -#undef _syscall4 -#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ +#undef _syscall4_base +#define _syscall4_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ type __libc_##name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \ { \ long __res; \ __inline_syscall4(name,__res,arg1,arg2,arg3,arg4) \ __syscall_return(type,__res); \ -} \ +} + +#undef _syscall4 +#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ +_syscall4_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \ weak_alias(__libc_##name,name); -#undef _syscall5 -#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ +#undef _syscall5_base +#define _syscall5_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5) \ type __libc_##name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5) \ { \ @@ -127,17 +147,27 @@ long __res; \ __inline_syscall5(name,__res,arg1,arg2,arg3,arg4,arg5) \ __syscall_return(type,__res); \ } \ + +#undef _syscall5 +#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ + type5,arg5) \ +_syscall5_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \ weak_alias(__libc_##name,name); -#undef _syscall6 -#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ +#undef _syscall6_base +#define _syscall6_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ type5,arg5,type6,arg6) \ type __libc_##name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5,type6 arg6) \ { \ long __res; \ __inline_syscall6(name,__res,arg1,arg2,arg3,arg4,arg5,arg6) \ __syscall_return(type,__res); \ -} \ +} + +#undef _syscall6 +#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4, \ + type5,arg5,type6,arg6) \ +_syscall6_base(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5,type6,arg6) \ weak_alias(__libc_##name,name); #endif /* __PIC__ && __i386__ */ diff --git a/newlib/libc/sys/linux/process.c b/newlib/libc/sys/linux/process.c index 52336f3..160b801 100644 --- a/newlib/libc/sys/linux/process.c +++ b/newlib/libc/sys/linux/process.c @@ -11,16 +11,21 @@ #define __NR__exit __NR_exit #define __NR__execve __NR_execve -_syscall0(int,fork) -_syscall3(int,_execve,const char *,file,char * const *,argv,char * const *,envp) _syscall0(int,getpid) -_syscall2(int,setpgid,pid_t,pid,pid_t,pgid) _syscall0(pid_t,getppid) -_syscall0(pid_t,getpgrp) -_syscall0(pid_t,setsid) weak_alias(__libc_getpid,__getpid); +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 3 +_syscall3(int,_execve,const char *,file,char * const *,argv,char * const *,envp) +_syscall0(int,fork) +#endif /* _ELIX_LEVEL >= 3 */ + +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 4 +_syscall0(pid_t,getpgrp) +_syscall2(int,setpgid,pid_t,pid,pid_t,pgid) +_syscall0(pid_t,setsid) + /* Here we implement vfork in terms of fork, since * Linux's vfork system call is not reliable. */ @@ -42,7 +47,10 @@ pid_t vfork(void) return pid; } } +#endif /* !_ELIX_LEVEL || _ELIX_LEVEL >= 4 */ + +/* Although _exit is listed as level 3, we use it from level 1 interfaces */ /* FIXME: get rid of noreturn warning */ #define return for (;;) diff --git a/newlib/libc/sys/linux/resource.c b/newlib/libc/sys/linux/resource.c index 66f9c05..54a049d 100644 --- a/newlib/libc/sys/linux/resource.c +++ b/newlib/libc/sys/linux/resource.c @@ -7,7 +7,11 @@ _syscall2(int,getrusage,int,who,struct rusage *,r_usage) _syscall2(int,getrlimit,int,resource,struct rlimit *,rlp) -_syscall2(int,setrlimit,int,resource,const struct rlimit *,rlp) weak_alias(__libc_getrlimit,__getrlimit) + +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 2 +_syscall2(int,setrlimit,int,resource,const struct rlimit *,rlp) weak_alias(__libc_setrlimit,__setrlimit) +#endif + diff --git a/newlib/libc/sys/linux/sched.c b/newlib/libc/sys/linux/sched.c index b0df1a9..031b1b5 100644 --- a/newlib/libc/sys/linux/sched.c +++ b/newlib/libc/sys/linux/sched.c @@ -6,17 +6,21 @@ #include <sched.h> #include <machine/syscall.h> -_syscall2(int,sched_getparam,pid_t,pid,struct sched_param *,sched); _syscall1(int,sched_get_priority_max,int,policy); _syscall1(int,sched_get_priority_min,int,policy); -_syscall1(int,sched_getscheduler,pid_t,pid); _syscall2(int,sched_rr_get_interval,pid_t,pid,struct timespec *,interval); -_syscall2(int,sched_setparam,pid_t,pid,const struct sched_param *,sched); -_syscall3(int,sched_setscheduler,pid_t,pid,int,policy,const struct sched_param *,sched); _syscall0(int,sched_yield); -weak_alias(__libc_sched_getparam,__sched_getparam); -weak_alias(__libc_sched_getscheduler,__sched_getscheduler); weak_alias(__libc_sched_get_priority_max,__sched_get_priority_max); weak_alias(__libc_sched_get_priority_min,__sched_get_priority_min); + +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 3 +_syscall2(int,sched_getparam,pid_t,pid,struct sched_param *,sched); +_syscall1(int,sched_getscheduler,pid_t,pid); +_syscall2(int,sched_setparam,pid_t,pid,const struct sched_param *,sched); +_syscall3(int,sched_setscheduler,pid_t,pid,int,policy,const struct sched_param *,sched); +weak_alias(__libc_sched_getparam,__sched_getparam); +weak_alias(__libc_sched_getscheduler,__sched_getscheduler); weak_alias(__libc_sched_setscheduler,__sched_setscheduler); +#endif /* !_ELIX_LEVEL || _ELIX_LEVEL >= 3 */ + diff --git a/newlib/libc/sys/linux/sig.c b/newlib/libc/sys/linux/sig.c index d083b17..6e22873 100644 --- a/newlib/libc/sys/linux/sig.c +++ b/newlib/libc/sys/linux/sig.c @@ -21,8 +21,6 @@ _syscall2(__sighandler_t,signal,int,signum,__sighandler_t,handler) _syscall0(int,pause) _syscall1(unsigned int,alarm,unsigned int,seconds) -static _syscall0(int,__sgetmask) -static _syscall1(int,__ssetmask,int,newmask) static _syscall2(int,__rt_sigpending,sigset_t *,set,size_t,size) static _syscall4(int,__rt_sigprocmask,int,how,const sigset_t *,set,sigset_t *,oldset,size_t,size) static _syscall2(int,__rt_sigsuspend,const sigset_t *,mask,size_t,size) @@ -34,21 +32,11 @@ int __sigsuspend (const sigset_t *mask) } weak_alias(__sigsuspend,sigsuspend) -int sigsetmask(int newmask) /* BSD */ -{ - return __ssetmask(newmask); -} - int sigmask(int signum) /* BSD */ { return 1 << signum; } -int sigblock(int mask) /* BSD */ -{ - return __ssetmask(mask | __sgetmask()); -} - int __libc_raise(int sig) { return kill(getpid(),sig); @@ -78,6 +66,22 @@ int sigwaitinfo(const sigset_t *set, siginfo_t *info) return __rt_sigtimedwait(set, info, NULL, NSIG/8); } +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 4 + +static _syscall1(int,__ssetmask,int,newmask) +static _syscall0(int,__sgetmask) + +int sigblock(int mask) /* BSD */ +{ + return __ssetmask(mask | __sgetmask()); +} + +int sigsetmask(int newmask) /* BSD */ +{ + return __ssetmask(newmask); +} +#endif + const char *const sys_siglist[] = { #include "siglist.inc" }; diff --git a/newlib/libc/sys/linux/termios.c b/newlib/libc/sys/linux/termios.c index bc0ac55..ac15520 100644 --- a/newlib/libc/sys/linux/termios.c +++ b/newlib/libc/sys/linux/termios.c @@ -38,7 +38,7 @@ tcsetattr(int fd,int optional_actions,const struct termios *termios_p) return ioctl(fd,cmd,termios_p); } - +#if !defined(_ELIX_LEVEL) || _ELIX_LEVEL >= 4 pid_t tcgetpgrp(int fd) { @@ -56,6 +56,7 @@ tcsetpgrp(int fd, pid_t pid) int p = (int)pid; return ioctl(fd,TIOCSPGRP,&p); } +#endif /* !_ELIX_LEVEL || _ELIX_LEVEL >= 4 */ int tcflow (int fd, int action) diff --git a/newlib/libc/sys/linux/wait.c b/newlib/libc/sys/linux/wait.c index bc27163..31d1cc7 100644 --- a/newlib/libc/sys/linux/wait.c +++ b/newlib/libc/sys/linux/wait.c @@ -22,5 +22,6 @@ pid_t __libc_wait(int *status) return __libc_waitpid(-1,status,0); } +weak_alias(__libc_waitpid,__libc___waitpid); weak_alias(__libc_wait,__wait); weak_alias(__libc_wait,wait); |