Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/unix')
-rw-r--r--newlib/libc/unix/Makefile.am69
-rw-r--r--newlib/libc/unix/Makefile.in603
-rw-r--r--newlib/libc/unix/basename.c28
-rw-r--r--newlib/libc/unix/dirname.c32
-rw-r--r--newlib/libc/unix/getcwd.c263
-rw-r--r--newlib/libc/unix/getlogin.c45
-rw-r--r--newlib/libc/unix/getpass.c101
-rw-r--r--newlib/libc/unix/getpwent.c131
-rw-r--r--newlib/libc/unix/getut.c90
-rw-r--r--newlib/libc/unix/pread.c93
-rw-r--r--newlib/libc/unix/pwrite.c94
-rw-r--r--newlib/libc/unix/sigset.c67
-rw-r--r--newlib/libc/unix/ttyname.c107
13 files changed, 0 insertions, 1723 deletions
diff --git a/newlib/libc/unix/Makefile.am b/newlib/libc/unix/Makefile.am
deleted file mode 100644
index f44d89a35..000000000
--- a/newlib/libc/unix/Makefile.am
+++ /dev/null
@@ -1,69 +0,0 @@
-## Process this file with automake to generate Makefile.in
-
-AUTOMAKE_OPTIONS = cygnus
-
-INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-
-GENERAL_SOURCES = \
- getcwd.c \
- pread.c \
- pwrite.c \
- sigset.c
-
-## Distinguish different EL/IX level interfaces
-ELIX_2_SOURCES = \
- ttyname.c
-
-ELIX_4_SOURCES = \
- basename.c \
- dirname.c \
- getlogin.c \
- getpass.c \
- getpwent.c \
- getut.c
-
-if ELIX_LEVEL_1
-ELIX_SOURCES =
-else
-if ELIX_LEVEL_2
-ELIX_SOURCES = $(ELIX_2_SOURCES)
-else
-if ELIX_LEVEL_3
-ELIX_SOURCES = $(ELIX_2_SOURCES)
-else
-ELIX_SOURCES = $(ELIX_2_SOURCES) $(ELIX_4_SOURCES)
-endif
-endif
-endif
-
-libunix_la_LDFLAGS = -Xcompiler -nostdlib
-
-if USE_LIBTOOL
-noinst_LTLIBRARIES = libunix.la
-libunix_la_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES)
-noinst_DATA = objectlist.awk.in
-else
-noinst_LIBRARIES = lib.a
-lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES)
-lib_a_CFLAGS = $(AM_CFLAGS)
-noinst_DATA =
-endif # USE_LIBTOOL
-
-include $(srcdir)/../../Makefile.shared
-
-CHEWOUT_FILES =
-
-SUFFIXES = .def
-
-CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str
-
-.c.def:
- $(CHEW) < $< > $*.def 2> $*.ref
- touch stmp-def
-
-TARGETDOC = ../tmp.texi
-
-# No doc for unix.
-doc:
-
-CLEANFILES = $(CHEWOUT_FILES) *.ref
diff --git a/newlib/libc/unix/Makefile.in b/newlib/libc/unix/Makefile.in
deleted file mode 100644
index f8debe615..000000000
--- a/newlib/libc/unix/Makefile.in
+++ /dev/null
@@ -1,603 +0,0 @@
-# Makefile.in generated by automake 1.9.6 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005 Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-DIST_COMMON = $(srcdir)/../../Makefile.shared $(srcdir)/Makefile.in \
- $(srcdir)/Makefile.am
-subdir = unix
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/../../libtool.m4 \
- $(top_srcdir)/../../ltoptions.m4 \
- $(top_srcdir)/../../ltsugar.m4 \
- $(top_srcdir)/../../ltversion.m4 \
- $(top_srcdir)/../../lt~obsolete.m4 \
- $(top_srcdir)/../acinclude.m4 $(top_srcdir)/../confsubdir.m4 \
- $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(SHELL) $(top_srcdir)/../../mkinstalldirs
-CONFIG_CLEAN_FILES =
-LIBRARIES = $(noinst_LIBRARIES)
-ARFLAGS = cru
-lib_a_AR = $(AR) $(ARFLAGS)
-lib_a_LIBADD =
-am__objects_1 = lib_a-getcwd.$(OBJEXT) lib_a-pread.$(OBJEXT) \
- lib_a-pwrite.$(OBJEXT) lib_a-sigset.$(OBJEXT)
-am__objects_2 = lib_a-ttyname.$(OBJEXT)
-am__objects_3 = lib_a-basename.$(OBJEXT) lib_a-dirname.$(OBJEXT) \
- lib_a-getlogin.$(OBJEXT) lib_a-getpass.$(OBJEXT) \
- lib_a-getpwent.$(OBJEXT) lib_a-getut.$(OBJEXT)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_4 = $(am__objects_2) \
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ $(am__objects_3)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@am__objects_4 = $(am__objects_2)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@am__objects_4 = \
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ $(am__objects_2)
-@USE_LIBTOOL_FALSE@am_lib_a_OBJECTS = $(am__objects_1) \
-@USE_LIBTOOL_FALSE@ $(am__objects_4)
-lib_a_OBJECTS = $(am_lib_a_OBJECTS)
-LTLIBRARIES = $(noinst_LTLIBRARIES)
-libunix_la_LIBADD =
-am__objects_5 = getcwd.lo pread.lo pwrite.lo sigset.lo
-am__objects_6 = ttyname.lo
-am__objects_7 = basename.lo dirname.lo getlogin.lo getpass.lo \
- getpwent.lo getut.lo
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@am__objects_8 = $(am__objects_6) \
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ $(am__objects_7)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@am__objects_8 = $(am__objects_6)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@am__objects_8 = \
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ $(am__objects_6)
-@USE_LIBTOOL_TRUE@am_libunix_la_OBJECTS = $(am__objects_5) \
-@USE_LIBTOOL_TRUE@ $(am__objects_8)
-libunix_la_OBJECTS = $(am_libunix_la_OBJECTS)
-@USE_LIBTOOL_TRUE@am_libunix_la_rpath =
-DEFAULT_INCLUDES = -I. -I$(srcdir)
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
- $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
- $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
- $(AM_LDFLAGS) $(LDFLAGS) -o $@
-SOURCES = $(lib_a_SOURCES) $(libunix_la_SOURCES)
-DATA = $(noinst_DATA)
-ETAGS = etags
-CTAGS = ctags
-ACLOCAL = @ACLOCAL@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
-AMTAR = @AMTAR@
-AR = @AR@
-AS = @AS@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CC = @CC@
-CCAS = @CCAS@
-CCASFLAGS = @CCASFLAGS@
-CCDEPMODE = @CCDEPMODE@
-CFLAGS = @CFLAGS@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CRT0 = @CRT0@
-CYGPATH_W = @CYGPATH_W@
-DEFS = @DEFS@
-DEPDIR = @DEPDIR@
-DLLTOOL = @DLLTOOL@
-DSYMUTIL = @DSYMUTIL@
-DUMPBIN = @DUMPBIN@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-ELIX_LEVEL_0_FALSE = @ELIX_LEVEL_0_FALSE@
-ELIX_LEVEL_0_TRUE = @ELIX_LEVEL_0_TRUE@
-ELIX_LEVEL_1_FALSE = @ELIX_LEVEL_1_FALSE@
-ELIX_LEVEL_1_TRUE = @ELIX_LEVEL_1_TRUE@
-ELIX_LEVEL_2_FALSE = @ELIX_LEVEL_2_FALSE@
-ELIX_LEVEL_2_TRUE = @ELIX_LEVEL_2_TRUE@
-ELIX_LEVEL_3_FALSE = @ELIX_LEVEL_3_FALSE@
-ELIX_LEVEL_3_TRUE = @ELIX_LEVEL_3_TRUE@
-ELIX_LEVEL_4_FALSE = @ELIX_LEVEL_4_FALSE@
-ELIX_LEVEL_4_TRUE = @ELIX_LEVEL_4_TRUE@
-ENABLE_NEWLIB_ICONV_FALSE = @ENABLE_NEWLIB_ICONV_FALSE@
-ENABLE_NEWLIB_ICONV_TRUE = @ENABLE_NEWLIB_ICONV_TRUE@
-EXEEXT = @EXEEXT@
-FGREP = @FGREP@
-GREP = @GREP@
-HAVE_POSIX_DIR_FALSE = @HAVE_POSIX_DIR_FALSE@
-HAVE_POSIX_DIR_TRUE = @HAVE_POSIX_DIR_TRUE@
-HAVE_SIGNAL_DIR_FALSE = @HAVE_SIGNAL_DIR_FALSE@
-HAVE_SIGNAL_DIR_TRUE = @HAVE_SIGNAL_DIR_TRUE@
-HAVE_STDIO64_DIR_FALSE = @HAVE_STDIO64_DIR_FALSE@
-HAVE_STDIO64_DIR_TRUE = @HAVE_STDIO64_DIR_TRUE@
-HAVE_STDIO_DIR_FALSE = @HAVE_STDIO_DIR_FALSE@
-HAVE_STDIO_DIR_TRUE = @HAVE_STDIO_DIR_TRUE@
-HAVE_SYSCALL_DIR_FALSE = @HAVE_SYSCALL_DIR_FALSE@
-HAVE_SYSCALL_DIR_TRUE = @HAVE_SYSCALL_DIR_TRUE@
-HAVE_UNIX_DIR_FALSE = @HAVE_UNIX_DIR_FALSE@
-HAVE_UNIX_DIR_TRUE = @HAVE_UNIX_DIR_TRUE@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LD = @LD@
-LDFLAGS = @LDFLAGS@
-LIBC_EXTRA_DEF = @LIBC_EXTRA_DEF@
-LIBC_EXTRA_LIB = @LIBC_EXTRA_LIB@
-LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@
-LIBC_POSIX_LIB = @LIBC_POSIX_LIB@
-LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@
-LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@
-LIBC_STDIO64_DEF = @LIBC_STDIO64_DEF@
-LIBC_STDIO64_LIB = @LIBC_STDIO64_LIB@
-LIBC_STDIO_DEF = @LIBC_STDIO_DEF@
-LIBC_STDIO_LIB = @LIBC_STDIO_LIB@
-LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@
-LIBC_SYS_LIB = @LIBC_SYS_LIB@
-LIBC_UNIX_LIB = @LIBC_UNIX_LIB@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIPO = @LIPO@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
-MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
-MAKEINFO = @MAKEINFO@
-MAY_SUPPLY_SYSCALLS_FALSE = @MAY_SUPPLY_SYSCALLS_FALSE@
-MAY_SUPPLY_SYSCALLS_TRUE = @MAY_SUPPLY_SYSCALLS_TRUE@
-NEWLIB_CFLAGS = @NEWLIB_CFLAGS@
-NM = @NM@
-NMEDIT = @NMEDIT@
-OBJDUMP = @OBJDUMP@
-OBJEXT = @OBJEXT@
-OTOOL = @OTOOL@
-OTOOL64 = @OTOOL64@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-RANLIB = @RANLIB@
-READELF = @READELF@
-SED = @SED@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-USE_LIBTOOL_FALSE = @USE_LIBTOOL_FALSE@
-USE_LIBTOOL_TRUE = @USE_LIBTOOL_TRUE@
-VERSION = @VERSION@
-ac_ct_AR = @ac_ct_AR@
-ac_ct_AS = @ac_ct_AS@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
-ac_ct_DSYMUTIL = @ac_ct_DSYMUTIL@
-ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
-ac_ct_LIPO = @ac_ct_LIPO@
-ac_ct_NMEDIT = @ac_ct_NMEDIT@
-ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
-ac_ct_OTOOL = @ac_ct_OTOOL@
-ac_ct_OTOOL64 = @ac_ct_OTOOL64@
-ac_ct_RANLIB = @ac_ct_RANLIB@
-ac_ct_READELF = @ac_ct_READELF@
-ac_ct_STRIP = @ac_ct_STRIP@
-aext = @aext@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
-am__include = @am__include@
-am__leading_dot = @am__leading_dot@
-am__quote = @am__quote@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-datadir = @datadir@
-exec_prefix = @exec_prefix@
-extra_dir = @extra_dir@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-libm_machine_dir = @libm_machine_dir@
-localstatedir = @localstatedir@
-lpfx = @lpfx@
-lt_ECHO = @lt_ECHO@
-machine_dir = @machine_dir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-newlib_basedir = @newlib_basedir@
-oext = @oext@
-oldincludedir = @oldincludedir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-subdirs = @subdirs@
-sys_dir = @sys_dir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-AUTOMAKE_OPTIONS = cygnus
-INCLUDES = $(NEWLIB_CFLAGS) $(CROSS_CFLAGS) $(TARGET_CFLAGS)
-GENERAL_SOURCES = \
- getcwd.c \
- pread.c \
- pwrite.c \
- sigset.c
-
-ELIX_2_SOURCES = \
- ttyname.c
-
-ELIX_4_SOURCES = \
- basename.c \
- dirname.c \
- getlogin.c \
- getpass.c \
- getpwent.c \
- getut.c
-
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_FALSE@ELIX_SOURCES = $(ELIX_2_SOURCES) $(ELIX_4_SOURCES)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_FALSE@@ELIX_LEVEL_3_TRUE@ELIX_SOURCES = $(ELIX_2_SOURCES)
-@ELIX_LEVEL_1_FALSE@@ELIX_LEVEL_2_TRUE@ELIX_SOURCES = $(ELIX_2_SOURCES)
-@ELIX_LEVEL_1_TRUE@ELIX_SOURCES =
-libunix_la_LDFLAGS = -Xcompiler -nostdlib
-@USE_LIBTOOL_TRUE@noinst_LTLIBRARIES = libunix.la
-@USE_LIBTOOL_TRUE@libunix_la_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES)
-@USE_LIBTOOL_FALSE@noinst_DATA =
-@USE_LIBTOOL_TRUE@noinst_DATA = objectlist.awk.in
-@USE_LIBTOOL_FALSE@noinst_LIBRARIES = lib.a
-@USE_LIBTOOL_FALSE@lib_a_SOURCES = $(GENERAL_SOURCES) $(ELIX_SOURCES)
-@USE_LIBTOOL_FALSE@lib_a_CFLAGS = $(AM_CFLAGS)
-CHEWOUT_FILES =
-SUFFIXES = .def
-CHEW = ../../doc/makedoc -f $(srcdir)/../../doc/doc.str
-TARGETDOC = ../tmp.texi
-CLEANFILES = $(CHEWOUT_FILES) *.ref
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .def .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../../Makefile.shared $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --cygnus unix/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --cygnus unix/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-clean-noinstLIBRARIES:
- -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
-lib.a: $(lib_a_OBJECTS) $(lib_a_DEPENDENCIES)
- -rm -f lib.a
- $(lib_a_AR) lib.a $(lib_a_OBJECTS) $(lib_a_LIBADD)
- $(RANLIB) lib.a
-
-clean-noinstLTLIBRARIES:
- -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
- @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
- dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
- test "$$dir" != "$$p" || dir=.; \
- echo "rm -f \"$${dir}/so_locations\""; \
- rm -f "$${dir}/so_locations"; \
- done
-libunix.la: $(libunix_la_OBJECTS) $(libunix_la_DEPENDENCIES)
- $(LINK) $(am_libunix_la_rpath) $(libunix_la_LDFLAGS) $(libunix_la_OBJECTS) $(libunix_la_LIBADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c $<
-
-.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- $(LTCOMPILE) -c -o $@ $<
-
-lib_a-getcwd.o: getcwd.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getcwd.o `test -f 'getcwd.c' || echo '$(srcdir)/'`getcwd.c
-
-lib_a-getcwd.obj: getcwd.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getcwd.obj `if test -f 'getcwd.c'; then $(CYGPATH_W) 'getcwd.c'; else $(CYGPATH_W) '$(srcdir)/getcwd.c'; fi`
-
-lib_a-pread.o: pread.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-pread.o `test -f 'pread.c' || echo '$(srcdir)/'`pread.c
-
-lib_a-pread.obj: pread.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-pread.obj `if test -f 'pread.c'; then $(CYGPATH_W) 'pread.c'; else $(CYGPATH_W) '$(srcdir)/pread.c'; fi`
-
-lib_a-pwrite.o: pwrite.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-pwrite.o `test -f 'pwrite.c' || echo '$(srcdir)/'`pwrite.c
-
-lib_a-pwrite.obj: pwrite.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-pwrite.obj `if test -f 'pwrite.c'; then $(CYGPATH_W) 'pwrite.c'; else $(CYGPATH_W) '$(srcdir)/pwrite.c'; fi`
-
-lib_a-sigset.o: sigset.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sigset.o `test -f 'sigset.c' || echo '$(srcdir)/'`sigset.c
-
-lib_a-sigset.obj: sigset.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-sigset.obj `if test -f 'sigset.c'; then $(CYGPATH_W) 'sigset.c'; else $(CYGPATH_W) '$(srcdir)/sigset.c'; fi`
-
-lib_a-ttyname.o: ttyname.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ttyname.o `test -f 'ttyname.c' || echo '$(srcdir)/'`ttyname.c
-
-lib_a-ttyname.obj: ttyname.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-ttyname.obj `if test -f 'ttyname.c'; then $(CYGPATH_W) 'ttyname.c'; else $(CYGPATH_W) '$(srcdir)/ttyname.c'; fi`
-
-lib_a-basename.o: basename.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-basename.o `test -f 'basename.c' || echo '$(srcdir)/'`basename.c
-
-lib_a-basename.obj: basename.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-basename.obj `if test -f 'basename.c'; then $(CYGPATH_W) 'basename.c'; else $(CYGPATH_W) '$(srcdir)/basename.c'; fi`
-
-lib_a-dirname.o: dirname.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-dirname.o `test -f 'dirname.c' || echo '$(srcdir)/'`dirname.c
-
-lib_a-dirname.obj: dirname.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-dirname.obj `if test -f 'dirname.c'; then $(CYGPATH_W) 'dirname.c'; else $(CYGPATH_W) '$(srcdir)/dirname.c'; fi`
-
-lib_a-getlogin.o: getlogin.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getlogin.o `test -f 'getlogin.c' || echo '$(srcdir)/'`getlogin.c
-
-lib_a-getlogin.obj: getlogin.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getlogin.obj `if test -f 'getlogin.c'; then $(CYGPATH_W) 'getlogin.c'; else $(CYGPATH_W) '$(srcdir)/getlogin.c'; fi`
-
-lib_a-getpass.o: getpass.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getpass.o `test -f 'getpass.c' || echo '$(srcdir)/'`getpass.c
-
-lib_a-getpass.obj: getpass.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getpass.obj `if test -f 'getpass.c'; then $(CYGPATH_W) 'getpass.c'; else $(CYGPATH_W) '$(srcdir)/getpass.c'; fi`
-
-lib_a-getpwent.o: getpwent.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getpwent.o `test -f 'getpwent.c' || echo '$(srcdir)/'`getpwent.c
-
-lib_a-getpwent.obj: getpwent.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getpwent.obj `if test -f 'getpwent.c'; then $(CYGPATH_W) 'getpwent.c'; else $(CYGPATH_W) '$(srcdir)/getpwent.c'; fi`
-
-lib_a-getut.o: getut.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getut.o `test -f 'getut.c' || echo '$(srcdir)/'`getut.c
-
-lib_a-getut.obj: getut.c
- $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-getut.obj `if test -f 'getut.c'; then $(CYGPATH_W) 'getut.c'; else $(CYGPATH_W) '$(srcdir)/getut.c'; fi`
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-check-am:
-check: check-am
-all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(DATA)
-installdirs:
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-install-am: all-am
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-installcheck: installcheck-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
- -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
- clean-noinstLTLIBRARIES mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am:
-
-install-exec-am:
-
-install-info: install-info-am
-
-install-man:
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am:
-
-.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
- clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \
- ctags distclean distclean-compile distclean-generic \
- distclean-libtool distclean-tags dvi dvi-am html html-am info \
- info-am install install-am install-data install-data-am \
- install-exec install-exec-am install-info install-info-am \
- install-man install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-info-am
-
-objectlist.awk.in: $(noinst_LTLIBRARIES)
- -rm -f objectlist.awk.in
- for i in `ls *.lo` ; \
- do \
- echo $$i `pwd`/$$i >> objectlist.awk.in ; \
- done
-
-.c.def:
- $(CHEW) < $< > $*.def 2> $*.ref
- touch stmp-def
-
-# No doc for unix.
-doc:
-# Tell versions [3.59,3.63) of GNU make to not export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/newlib/libc/unix/basename.c b/newlib/libc/unix/basename.c
deleted file mode 100644
index 3a9cc0c19..000000000
--- a/newlib/libc/unix/basename.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#ifndef _NO_BASENAME
-/* Copyright 2005 Shaun Jackman
- * Permission to use, copy, modify, and distribute this software
- * is freely granted, provided that this notice is preserved.
- */
-
-#include <libgen.h>
-#include <string.h>
-
-char*
-_DEFUN (basename, (path),
- char *path)
-{
- char *p;
- if( path == NULL || *path == '\0' )
- return ".";
- p = path + strlen(path) - 1;
- while( *p == '/' ) {
- if( p == path )
- return path;
- *p-- = '\0';
- }
- while( p >= path && *p != '/' )
- p--;
- return p + 1;
-}
-
-#endif /* !_NO_BASENAME */
diff --git a/newlib/libc/unix/dirname.c b/newlib/libc/unix/dirname.c
deleted file mode 100644
index 164da7f78..000000000
--- a/newlib/libc/unix/dirname.c
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef _NO_DIRNAME
-
-/* Copyright 2005 Shaun Jackman
- * Permission to use, copy, modify, and distribute this software
- * is freely granted, provided that this notice is preserved.
- */
-
-#include <libgen.h>
-#include <string.h>
-
-char *
-_DEFUN (dirname, (path),
- char *path)
-{
- char *p;
- if( path == NULL || *path == '\0' )
- return ".";
- p = path + strlen(path) - 1;
- while( *p == '/' ) {
- if( p == path )
- return path;
- *p-- = '\0';
- }
- while( p >= path && *p != '/' )
- p--;
- return
- p < path ? "." :
- p == path ? "/" :
- (*p = '\0', path);
-}
-
-#endif /* !_NO_DIRNAME */
diff --git a/newlib/libc/unix/getcwd.c b/newlib/libc/unix/getcwd.c
deleted file mode 100644
index b49a4b6e0..000000000
--- a/newlib/libc/unix/getcwd.c
+++ /dev/null
@@ -1,263 +0,0 @@
-#ifndef _NO_GETCWD
-/*
- * Copyright (c) 1989, 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getcwd.c 5.11 (Berkeley) 2/24/91";
-#endif /* LIBC_SCCS and not lint */
-
-#include <sys/stat.h>
-#include <errno.h>
-#include <dirent.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <reent.h>
-#include <_syslist.h>
-
-#define bcopy(a,b,c) memmove (b,a,c)
-
-#define ISDOT(dp) \
- (dp->d_name[0] == '.' && (dp->d_name[1] == '\0' || \
- (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
-
-#ifndef _REENT_ONLY
-
-char *
-getcwd (pt, size)
- char *pt;
- size_t size;
-{
- register struct dirent *dp;
- register DIR *dir;
- register dev_t dev;
- register ino_t ino;
- register int first;
- register char *bpt, *bup;
- struct stat s;
- dev_t root_dev;
- ino_t root_ino;
- size_t ptsize, upsize;
- int save_errno;
- char *ept, *eup, *up;
-
- /*
- * If no buffer specified by the user, allocate one as necessary.
- * If a buffer is specified, the size has to be non-zero. The path
- * is built from the end of the buffer backwards.
- */
-
- if (pt)
- {
- ptsize = 0;
- if (!size)
- {
- errno = EINVAL;
- return (char *) NULL;
- }
- ept = pt + size;
- }
- else
- {
- if (!(pt = (char *) malloc (ptsize = 1024 - 4)))
- {
- return (char *) NULL;
- }
- ept = pt + ptsize;
- }
- bpt = ept - 1;
- *bpt = '\0';
-
- /*
- * Allocate bytes (1024 - malloc space) for the string of "../"'s.
- * Should always be enough (it's 340 levels). If it's not, allocate
- * as necessary. Special * case the first stat, it's ".", not "..".
- */
-
- if (!(up = (char *) malloc (upsize = 1024 - 4)))
- {
- goto err;
- }
- eup = up + MAXPATHLEN;
- bup = up;
- up[0] = '.';
- up[1] = '\0';
-
- /* Save root values, so know when to stop. */
- if (stat ("/", &s))
- goto err;
- root_dev = s.st_dev;
- root_ino = s.st_ino;
-
- errno = 0; /* XXX readdir has no error return. */
-
- for (first = 1;; first = 0)
- {
- /* Stat the current level. */
- if (stat (up, &s))
- goto err;
-
- /* Save current node values. */
- ino = s.st_ino;
- dev = s.st_dev;
-
- /* Check for reaching root. */
- if (root_dev == dev && root_ino == ino)
- {
- *--bpt = '/';
- /*
- * It's unclear that it's a requirement to copy the
- * path to the beginning of the buffer, but it's always
- * been that way and stuff would probably break.
- */
- (void) bcopy (bpt, pt, ept - bpt);
- free (up);
- return pt;
- }
-
- /*
- * Build pointer to the parent directory, allocating memory
- * as necessary. Max length is 3 for "../", the largest
- * possible component name, plus a trailing NULL.
- */
-
- if (bup + 3 + MAXNAMLEN + 1 >= eup)
- {
- if (!(up = (char *) realloc (up, upsize *= 2)))
- {
- goto err;
- }
- bup = up;
- eup = up + upsize;
- }
- *bup++ = '.';
- *bup++ = '.';
- *bup = '\0';
-
- /* Open and stat parent directory. */
- if (!(dir = opendir (up)) || fstat (__dirfd (dir), &s))
- goto err;
-
- /* Add trailing slash for next directory. */
- *bup++ = '/';
-
- /*
- * If it's a mount point, have to stat each element because
- * the inode number in the directory is for the entry in the
- * parent directory, not the inode number of the mounted file.
- */
-
- save_errno = 0;
- if (s.st_dev == dev)
- {
- for (;;)
- {
- if (!(dp = readdir (dir)))
- goto notfound;
- if (dp->d_ino == ino)
- break;
- }
- }
- else
- for (;;)
- {
- if (!(dp = readdir (dir)))
- goto notfound;
- if (ISDOT (dp))
- continue;
- bcopy (dp->d_name, bup, strlen (dp->d_name) + 1);
-
- /* Save the first error for later. */
- if (stat (up, &s))
- {
- if (!save_errno)
- save_errno = errno;
- errno = 0;
- continue;
- }
- if (s.st_dev == dev && s.st_ino == ino)
- break;
- }
-
- /*
- * Check for length of the current name, preceding slash,
- * leading slash.
- */
-
- if (bpt - pt <= strlen (dp->d_name) + (first ? 1 : 2))
- {
- size_t len, off;
-
- if (!ptsize)
- {
- errno = ERANGE;
- goto err;
- }
- off = bpt - pt;
- len = ept - bpt;
- if (!(pt = (char *) realloc (pt, ptsize *= 2)))
- {
- goto err;
- }
- bpt = pt + off;
- ept = pt + ptsize;
- (void) bcopy (bpt, ept - len, len);
- bpt = ept - len;
- }
- if (!first)
- *--bpt = '/';
- bpt -= strlen (dp->d_name);
- bcopy (dp->d_name, bpt, strlen (dp->d_name));
- (void) closedir (dir);
-
- /* Truncate any file name. */
- *bup = '\0';
- }
-
-notfound:
- /*
- * If readdir set errno, use it, not any saved error; otherwise,
- * didn't find the current directory in its parent directory, set
- * errno to ENOENT.
- */
-
- if (!errno)
- errno = save_errno ? save_errno : ENOENT;
- /* FALLTHROUGH */
-
-err:
- if (ptsize)
- free (pt);
- free (up);
- return (char *) NULL;
-}
-
-#endif /* _REENT_ONLY */
-#endif /* !_NO_GETCWD */
diff --git a/newlib/libc/unix/getlogin.c b/newlib/libc/unix/getlogin.c
deleted file mode 100644
index da4f47a95..000000000
--- a/newlib/libc/unix/getlogin.c
+++ /dev/null
@@ -1,45 +0,0 @@
-#ifndef _NO_GETLOGIN
-
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <utmp.h>
-#include <fcntl.h>
-#include <_syslist.h>
-
-char *
-getlogin ()
-{
- int utmp_fd;
- struct utmp utmp_buf;
- static char buf[10];
- extern char *ttyname ();
- char *tty;
-
- if (((tty = ttyname (0)) == 0)
- || ((tty = ttyname (1)) == 0)
- || ((tty = ttyname (2)) == 0))
- return 0;
-
- if ((utmp_fd = open (UTMP_FILE, O_RDONLY)) == -1)
- return 0;
-
- if (!strncmp (tty, "/dev/", 5))
- tty += 5;
-
- while (read (utmp_fd, &utmp_buf, sizeof (utmp_buf)) == sizeof (utmp_buf))
- {
- if (!strncmp (tty, utmp_buf.ut_line, sizeof (utmp_buf.ut_line))
- && utmp_buf.ut_type == USER_PROCESS)
- {
- close (utmp_fd);
- memset (buf, 0, sizeof (buf));
- strncpy (buf, utmp_buf.ut_user, sizeof (utmp_buf.ut_user));
- return buf;
- }
- }
-
- close (utmp_fd);
- return 0;
-}
-#endif /* !_NO_GETLOGIN */
diff --git a/newlib/libc/unix/getpass.c b/newlib/libc/unix/getpass.c
deleted file mode 100644
index de23261cb..000000000
--- a/newlib/libc/unix/getpass.c
+++ /dev/null
@@ -1,101 +0,0 @@
-#ifndef _NO_GETPASS
-/*
- * Copyright (c) 1988 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)getpass.c 5.9 (Berkeley) 5/6/91";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <pwd.h>
-#include <sys/termios.h>
-#include <sys/signal.h>
-#include <_syslist.h>
-
-#ifndef _PATH_PASSWD
-#define _PATH_PASSWD "/etc/passwd"
-#endif
-
-#ifndef _PASSWORD_LEN
-#define _PASSWORD_LEN 128 /* max length, not counting NULL */
-#endif
-
-char *
-getpass (prompt)
- const char *prompt;
-{
- struct termios term;
- register int ch;
- register char *p;
- FILE *fp, *outfp;
- long omask;
- int echo;
- static char buf[_PASSWORD_LEN + 1];
-
- /*
- * read and write to /dev/tty if possible; else read from
- * stdin and write to stderr.
- */
-
- if ((outfp = fp = fopen ("/dev/tty", "w+")) == NULL)
- {
- outfp = stderr;
- fp = stdin;
- }
- /*
- * note - blocking signals isn't necessarily the
- * right thing, but we leave it for now.
- */
- omask = sigblock (sigmask (SIGINT) | sigmask (SIGTSTP));
- (void) tcgetattr (fileno (fp), &term);
- echo = (term.c_lflag & ECHO);
- if (echo)
- {
- term.c_lflag &= ~ECHO;
- (void) tcsetattr (fileno (fp), TCSAFLUSH, &term);
- }
- (void) fputs (prompt, outfp);
- rewind (outfp); /* implied flush */
- for (p = buf; (ch = getc (fp)) != EOF && ch != '\n';)
- if (p < buf + _PASSWORD_LEN)
- *p++ = ch;
- *p = '\0';
- (void) write (fileno (outfp), "\n", 1);
- if (echo)
- {
- term.c_lflag |= ECHO;
- tcsetattr (fileno (fp), TCSAFLUSH, &term);
- }
- (void) sigsetmask (omask);
- if (fp != stdin)
- (void) fclose (fp);
- return buf;
-}
-#endif /* !_NO_GETPASS */
diff --git a/newlib/libc/unix/getpwent.c b/newlib/libc/unix/getpwent.c
deleted file mode 100644
index 0f13a20f7..000000000
--- a/newlib/libc/unix/getpwent.c
+++ /dev/null
@@ -1,131 +0,0 @@
-#ifndef _NO_GETPWENT
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <pwd.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-
-static struct passwd pw_passwd; /* password structure */
-static FILE *passwd_fp;
-
-static char logname[8];
-static char password[1024];
-static char gecos[1024];
-static char dir[1024];
-static char shell[1024];
-
-struct passwd *
-getpwnam (name)
- const char *name;
-{
- FILE *fp;
- char buf[1024];
-
- if ((fp = fopen ("/etc/passwd", "r")) == NULL)
- {
- return NULL;
- }
-
- while (fgets (buf, sizeof (buf), fp))
- {
- sscanf (buf, "%[^:]:%[^:]:%d:%d:%[^:]:%[^:]:%s\n",
- logname, password, &pw_passwd.pw_uid,
- &pw_passwd.pw_gid, gecos,
- dir, shell);
- pw_passwd.pw_name = logname;
- pw_passwd.pw_passwd = password;
- pw_passwd.pw_comment = "";
- pw_passwd.pw_gecos = gecos;
- pw_passwd.pw_dir = dir;
- pw_passwd.pw_shell = shell;
-
- if (!strcmp (logname, name))
- {
- fclose (fp);
- return &pw_passwd;
- }
- }
- fclose (fp);
- return NULL;
-}
-
-struct passwd *
-getpwuid (uid_t uid)
-{
- FILE *fp;
- char buf[1024];
-
- if ((fp = fopen ("/etc/passwd", "r")) == NULL)
- {
- return NULL;
- }
-
- while (fgets (buf, sizeof (buf), fp))
- {
- sscanf (buf, "%[^:]:%[^:]:%d:%d:%[^:]:%[^:]:%s\n",
- logname, password, &pw_passwd.pw_uid,
- &pw_passwd.pw_gid, gecos,
- dir, shell);
- pw_passwd.pw_name = logname;
- pw_passwd.pw_passwd = password;
- pw_passwd.pw_comment = "";
- pw_passwd.pw_gecos = gecos;
- pw_passwd.pw_dir = dir;
- pw_passwd.pw_shell = shell;
-
- if (uid == pw_passwd.pw_uid)
- {
- fclose (fp);
- return &pw_passwd;
- }
- }
- fclose (fp);
- return NULL;
-}
-
-struct passwd *
-getpwent ()
-{
- char buf[1024];
-
- if (passwd_fp == NULL)
- return NULL;
-
- if (fgets (buf, sizeof (buf), passwd_fp) == NULL)
- return NULL;
-
- sscanf (buf, "%[^:]:%[^:]:%d:%d:%[^:]:%[^:]:%s\n",
- logname, password, &pw_passwd.pw_uid,
- &pw_passwd.pw_gid, gecos,
- dir, shell);
- pw_passwd.pw_name = logname;
- pw_passwd.pw_passwd = password;
- pw_passwd.pw_comment = "";
- pw_passwd.pw_gecos = gecos;
- pw_passwd.pw_dir = dir;
- pw_passwd.pw_shell = shell;
-
- return &pw_passwd;
-}
-
-void
-setpwent ()
-{
- if (passwd_fp != NULL)
- fclose (passwd_fp);
-
- passwd_fp = fopen ("/etc/passwd", "r");
-}
-
-void
-endpwent ()
-{
- if (passwd_fp != NULL)
- fclose (passwd_fp);
-}
-
-#endif /* !_NO_GETPWENT */
diff --git a/newlib/libc/unix/getut.c b/newlib/libc/unix/getut.c
deleted file mode 100644
index cf054cb46..000000000
--- a/newlib/libc/unix/getut.c
+++ /dev/null
@@ -1,90 +0,0 @@
-#ifndef _NO_GETUT
-
-#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <utmp.h>
-#include <_syslist.h>
-#include <_ansi.h>
-
-static int utmp_fd = -2;
-static char *utmp_file = UTMP_FILE;
-
-static struct utmp utmp_data;
-
-void
-setutent ()
-{
- if (utmp_fd == -2)
- {
- utmp_fd = open (utmp_file, O_RDONLY);
- }
- lseek (utmp_fd, 0, SEEK_SET);
-}
-
-void
-endutent ()
-{
- close (utmp_fd);
- utmp_fd = -2;
-}
-
-void
-utmpname (_CONST char *file)
-{
- utmp_file = strdup (file);
-}
-
-struct utmp *
-getutent ()
-{
- if (utmp_fd == -2)
- setutent ();
- if (read (utmp_fd, &utmp_data, sizeof (utmp_data)) < sizeof (utmp_data))
- return 0;
- return &utmp_data;
-}
-
-struct utmp *
-getutid (struct utmp *id)
-{
- while (read (utmp_fd, &utmp_data, sizeof (utmp_data)) == sizeof (utmp_data))
- {
- switch (id->ut_type)
- {
- case RUN_LVL:
- case BOOT_TIME:
- case OLD_TIME:
- case NEW_TIME:
- if (id->ut_type == utmp_data.ut_type)
- return &utmp_data;
- case INIT_PROCESS:
- case LOGIN_PROCESS:
- case USER_PROCESS:
- case DEAD_PROCESS:
- if (id->ut_id == utmp_data.ut_id)
- return &utmp_data;
- default:
- abort ();
- }
- }
- return 0;
-}
-
-struct utmp *
-getutline (struct utmp *line)
-{
- while (read (utmp_fd, &utmp_data, sizeof (utmp_data)) == sizeof (utmp_data))
- {
- if ((utmp_data.ut_type == LOGIN_PROCESS ||
- utmp_data.ut_type == USER_PROCESS) &&
- !strncmp (utmp_data.ut_line, line->ut_line,
- sizeof (utmp_data.ut_line)))
- return &utmp_data;
- }
-
- return 0;
-}
-
-#endif /* !_NO_GETUT */
diff --git a/newlib/libc/unix/pread.c b/newlib/libc/unix/pread.c
deleted file mode 100644
index 770c3fcf0..000000000
--- a/newlib/libc/unix/pread.c
+++ /dev/null
@@ -1,93 +0,0 @@
-#ifndef _NO_PREAD
-/*
-FUNCTION
-<<pread>>---read a file from specified position
-
-INDEX
- pread
-INDEX
- _pread_r
-
-ANSI_SYNOPSIS
- #include <unistd.h>
- ssize_t pread(int <[fd]>, void *<[buf]>, size_t <[n]>, off_t <[off]>);
- ssize_t _pread_r(struct _reent *<[rptr]>, int <[fd]>,
- void *<[buf]>, size_t <[n]>, off_t <[off]>);
-
-TRAD_SYNOPSIS
- #include <unistd.h>
- ssize_t pread(<[fd]>, <[buf]>, <[n]>, <[off]>)
- int <[fd]>;
- void *<[buf]>;
- size_t <[n]>;
- off_t <[off]>;
-
- ssize_t _pread_r(<[rptr]>, <[fd]>, <[buf]>, <[n]>, <[off]>)
- struct _reent *<[rptr]>;
- int <[fd]>;
- void *<[buf]>;
- size_t <[n]>;
- off_t <[off]>;
-
-DESCRIPTION
-The <<pread>> function is similar to <<read>>. One difference is that
-<<pread>> has an additional parameter <[off]> which is the offset to
-position in the file before reading. The function also differs in that
-the file position is unchanged by the function (i.e. the file position
-is the same before and after a call to <<pread>>).
-
-The <<_pread_r>> function is the same as <<pread>>, only a reentrant
-struct pointer <[rptr]> is provided to preserve reentrancy.
-
-RETURNS
-<<pread>> returns the number of bytes read or <<-1>> if failure occurred.
-
-PORTABILITY
-<<pread>> is non-ANSI and is specified by the Single Unix Specification.
-
-Supporting OS subroutine required: <<read>>, <<lseek>>.
-*/
-
-#include <_ansi.h>
-#include <unistd.h>
-#include <reent.h>
-
-ssize_t
-_DEFUN (_pread_r, (rptr, fd, buf, n, off),
- struct _reent *rptr _AND
- int fd _AND
- _PTR buf _AND
- size_t n _AND
- off_t off)
-{
- off_t cur_pos;
- _READ_WRITE_RETURN_TYPE num_read;
-
- if ((cur_pos = _lseek_r (rptr, fd, 0, SEEK_CUR)) == (off_t)-1)
- return -1;
-
- if (_lseek_r (rptr, fd, off, SEEK_SET) == (off_t)-1)
- return -1;
-
- num_read = _read_r (rptr, fd, buf, n);
-
- if (_lseek_r (rptr, fd, cur_pos, SEEK_SET) == (off_t)-1)
- return -1;
-
- return (ssize_t)num_read;
-}
-
-#ifndef _REENT_ONLY
-
-ssize_t
-_DEFUN (pread, (fd, buf, n, off),
- int fd _AND
- _PTR buf _AND
- size_t n _AND
- off_t off)
-{
- return _pread_r (_REENT, fd, buf, n, off);
-}
-
-#endif /* !_REENT_ONLY */
-#endif /* !_NO_PREAD */
diff --git a/newlib/libc/unix/pwrite.c b/newlib/libc/unix/pwrite.c
deleted file mode 100644
index 9f2a89835..000000000
--- a/newlib/libc/unix/pwrite.c
+++ /dev/null
@@ -1,94 +0,0 @@
-#ifndef _NO_PWRITE
-/*
-FUNCTION
-<<pwrite>>---write a file from specified position
-
-INDEX
- pwrite
-INDEX
- _pwrite_r
-
-ANSI_SYNOPSIS
- #include <unistd.h>
- ssize_t pwrite(int <[fd]>, const void *<[buf]>,
- size_t <[n]>, off_t <[off]>);
- ssize_t _pwrite_r(struct _reent *<[rptr]>, int <[fd]>,
- const void *<[buf]>, size_t <[n]>, off_t <[off]>);
-
-TRAD_SYNOPSIS
- #include <unistd.h>
- ssize_t pwrite(<[fd]>, <[buf]>, <[n]>, <[off]>)
- int <[fd]>;
- const void *<[buf]>;
- size_t <[n]>;
- off_t <[off]>;
-
- ssize_t _pwrite_r(<[rptr]>, <[fd]>, <[buf]>, <[n]>, <[off]>)
- struct _reent *<[rptr]>;
- int <[fd]>;
- const void *<[buf]>;
- size_t <[n]>;
- off_t <[off]>;
-
-DESCRIPTION
-The <<pwrite>> function is similar to <<write>>. One difference is that
-<<pwrite>> has an additional parameter <[off]> which is the offset to
-position in the file before writing. The function also differs in that
-the file position is unchanged by the function (i.e. the file position
-is the same before and after a call to <<pwrite>>).
-
-The <<_pwrite_r>> function is the same as <<pwrite>>, only a reentrant
-struct pointer <[rptr]> is provided to preserve reentrancy.
-
-RETURNS
-<<pwrite>> returns the number of bytes written or <<-1>> if failure occurred.
-
-PORTABILITY
-<<pwrite>> is non-ANSI and is specified by the Single Unix Specification.
-
-Supporting OS subroutine required: <<write>>, <<lseek>>.
-*/
-
-#include <_ansi.h>
-#include <unistd.h>
-#include <reent.h>
-
-ssize_t
-_DEFUN (_pwrite_r, (rptr, fd, buf, n, off),
- struct _reent *rptr _AND
- int fd _AND
- _CONST _PTR buf _AND
- size_t n _AND
- off_t off)
-{
- off_t cur_pos;
- _READ_WRITE_RETURN_TYPE num_written;
-
- if ((cur_pos = _lseek_r (rptr, fd, 0, SEEK_CUR)) == (off_t)-1)
- return -1;
-
- if (_lseek_r (rptr, fd, off, SEEK_SET) == (off_t)-1)
- return -1;
-
- num_written = _write_r (rptr, fd, buf, n);
-
- if (_lseek_r (rptr, fd, cur_pos, SEEK_SET) == (off_t)-1)
- return -1;
-
- return (ssize_t)num_written;
-}
-
-#ifndef _REENT_ONLY
-
-ssize_t
-_DEFUN (pwrite, (fd, buf, n, off),
- int fd _AND
- _CONST _PTR buf _AND
- size_t n _AND
- off_t off)
-{
- return _pwrite_r (_REENT, fd, buf, n, off);
-}
-
-#endif /* !_REENT_ONLY */
-#endif /* !_NO_PWRITE */
diff --git a/newlib/libc/unix/sigset.c b/newlib/libc/unix/sigset.c
deleted file mode 100644
index 186134956..000000000
--- a/newlib/libc/unix/sigset.c
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef _NO_SIGSET
-
-#include <signal.h>
-#include <errno.h>
-
-#if defined(SIG_SETMASK) && NSIG <= 32 /* easier than trying to remove from Makefile */
-
-#undef sigemptyset
-int
-sigemptyset (sigset_t * set)
-{
- *set = (sigset_t) 0;
- return 0;
-}
-
-#undef sigfillset
-int
-sigfillset (sigset_t * set)
-{
- *set = ~((sigset_t) 0);
- return 0;
-}
-
-#undef sigaddset
-int
-sigaddset (sigset_t * set, int signo)
-{
- if (signo >= NSIG || signo <= 0)
- {
- errno = EINVAL;
- return -1;
- }
- *set |= 1 << (signo - 1);
- return 0;
-}
-
-#undef sigdelset
-int
-sigdelset (sigset_t * set, int signo)
-{
- if (signo >= NSIG || signo <= 0)
- {
- errno = EINVAL;
- return -1;
- }
- *set &= ~(1 << (signo - 1));
- return 0;
-}
-
-#undef sigismember
-int
-sigismember (const sigset_t * set, int signo)
-{
- if (signo >= NSIG || signo <= 0)
- {
- errno = EINVAL;
- return -1;
- }
-
- if (*set & (1 << (signo - 1)))
- return 1;
- else
- return 0;
-}
-
-#endif /* SIG_SETMASK */
-#endif /* _NO_SIGSET */
diff --git a/newlib/libc/unix/ttyname.c b/newlib/libc/unix/ttyname.c
deleted file mode 100644
index 7e0fec89c..000000000
--- a/newlib/libc/unix/ttyname.c
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifndef _NO_TTYNAME
-/*
- * Copyright (c) 1988 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <unistd.h>
-#include <string.h>
-#include <paths.h>
-#include <_syslist.h>
-#include <errno.h>
-
-static char ttyname_buf[sizeof (_PATH_DEV) + MAXNAMLEN] = _PATH_DEV;
-
-/*
- * ttyname_r() - POSIX 1003.1b 4.7.2 - Determine Terminal Device Name
- */
-int
-_DEFUN( ttyname_r,(fd, name, namesize),
- int fd _AND
- char *name _AND
- size_t namesize)
-{
- struct stat sb;
- struct dirent *dirp;
- DIR *dp;
- struct stat dsb;
- char buf[sizeof(ttyname_buf)];
-
- /* Must be a terminal. */
- if (!isatty(fd))
- return ENOTTY;
-
- /* Must be a character device. */
- if (fstat (fd, &sb) || !S_ISCHR (sb.st_mode))
- return ENOTTY;
-
- if ((dp = opendir (_PATH_DEV)) == NULL)
- return EBADF;
-
- strcpy(buf, _PATH_DEV);
- while ((dirp = readdir (dp)) != NULL)
- {
- if (dirp->d_ino != sb.st_ino)
- continue;
- strcpy (buf + sizeof (_PATH_DEV) - 1, dirp->d_name);
- if (stat (buf, &dsb) || sb.st_dev != dsb.st_dev ||
- sb.st_ino != dsb.st_ino)
- continue;
- (void) closedir (dp);
- if(strlen(buf) < namesize) /* < to account for terminating null */
- {
- strcpy(name, buf);
- return 0;
- }
- else
- {
- return ERANGE;
- }
- }
- (void) closedir (dp);
- return EBADF;
-}
-
-/*
- * ttyname() - POSIX 1003.1b 4.7.2 - Determine Terminal Device Name
- */
-char *
-_DEFUN( ttyname,(fd),
- int fd)
-{
- register int fail;
- register char *ret=NULL;
- fail = ttyname_r( fd, ttyname_buf, sizeof(ttyname_buf) );
- if ( fail ) errno = fail;
- else ret = ttyname_buf;
- return ret;
-}
-#endif /* !_NO_TTYNAME */