diff -urN fileutils-4.0l/config.h fileutils-4.0l-eo/config.h --- fileutils-4.0l/config.h Thu Jun 26 22:02:39 2003 +++ fileutils-4.0l-eo/config.h Thu Jun 26 21:28:22 2003 @@ -35,7 +35,7 @@ #define D_TYPE_IN_DIRENT 1 /* Define to 1 if NLS is requested. */ -#define ENABLE_NLS 1 +/* #define ENABLE_NLS 1 */ /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ @@ -45,22 +45,22 @@ #define GNU_PACKAGE "GNU fileutils" /* Define if TIOCGWINSZ requires sys/ioctl.h */ -#define GWINSZ_IN_SYS_IOCTL 1 +/* #define GWINSZ_IN_SYS_IOCTL 1 */ /* Define if you have the `acl' function. */ /* #undef HAVE_ACL */ /* Define if you have the `alarm' function. */ -#define HAVE_ALARM 1 +/* #define HAVE_ALARM 1 */ /* Define if you have `alloca', as a function or macro. */ #define HAVE_ALLOCA 1 /* Define if you have and it should be used (not on Ultrix). */ -#define HAVE_ALLOCA_H 1 +/* #define HAVE_ALLOCA_H 1 */ /* Define if you have the header file. */ -#define HAVE_ARGZ_H 1 +/* #define HAVE_ARGZ_H 1 */ /* Define if you have the `bcopy' function. */ #define HAVE_BCOPY 1 @@ -96,7 +96,7 @@ #define HAVE_DECL_REALLOC 1 /* Define if this function is declared. */ -#define HAVE_DECL_STPCPY 1 +/* #define HAVE_DECL_STPCPY 1 */ /* Define if this function is declared. */ #define HAVE_DECL_STRSTR 1 @@ -117,37 +117,37 @@ #define HAVE_DUP2 1 /* Define if you have the `endgrent' function. */ -#define HAVE_ENDGRENT 1 +/* #define HAVE_ENDGRENT 1 */ /* Define if you have the `endpwent' function. */ -#define HAVE_ENDPWENT 1 +/* #define HAVE_ENDPWENT 1 */ /* Define if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define if you have the `euidaccess' function. */ -#define HAVE_EUIDACCESS 1 +/* #define HAVE_EUIDACCESS 1 */ /* Define if you have the `fchdir' function. */ -#define HAVE_FCHDIR 1 +/* #define HAVE_FCHDIR 1 */ /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the `fdatasync' function. */ -#define HAVE_FDATASYNC 1 +/* #define HAVE_FDATASYNC 1 */ /* Define if your system has a working `fnmatch' function. */ -#define HAVE_FNMATCH 1 +/* #define HAVE_FNMATCH 1 */ /* Define if you have the header file. */ -#define HAVE_FNMATCH_H 1 +/* #define HAVE_FNMATCH_H 1 */ /* Define if you have the `ftime' function. */ -#define HAVE_FTIME 1 +/* #define HAVE_FTIME 1 */ /* Define if you have the `ftruncate' function. */ -#define HAVE_FTRUNCATE 1 +/* #define HAVE_FTRUNCATE 1 */ /* Define if struct statfs has the f_fstypename member. */ /* #undef HAVE_F_FSTYPENAME_IN_STATFS */ @@ -165,29 +165,29 @@ /* #undef HAVE_GETHRTIME */ /* Define if you have the `getmntent' function. */ -#define HAVE_GETMNTENT 1 +/* #define HAVE_GETMNTENT 1 */ /* Define if you have the `getmntinfo' function. */ /* #undef HAVE_GETMNTINFO */ /* Define if you have the `getpagesize' function. */ -#define HAVE_GETPAGESIZE 1 +/* #define HAVE_GETPAGESIZE 1 */ /* Define to 1 if you have gettext and don't want to use GNU gettext. */ -#define HAVE_GETTEXT 1 +/* #define HAVE_GETTEXT 1 */ /* Define if you have the `hasmntopt' function. */ -#define HAVE_HASMNTOPT 1 +/* #define HAVE_HASMNTOPT 1 */ /* Define if exists, doesn't clash with , and declares uintmax_t. */ -#define HAVE_INTTYPES_H 1 +/* #define HAVE_INTTYPES_H 1 */ /* Define if you have the `isascii' function. */ #define HAVE_ISASCII 1 /* Define if you have the `lchown' function. */ -#define HAVE_LCHOWN 1 +/* #define HAVE_LCHOWN 1 */ /* Define if your locale.h file contains LC_MESSAGES. */ #define HAVE_LC_MESSAGES 1 @@ -211,7 +211,7 @@ /* #undef HAVE_LIBINTL */ /* Define if you have the header file. */ -#define HAVE_LIBINTL_H 1 +/* #define HAVE_LIBINTL_H 1 */ /* Define if you have the `ldgc' library (-lldgc). */ /* #undef HAVE_LIBLDGC */ @@ -258,7 +258,7 @@ #define HAVE_MBLEN 1 /* Define if you have the `mbrlen' function. */ -#define HAVE_MBRLEN 1 +/* #define HAVE_MBRLEN 1 */ /* Define if you have the `memchr' function. */ #define HAVE_MEMCHR 1 @@ -273,10 +273,10 @@ #define HAVE_MEMMOVE 1 /* Define if you have the header file. */ -#define HAVE_MEMORY_H 1 +/* #define HAVE_MEMORY_H 1 */ /* Define if you have the `mempcpy' function. */ -#define HAVE_MEMPCPY 1 +/* #define HAVE_MEMPCPY 1 */ /* Define if you have the `memset' function. */ #define HAVE_MEMSET 1 @@ -288,25 +288,25 @@ #define HAVE_MKFIFO 1 /* Define if you have a working `mmap' system call. */ -#define HAVE_MMAP 1 +/* #define HAVE_MMAP 1 */ /* Define if you have the header file. */ -#define HAVE_MNTENT_H 1 +/* #define HAVE_MNTENT_H 1 */ /* Define if you have the header file. */ /* #undef HAVE_MNTTAB_H */ /* Define if you have the `munmap' function. */ -#define HAVE_MUNMAP 1 +/* #define HAVE_MUNMAP 1 */ /* Define if you have the header file. */ /* #undef HAVE_NDIR_H */ /* Define if you have the header file. */ -#define HAVE_NL_TYPES_H 1 +/* #define HAVE_NL_TYPES_H 1 */ /* Define if libc includes obstacks */ -#define HAVE_OBSTACK 1 +/* #define HAVE_OBSTACK 1 */ /* Define if you have the `putenv' function. */ #define HAVE_PUTENV 1 @@ -315,7 +315,7 @@ #define HAVE_RMDIR 1 /* Define if you have the `rpmatch' function. */ -#define HAVE_RPMATCH 1 +/* #define HAVE_RPMATCH 1 */ /* Define if you have the `setenv' function. */ #define HAVE_SETENV 1 @@ -332,7 +332,7 @@ #define HAVE_STDLIB_H 1 /* Define to 1 if you have the stpcpy function. */ -#define HAVE_STPCPY 1 +/* #define HAVE_STPCPY 1 */ /* Define if you have the `strcasecmp' function. */ #define HAVE_STRCASECMP 1 @@ -347,10 +347,10 @@ #define HAVE_STRERROR 1 /* Define if you have the `strerror_r' function. */ -#define HAVE_STRERROR_R 1 +/* #define HAVE_STRERROR_R 1 */ /* Define if you have the header file. */ -#define HAVE_STRINGS_H 1 +/* #define HAVE_STRINGS_H 1 */ /* Define if you have the header file. */ #define HAVE_STRING_H 1 @@ -359,7 +359,7 @@ #define HAVE_STRNCASECMP 1 /* Define if you have the `strndup' function. */ -#define HAVE_STRNDUP 1 +/* #define HAVE_STRNDUP 1 */ /* Define if you have the `strrchr' function. */ #define HAVE_STRRCHR 1 @@ -386,14 +386,14 @@ #define HAVE_STRUCT_STAT_ST_BLOCKS 1 /* Define if `tm_zone' is member of `struct tm'. */ -#define HAVE_STRUCT_TM_TM_ZONE 1 +/* #define HAVE_STRUCT_TM_TM_ZONE 1 */ /* Define if struct utimbuf is declared -- usually in . Some systems have utime.h but don't declare the struct anywhere. */ #define HAVE_STRUCT_UTIMBUF 1 /* Define if you have the `strverscmp' function. */ -#define HAVE_STRVERSCMP 1 +/* #define HAVE_STRVERSCMP 1 */ /* Define if your `struct stat' has `st_blocks'. Deprecated, use `HAVE_STRUCT_STAT_ST_BLOCKS' instead. */ @@ -421,13 +421,13 @@ /* #undef HAVE_SYS_FS_TYPES_H */ /* Define if you have the header file. */ -#define HAVE_SYS_IOCTL_H 1 +/* #define HAVE_SYS_IOCTL_H 1 */ /* Define if you have the header file. */ /* #undef HAVE_SYS_MNTENT_H */ /* Define if you have the header file. */ -#define HAVE_SYS_MOUNT_H 1 +/* #define HAVE_SYS_MOUNT_H 1 */ /* Define if you have the header file. */ /* #undef HAVE_SYS_NDIR_H */ @@ -436,10 +436,10 @@ #define HAVE_SYS_PARAM_H 1 /* Define if you have the header file. */ -#define HAVE_SYS_STATFS_H 1 +/* #define HAVE_SYS_STATFS_H 1 */ /* Define if you have the header file. */ -#define HAVE_SYS_STATVFS_H 1 +/* #define HAVE_SYS_STATVFS_H 1 */ /* Define if you have the header file. */ #define HAVE_SYS_TIMEB_H 1 @@ -448,27 +448,27 @@ #define HAVE_SYS_TIME_H 1 /* Define if you have the header file. */ -#define HAVE_SYS_VFS_H 1 +/* #define HAVE_SYS_VFS_H 1 */ /* Define if you have the header file. */ #define HAVE_SYS_WAIT_H 1 /* Define if you have the header file. */ -#define HAVE_TERMIOS_H 1 +/* #define HAVE_TERMIOS_H 1 */ /* Define if struct tm has the tm_gmtoff member. */ #define HAVE_TM_GMTOFF 1 /* Define if your `struct tm' has `tm_zone'. Deprecated, use `HAVE_STRUCT_TM_TM_ZONE' instead. */ -#define HAVE_TM_ZONE 1 +/* #define HAVE_TM_ZONE 1 */ /* Define if you don't have `tm_zone' but do have the external array `tzname'. */ /* #undef HAVE_TZNAME */ /* Define if you have the `tzset' function. */ -#define HAVE_TZSET 1 +/* #define HAVE_TZSET 1 */ /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 @@ -489,7 +489,7 @@ #define HAVE_UTIME_NULL 1 /* Define if you have the header file. */ -#define HAVE_VALUES_H 1 +/* #define HAVE_VALUES_H 1 */ /* Define if you have the `vprintf' function. */ #define HAVE_VPRINTF 1 @@ -504,13 +504,13 @@ #define HAVE_WORKING_READDIR 1 /* Define if you have the `__argz_count' function. */ -#define HAVE___ARGZ_COUNT 1 +/* #define HAVE___ARGZ_COUNT 1 */ /* Define if you have the `__argz_next' function. */ -#define HAVE___ARGZ_NEXT 1 +/* #define HAVE___ARGZ_NEXT 1 */ /* Define if you have the `__argz_stringify' function. */ -#define HAVE___ARGZ_STRINGIFY 1 +/* #define HAVE___ARGZ_STRINGIFY 1 */ /* Define if `link(2)' dereferences symbolic links. */ /* #undef LINK_FOLLOWS_SYMLINKS */ @@ -544,7 +544,7 @@ /* Define if there is a function named getmntent for reading the list of mounted filesystems, and that function takes a single argument. (4.3BSD, SunOS, HP-UX, Dynix, Irix) */ -#define MOUNTED_GETMNTENT1 1 +/* #define MOUNTED_GETMNTENT1 1 */ /* Define if there is a function named getmntent for reading the list of mounted filesystems, and that function takes two arguments. (SVR4) */ @@ -621,7 +621,7 @@ /* #undef STAT_STATFS4 */ /* Define if there is a function named statvfs. (SVR4) */ -#define STAT_STATVFS 1 +/* #define STAT_STATVFS 1 */ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 @@ -731,3 +731,5 @@ /* Define to `unsigned long' or `unsigned long long' if doesn't define. */ /* #undef uintmax_t */ +#define intmax_t long long int +#define uintmax_t unsigned long long int diff -urN fileutils-4.0l/lib/Makefile fileutils-4.0l-eo/lib/Makefile --- fileutils-4.0l/lib/Makefile Thu Jun 26 22:02:24 2003 +++ fileutils-4.0l-eo/lib/Makefile Thu Jun 26 21:22:50 2003 @@ -12,6 +12,16 @@ SHELL = /bin/sh +ROOT = $(HOME)/EOTA/eota/kernel +NEWLIB = $(HOME)/EOTA/libc/newlib-1.8.1/eota/newlib +LIBS = $(NEWLIB)/crt0.o $(NEWLIB)/libc.a +KERNLIBS = $(ROOT)/POSIX/libc/libnative.a +STARTADDR = 0x00001000 +ENTRY = _start +CFLAGS = -O2 -Wall -I. -I$(NEWLIB)/targ-include \ + -I$(NEWLIB)/libc/include -DEOTA +LDFLAGS = -Bstatic -o $@ -e ${ENTRY} -Ttext=$(STARTADDR) + srcdir = . top_srcdir = .. prefix = /usr/local @@ -38,10 +48,10 @@ top_builddir = .. -ACLOCAL = ${SHELL} /tmp/fileutils-4.0l/missing --run aclocal -AUTOCONF = ${SHELL} /tmp/fileutils-4.0l/missing --run autoconf -AUTOMAKE = ${SHELL} /tmp/fileutils-4.0l/missing --run automake -AUTOHEADER = ${SHELL} /tmp/fileutils-4.0l/missing --run autoheader +ACLOCAL = ${SHELL} /home/shin/EOTA/app/fileutils-4.0l/missing --run aclocal +AUTOCONF = ${SHELL} /home/shin/EOTA/app/fileutils-4.0l/missing --run autoconf +AUTOMAKE = ${SHELL} /home/shin/EOTA/app/fileutils-4.0l/missing --run automake +AUTOHEADER = ${SHELL} /home/shin/EOTA/app/fileutils-4.0l/missing --run autoheader INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} @@ -59,7 +69,7 @@ host_alias = i586-pc-linux-gnu host_triplet = i586-pc-linux-gnu AMDEP = -AMTAR = ${SHELL} /tmp/fileutils-4.0l/missing --run tar +AMTAR = ${SHELL} /home/shin/EOTA/app/fileutils-4.0l/missing --run tar AWK = mawk CATALOGS = cs.gmo de.gmo el.gmo es.gmo fr.gmo gl.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt.gmo pt_BR.gmo ru.gmo sk.gmo sl.gmo sv.gmo zh.gmo CATOBJEXT = .gmo @@ -83,7 +93,8 @@ INTLLIBS = INTLOBJS = LIBOBJS = fsusage$U.o mountlist$U.o -MAKEINFO = ${SHELL} /tmp/fileutils-4.0l/missing --run makeinfo +LD = ld +MAKEINFO = ${SHELL} /home/shin/EOTA/app/fileutils-4.0l/missing --run makeinfo MKINSTALLDIRS = ./mkinstalldirs MSGFMT = /usr/bin/msgfmt PACKAGE = fileutils @@ -92,6 +103,7 @@ POSUB = po RANLIB = ranlib U = +STRIP = strip USE_INCLUDED_LIBINTL = no USE_NLS = yes VERSION = 4.0l @@ -113,7 +125,11 @@ isdir.c long-options.c makepath.c modechange.c hash.c path-concat.c \ quotearg.c safe-read.c same.c save-cwd.c savedir.c stripslash.c userspec.c \ version-etc.c xgetcwd.c xmalloc.c xstrdup.c \ -xstrtol.c xstrtoul.c xstrtoumax.c yesno.c +xstrtol.c xstrtoul.c xstrtoumax.c yesno.c \ +error.c stpcpy.c euidaccess.c fnmatch.c ftruncate.c \ +lchown.c rpmatch.c strndup.c strverscmp.c group-member.c obstack.c \ +getline.c strtoumax.c strtoull.c \ +eota.c libfu_a_LIBADD = fsusage$U.o mountlist$U.o @@ -143,8 +159,8 @@ DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I.. CPPFLAGS = -LDFLAGS = -LIBS = +## LDFLAGS = +## LIBS = ANSI2KNR = ../src/ansi2knr libfu_a_AR = $(AR) cru am_libfu_a_OBJECTS = getdate$U.o posixtm$U.o getopt$U.o getopt1$U.o \ @@ -154,13 +170,17 @@ hash$U.o path-concat$U.o quotearg$U.o safe-read$U.o same$U.o \ save-cwd$U.o savedir$U.o stripslash$U.o userspec$U.o version-etc$U.o \ xgetcwd$U.o xmalloc$U.o xstrdup$U.o xstrtol$U.o xstrtoul$U.o \ -xstrtoumax$U.o yesno$U.o +xstrtoumax$U.o yesno$U.o \ +error$U.o stpcpy$U.o euidaccess$U.o fnmatch$U.o ftruncate$U.o \ +lchown$U.o rpmatch$U.o strndup$U.o strverscmp$U.o group-member$U.o \ +obstack$U.o getline$U.o strtoumax$U.o strtoull$U.o\ +eota$U.o libfu_a_OBJECTS = $(am_libfu_a_OBJECTS) AR = ar COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CFLAGS = -g -O2 -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +## CFLAGS = -g -O2 +## CCLD = $(CC) +LINK = $(LD) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = $(libfu_a_SOURCES) HEADERS = $(noinst_HEADERS) diff -urN fileutils-4.0l/lib/eota.c fileutils-4.0l-eo/lib/eota.c --- fileutils-4.0l/lib/eota.c Thu Jan 1 09:00:00 1970 +++ fileutils-4.0l-eo/lib/eota.c Thu Jun 26 21:30:48 2003 @@ -0,0 +1,38 @@ +/* + Modified by NAKANISHI Shin. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Last modified: Jun 26, 2003. */ + +#include + +int lstat(const char *file_name, struct stat *buf) +{ + return stat(file_name, buf); +} + +int readlink(const char *path, char *buf, size_t bufsiz) { return -1; } +int symlink(const char *oldpath, const char *newpath) { return -1; } +int mknod() { return -1; } +long pathconf(char *path, int name) { return NULL; } +int sync(void) { return 0; } +int fsync(int fd) { return -1; } + +long sysconf(int name) +{ + return _SC_PAGESIZE; +} + +#include + +struct passwd *getpwnam(const char *name) { return NULL; } +struct passwd *getpwuid(uid_t uid) { return NULL; } + diff -urN fileutils-4.0l/lib/fsusage.c fileutils-4.0l-eo/lib/fsusage.c --- fileutils-4.0l/lib/fsusage.c Thu Jul 15 16:47:31 1999 +++ fileutils-4.0l-eo/lib/fsusage.c Thu Jun 26 21:33:22 2003 @@ -240,6 +240,7 @@ #endif /* STAT_STATVFS */ +#ifndef EOTA #if !defined(STAT_STATFS2_FS_DATA) && !defined(STAT_READ_FILSYS) /* !Ultrix && !SVR2 */ @@ -251,7 +252,7 @@ fsp->fsu_ffree = PROPAGATE_ALL_ONES (fsd.f_ffree); #endif /* not STAT_STATFS2_FS_DATA && not STAT_READ_FILSYS */ - +#endif /* not EOTA */ return 0; } diff -urN fileutils-4.0l/lib/lstat.c fileutils-4.0l-eo/lib/lstat.c --- fileutils-4.0l/lib/lstat.c Thu Jan 1 09:00:00 1970 +++ fileutils-4.0l-eo/lib/lstat.c Thu Jun 26 21:21:30 2003 @@ -0,0 +1,102 @@ +/* Work around the bug in some systems whereby lstat succeeds when + given the zero-length file name argument. The lstat from SunOS4.1.4 + has this bug. + Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* written by Jim Meyering */ + +#include + +#include +#include +#include +#ifndef errno +extern int errno; +#endif + +#ifdef STAT_MACROS_BROKEN +# undef S_ISLNK +#endif +#if !defined(S_ISLNK) && defined(S_IFLNK) +# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#endif + +char *xmalloc (); + +/* lstat works different on Linux and Solaris systems. POSIX (see + `pathname resolution' in the glossary) requires that programs like `ls' + take into consideration the fact that FILE has a trailing slash when + FILE is a symbolic link. On Linux systems, the lstat function already + has the desired semantics (in treating `lstat("symlink/",sbuf)' just like + `lstat("symlink/.",sbuf)', but on Solaris it does not. + + If FILE has a trailing slash and specifies a symbolic link, + then append a `.' to FILE and call lstat a second time. */ + +static int +slash_aware_lstat (const char *file, struct stat *sbuf) +{ + size_t len; + char *new_file; + + int lstat_result = lstat (file, sbuf); + + if (lstat_result != 0 || !S_ISLNK (sbuf->st_mode)) + return lstat_result; + + len = strlen (file); + if (file[len - 1] != '/') + return lstat_result; + + /* FILE refers to a symbolic link and the name ends with a slash. + Append a `.' to FILE and repeat the lstat call. */ + + /* Add one for the `.' we might have to append, and one more + for the trailing NUL. */ + new_file = xmalloc (len + 1 + 1); + memcpy (new_file, file, len); + new_file[len] = '.'; + new_file[len + 1] = 0; + + lstat_result = lstat (new_file, sbuf); + free (new_file); + + return lstat_result; +} + +/* This is a wrapper for lstat(2). + If FILE is the empty string, fail with errno == ENOENT. + Otherwise, return the result of calling the real lstat. + + This works around the bug in some systems whereby lstat succeeds when + given the zero-length file name argument. The lstat from SunOS4.1.4 + has this bug. */ + +/* This function also provides a version of lstat with consistent semantics + when FILE specifies a symbolic link and has a trailing slash. */ + +int +rpl_lstat (const char *file, struct stat *sbuf) +{ + if (file && *file == 0) + { + errno = ENOENT; + return -1; + } + + return slash_aware_lstat (file, sbuf); +} diff -urN fileutils-4.0l/lib/stat.c fileutils-4.0l-eo/lib/stat.c --- fileutils-4.0l/lib/stat.c Thu Jan 1 09:00:00 1970 +++ fileutils-4.0l-eo/lib/stat.c Thu Jun 26 21:21:30 2003 @@ -0,0 +1,49 @@ +/* Work around the bug in some systems whereby stat succeeds when + given the zero-length file name argument. The stat from SunOS4.1.4 + has this bug. + Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* written by Jim Meyering */ + +#include + +#include +#include +#include +#ifndef errno +extern int errno; +#endif + +/* This is a wrapper for stat(2). + If FILE is the empty string, fail with errno == ENOENT. + Otherwise, return the result of calling the real stat. + + This works around the bug in some systems whereby stat succeeds when + given the zero-length file name argument. The stat from SunOS4.1.4 + has this bug. */ + +int +rpl_stat (const char *file, struct stat *sbuf) +{ + if (file && *file == 0) + { + errno = ENOENT; + return -1; + } + + return stat (file, sbuf); +} diff -urN fileutils-4.0l/src/Makefile fileutils-4.0l-eo/src/Makefile --- fileutils-4.0l/src/Makefile Thu Jun 26 22:02:27 2003 +++ fileutils-4.0l-eo/src/Makefile Thu Jun 26 21:18:47 2003 @@ -12,6 +12,18 @@ SHELL = /bin/sh +ROOT = $(HOME)/EOTA/eota/kernel +NEWLIB = $(HOME)/EOTA/libc/newlib-1.8.1/eota/newlib +LIBS = $(NEWLIB)/crt0.o $(NEWLIB)/libc.a +KERNLIBS = $(ROOT)/POSIX/libc/libnative.a +STARTADDR = 0x00001000 +ENTRY = _start +CFLAGS = -O2 -Wall -I. -I$(NEWLIB)/targ-include \ + -I$(NEWLIB)/libc/include -DEOTA +LDFLAGS = -s -Bstatic -o $@ -e ${ENTRY} -Ttext=$(STARTADDR) + +GCCLIB = /usr/lib/gcc-lib/i386-linux/2.95.2/libgcc.a + srcdir = . top_srcdir = .. prefix = /usr/local @@ -37,9 +49,9 @@ top_builddir = .. -ACLOCAL = ${SHELL} /tmp/fileutils-4.0l/missing --run aclocal -AUTOCONF = ${SHELL} /tmp/fileutils-4.0l/missing --run autoconf -AUTOHEADER = ${SHELL} /tmp/fileutils-4.0l/missing --run autoheader +ACLOCAL = ${SHELL} /home/shin/EOTA/app/fileutils-4.0l/missing --run aclocal +AUTOCONF = ${SHELL} /home/shin/EOTA/app/fileutils-4.0l/missing --run autoconf +AUTOHEADER = ${SHELL} /home/shin/EOTA/app/fileutils-4.0l/missing --run autoheader INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} @@ -56,7 +68,7 @@ host_alias = i586-pc-linux-gnu host_triplet = i586-pc-linux-gnu AMDEP = -AMTAR = ${SHELL} /tmp/fileutils-4.0l/missing --run tar +AMTAR = ${SHELL} /home/shin/EOTA/app/fileutils-4.0l/missing --run tar AWK = mawk CATALOGS = cs.gmo de.gmo el.gmo es.gmo fr.gmo gl.gmo it.gmo ja.gmo ko.gmo nl.gmo no.gmo pl.gmo pt.gmo pt_BR.gmo ru.gmo sk.gmo sl.gmo sv.gmo zh.gmo CATOBJEXT = .gmo @@ -79,8 +91,9 @@ INTLDEPS = INTLLIBS = INTLOBJS = +LD = ld LIBOBJS = fsusage$U.o mountlist$U.o -MAKEINFO = ${SHELL} /tmp/fileutils-4.0l/missing --run makeinfo +MAKEINFO = ${SHELL} /home/shin/EOTA/app/fileutils-4.0l/missing --run makeinfo MKINSTALLDIRS = ./mkinstalldirs MSGFMT = /usr/bin/msgfmt PACKAGE = fileutils @@ -88,6 +101,7 @@ POFILES = cs.po de.po el.po es.po fr.po gl.po it.po ja.po ko.po nl.po no.po pl.po pt.po pt_BR.po ru.po sk.po sl.po sv.po zh.po POSUB = po RANLIB = ranlib +STRIP = strip U = USE_INCLUDED_LIBINTL = no USE_NLS = yes @@ -147,8 +161,8 @@ PROGRAMS = $(bin_PROGRAMS) CPPFLAGS = -LDFLAGS = -LIBS = +## LDFLAGS = +## LIBS = ANSI2KNR = chgrp_SOURCES = chgrp.c chgrp_OBJECTS = chgrp$U.o @@ -261,9 +275,9 @@ vdir_DEPENDENCIES = ../lib/libfu.a vdir_LDFLAGS = COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CFLAGS = -g -O2 -CCLD = $(CC) -LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +## CFLAGS = -g -O2 +## CCLD = $(CC) +LINK = $(LD) $(AM_LDFLAGS) $(LDFLAGS) -o $@ DIST_SOURCES = chgrp.c chmod.c chown.c $(cp_SOURCES) dd.c df.c \ $(dir_SOURCES) dircolors.c du.c $(ginstall_SOURCES) ln.c $(ls_SOURCES) \ mkdir.c mkfifo.c mknod.c $(mv_SOURCES) $(rm_SOURCES) rmdir.c shred.c \ @@ -361,93 +375,93 @@ maintainer-clean-kr: -chgrp: $(chgrp_OBJECTS) $(chgrp_DEPENDENCIES) +chgrp: $(chgrp_OBJECTS) $(chgrp_DEPENDENCIES) $(LIBS) $(KERNLIBS) @rm -f chgrp - $(LINK) $(chgrp_LDFLAGS) $(chgrp_OBJECTS) $(chgrp_LDADD) $(LIBS) + $(LINK) $(chgrp_LDFLAGS) $(chgrp_OBJECTS) $(chgrp_LDADD) $(LIBS) $(KERNLIBS) -chmod: $(chmod_OBJECTS) $(chmod_DEPENDENCIES) +chmod: $(chmod_OBJECTS) $(chmod_DEPENDENCIES) $(LIBS) $(KERNLIBS) @rm -f chmod - $(LINK) $(chmod_LDFLAGS) $(chmod_OBJECTS) $(chmod_LDADD) $(LIBS) + $(LINK) $(chmod_LDFLAGS) $(chmod_OBJECTS) $(chmod_LDADD) $(LIBS) $(KERNLIBS) -chown: $(chown_OBJECTS) $(chown_DEPENDENCIES) +chown: $(chown_OBJECTS) $(chown_DEPENDENCIES) $(LIBS) $(KERNLIBS) @rm -f chown - $(LINK) $(chown_LDFLAGS) $(chown_OBJECTS) $(chown_LDADD) $(LIBS) + $(LINK) $(chown_LDFLAGS) $(chown_OBJECTS) $(chown_LDADD) $(LIBS) $(KERNLIBS) -cp: $(cp_OBJECTS) $(cp_DEPENDENCIES) +cp: $(cp_OBJECTS) $(cp_DEPENDENCIES) $(LIBS) $(KERNLIBS) $(GCCLIB) @rm -f cp - $(LINK) $(cp_LDFLAGS) $(cp_OBJECTS) $(cp_LDADD) $(LIBS) + $(LINK) $(cp_LDFLAGS) $(cp_OBJECTS) $(cp_LDADD) $(LIBS) $(KERNLIBS) $(GCCLIB) -dd: $(dd_OBJECTS) $(dd_DEPENDENCIES) +dd: $(dd_OBJECTS) $(dd_DEPENDENCIES) $(LIBS) $(KERNLIBS) $(GCCLIB) @rm -f dd - $(LINK) $(dd_LDFLAGS) $(dd_OBJECTS) $(dd_LDADD) $(LIBS) + $(LINK) $(dd_LDFLAGS) $(dd_OBJECTS) $(dd_LDADD) $(LIBS) $(KERNLIBS) $(GCCLIB) -df: $(df_OBJECTS) $(df_DEPENDENCIES) +df: $(df_OBJECTS) $(df_DEPENDENCIES) $(LIBS) $(KERNLIBS) $(GCCLIB) @rm -f df - $(LINK) $(df_LDFLAGS) $(df_OBJECTS) $(df_LDADD) $(LIBS) + $(LINK) $(df_LDFLAGS) $(df_OBJECTS) $(df_LDADD) $(LIBS) $(KERNLIBS) $(GCCLIB) -dir: $(dir_OBJECTS) $(dir_DEPENDENCIES) +dir: $(dir_OBJECTS) $(dir_DEPENDENCIES) $(LIBS) $(KERNLIBS) $(GCCLIB) @rm -f dir - $(LINK) $(dir_LDFLAGS) $(dir_OBJECTS) $(dir_LDADD) $(LIBS) + $(LINK) $(dir_LDFLAGS) $(dir_OBJECTS) $(dir_LDADD) $(LIBS) $(KERNLIBS) $(GCCLIB) -dircolors: $(dircolors_OBJECTS) $(dircolors_DEPENDENCIES) +dircolors: $(dircolors_OBJECTS) $(dircolors_DEPENDENCIES) $(LIBS) $(KERNLIBS) @rm -f dircolors - $(LINK) $(dircolors_LDFLAGS) $(dircolors_OBJECTS) $(dircolors_LDADD) $(LIBS) + $(LINK) $(dircolors_LDFLAGS) $(dircolors_OBJECTS) $(dircolors_LDADD) $(LIBS) $(KERNLIBS) -du: $(du_OBJECTS) $(du_DEPENDENCIES) +du: $(du_OBJECTS) $(du_DEPENDENCIES) $(LIBS) $(KERNLIBS) $(GCCLIB) @rm -f du - $(LINK) $(du_LDFLAGS) $(du_OBJECTS) $(du_LDADD) $(LIBS) + $(LINK) $(du_LDFLAGS) $(du_OBJECTS) $(du_LDADD) $(LIBS) $(KERNLIBS) $(GCCLIB) -ginstall: $(ginstall_OBJECTS) $(ginstall_DEPENDENCIES) +ginstall: $(ginstall_OBJECTS) $(ginstall_DEPENDENCIES) $(LIBS) $(KERNLIBS) $(GCCLIB) @rm -f ginstall - $(LINK) $(ginstall_LDFLAGS) $(ginstall_OBJECTS) $(ginstall_LDADD) $(LIBS) + $(LINK) $(ginstall_LDFLAGS) $(ginstall_OBJECTS) $(ginstall_LDADD) $(LIBS) $(KERNLIBS) $(GCCLIB) -ln: $(ln_OBJECTS) $(ln_DEPENDENCIES) +ln: $(ln_OBJECTS) $(ln_DEPENDENCIES) $(LIBS) $(KERNLIBS) @rm -f ln - $(LINK) $(ln_LDFLAGS) $(ln_OBJECTS) $(ln_LDADD) $(LIBS) + $(LINK) $(ln_LDFLAGS) $(ln_OBJECTS) $(ln_LDADD) $(LIBS) $(KERNLIBS) -ls: $(ls_OBJECTS) $(ls_DEPENDENCIES) +ls: $(ls_OBJECTS) $(ls_DEPENDENCIES) $(LIBS) $(KERNLIBS) $(GCCLIB) @rm -f ls - $(LINK) $(ls_LDFLAGS) $(ls_OBJECTS) $(ls_LDADD) $(LIBS) + $(LINK) $(ls_LDFLAGS) $(ls_OBJECTS) $(ls_LDADD) $(LIBS) $(KERNLIBS) $(GCCLIB) -mkdir: $(mkdir_OBJECTS) $(mkdir_DEPENDENCIES) +mkdir: $(mkdir_OBJECTS) $(mkdir_DEPENDENCIES) $(LIBS) $(KERNLIBS) @rm -f mkdir - $(LINK) $(mkdir_LDFLAGS) $(mkdir_OBJECTS) $(mkdir_LDADD) $(LIBS) + $(LINK) $(mkdir_LDFLAGS) $(mkdir_OBJECTS) $(mkdir_LDADD) $(LIBS) $(KERNLIBS) -mkfifo: $(mkfifo_OBJECTS) $(mkfifo_DEPENDENCIES) +mkfifo: $(mkfifo_OBJECTS) $(mkfifo_DEPENDENCIES) $(LIBS) $(KERNLIBS) @rm -f mkfifo - $(LINK) $(mkfifo_LDFLAGS) $(mkfifo_OBJECTS) $(mkfifo_LDADD) $(LIBS) + $(LINK) $(mkfifo_LDFLAGS) $(mkfifo_OBJECTS) $(mkfifo_LDADD) $(LIBS) $(KERNLIBS) -mknod: $(mknod_OBJECTS) $(mknod_DEPENDENCIES) +mknod: $(mknod_OBJECTS) $(mknod_DEPENDENCIES) $(LIBS) $(KERNLIBS) @rm -f mknod - $(LINK) $(mknod_LDFLAGS) $(mknod_OBJECTS) $(mknod_LDADD) $(LIBS) + $(LINK) $(mknod_LDFLAGS) $(mknod_OBJECTS) $(mknod_LDADD) $(LIBS) $(KERNLIBS) -mv: $(mv_OBJECTS) $(mv_DEPENDENCIES) +mv: $(mv_OBJECTS) $(mv_DEPENDENCIES) $(LIBS) $(KERNLIBS) $(GCCLIB) @rm -f mv - $(LINK) $(mv_LDFLAGS) $(mv_OBJECTS) $(mv_LDADD) $(LIBS) + $(LINK) $(mv_LDFLAGS) $(mv_OBJECTS) $(mv_LDADD) $(LIBS) $(KERNLIBS) $(GCCLIB) -rm: $(rm_OBJECTS) $(rm_DEPENDENCIES) +rm: $(rm_OBJECTS) $(rm_DEPENDENCIES) $(LIBS) $(KERNLIBS) $(GCCLIB) @rm -f rm - $(LINK) $(rm_LDFLAGS) $(rm_OBJECTS) $(rm_LDADD) $(LIBS) + $(LINK) $(rm_LDFLAGS) $(rm_OBJECTS) $(rm_LDADD) $(LIBS) $(KERNLIBS) $(GCCLIB) -rmdir: $(rmdir_OBJECTS) $(rmdir_DEPENDENCIES) +rmdir: $(rmdir_OBJECTS) $(rmdir_DEPENDENCIES) $(LIBS) $(KERNLIBS) @rm -f rmdir - $(LINK) $(rmdir_LDFLAGS) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS) + $(LINK) $(rmdir_LDFLAGS) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS) $(KERNLIBS) -shred: $(shred_OBJECTS) $(shred_DEPENDENCIES) +shred: $(shred_OBJECTS) $(shred_DEPENDENCIES) $(LIBS) $(KERNLIBS) $(GCCLIB) @rm -f shred - $(LINK) $(shred_LDFLAGS) $(shred_OBJECTS) $(shred_LDADD) $(LIBS) + $(LINK) $(shred_LDFLAGS) $(shred_OBJECTS) $(shred_LDADD) $(LIBS) $(KERNLIBS) $(GCCLIB) -sync: $(sync_OBJECTS) $(sync_DEPENDENCIES) +sync: $(sync_OBJECTS) $(sync_DEPENDENCIES) $(LIBS) $(KERNLIBS) @rm -f sync - $(LINK) $(sync_LDFLAGS) $(sync_OBJECTS) $(sync_LDADD) $(LIBS) + $(LINK) $(sync_LDFLAGS) $(sync_OBJECTS) $(sync_LDADD) $(LIBS) $(KERNLIBS) -touch: $(touch_OBJECTS) $(touch_DEPENDENCIES) +touch: $(touch_OBJECTS) $(touch_DEPENDENCIES) $(LIBS) $(KERNLIBS) $(GCCLIB) @rm -f touch - $(LINK) $(touch_LDFLAGS) $(touch_OBJECTS) $(touch_LDADD) $(LIBS) + $(LINK) $(touch_LDFLAGS) $(touch_OBJECTS) $(touch_LDADD) $(LIBS) $(KERNLIBS) $(GCCLIB) -vdir: $(vdir_OBJECTS) $(vdir_DEPENDENCIES) +vdir: $(vdir_OBJECTS) $(vdir_DEPENDENCIES) $(LIBS) $(KERNLIBS) $(GCCLIB) @rm -f vdir - $(LINK) $(vdir_LDFLAGS) $(vdir_OBJECTS) $(vdir_LDADD) $(LIBS) + $(LINK) $(vdir_LDFLAGS) $(vdir_OBJECTS) $(vdir_LDADD) $(LIBS) $(KERNLIBS) $(GCCLIB) chgrp_.c: chgrp.c $(ANSI2KNR) $(CPP) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/chgrp.c; then echo $(srcdir)/chgrp.c; else echo chgrp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > chgrp_.c chmod_.c: chmod.c $(ANSI2KNR) diff -urN fileutils-4.0l/src/chgrp.c fileutils-4.0l-eo/src/chgrp.c --- fileutils-4.0l/src/chgrp.c Sat Nov 20 18:50:13 1999 +++ fileutils-4.0l-eo/src/chgrp.c Thu Jun 26 21:37:27 2003 @@ -418,7 +418,7 @@ if (change_symlinks) xstat = lstat; else - xstat = stat; + xstat = NULL; if (reference_file) { diff -urN fileutils-4.0l/src/shred.c fileutils-4.0l-eo/src/shred.c --- fileutils-4.0l/src/shred.c Sun Dec 19 00:56:37 1999 +++ fileutils-4.0l-eo/src/shred.c Thu Jun 26 21:56:57 2003 @@ -96,6 +96,9 @@ # include "quotearg.h" /* For quotearg_colon */ # include "xalloc.h" char *xstrdup PARAMS ((char const *)); +#ifdef EOTA +#include +#endif /* EOTA */ #else /* !HAVE_CONFIG_H */ /* @@ -1466,6 +1469,10 @@ return 0; } +#ifdef EOTA +#define fcntl(fd, F_GETFL) NULL +#endif /* EOTA */ + /* A wrapper with a little more checking for fds on the command line */ static int wipefd (int fd, char const *qname, struct isaac_state *s, @@ -1644,6 +1651,10 @@ * again or EPERM, which both give similar error messages. * Does anyone disagree? */ +#ifdef EOTA +#define EACCES 13 +#endif + static int wipefile (char *name, char const *qname, struct isaac_state *s, struct Options const *flags)