diff options
Diffstat (limited to 'lib')
103 files changed, 3774 insertions, 1475 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog new file mode 100644 index 00000000..14a8f19a --- /dev/null +++ b/lib/ChangeLog @@ -0,0 +1,28 @@ +Mon Sep 4 21:42:46 1995 Remy Card <card@bbj> + + * Makefile.bsd-lib: New file containing support for BSD shared + libraries. + +Sat Aug 5 11:43:05 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * Makefile.dll-lib: Added new target install-shlibs, which just + installs the shared libraries. + + * Makefile.elf-lib: Added new target install-shlibs, which just + installs the shared libraries. + +Tue Jul 18 21:24:13 1995 <tytso@rsx-11.mit.edu> + + * Makefile.dll-lib (jump): For each of the libraries jump/jump.* + files are now in in dll/jump.*; now the subdirs target + takes care of creating the jump directory, and then copy + the jump.* files from the dll directory to the jump + directory. This allows dll libraries to be built where + the build directory is not equal to the source directory. + +Tue Jul 11 22:05:56 1995 <tytso@rsx-11.mit.edu> + + * Makefile.checker,Makefile.elf-lib,Makefile.dll-lib, + Makefile.profile: Add rule to mkdir the appropriate object + subdirectory (checker, elfshared, jump, profiled, etc.) + diff --git a/lib/Makefile.bsd-lib b/lib/Makefile.bsd-lib new file mode 100644 index 00000000..e0227a26 --- /dev/null +++ b/lib/Makefile.bsd-lib @@ -0,0 +1,37 @@ +# +# This is a Makefile stub which handles the creation of Linux BSD shared +# libraries. +# +# In order to use this stub, the following makefile variables must be defined. +# +# BSDLIB_VERSION = 1.0 +# BSDLIB_IMAGE = libce +# BSDLIB_MYDIR = et +# BSDLIB_INSTALL_DIR = $(SHLIBDIR) +# + +all:: pic image + +subdirs:: pic + +pic: + mkdir pic + +BSD_LIB = $(BSDLIB_IMAGE).so.$(BSDLIB_VERSION) + +image: $(BSD_LIB) + +$(BSD_LIB): $(OBJS) + (cd pic; ld -Bshareable -o $(BSD_LIB) $(OBJS)) + $(MV) pic/$(BSD_LIB) . + $(RM) -f ../$(BSD_LIB) + $(LN) $(BSD_LIB) ../$(BSD_LIB) + +install-shlibs install:: $(BSD_LIB) + $(INSTALL_PROGRAM) $(BSD_LIB) $(BSDLIB_INSTALL_DIR)/$(BSD_LIB) + -ldconfig + +clean:: + $(RM) -rf pic + $(RM) -f $(BSD_LIB) + $(RM) -f ../$(BSD_LIB) diff --git a/lib/Makefile.checker b/lib/Makefile.checker new file mode 100644 index 00000000..6064494a --- /dev/null +++ b/lib/Makefile.checker @@ -0,0 +1,16 @@ +all:: checker $(LIBRARY)_chk.a + +subdirs:: checker + +checker: + mkdir checker + +clean:: + $(RM) -rf checker + +$(LIBRARY)_chk.a: $(OBJS) + @(test -r $@ && $(RM) -f $@.bak && $(MV) $@ $@.bak) + (cd checker; $(ARUPD) $@ $(OBJS)) + -$(RANLIB) $@ + $(RM) -f ../$@ + $(LN) $@ ../$@ diff --git a/lib/Makefile.dll-lib b/lib/Makefile.dll-lib index dee8e62c..94864bf2 100644 --- a/lib/Makefile.dll-lib +++ b/lib/Makefile.dll-lib @@ -14,7 +14,31 @@ # DLL_INSTALL_DIR = $(SHLIBDIR) # -all:: image stubs +all:: jump image stubs + +subdirs:: jump jump/jump.funcs jump/jump.ignore jump/jump.import \ + jump/jump.params jump/jump.undefs jump/jump.vars + +jump: + mkdir jump + +jump/jump.funcs: dll/jump.funcs + $(CP) $< $@ + +jump/jump.ignore: dll/jump.ignore + $(CP) $< $@ + +jump/jump.import: dll/jump.import + $(CP) $< $@ + +jump/jump.params: dll/jump.params + $(CP) $< $@ + +jump/jump.undefs: dll/jump.undefs + $(CP) $< $@ + +jump/jump.vars: dll/jump.vars + $(CP) $< $@ # # This is a horrible hack to try to find libgcc.a --- the DLL documentation @@ -37,34 +61,31 @@ $(DLL_IMAGE).so.$(DLL_VERSION): $(OBJS) $(DLL_BIN)/mkimage -l $(DLL_IMAGE) -v $(DLL_VERSION) \ -a $(DLL_ADDRESS) -j $(DLL_JUMPSIZE) -g $(DLL_GOTSIZE) -- \ $(OBJS) -lc $(DLL_LIBS) $(DLL_LIBGCC) -lc) - mv jump/$(DLL_IMAGE).so.$(DLL_VERSION) . + $(MV) jump/$(DLL_IMAGE).so.$(DLL_VERSION) . $(DLL_STUB).sa: (cd jump; export JUMP_DIR=`pwd`; \ $(DLL_BIN)/mkstubs -l $(DLL_IMAGE) -v $(DLL_VERSION) \ -a $(DLL_ADDRESS) -j $(DLL_JUMPSIZE) -g $(DLL_GOTSIZE) \ -- $(DLL_STUB)) - mv jump/$(DLL_STUB).sa . - @$(RM) ../$@ - @$(LN) $(DLL_MYDIR)/$@ ../$@ + $(MV) jump/$(DLL_STUB).sa . + $(RM) -f ../$@ + $(LN) $@ ../$@ -install:: $(DLL_IMAGE).so.$(DLL_VERSION) - $(INSTALLBIN) $(DLL_IMAGE).so.$(DLL_VERSION) \ - $(DLL_INSTALL_DIR)/$(DLL_IMAGE).so.$(DLL_VERSION) - -ldconfig +installdirs:: + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(DLL_INSTALL_DIR) -install-libs:: $(DLL_STUB).sa - $(INSTALLLIB) $(DLL_STUB).sa $(LIBDIR)/$(DLL_STUB).sa - $(CHMOD) 644 $(LIBDIR)/$(DLL_STUB).sa - $(RANLIB) $(LIBDIR)/$(DLL_STUB).sa - $(CHMOD) $(LIBMODE) $(LIBDIR)/$(DLL_STUB).sa +install-shlibs install:: $(DLL_IMAGE).so.$(DLL_VERSION) installdirs + $(INSTALL_PROGRAM) $(DLL_IMAGE).so.$(DLL_VERSION) \ + $(DESTDIR)$(DLL_INSTALL_DIR)/$(DLL_IMAGE).so.$(DLL_VERSION) + -ldconfig -install-tree:: $(DLL_IMAGE).so.$(DLL_VERSION) - rm -f ../../shlibs/$(DLL_IMAGE).so.$(DLL_VERSION) - cp $(DLL_IMAGE).so.$(DLL_VERSION) ../../shlibs - strip ../../shlibs/$(DLL_IMAGE).so.$(DLL_VERSION) - chmod 555 ../../shlibs/$(DLL_IMAGE).so.$(DLL_VERSION) +install:: $(DLL_STUB).sa + $(INSTALL_DATA) $(DLL_STUB).sa $(DESTDIR)$(ulibdir)/$(DLL_STUB).sa + $(CHMOD) 644 $(DESTDIR)$(ulibdir)/$(DLL_STUB).sa + $(RANLIB) $(DESTDIR)$(ulibdir)/$(DLL_STUB).sa + $(CHMOD) $(LIBMODE) $(DESTDIR)$(ulibdir)/$(DLL_STUB).sa clean:: - (cd jump; $(RM) *~ *.o *.s jump.log size.nm) - $(RM) ../$(DLL_STUB).sa $(DLL_STUB).sa $(DLL_IMAGE).so.$(DLL_VERSION) + $(RM) -f ../$(DLL_STUB).sa $(DLL_STUB).sa $(DLL_IMAGE).so.$(DLL_VERSION) + $(RM) -rf jump diff --git a/lib/Makefile.elf-lib b/lib/Makefile.elf-lib new file mode 100644 index 00000000..10051ddd --- /dev/null +++ b/lib/Makefile.elf-lib @@ -0,0 +1,41 @@ +# +# This is a Makefile stub which handles the creation of Linux ELF shared +# libraries. +# +# In order to use this stub, the following makefile variables must be defined. +# +# ELF_VERSION = 1.0 +# ELF_IMAGE = libce +# ELF_MYDIR = et +# ELF_INSTALL_DIR = $(SHLIBDIR) +# + +all:: elfshared image + +subdirs:: elfshared + +elfshared: + mkdir elfshared + +ELF_LIB = $(ELF_IMAGE).so.$(ELF_VERSION) + +image: $(ELF_LIB) + +$(ELF_LIB): $(OBJS) + (cd elfshared; $(CC) --shared -o $(ELF_LIB) $(OBJS)) + $(MV) elfshared/$(ELF_LIB) . + $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so + $(LN) $(ELF_LIB) ../$(ELF_LIB) + $(LN) ../$(ELF_LIB) ../$(ELF_IMAGE).so + +installdirs:: + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(ELF_INSTALL_DIR) + +install-shlibs install:: $(ELF_LIB) installdirs + $(INSTALL_PROGRAM) $(ELF_LIB) $(DESTDIR)$(ELF_INSTALL_DIR)/$(ELF_LIB) + -ldconfig + +clean:: + $(RM) -rf elfshared + $(RM) -f $(ELF_LIB) + $(RM) -f ../$(ELF_LIB) ../$(ELF_IMAGE).so diff --git a/lib/Makefile.library b/lib/Makefile.library new file mode 100644 index 00000000..2ea95c11 --- /dev/null +++ b/lib/Makefile.library @@ -0,0 +1,13 @@ +all:: subdirs $(LIBRARY).a + +install-shlibs:: + +subdirs:: + +$(LIBRARY).a: $(OBJS) + (if test -r $@; then $(RM) -f $@.bak && $(MV) $@ $@.bak; fi) + $(ARUPD) $@ $(OBJS) + -$(RANLIB) $@ + $(RM) -f ../$@ + $(LN) $@ ../$@ + diff --git a/lib/Makefile.profile b/lib/Makefile.profile new file mode 100644 index 00000000..8cb197aa --- /dev/null +++ b/lib/Makefile.profile @@ -0,0 +1,16 @@ +all:: profiled $(LIBRARY)_p.a + +subdirs:: profiled + +profiled: + mkdir profiled + +clean:: + $(RM) -rf profiled + +$(LIBRARY)_p.a: $(OBJS) + (if test -r $@; then $(RM) -f $@.bak && $(MV) $@ $@.bak; fi) + (cd profiled; $(ARUPD) ../$@ $(OBJS)) + -$(RANLIB) $@ + $(RM) -f ../$@ + $(LN) $@ ../$@ diff --git a/lib/e2p/.depend b/lib/e2p/.depend index f3bd9164..0ba793d8 100644 --- a/lib/e2p/.depend +++ b/lib/e2p/.depend @@ -1,86 +1,88 @@ -fgetflags.o : fgetflags.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/linux/errno.h /usr/include/fcntl.h /usr/include/sys/types.h /usr/include/linux/types.h \ - /usr/include/asm/types.h /usr/include/linux/fcntl.h /usr/include/unistd.h /usr/include/posix_opt.h \ - /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ +fgetflags.o : ./fgetflags.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/linux/errno.h /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h \ + /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/confname.h /usr/include/sys/types.h \ + /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \ /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \ - /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \ + /usr/include/linux/ext2_fs.h ./e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \ /usr/include/linux/dirent.h /usr/include/posix1_lim.h /usr/include/stdio.h /usr/include/libio.h \ /usr/include/_G_config.h -fgetversion.o : fgetversion.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/linux/errno.h /usr/include/fcntl.h /usr/include/sys/types.h /usr/include/linux/types.h \ - /usr/include/asm/types.h /usr/include/linux/fcntl.h /usr/include/unistd.h /usr/include/posix_opt.h \ +fgetversion.o : ./fgetversion.c /usr/include/errno.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/linux/errno.h /usr/include/unistd.h /usr/include/posix_opt.h \ /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \ - /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \ + /usr/include/confname.h /usr/include/sys/types.h /usr/include/linux/types.h \ + /usr/include/asm/types.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/sys/ioctl.h \ + /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \ + /usr/include/linux/ext2_fs.h ./e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \ /usr/include/linux/dirent.h /usr/include/posix1_lim.h /usr/include/stdio.h /usr/include/libio.h \ /usr/include/_G_config.h -fsetflags.o : fsetflags.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/linux/errno.h /usr/include/fcntl.h /usr/include/sys/types.h /usr/include/linux/types.h \ - /usr/include/asm/types.h /usr/include/linux/fcntl.h /usr/include/unistd.h /usr/include/posix_opt.h \ - /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ +fsetflags.o : ./fsetflags.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/linux/errno.h /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h \ + /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/confname.h /usr/include/sys/types.h \ + /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \ /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \ - /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \ + /usr/include/linux/ext2_fs.h ./e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \ /usr/include/linux/dirent.h /usr/include/posix1_lim.h /usr/include/stdio.h /usr/include/libio.h \ /usr/include/_G_config.h -fsetversion.o : fsetversion.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/linux/errno.h /usr/include/fcntl.h /usr/include/sys/types.h /usr/include/linux/types.h \ - /usr/include/asm/types.h /usr/include/linux/fcntl.h /usr/include/unistd.h /usr/include/posix_opt.h \ +fsetversion.o : ./fsetversion.c /usr/include/errno.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/linux/errno.h /usr/include/unistd.h /usr/include/posix_opt.h \ /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \ - /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \ + /usr/include/confname.h /usr/include/sys/types.h /usr/include/linux/types.h \ + /usr/include/asm/types.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/sys/ioctl.h \ + /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.h \ + /usr/include/linux/ext2_fs.h ./e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \ /usr/include/linux/dirent.h /usr/include/posix1_lim.h /usr/include/stdio.h /usr/include/libio.h \ /usr/include/_G_config.h -getflags.o : getflags.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ +getflags.o : ./getflags.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/linux/errno.h /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ /usr/include/termios.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ - /usr/include/linux/termios.h /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h \ + /usr/include/linux/termios.h /usr/include/linux/ext2_fs.h ./e2p.h /usr/include/dirent.h \ /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ /usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h -getversion.o : getversion.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ +getversion.o : ./getversion.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/linux/errno.h /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ /usr/include/termios.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ - /usr/include/linux/termios.h /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h \ + /usr/include/linux/termios.h /usr/include/linux/ext2_fs.h ./e2p.h /usr/include/dirent.h \ /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ /usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h -iod.o : iod.c /usr/include/dirent.h /usr/include/features.h /usr/include/sys/cdefs.h \ +iod.o : ./iod.c ./e2p.h /usr/include/sys/types.h /usr/include/linux/types.h \ + /usr/include/asm/types.h /usr/include/dirent.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ /usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ - e2p.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/linux/ext2_fs.h -ls.o : ls.c /usr/include/grp.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/gnu/types.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ - /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/pwd.h /usr/include/time.h \ - /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ - /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h /usr/include/linux/limits.h \ - /usr/include/linux/dirent.h /usr/include/posix1_lim.h -pe.o : pe.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/linux/ext2_fs.h +ls.o : ./ls.c /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/grp.h /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/gnu/types.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ + /usr/include/pwd.h /usr/include/time.h /usr/include/linux/ext2_fs.h ./e2p.h \ + /usr/include/dirent.h /usr/include/linux/limits.h /usr/include/linux/dirent.h \ + /usr/include/posix1_lim.h +pe.o : ./pe.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/linux/ext2_fs.h /usr/include/linux/types.h \ - /usr/include/asm/types.h e2p.h /usr/include/dirent.h /usr/include/gnu/types.h \ - /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/sys/types.h \ + /usr/include/asm/types.h ./e2p.h /usr/include/sys/types.h /usr/include/dirent.h \ + /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ /usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h -pf.o : pf.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +pf.o : ./pf.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/linux/ext2_fs.h /usr/include/linux/types.h \ - /usr/include/asm/types.h e2p.h /usr/include/dirent.h /usr/include/gnu/types.h \ - /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/sys/types.h \ + /usr/include/asm/types.h ./e2p.h /usr/include/sys/types.h /usr/include/dirent.h \ + /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ /usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h -ps.o : ps.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +ps.o : ./ps.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/linux/ext2_fs.h /usr/include/linux/types.h \ - /usr/include/asm/types.h e2p.h /usr/include/dirent.h /usr/include/gnu/types.h \ - /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/sys/types.h \ + /usr/include/asm/types.h ./e2p.h /usr/include/sys/types.h /usr/include/dirent.h \ + /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ /usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h -setflags.o : setflags.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ +setflags.o : ./setflags.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/linux/errno.h /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ /usr/include/termios.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ - /usr/include/linux/termios.h /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h \ + /usr/include/linux/termios.h /usr/include/linux/ext2_fs.h ./e2p.h /usr/include/dirent.h \ /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ /usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h -setversion.o : setversion.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ +setversion.o : ./setversion.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/linux/errno.h /usr/include/sys/ioctl.h /usr/include/linux/ioctl.h \ /usr/include/termios.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ - /usr/include/linux/termios.h /usr/include/linux/ext2_fs.h e2p.h /usr/include/dirent.h \ + /usr/include/linux/termios.h /usr/include/linux/ext2_fs.h ./e2p.h /usr/include/dirent.h \ /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ /usr/include/linux/limits.h /usr/include/linux/dirent.h /usr/include/posix1_lim.h \ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h diff --git a/lib/e2p/ChangeLog b/lib/e2p/ChangeLog index f96ffa82..228b4722 100644 --- a/lib/e2p/ChangeLog +++ b/lib/e2p/ChangeLog @@ -1,3 +1,61 @@ +Fri Oct 27 18:07:48 1995 <tytso@rsts-11.mit.edu> + + * iod.c (iterate_on_dir): Don't assume that d->reclen is the size + of the dirent structure; it isn't under Linux. + +Mon Sep 4 21:43:53 1995 Remy Card <card@bbj> + + * Makefile.in: Added support for BSD shared libraries. + +Fri Aug 11 08:36:40 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * setflags.c: #include <sys/types.h> before including <sys/stat.h> + +Sat Aug 12 03:11:45 1995 Remy Card <card@bbj> + + * Makefile.in (install): Install static libraries in $(ulibdir) + (/usr/lib on Linux) instead of $(libdir) (/lib on Linux). + +Sat Aug 5 11:43:36 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * Makefile.in (DLL_INSTALL_DIR, ELF_INSTALL_DIR): Set the + installation directories correctly. + +Thu Jun 15 23:41:20 1995 Remy Card <card@bbj> + + * Makefile.in: Added support for ELF shared libraries. + +Mon Jun 12 08:34:44 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * e2p.h: Move <direct.h> after <stdio.h> + +Thu Jun 8 12:47:04 1995 Miles Bader <miles@churchy.gnu.ai.mit.edu> + + * iod.c (iterate_on_dir): If struct dirent has a d_namlen field, + assume that actual dirent entries may be larger than the structure + (by the name field), and take extra care deal with this case. + This code assumes that d_reclen is a valid dirent field. + Also, don't include <dirent.h>, as e2p.h already does. + + * fgetversion.c (fgetversion): Only use the ext2 ioctl if it + doesn't cause a compile-time barf, otherwise just return EOPNOTSUPP. + * getversion.c (getversion): Ditto. + * fsetversion.c (fsetversion): Ditto. + * setversion.c (setversion): Ditto. + * fsetflags.c (fsetflags): Use chflags instead of the ext2 ioctl + if possible, and otherwise only use the ioctl if it doesn't barf. + * setflags.c (setflags): Ditto (with fchflags). + * fgetflags.c (fgetflags): Use the stat st_flags field instead of + the ext2 ioctl if possible, and otherwise only use the ioctl if it + doesn't barf. + * getflags.c (getflags): Ditto. + + * e2p.h: Include <sys/types.h>, as some <dirent.h>s need it. + * ls.c: Move the include of <sys/types.h> to where <grp.h> can see it. + + * Makefile.in: Rewritten to conform to GNU coding standards and + support separate compilation directories. + Mon Nov 7 21:59:12 1994 Remy Card <card@bbj> * ls.c (list_super): List the new fields s_def_resuid and diff --git a/lib/e2p/MAKELOG b/lib/e2p/MAKELOG new file mode 100644 index 00000000..27e4420d --- /dev/null +++ b/lib/e2p/MAKELOG @@ -0,0 +1,181 @@ +gcc -O2 -fomit-frame-pointer -I.. -c pe.c +In file included from pe.c:19: +/usr/include/linux/ext2_fs.h:127: parse error before `__u32' +/usr/include/linux/ext2_fs.h:127: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:128: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:129: parse error before `aclh_acle_count' +/usr/include/linux/ext2_fs.h:129: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:130: parse error before `aclh_first_acle' +/usr/include/linux/ext2_fs.h:130: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:135: parse error before `__u32' +/usr/include/linux/ext2_fs.h:135: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:136: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:137: parse error before `acle_type' +/usr/include/linux/ext2_fs.h:137: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:138: parse error before `acle_tag' +/usr/include/linux/ext2_fs.h:138: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:139: parse error before `acle_pad1' +/usr/include/linux/ext2_fs.h:139: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:140: parse error before `acle_next' +/usr/include/linux/ext2_fs.h:140: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:149: parse error before `__u32' +/usr/include/linux/ext2_fs.h:149: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:150: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:151: parse error before `bg_inode_table' +/usr/include/linux/ext2_fs.h:151: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:152: parse error before `bg_free_blocks_count' +/usr/include/linux/ext2_fs.h:152: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:153: parse error before `bg_free_inodes_count' +/usr/include/linux/ext2_fs.h:153: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:158: parse error before `__u32' +/usr/include/linux/ext2_fs.h:158: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:159: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:160: parse error before `bg_inode_table' +/usr/include/linux/ext2_fs.h:160: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:161: parse error before `bg_free_blocks_count' +/usr/include/linux/ext2_fs.h:161: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:162: parse error before `bg_free_inodes_count' +/usr/include/linux/ext2_fs.h:162: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:163: parse error before `bg_used_dirs_count' +/usr/include/linux/ext2_fs.h:163: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:164: parse error before `bg_pad' +/usr/include/linux/ext2_fs.h:164: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:165: parse error before `bg_reserved' +/usr/include/linux/ext2_fs.h:165: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:166: parse error before `}' +/usr/include/linux/ext2_fs.h:213: parse error before `__u16' +/usr/include/linux/ext2_fs.h:213: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:214: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:215: parse error before `i_size' +/usr/include/linux/ext2_fs.h:215: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:216: parse error before `i_atime' +/usr/include/linux/ext2_fs.h:216: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:217: parse error before `i_ctime' +/usr/include/linux/ext2_fs.h:217: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:218: parse error before `i_mtime' +/usr/include/linux/ext2_fs.h:218: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:219: parse error before `i_dtime' +/usr/include/linux/ext2_fs.h:219: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:220: parse error before `i_gid' +/usr/include/linux/ext2_fs.h:220: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:221: parse error before `i_links_count' +/usr/include/linux/ext2_fs.h:221: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:222: parse error before `i_blocks' +/usr/include/linux/ext2_fs.h:222: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:223: parse error before `i_flags' +/usr/include/linux/ext2_fs.h:223: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:226: parse error before `__u32' +/usr/include/linux/ext2_fs.h:226: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:226: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:227: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:229: parse error before `__u32' +/usr/include/linux/ext2_fs.h:229: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:230: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:232: parse error before `__u32' +/usr/include/linux/ext2_fs.h:232: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:233: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:234: parse error before `}' +/usr/include/linux/ext2_fs.h:234: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:235: parse error before `i_block' +/usr/include/linux/ext2_fs.h:235: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:236: parse error before `i_version' +/usr/include/linux/ext2_fs.h:236: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:237: parse error before `i_file_acl' +/usr/include/linux/ext2_fs.h:237: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:238: parse error before `i_dir_acl' +/usr/include/linux/ext2_fs.h:238: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:239: parse error before `i_faddr' +/usr/include/linux/ext2_fs.h:239: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:242: parse error before `__u8' +/usr/include/linux/ext2_fs.h:242: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:242: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:243: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:244: parse error before `i_pad1' +/usr/include/linux/ext2_fs.h:244: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:245: parse error before `l_i_reserved2' +/usr/include/linux/ext2_fs.h:245: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:246: parse error before `}' +/usr/include/linux/ext2_fs.h:246: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:248: parse error before `__u8' +/usr/include/linux/ext2_fs.h:248: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:249: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:250: parse error before `h_i_mode_high' +/usr/include/linux/ext2_fs.h:250: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:251: parse error before `h_i_uid_high' +/usr/include/linux/ext2_fs.h:251: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:252: parse error before `h_i_gid_high' +/usr/include/linux/ext2_fs.h:252: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:253: parse error before `h_i_author' +/usr/include/linux/ext2_fs.h:253: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:254: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:256: parse error before `__u8' +/usr/include/linux/ext2_fs.h:256: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:257: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:258: parse error before `m_pad1' +/usr/include/linux/ext2_fs.h:258: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:259: parse error before `m_i_reserved2' +/usr/include/linux/ext2_fs.h:259: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:260: parse error before `}' +/usr/include/linux/ext2_fs.h:260: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:261: parse error before `}' +/usr/include/linux/ext2_fs.h:261: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:262: parse error before `}' +/usr/include/linux/ext2_fs.h:329: parse error before `__u32' +/usr/include/linux/ext2_fs.h:329: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:330: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:331: parse error before `s_r_blocks_count' +/usr/include/linux/ext2_fs.h:331: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:332: parse error before `s_free_blocks_count' +/usr/include/linux/ext2_fs.h:332: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:333: parse error before `s_free_inodes_count' +/usr/include/linux/ext2_fs.h:333: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:334: parse error before `s_first_data_block' +/usr/include/linux/ext2_fs.h:334: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:335: parse error before `s_log_block_size' +/usr/include/linux/ext2_fs.h:335: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:336: parse error before `s_log_frag_size' +/usr/include/linux/ext2_fs.h:336: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:337: parse error before `s_blocks_per_group' +/usr/include/linux/ext2_fs.h:337: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:338: parse error before `s_frags_per_group' +/usr/include/linux/ext2_fs.h:338: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:339: parse error before `s_inodes_per_group' +/usr/include/linux/ext2_fs.h:339: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:340: parse error before `s_mtime' +/usr/include/linux/ext2_fs.h:340: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:341: parse error before `s_wtime' +/usr/include/linux/ext2_fs.h:341: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:342: parse error before `s_mnt_count' +/usr/include/linux/ext2_fs.h:342: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:343: parse error before `s_max_mnt_count' +/usr/include/linux/ext2_fs.h:343: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:344: parse error before `s_magic' +/usr/include/linux/ext2_fs.h:344: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:345: parse error before `s_state' +/usr/include/linux/ext2_fs.h:345: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:346: parse error before `s_errors' +/usr/include/linux/ext2_fs.h:346: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:347: parse error before `s_pad' +/usr/include/linux/ext2_fs.h:347: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:348: parse error before `s_lastcheck' +/usr/include/linux/ext2_fs.h:348: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:349: parse error before `s_checkinterval' +/usr/include/linux/ext2_fs.h:349: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:350: parse error before `s_creator_os' +/usr/include/linux/ext2_fs.h:350: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:351: parse error before `s_rev_level' +/usr/include/linux/ext2_fs.h:351: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:352: parse error before `s_def_resuid' +/usr/include/linux/ext2_fs.h:352: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:353: parse error before `s_def_resgid' +/usr/include/linux/ext2_fs.h:353: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:354: parse error before `s_reserved' +/usr/include/linux/ext2_fs.h:354: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:355: parse error before `}' +/usr/include/linux/ext2_fs.h:372: parse error before `__u32' +/usr/include/linux/ext2_fs.h:372: warning: no semicolon at end of struct or union +/usr/include/linux/ext2_fs.h:373: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:374: parse error before `name_len' +/usr/include/linux/ext2_fs.h:374: warning: data definition has no type or storage class +/usr/include/linux/ext2_fs.h:376: parse error before `}' +make: *** [pe.o] Error 1 diff --git a/lib/e2p/Makefile b/lib/e2p/Makefile deleted file mode 100644 index 8ade7fa0..00000000 --- a/lib/e2p/Makefile +++ /dev/null @@ -1,98 +0,0 @@ -# Makefile for the second extended file system utility functions -# -# Copyright (C) 1993 Remy Card (card@masi.ibp.fr) -# -# This file can be redistributed under the terms of the GNU General -# Public License - -all:: - -include ../../MCONFIG - -CFLAGS_NO= $(WFLAGS) -I.. -CFLAGS= $(OPT) $(CFLAGS_NO) -LDFLAGS= $(OPT) - -RM=rm -f -MV=mv -LN=ln -s - -OBJS= fgetflags.o fsetflags.o fgetversion.o fsetversion.o \ - getflags.o getversion.o iod.o ls.o pe.o pf.o ps.o \ - setflags.o setversion.o - -ifdef BUILD_DLL_SHLIBS -DLL_ADDRESS = 0x66980000 -DLL_JUMPSIZE = 0x1000 -DLL_GOTSIZE = 0x1000 -DLL_VERSION = 1.0 -DLL_IMAGE = libe2p -DLL_STUB = libe2p -DLL_MYDIR = e2p -DLL_INSTALL_DIR = $(SHLIBDIR) - -include ../Makefile.dll-lib -endif - -.c.o: - $(CC) $(CFLAGS) -c $*.c -ifdef BUILD_PROFILE_LIBS - $(CC) $(CFLAGS_NO) -pg -o profiled/$*.o -c $*.c -endif -ifdef BUILD_DLL_SHLIBS - (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \ - -o jump/$*.o -c $*.c) -endif -# $(CC) $(CFLAGS_NO) -checker -g -o checker/$*.o -c $*.c - -all:: libe2p.a - -ifdef BUILD_PROFILE_LIBS -all:: libe2p_p.a -endif - -libe2p.a: $(OBJS) - $(RM) $@.bak - -$(MV) $@ $@.bak - $(ARCHIVE) $@ $(OBJS) - $(RANLIB) $@ - $(RM) ../$@ - $(LN) e2p/$@ ../$@ - -libe2p_p.a: $(OBJS) - $(RM) $@.bak - -$(MV) $@ $@.bak - (cd profiled; $(ARCHIVE) ../$@ $(OBJS)) - $(RANLIB) $@ - $(RM) ../$@ - $(LN) e2p/$@ ../$@ - -libe2p_chk.a: $(OBJS) - $(RM) $@.bak - -$(MV) $@ $@.bak - (cd checker; $(ARCHIVE) ../$@ $(OBJS)) - $(RANLIB) $@ - $(RM) ../$@ - $(LN) e2p/$@ ../$@ - -install:: - -install-libs:: - $(INSTALLLIB) libe2p.a $(LIBDIR)/libe2p.a - $(CHMOD) 644 $(LIBDIR)/libe2p.a - $(RANLIB) $(LIBDIR)/libe2p.a - $(CHMOD) $(LIBMODE) $(LIBDIR)/libe2p.a - -install-tree:: - -clean:: - rm -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/* - rm -f ../libe2p.a ../libe2p_p.a - -really-clean:: clean - rm -f .depend - -dep depend .depend: - $(CC) -M $(CFLAGS) *.c >.depend - -include .depend diff --git a/lib/e2p/Makefile.in b/lib/e2p/Makefile.in new file mode 100644 index 00000000..2e8da282 --- /dev/null +++ b/lib/e2p/Makefile.in @@ -0,0 +1,129 @@ +# Makefile for the second extended file system utility functions +# +# Copyright (C) 1993 Remy Card (card@masi.ibp.fr) +# +# This file can be redistributed under the terms of the GNU General +# Public License + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +top_builddir = ../.. +INSTALL = @INSTALL@ + +@MCONFIG@ + +all:: + +OBJS= fgetflags.o fsetflags.o fgetversion.o fsetversion.o \ + getflags.o getversion.o iod.o ls.o pe.o pf.o ps.o \ + setflags.o setversion.o + +SRCS= $(srcdir)/fgetflags.c $(srcdir)/fsetflags.c \ + $(srcdir)/fgetversion.c $(srcdir)/fsetversion.c \ + $(srcdir)/getflags.c $(srcdir)/getversion.c \ + $(srcdir)/iod.c $(srcdir)/ls.c $(srcdir)/pe.c \ + $(srcdir)/pf.c $(srcdir)/ps.c \ + $(srcdir)/setflags.c $(srcdir)/setversion.c + +LIBRARY= libe2p +LIBDIR= e2p + +DLL_ADDRESS = 0x66980000 +DLL_JUMPSIZE = 0x1000 +DLL_GOTSIZE = 0x1000 +DLL_VERSION = 1.2 +DLL_IMAGE = libe2p +DLL_STUB = libe2p +DLL_MYDIR = e2p +DLL_INSTALL_DIR = $(libdir) + +ELF_VERSION = 2.1 +ELF_IMAGE = libe2p +ELF_MYDIR = e2p +ELF_INSTALL_DIR = $(libdir) + +BSDLIB_VERSION = 2.1 +BSDLIB_IMAGE = libe2p +BSDLIB_MYDIR = e2p +BSDLIB_INSTALL_DIR = $(libdir) + +@MAKEFILE_LIBRARY@ +@MAKEFILE_DLL@ +@MAKEFILE_ELF@ +@MAKEFILE_BSDLIB@ +@MAKEFILE_PROFILE@ +@MAKEFILE_CHECKER@ + +.c.o: + $(CC) $(CFLAGS) -c $< -o $@ +@PROFILE_CMT@ $(CC) $(CFLAGS) -pg -o profiled/$*.o -c $< +@CHECKER_CMT@ $(CC) $(CFLAGS) -checker -g -o checker/$*.o -c $< +@DLL_CMT@ (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \ +@DLL_CMT@ -o jump/$*.o -c $<) +@ELF_CMT@ $(CC) $(CFLAGS) -fPIC -o elfshared/$*.o -c $< +@BSDLIB_CMT@ $(CC) $(CFLAGS) -fpic -o pic/$*.o -c $< + +installdirs:: + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(ulibdir) + +install:: all installdirs + $(INSTALL_DATA) libe2p.a $(DESTDIR)$(ulibdir)/libe2p.a + $(CHMOD) 644 $(DESTDIR)$(ulibdir)/libe2p.a + -$(RANLIB) $(DESTDIR)$(ulibdir)/libe2p.a + $(CHMOD) $(LIBMODE) $(DESTDIR)$(ulibdir)/libe2p.a + +uninstall:: + $(RM) -f $(ulibdir)/libe2p.a + +clean:: + $(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/* + $(RM) -f ../libe2p.a ../libe2p_p.a +mostlyclean:: clean +distclean:: clean + $(RM) -f .depend Makefile + +# +++ Dependency line eater +++ +# +# Makefile dependencies follow. This must be the last section in +# the Makefile.in file +# +fgetflags.o : $(srcdir)/fgetflags.c \ + $(srcdir)/e2p.h \ + +fsetflags.o : $(srcdir)/fsetflags.c \ + $(srcdir)/e2p.h \ + +fgetversion.o : $(srcdir)/fgetversion.c \ + $(srcdir)/e2p.h \ + +fsetversion.o : $(srcdir)/fsetversion.c \ + $(srcdir)/e2p.h \ + +getflags.o : $(srcdir)/getflags.c \ + $(srcdir)/e2p.h \ + +getversion.o : $(srcdir)/getversion.c \ + $(srcdir)/e2p.h \ + +iod.o : $(srcdir)/iod.c $(srcdir)/e2p.h \ + +ls.o : $(srcdir)/ls.c \ + $(srcdir)/e2p.h \ + +pe.o : $(srcdir)/pe.c \ + $(srcdir)/e2p.h \ + +pf.o : $(srcdir)/pf.c \ + $(srcdir)/e2p.h \ + +ps.o : $(srcdir)/ps.c \ + $(srcdir)/e2p.h \ + +setflags.o : $(srcdir)/setflags.c \ + $(srcdir)/e2p.h \ + +setversion.o : $(srcdir)/setversion.c \ + $(srcdir)/e2p.h \ + + diff --git a/lib/e2p/configure b/lib/e2p/configure new file mode 100644 index 00000000..db75368b --- /dev/null +++ b/lib/e2p/configure @@ -0,0 +1,613 @@ +#!/bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.1 +# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help +select compiler to use" +ac_help="$ac_help +select compiler command line options" +ac_help="$ac_help +select compiler preprocessor command line options" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE + +# Initialize some other variables. +subdirs= + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -build | --build | --buil | --bui | --bu | --b) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=PREFIX install architecture-dependent files in PREFIX + [same as prefix] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +--enable and --with options recognized:$ac_help +EOF + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.1" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 unused; standard input +# 1 file creation +# 2 errors and warnings +# 3 unused; some systems may open it to /dev/tty +# 4 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 4>/dev/null +else + exec 4>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LANG+set}" = set; then LANG=C; export LANG; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=e2p.h + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} $CFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&5 2>&5' +ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&5 2>&5' + +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + + +# Check whether --with-cc or --without-cc was given. +withval="$with_cc" +if test -n "$withval"; then + echo "$ac_t""CC=$withval" 1>&4 +CC=$withval +else + if test -z "$CC" ; then CC=cc; fi +echo "$ac_t""CC defaults to $CC" 1>&4 +fi + + +# Check whether --with-ccopts or --without-ccopts was given. +withval="$with_ccopts" +if test -n "$withval"; then + echo "$ac_t""CCOPTS is $withval" 1>&4 +CCOPTS=$withval +CFLAGS="$CFLAGS $withval" +else + CCOPTS= +fi + + +# Check whether --with-cppopts or --without-cppopts was given. +withval="$with_cppopts" +if test -n "$withval"; then + echo "$ac_t""CPPOPTS=$withval" 1>&4 +CPPOPTS=$withval +CPPFLAGS="$CPPFLAGS $withval" +else + echo "$ac_t""CPPOPTS defaults to $CPPOPTS" 1>&4 +fi + +trap '' 1 2 15 +if test -w $cache_file; then +echo "updating cache $cache_file" +cat > $cache_file <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# Ultrix sh set writes to stderr and can't be redirected directly. +(set) 2>&1 | + sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \ + >> $cache_file +else +echo "not updating unwritable cache $cache_file" +fi + +trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#!/bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.1" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir + +trap 'rm -f Makefile; exit 1' 1 2 15 + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF +$ac_vpsub +$extrasub +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@CC@%$CC%g +s%@CCOPTS@%$CCOPTS%g +s%@CPPOPTS@%$CPPOPTS%g + +CEOF +EOF +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust relative srcdir, etc. for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/$ac_dir" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file +fi; done +rm -f conftest.subs + + + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS + diff --git a/lib/e2p/jump/jump.funcs b/lib/e2p/dll/jump.funcs index 61a69fb6..61a69fb6 100644 --- a/lib/e2p/jump/jump.funcs +++ b/lib/e2p/dll/jump.funcs diff --git a/lib/e2p/dll/jump.ignore b/lib/e2p/dll/jump.ignore new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/lib/e2p/dll/jump.ignore diff --git a/lib/e2p/jump/jump.import b/lib/e2p/dll/jump.import index 51b1fd88..51b1fd88 100644 --- a/lib/e2p/jump/jump.import +++ b/lib/e2p/dll/jump.import diff --git a/lib/e2p/jump/jump.params b/lib/e2p/dll/jump.params index 7d3efe93..ebaa892c 100644 --- a/lib/e2p/jump/jump.params +++ b/lib/e2p/dll/jump.params @@ -3,4 +3,4 @@ Text=0x66980000 Data=0x00000000 Jump=0x00001000 GOT=0x00001000 -Version=1.0.0 +Version=1.2.0 diff --git a/lib/e2p/dll/jump.undefs b/lib/e2p/dll/jump.undefs new file mode 100644 index 00000000..48d61eaf --- /dev/null +++ b/lib/e2p/dll/jump.undefs @@ -0,0 +1 @@ +66982040 D __NEEDS_SHRLIB_libc_4 diff --git a/lib/e2p/dll/jump.vars b/lib/e2p/dll/jump.vars new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/lib/e2p/dll/jump.vars diff --git a/lib/e2p/e2p.h b/lib/e2p/e2p.h index 8ff770f5..dc2dbe57 100644 --- a/lib/e2p/e2p.h +++ b/lib/e2p/e2p.h @@ -1,5 +1,6 @@ -#include <dirent.h> +#include <sys/types.h> /* Needed by dirent.h on netbsd */ #include <stdio.h> +#include <dirent.h> #include <linux/ext2_fs.h> diff --git a/lib/e2p/fgetflags.c b/lib/e2p/fgetflags.c index 95b0bdc8..752da0b5 100644 --- a/lib/e2p/fgetflags.c +++ b/lib/e2p/fgetflags.c @@ -14,10 +14,18 @@ * 93/10/30 - Creation */ +#if HAVE_ERRNO_H #include <errno.h> -#include <fcntl.h> +#endif +#if HAVE_UNISTD_H #include <unistd.h> +#endif +#if HAVE_STAT_FLAGS +#include <sys/stat.h> +#else +#include <fcntl.h> #include <sys/ioctl.h> +#endif #include <linux/ext2_fs.h> @@ -25,6 +33,29 @@ int fgetflags (const char * name, unsigned long * flags) { +#if HAVE_STAT_FLAGS + struct stat buf; + + if (stat (name, &buf) == -1) + return -1; + + *flags = 0; +#ifdef UF_IMMUTABLE + if (buf.st_flags & UF_IMMUTABLE) + *flags |= EXT2_IMMUTABLE_FL; +#endif +#ifdef UF_APPEND + if (buf.st_flags & UF_APPEND) + *flags |= EXT2_APPEND_FL; +#endif +#ifdef UF_NODUMP + if (buf.st_flags & UF_NODUMP) + *flags |= EXT2_NODUMP_FL; +#endif + + return 0; +#else +#if HAVE_EXT2_IOCTLS int fd; int r; @@ -32,6 +63,13 @@ int fgetflags (const char * name, unsigned long * flags) if (fd == -1) return -1; r = ioctl (fd, EXT2_IOC_GETFLAGS, flags); + close (fd); return r; +#else /* ! HAVE_EXT2_IOCTLS */ + extern int errno; + errno = EOPNOTSUPP; + return -1; +#endif /* ! HAVE_EXT2_IOCTLS */ +#endif } diff --git a/lib/e2p/fgetversion.c b/lib/e2p/fgetversion.c index 73429f2a..89e07131 100644 --- a/lib/e2p/fgetversion.c +++ b/lib/e2p/fgetversion.c @@ -14,9 +14,13 @@ * 93/10/30 - Creation */ +#if HAVE_ERRNO_H #include <errno.h> -#include <fcntl.h> +#endif +#if HAVE_UNISTD_H #include <unistd.h> +#endif +#include <fcntl.h> #include <sys/ioctl.h> #include <linux/ext2_fs.h> @@ -25,6 +29,7 @@ int fgetversion (const char * name, unsigned long * version) { +#if HAVE_EXT2_IOCTLS int fd; int r; @@ -34,4 +39,9 @@ int fgetversion (const char * name, unsigned long * version) r = ioctl (fd, EXT2_IOC_GETVERSION, version); close (fd); return r; +#else /* ! HAVE_EXT2_IOCTLS */ + extern int errno; + errno = EOPNOTSUPP; + return -1; +#endif /* ! HAVE_EXT2_IOCTLS */ } diff --git a/lib/e2p/fsetflags.c b/lib/e2p/fsetflags.c index 180d48f5..a2584432 100644 --- a/lib/e2p/fsetflags.c +++ b/lib/e2p/fsetflags.c @@ -14,10 +14,18 @@ * 93/10/30 - Creation */ +#if HAVE_ERRNO_H #include <errno.h> -#include <fcntl.h> +#endif +#if HAVE_UNISTD_H #include <unistd.h> +#endif +#if HAVE_CHFLAGS +#include <sys/stat.h> /* For the flag values. */ +#else +#include <fcntl.h> #include <sys/ioctl.h> +#endif #include <linux/ext2_fs.h> @@ -25,6 +33,25 @@ int fsetflags (const char * name, unsigned long flags) { +#if HAVE_CHFLAGS + unsigned long bsd_flags = 0; + +#ifdef UF_IMMUTABLE + if (flags & EXT2_IMMUTABLE_FL) + bsd_flags |= UF_IMMUTABLE; +#endif +#ifdef UF_APPEND + if (flags & EXT2_APPEND_FL) + bsd_flags |= UF_APPEND; +#endif +#ifdef UF_NODUMP + if (flags & EXT2_NODUMP_FL) + bsd_flags |= UF_NODUMP; +#endif + + return chflags (name, bsd_flags); +#else +#if HAVE_EXT2_IOCTLS int fd; int r; @@ -34,4 +61,10 @@ int fsetflags (const char * name, unsigned long flags) r = ioctl (fd, EXT2_IOC_SETFLAGS, &flags); close (fd); return r; +#else /* ! HAVE_EXT2_IOCTLS */ + extern int errno; + errno = EOPNOTSUPP; + return -1; +#endif /* ! HAVE_EXT2_IOCTLS */ +#endif } diff --git a/lib/e2p/fsetversion.c b/lib/e2p/fsetversion.c index 1bb8acca..afea3656 100644 --- a/lib/e2p/fsetversion.c +++ b/lib/e2p/fsetversion.c @@ -14,9 +14,13 @@ * 93/10/30 - Creation */ +#if HAVE_ERRNO_H #include <errno.h> -#include <fcntl.h> +#endif +#if HAVE_UNISTD_H #include <unistd.h> +#endif +#include <fcntl.h> #include <sys/ioctl.h> #include <linux/ext2_fs.h> @@ -25,6 +29,7 @@ int fsetversion (const char * name, unsigned long version) { +#if HAVE_EXT2_IOCTLS int fd; int r; @@ -34,4 +39,9 @@ int fsetversion (const char * name, unsigned long version) r = ioctl (fd, EXT2_IOC_SETVERSION, &version); close (fd); return r; +#else /* ! HAVE_EXT2_IOCTLS */ + extern int errno; + errno = EOPNOTSUPP; + return -1; +#endif /* ! HAVE_EXT2_IOCTLS */ } diff --git a/lib/e2p/getflags.c b/lib/e2p/getflags.c index 4e537490..ac014a70 100644 --- a/lib/e2p/getflags.c +++ b/lib/e2p/getflags.c @@ -14,8 +14,14 @@ * 93/10/30 - Creation */ +#if HAVE_ERRNO_H #include <errno.h> +#endif +#if HAVE_STAT_FLAGS +#include <sys/stat.h> +#else #include <sys/ioctl.h> +#endif #include <linux/ext2_fs.h> @@ -23,5 +29,34 @@ int getflags (int fd, unsigned long * flags) { +#if HAVE_STAT_FLAGS + struct stat buf; + + if (fstat (fd, &buf) == -1) + return -1; + + *flags = 0; +#ifdef UF_IMMUTABLE + if (buf.st_flags & UF_IMMUTABLE) + *flags |= EXT2_IMMUTABLE_FL; +#endif +#ifdef UF_APPEND + if (buf.st_flags & UF_APPEND) + *flags |= EXT2_APPEND_FL; +#endif +#ifdef UF_NODUMP + if (buf.st_flags & UF_NODUMP) + *flags |= EXT2_NODUMP_FL; +#endif + + return 0; +#else +#if HAVE_EXT2_IOCTLS return ioctl (fd, EXT2_IOC_GETFLAGS, flags); +#else /* ! HAVE_EXT2_IOCTLS */ + extern int errno; + errno = EOPNOTSUPP; + return -1; +#endif /* ! HAVE_EXT2_IOCTLS */ +#endif } diff --git a/lib/e2p/getversion.c b/lib/e2p/getversion.c index 04dc0f75..309dfb6f 100644 --- a/lib/e2p/getversion.c +++ b/lib/e2p/getversion.c @@ -14,7 +14,9 @@ * 93/10/30 - Creation */ +#if HAVE_ERRNO_H #include <errno.h> +#endif #include <sys/ioctl.h> #include <linux/ext2_fs.h> @@ -23,5 +25,11 @@ int getversion (int fd, unsigned long * version) { +#if HAVE_EXT2_IOCTLS return ioctl (fd, EXT2_IOC_GETVERSION, version); +#else /* ! HAVE_EXT2_IOCTLS */ + extern int errno; + errno = EOPNOTSUPP; + return -1; +#endif /* ! HAVE_EXT2_IOCTLS */ } diff --git a/lib/e2p/iod.c b/lib/e2p/iod.c index 52c16a13..7b02a7f3 100644 --- a/lib/e2p/iod.c +++ b/lib/e2p/iod.c @@ -14,8 +14,6 @@ * 93/10/30 - Creation */ -#include <dirent.h> - #include "e2p.h" int iterate_on_dir (const char * dir_name, @@ -23,7 +21,13 @@ int iterate_on_dir (const char * dir_name, void * private) { DIR * dir; - struct dirent de; +#if HAVE_DIRENT_NAMELEN + /* Declare DE_BUF with some extra room for the name. */ + char de_buf[sizeof (struct dirent) + 32]; + struct dirent *de = (struct dirent *)&de_buf; +#else + struct dirent de_buf, *de = &de_buf; +#endif struct dirent *dep; dir = opendir (dir_name); @@ -31,12 +35,32 @@ int iterate_on_dir (const char * dir_name, return -1; while ((dep = readdir (dir))) { - de.d_ino = dep->d_ino; - de.d_off = dep->d_off; - de.d_reclen = dep->d_reclen; - strcpy (de.d_name, dep->d_name); - (*func) (dir_name, &de, private); +#if HAVE_DIRENT_NAMELEN + /* See if there's enough room for this entry in DE, and grow if + not. */ + if (de_len < dep->d_reclen) + { + de_len = dep->d_reclen + 32; + de = + (de == (struct dirent *)&de_buf + ? malloc (de_len) + : realloc (de, de_len)); + if (de == NULL) + { + errno = ENOMEM; + return -1; + } + } + memcpy (de, dep, dep->d_reclen); +#else + *de = *dep; +#endif + (*func) (dir_name, de, private); } +#if HAVE_DIRENT_NAMELEN + if (de != (struct dirent *)&de_buf) + free (de); +#endif closedir (dir); return 0; } diff --git a/lib/e2p/jump/jump.undefs b/lib/e2p/jump/jump.undefs deleted file mode 100644 index 44925621..00000000 --- a/lib/e2p/jump/jump.undefs +++ /dev/null @@ -1 +0,0 @@ -66983040 D __NEEDS_SHRLIB_libc_4 diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c index f879a3c6..6870098c 100644 --- a/lib/e2p/ls.c +++ b/lib/e2p/ls.c @@ -9,11 +9,11 @@ * Public License */ +#include <sys/types.h> #include <grp.h> #include <pwd.h> #include <stdio.h> #include <time.h> -#include <sys/types.h> #include <linux/ext2_fs.h> @@ -52,23 +52,23 @@ void list_super (struct ext2_super_block * s) printf ("Errors behavior: "); print_fs_errors (stdout, s->s_errors); printf ("\n"); - printf ("Inode count: %lu\n", s->s_inodes_count); - printf ("Block count: %lu\n", s->s_blocks_count); - printf ("Reserved block count: %lu\n", s->s_r_blocks_count); - printf ("Free blocks: %lu\n", s->s_free_blocks_count); - printf ("Free inodes: %lu\n", s->s_free_inodes_count); - printf ("First block: %lu\n", s->s_first_data_block); + printf ("Inode count: %u\n", s->s_inodes_count); + printf ("Block count: %u\n", s->s_blocks_count); + printf ("Reserved block count: %u\n", s->s_r_blocks_count); + printf ("Free blocks: %u\n", s->s_free_blocks_count); + printf ("Free inodes: %u\n", s->s_free_inodes_count); + printf ("First block: %u\n", s->s_first_data_block); printf ("Block size: %u\n", EXT2_BLOCK_SIZE(s)); printf ("Fragment size: %u\n", EXT2_FRAG_SIZE(s)); - printf ("Blocks per group: %lu\n", s->s_blocks_per_group); - printf ("Fragments per group: %lu\n", s->s_frags_per_group); - printf ("Inodes per group: %lu\n", s->s_inodes_per_group); + printf ("Blocks per group: %u\n", s->s_blocks_per_group); + printf ("Fragments per group: %u\n", s->s_frags_per_group); + printf ("Inodes per group: %u\n", s->s_inodes_per_group); printf ("Last mount time: %s", ctime ((time_t *) &s->s_mtime)); printf ("Last write time: %s", ctime ((time_t *) &s->s_wtime)); printf ("Mount count: %u\n", s->s_mnt_count); printf ("Maximum mount count: %d\n", s->s_max_mnt_count); printf ("Last checked: %s", ctime ((time_t *) &s->s_lastcheck)); - printf ("Check interval: %lu\n", s->s_checkinterval); + printf ("Check interval: %u\n", s->s_checkinterval); if (s->s_checkinterval) { time_t next; diff --git a/lib/e2p/setflags.c b/lib/e2p/setflags.c index c1e9fcbb..06f127f2 100644 --- a/lib/e2p/setflags.c +++ b/lib/e2p/setflags.c @@ -14,8 +14,15 @@ * 93/10/30 - Creation */ +#if HAVE_ERRNO_H #include <errno.h> +#endif +#if HAVE_CHFLAGS +#include <sys/types.h> +#include <sys/stat.h> /* For the flag values. */ +#else #include <sys/ioctl.h> +#endif #include <linux/ext2_fs.h> @@ -23,5 +30,30 @@ int setflags (int fd, unsigned long flags) { +#if HAVE_CHFLAGS + unsigned long bsd_flags = 0; + +#ifdef UF_IMMUTABLE + if (flags & EXT2_IMMUTABLE_FL) + bsd_flags |= UF_IMMUTABLE; +#endif +#ifdef UF_APPEND + if (flags & EXT2_APPEND_FL) + bsd_flags |= UF_APPEND; +#endif +#ifdef UF_NODUMP + if (flags & EXT2_NODUMP_FL) + bsd_flags |= UF_NODUMP; +#endif + + return fchflags (fd, bsd_flags); +#else +#if HAVE_EXT2_IOCTLS return ioctl (fd, EXT2_IOC_SETFLAGS, &flags); +#else /* ! HAVE_EXT2_IOCTLS */ + extern int errno; + errno = EOPNOTSUPP; + return -1; +#endif /* ! HAVE_EXT2_IOCTLS */ +#endif } diff --git a/lib/e2p/setversion.c b/lib/e2p/setversion.c index a6da31e2..f2c48cd9 100644 --- a/lib/e2p/setversion.c +++ b/lib/e2p/setversion.c @@ -14,7 +14,9 @@ * 93/10/30 - Creation */ +#if HAVE_ERRNO_H #include <errno.h> +#endif #include <sys/ioctl.h> #include <linux/ext2_fs.h> @@ -23,5 +25,11 @@ int setversion (int fd, unsigned long version) { +#if HAVE_EXT2_IOCTLS return ioctl (fd, EXT2_IOC_SETVERSION, &version); +#else /* ! HAVE_EXT2_IOCTLS */ + extern int errno; + errno = EOPNOTSUPP; + return -1; +#endif /* ! HAVE_EXT2_IOCTLS */ } diff --git a/lib/et/.depend b/lib/et/.depend index 2556ee49..42855603 100644 --- a/lib/et/.depend +++ b/lib/et/.depend @@ -1,17 +1,16 @@ -com_err.o : com_err.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/libio.h /usr/include/_G_config.h com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ - mit-sipb-copyright.h error_table.h internal.h /usr/include/errno.h /usr/include/linux/errno.h -error_message.o : error_message.c /usr/include/stdio.h /usr/include/features.h \ +com_err.o : ./com_err.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/libio.h /usr/include/_G_config.h ./com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./mit-sipb-copyright.h ./error_table.h ./internal.h /usr/include/errno.h /usr/include/linux/errno.h +error_message.o : ./error_message.c /usr/include/stdio.h /usr/include/features.h \ /usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/errno.h /usr/include/linux/errno.h \ - com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h error_table.h mit-sipb-copyright.h \ - internal.h -et_name.o : et_name.c error_table.h mit-sipb-copyright.h internal.h /usr/include/errno.h \ - /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/linux/errno.h -init_et.o : init_et.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + ./com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ./error_table.h \ + ./mit-sipb-copyright.h ./internal.h +et_name.o : ./et_name.c ./error_table.h ./mit-sipb-copyright.h ./internal.h \ + /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/linux/errno.h +init_et.o : ./init_et.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/errno.h /usr/include/linux/errno.h \ /usr/include/stdlib.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ - /usr/include/alloca.h com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ - error_table.h mit-sipb-copyright.h -vfprintf.o : vfprintf.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/varargs.h + /usr/include/alloca.h ./com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./error_table.h ./mit-sipb-copyright.h +vfprintf.o : ./vfprintf.c diff --git a/lib/et/ChangeLog b/lib/et/ChangeLog index 3c372243..99436325 100644 --- a/lib/et/ChangeLog +++ b/lib/et/ChangeLog @@ -1,3 +1,39 @@ +Mon Sep 4 21:44:47 1995 Remy Card <card@bbj> + + * Makefile.in: Added support for BSD shared libraries. + +Sat Aug 12 03:11:28 1995 Remy Card <card@bbj> + + * Makefile.in (install): Install static libraries in $(ulibdir) + (/usr/lib on Linux) instead of $(libdir) (/lib on Linux). + +Sat Aug 5 11:44:17 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * Makefile.in (DLL_INSTALL_DIR, ELF_INSTALL_DIR): Set the + installation directories correctly. + +Thu Jun 15 23:39:51 1995 Remy Card <card@bbj> + + * Makefile.in: Added support for ELF shared libraries. + Fixed typos in the compilation rules. + (distclean): Added compile_et.sh. + +Sat Jun 10 19:56:13 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * compile_et.sh.in: Use ET_DIR instead of srcdir to determine the + location of the et directory. + +Thu Jun 8 12:45:41 1995 Miles Bader <miles@churchy.gnu.ai.mit.edu> + + * vfprintf.c (vfprintf): Only compile this function if vfprintf + doesn't already exist and _doprnt does. + + * compile_et.sh: Moved to compile_et.sh.in. + + * Makefile.in: Rewritten to conform to GNU coding standards and + support separate compilation directories. + Don't preprocess compile_et.sh, as this is now done by configure. + Mon Nov 7 21:17:48 1994 Remy Card <card@bbj> * Makefile: Added a dummy install target in case shared libraries diff --git a/lib/et/Makefile b/lib/et/Makefile deleted file mode 100644 index 2dcf1ef1..00000000 --- a/lib/et/Makefile +++ /dev/null @@ -1,118 +0,0 @@ -# -# Makefile for lib/et -# - -all:: compile_et libcom_err.a - -include ../../MCONFIG - -OBJS= error_message.o et_name.o init_et.o com_err.o -SRCS = error_message.c et_name.c init_et.c com_err.c - -HFILES= com_err.h - -ifdef BUILD_PROFILE_LIBS -all:: libcom_err_p.a -endif - -ifdef BUILD_DLL_SHLIBS -DLL_ADDRESS = 0x66800000 -DLL_JUMPSIZE = 0x1000 -DLL_GOTSIZE = 0x1000 -DLL_VERSION = 1.0 -DLL_IMAGE = libet -DLL_STUB = libcom_err -DLL_MYDIR = et -DLL_INSTALL_DIR = $(SHLIBDIR) - -include ../Makefile.dll-lib -endif - -RM=rm -f -MV=mv -LN=ln -s -TAGS=etags - -DEFS= -DHAS_STDLIB_H - -CFLAGS_NO= $(WFLAGS) $(DEFS) -CFLAGS= $(CFLAGS_NO) $(OPT) - -# -# what to build... -# - -.c.o: - $(CC) $(CFLAGS) -c $*.c -ifdef BUILD_PROFILE_LIBS - $(CC) $(CFLAGS_NO) -g -pg -o profiled/$*.o -c $*.c -endif -ifdef BUILD_DLL_SHLIBS - (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \ - -o jump/$*.o -c $*.c) -endif - - -compile_et: compile_et.sh - ./config_script compile_et.sh $(AWK) > compile_et - chmod +x compile_et - -libcom_err.a: $(OBJS) - $(RM) $@.bak - -$(MV) $@ $@.bak - $(ARCHIVE) $@ $(OBJS) - $(RANLIB) $@ - $(RM) ../$@ - $(LN) et/$@ ../$@ - -libcom_err_p.a: $(OBJS) - $(RM) $@.bak - -$(MV) $@ $@.bak - (cd profiled ; $(ARCHIVE) ../$@ $(OBJS)) - $(RANLIB) $@ - $(RM) ../$@ - $(LN) et/$@ ../$@ - -clean:: - $(RM) compile_et libcom_err.a libcom_err_p.a - $(RM) $(OBJS) profiled/* - $(RM) *~ \#* *.bak *.otl *.aux *.toc *.PS *.dvi *.ps TAGS *.ln - $(RM) ../libcom_err.a ../libcom_err_p.a - -really-clean:: clean - $(RM) .depend - -install-libs:: libcom_err.a - $(INSTALLLIB) libcom_err.a $(LIBDIR)/libcom_err.a - $(CHMOD) 644 $(LIBDIR)/libcom_err.a - $(RANLIB) $(LIBDIR)/libcom_err.a - $(CHMOD) $(LIBMODE) $(LIBDIR)/libcom_err.a - -install-libs:: $(HFILES) - @rm -rf $(INCLDIR)/et - @mkdir $(INCLDIR)/et - for i in $(HFILES); do \ - $(INSTALLINC) $$i $(INCLDIR)/et/$$i; \ - done - -install-tree:: - -install:: - -## - -com_err.ps : com_err.dvi -com_err.dvi: com_err.texinfo - -libcom_err.o: $(LIBOBJS) - ld -r -s -o libcom_err.o $(LIBOBJS) - chmod -x libcom_err.o - - -TAGS: $(SRCS) - $(TAGS) $(SRCS) - -dep depend .depend: compile_et - $(CPP) -M $(CFLAGS) *.c >.depend - -include .depend diff --git a/lib/et/Makefile.in b/lib/et/Makefile.in new file mode 100644 index 00000000..39141a45 --- /dev/null +++ b/lib/et/Makefile.in @@ -0,0 +1,121 @@ +# +# Makefile for lib/et +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +top_builddir = ../.. +INSTALL = @INSTALL@ + +@MCONFIG@ + +all:: compile_et + +OBJS= error_message.o et_name.o init_et.o com_err.o +SRCS = $(srcdir)/error_message.c $(srcdir)/et_name.c $(srcdir)/init_et.c \ + $(srcdir)/com_err.c + +HFILES= com_err.h + +LIBRARY= libcom_err +LIBDIR= et + +DLL_ADDRESS = 0x66800000 +DLL_JUMPSIZE = 0x1000 +DLL_GOTSIZE = 0x1000 +DLL_VERSION = 1.0 +DLL_IMAGE = libet +DLL_STUB = libcom_err +DLL_MYDIR = et +DLL_INSTALL_DIR = $(libdir) + +ELF_VERSION = 2.0 +ELF_IMAGE = libcom_err +ELF_MYDIR = et +ELF_INSTALL_DIR = $(libdir) + +BSDLIB_VERSION = 1.0 +BSDLIB_IMAGE = libcom_err +BSDLIB_MYDIR = et +BSDLIB_INSTALL_DIR = $(libdir) + +# +# what to build... +# +.c.o: + $(CC) $(CFLAGS) -c $< -o $@ +@PROFILE_CMT@ $(CC) $(CFLAGS) -pg -o profiled/$*.o -c $< +@CHECKER_CMT@ $(CC) $(CFLAGS) -checker -g -o checker/$*.o -c $< +@DLL_CMT@ (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \ +@DLL_CMT@ -o jump/$*.o -c $<) +@ELF_CMT@ $(CC) $(CFLAGS) -fPIC -o elfshared/$*.o -c $< +@BSDLIB_CMT@ $(CC) $(CFLAGS) -fpic -o pic/$*.o -c $< + +@MAKEFILE_LIBRARY@ +@MAKEFILE_DLL@ +@MAKEFILE_ELF@ +@MAKEFILE_BSDLIB@ +@MAKEFILE_PROFILE@ +@MAKEFILE_CHECKER@ + +compile_et: compile_et.sh + $(CP) $< $@ && $(CHMOD) +x compile_et + +com_err.ps : com_err.dvi +com_err.dvi: com_err.texinfo + +#libcom_err.o: $(LIBOBJS) +# $(LD) -r -s -o libcom_err.o $(LIBOBJS) +# chmod -x libcom_err.o + +TAGS: $(SRCS) + $(TAGS) $(SRCS) + +installdirs:: + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(ulibdir) \ + $(DESTDIR)$(includedir)/et + +install:: libcom_err.a $(HFILES) installdirs + $(INSTALL_DATA) libcom_err.a $(DESTDIR)$(ulibdir)/libcom_err.a + $(CHMOD) 644 $(DESTDIR)$(ulibdir)/libcom_err.a + -$(RANLIB) $(DESTDIR)$(ulibdir)/libcom_err.a + $(CHMOD) $(LIBMODE) $(DESTDIR)$(ulibdir)/libcom_err.a + for i in $(HFILES); do \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/et/$$i; \ + done + +uninstall:: + $(RM) -f $(ulibdir)/libcom_err.a + $(RM) -rf $(includedir)/et + +clean:: + $(RM) -f compile_et libcom_err.a libcom_err_p.a + $(RM) -f $(OBJS) profiled/* + $(RM) -f *~ \#* *.bak *.otl *.aux *.toc *.PS *.dvi *.ps TAGS *.ln + $(RM) -f ../libcom_err.a ../libcom_err_p.a +mostlyclean:: clean +distclean:: clean + $(RM) -f .depend compile_et.sh Makefile + +# +++ Dependency line eater +++ +# +# Makefile dependencies follow. This must be the last section in +# the Makefile.in file +# +error_message.o : $(srcdir)/error_message.c \ + $(srcdir)/com_err.h \ + $(srcdir)/error_table.h $(srcdir)/mit-sipb-copyright.h $(srcdir)/internal.h +et_name.o : $(srcdir)/et_name.c $(srcdir)/error_table.h $(srcdir)/mit-sipb-copyright.h \ + $(srcdir)/internal.h \ + +init_et.o : $(srcdir)/init_et.c \ + $(srcdir)/com_err.h \ + $(srcdir)/error_table.h \ + $(srcdir)/mit-sipb-copyright.h +com_err.o : $(srcdir)/com_err.c \ + $(srcdir)/com_err.h \ + $(srcdir)/mit-sipb-copyright.h \ + $(srcdir)/error_table.h $(srcdir)/internal.h \ + + diff --git a/lib/et/compile_et.sh b/lib/et/compile_et.sh.in index fdd249e8..0cae2971 100644 --- a/lib/et/compile_et.sh +++ b/lib/et/compile_et.sh.in @@ -2,7 +2,7 @@ # # AWK=@AWK@ -DIR=@DIR@ +DIR=@ET_DIR@ ROOT=`echo $1 | sed -e s/.et$//` BASE=`basename $ROOT` diff --git a/lib/et/config_script b/lib/et/config_script deleted file mode 100644 index e3de35c8..00000000 --- a/lib/et/config_script +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# -# This program takes a shell script and configures for the following -# variables: @DIR@ -# @AWK@ -# @SED@ -# -# Usage: config_script <filename> [<awk>] [<sed>] -# - -FILE=$1 -AWK=$2 -SED=$3 - -# Grr.... not all Unix's have the dirname command -TMP=`echo $1 | sed -e 's;[^/]*$;;' -e 's/^$/./'` -DIR=`cd ${TMP}; pwd` - -if test "${AWK}x" = "x" ; then - AWK=awk -fi -if test "${SED}x" = "x" ; then - SED=sed -fi -sed -e "s;@DIR@;${DIR};" -e "s;@AWK@;${AWK};" -e "s;@SED@;${SED};" $FILE diff --git a/lib/et/jump/jump.funcs b/lib/et/dll/jump.funcs index c5cdbc41..c5cdbc41 100644 --- a/lib/et/jump/jump.funcs +++ b/lib/et/dll/jump.funcs diff --git a/lib/et/jump/jump.ignore b/lib/et/dll/jump.ignore index 0bcb5519..0bcb5519 100644 --- a/lib/et/jump/jump.ignore +++ b/lib/et/dll/jump.ignore diff --git a/lib/et/jump/jump.import b/lib/et/dll/jump.import index 51b1fd88..51b1fd88 100644 --- a/lib/et/jump/jump.import +++ b/lib/et/dll/jump.import diff --git a/lib/et/jump/jump.params b/lib/et/dll/jump.params index d88c8c2f..d88c8c2f 100644 --- a/lib/et/jump/jump.params +++ b/lib/et/dll/jump.params diff --git a/lib/et/dll/jump.undefs b/lib/et/dll/jump.undefs new file mode 100644 index 00000000..de3f8d49 --- /dev/null +++ b/lib/et/dll/jump.undefs @@ -0,0 +1 @@ +66803000 D __NEEDS_SHRLIB_libc_4 diff --git a/lib/et/jump/jump.vars b/lib/et/dll/jump.vars index c0aad656..c0aad656 100644 --- a/lib/et/jump/jump.vars +++ b/lib/et/dll/jump.vars diff --git a/lib/et/init_et.c b/lib/et/init_et.c index 8e5af844..969ef362 100644 --- a/lib/et/init_et.c +++ b/lib/et/init_et.c @@ -11,7 +11,7 @@ #include <stdio.h> #include <errno.h> -#ifdef HAS_STDLIB_H +#ifdef HAVE_STDLIB_H #include <stdlib.h> #endif #include "com_err.h" diff --git a/lib/et/jump/jump.undefs b/lib/et/jump/jump.undefs deleted file mode 100644 index c61658a2..00000000 --- a/lib/et/jump/jump.undefs +++ /dev/null @@ -1 +0,0 @@ -66804000 D __NEEDS_SHRLIB_libc_4 diff --git a/lib/et/vfprintf.c b/lib/et/vfprintf.c index 94f0fb58..a1dc1e8c 100644 --- a/lib/et/vfprintf.c +++ b/lib/et/vfprintf.c @@ -19,6 +19,7 @@ static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88"; #endif /* LIBC_SCCS and not lint */ +#if !HAVE_VPRINTF && HAVE_DOPRNT #include <stdio.h> #include <varargs.h> @@ -45,3 +46,4 @@ vfprintf(iop, fmt, ap) return (ferror(iop) ? EOF : len); } +#endif /* !HAVE_VPRINTF */ diff --git a/lib/ext2fs/.depend b/lib/ext2fs/.depend index dd371f65..19290096 100644 --- a/lib/ext2fs/.depend +++ b/lib/ext2fs/.depend @@ -1,198 +1,199 @@ -alloc.o : alloc.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +alloc.o : ./alloc.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/unistd.h /usr/include/posix_opt.h \ /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ - /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ - /usr/include/alloca.h /usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + /usr/include/confname.h /usr/include/sys/types.h /usr/include/linux/types.h \ + /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \ + /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/time.h \ + /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -badblocks.o : badblocks.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +badblocks.o : ./badblocks.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ /usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \ /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \ - ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -bb_inode.o : bb_inode.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +bb_inode.o : ./bb_inode.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ /usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \ /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \ - ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -bitmaps.o : bitmaps.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +bitmaps.o : ./bitmaps.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ /usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \ /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \ - ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -bitops.o : bitops.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +bitops.o : ./bitops.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/sys/types.h /usr/include/linux/types.h \ - /usr/include/asm/types.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \ + /usr/include/asm/types.h /usr/include/linux/ext2_fs.h ./ext2fs.h ../et/com_err.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \ ../ext2fs/bitops.h -block.o : block.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +block.o : ./block.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ - /usr/include/alloca.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/alloca.h /usr/include/linux/ext2_fs.h ./ext2fs.h ../et/com_err.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \ ../ext2fs/bitops.h -check_desc.o : check_desc.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +check_desc.o : ./check_desc.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ /usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \ /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \ - ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -closefs.o : closefs.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +closefs.o : ./closefs.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/unistd.h /usr/include/posix_opt.h \ /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ + /usr/include/confname.h /usr/include/sys/types.h /usr/include/linux/types.h \ + /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \ + /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/time.h \ + /usr/include/linux/ext2_fs.h ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h +expanddir.o : ./expanddir.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ - /usr/include/alloca.h /usr/include/time.h /usr/include/linux/ext2_fs.h ext2fs.h \ - ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h \ - ../ext2fs/ext2_err.h ../ext2fs/bitops.h -expanddir.o : expanddir.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ - /usr/include/alloca.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \ + /usr/include/alloca.h /usr/include/linux/ext2_fs.h ./ext2fs.h ../et/com_err.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \ ../ext2fs/bitops.h -ext2_err.o : ext2_err.c -freefs.o : freefs.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +ext2_err.o : ./ext2_err.c +freefs.o : ./freefs.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/unistd.h /usr/include/posix_opt.h \ /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ - /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ - /usr/include/alloca.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \ - /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \ - ../ext2fs/bitops.h -get_pathname.o : get_pathname.c /usr/include/stdio.h /usr/include/features.h \ + /usr/include/confname.h /usr/include/sys/types.h /usr/include/linux/types.h \ + /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \ + /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/linux/ext2_fs.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h +get_pathname.o : ./get_pathname.c /usr/include/stdio.h /usr/include/features.h \ /usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/unistd.h /usr/include/posix_opt.h \ - /usr/include/gnu/types.h /usr/include/sys/types.h /usr/include/linux/types.h \ + /usr/include/gnu/types.h /usr/include/confname.h /usr/include/sys/types.h /usr/include/linux/types.h \ /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/linux/ext2_fs.h \ - ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -initialize.o : initialize.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +initialize.o : ./initialize.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ /usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \ /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \ - ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -inline.o : inline.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +inline.o : ./inline.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ /usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \ /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \ - ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -inode.o : inode.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +inode.o : ./inode.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ /usr/include/alloca.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \ - ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -link.o : link.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +link.o : ./link.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ - /usr/include/alloca.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/alloca.h /usr/include/linux/ext2_fs.h ./ext2fs.h ../et/com_err.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \ ../ext2fs/bitops.h -llseek.o : llseek.c /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ +llseek.o : ./llseek.c /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/linux/errno.h \ /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/linux/unistd.h /usr/include/asm/unistd.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ - ../ext2fs/io.h -mkdir.o : mkdir.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/confname.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ../ext2fs/io.h /usr/include/linux/unistd.h /usr/include/asm/unistd.h +mkdir.o : ./mkdir.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ /usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \ /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \ - ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -namei.o : namei.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +namei.o : ./namei.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ - /usr/include/alloca.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/alloca.h /usr/include/linux/ext2_fs.h ./ext2fs.h ../et/com_err.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \ ../ext2fs/bitops.h -newdir.o : newdir.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +newdir.o : ./newdir.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ - /usr/include/alloca.h /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/alloca.h /usr/include/linux/ext2_fs.h ./ext2fs.h ../et/com_err.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ../ext2fs/io.h ../ext2fs/ext2_err.h \ ../ext2fs/bitops.h -openfs.o : openfs.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +openfs.o : ./openfs.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ /usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \ /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \ - ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -read_bb.o : read_bb.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +read_bb.o : ./read_bb.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ /usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \ /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \ - ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -read_bb_file.o : read_bb_file.c /usr/include/stdio.h /usr/include/features.h \ +read_bb_file.o : ./read_bb_file.c /usr/include/stdio.h /usr/include/features.h \ /usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/unistd.h /usr/include/posix_opt.h \ - /usr/include/gnu/types.h /usr/include/sys/types.h /usr/include/linux/types.h \ + /usr/include/gnu/types.h /usr/include/confname.h /usr/include/sys/types.h /usr/include/linux/types.h \ /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h /usr/include/fcntl.h \ /usr/include/linux/fcntl.h /usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h \ - /usr/include/linux/ext2_fs.h ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + /usr/include/linux/ext2_fs.h ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -rw_bitmaps.o : rw_bitmaps.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +rw_bitmaps.o : ./rw_bitmaps.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ /usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \ /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/ext2_fs.h \ - ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ + ./ext2fs.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ ../ext2fs/io.h ../ext2fs/ext2_err.h ../ext2fs/bitops.h -unix_io.o : unix_io.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ +unix_io.o : ./unix_io.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/sys/types.h \ - /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/stdlib.h /usr/include/errno.h \ - /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ + /usr/include/unistd.h /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/include/confname.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ /usr/include/alloca.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h \ /usr/include/sys/stat.h /usr/include/linux/stat.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ - ext2_err.h io.h + ./ext2_err.h ./io.h diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog index 5fd3bfed..4dd44ed4 100644 --- a/lib/ext2fs/ChangeLog +++ b/lib/ext2fs/ChangeLog @@ -1,3 +1,234 @@ +Thu Oct 26 12:09:16 1995 <tytso@rsts-11.mit.edu> + + * ext2_err.et: Updated message in EXT2_ET_BASE to say version 0.5c + + * swapfs.c (ext2fs_swap_super): Put an #ifdef check around + s_def_resuid and s_def_resgid for backwards compatibility. + +Fri Oct 20 23:33:31 1995 <tytso@rsts-11.mit.edu> + + * bitops.h: Added #ifdef's for Sparc. + +Wed Sep 6 22:14:46 1995 <tytso@rsts-11.mit.edu> + + * getsize.c: #include <sys/ioctl.h> under Linux to pick up ioctl() + declaration + + * closefs.c: #include <string.h> to pick up memset() declaration + +Mon Sep 4 21:45:29 1995 Remy Card <card@bbj> + + * Makefile.in: Added support for BSD shared libraries. + + * initialize.c (ext2fs_initialize): Correctly set the s_creator_os + flag. + +Mon Sep 4 09:55:30 1995 <tytso@rsts-11.mit.edu> + + * unix_io.c (unix_open): Add a double check; if the passed in name + is NULL, return EXT2_ET_BAD_DEVICE_NAME. + + * ext2_err.et (EXT2_ET_BAD_DEVICE_NAME): Added new error code + +Wed Aug 16 15:44:10 1995 <tytso@rsts-11.mit.edu> + + * inode.c (ext2fs_check_directory): Use LINUX_S_ISDIR instead of + S_ISDIR. + +Tue Aug 15 13:08:36 1995 <tytso@rsts-11.mit.edu> + + * getsize.c (ext2fs_get_device_size): Add support for reading the + partition size from a BSD disk label. + +Thu Aug 10 09:33:26 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * getsize.c (ext2fs_get_device_size): New function that determins + the size of a device. Used by mke2fs and e2fsck. + +Sat Aug 12 03:09:54 1995 Remy Card <card@bbj> + + * Makefile.in (install): Install static libraries in $(ulibdir) + (/usr/lib on Linux) instead of $(libdir) (/lib on Linux). + +Wed Aug 9 17:04:23 1995 Theodore Y. Ts'o <tytso@dcl> + + * bitmaps.c (ext2fs_free_inode_bitmap, ext2fs_free_block_bitmap): + Move these functions to freefs.c. + + * closefs.c (ext2fs_flush): If swapping blocks, clear the group + descriptors shadow memory to keep purify quiet. (This + also has the nice benefit that the unused portion of the + shadow descriptors are zeroed out.) + + * dirblock.c (ext2fs_write_dir_block): We need to use + dirent->rec_len *before* it's byteswapped to find the + location of the next directory structure! + + * alloc.c (ext2fs_new_inode): Fix bug which could potentially + cause ext2fs_new_inode to loop infinitely if we're trying + to allocate an inode in group #0 and there are no free + inodes at all in the system. + + * closefs.c: #include <errno.h> if it exists. + +Sun Aug 6 13:27:50 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * ext2fs.h (BLOCK_FLAG_HOLE): Added new definition for + BLOCK_FLAG_APPEND. Added documentation for the block + interator flags. + +Sat Aug 5 11:44:05 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * Makefile.in (DLL_INSTALL_DIR, ELF_INSTALL_DIR): Set the + installation directories correctly. + +Tue Jul 18 09:27:38 1995 <tytso@rsx-11.mit.edu> + + * namei.c (process_dir_block): + * mkdir.c (ext2fs_mkdir): + * expanddir.c (expand_dir_proc): Use ext2fs_{read,write}_dir_block + to read/write the directory block. + + * dirblock.c (ext2fs_read_dir_block), ext2fs_write_dir_block): New + file containing functions for reading and writing + directory blocks (byte swapping if necesssary) + + * block.c (block_iterate_ind, block_iterate_dind, + block_iterate_tind): Byte swap the block addresses if + EXT2_SWAP_BYTES is set (and swap them back before writing + them out.) + + * inode.c (inocpy_with_swap): New function. + (ext2fs_get_next_inode, ext2fs_read_inode, ext2fs_write_inode): + Call inocpy_with_swap if EXT2_SWAP_BYTES if set. + + * closefs.c (ext2fs_flush): If EXT2_SWAP_BYTES is set, then swap + the superblock and group descriptors before writing it out. + + * openfs.c (ext2fs_open): If the magic number is byte-swapped, + then set the EXT2_SWAP_BYTES and byte-swap the superblock + and group descriptors. + + * swapfs.c (ext2fs_swap_super, ext2fs_swap_group_desc): New functions + to desp ext2 filesystem structures. + + * bitops.c (set_bit, clear_bit, test_bit): Use modifications + supplied by Pete A. Zaitcev so that the C language + versions of these functions are more portable. They will + now work on both little and big endian systems, and the + assumption that 32-bit integers are used is gone. + + * bitops.h (ext2_swab16, ext2_swab32): Added new functions for + doing byte swapping. + + * ext2fs.h (EXT2_SWAP_BYTES): Add new flag which indicates that + byte swapping should take place. + +Sun Jul 16 06:21:43 1995 <tytso@rsx-11.mit.edu> + + * Makefile.in, cmp_bitmaps.c (ext2fs_compare_block_bitmap_end, + ext2fs_compare_inode_bitmap_end): Added new file + containing routines to compare bitmaps. + + * ext2_err.et (EXT2_ET_NEQ_BLOCK_BITMAP, EXT2_ET_NEQ_INODE_BITMAP): + Added new error codes. + +Sat Jul 15 04:23:37 1995 <tytso@rsx-11.mit.edu> + + * inode.c (ext2fs_get_next_inode): Don't check scan->inode_buffer; + if the magic number is correct, it will be allocated. + +Fri Jul 14 19:02:59 1995 <tytso@rsx-11.mit.edu> + + * block.c (block_iterate_ind, block_iterate_dind, + block_iterate_tind): Don't recompute block_nr each loop; + just increment it! Factor check of BLOCK_FLAG_APPEND out + of the loop. Factor mask of BLOCK_CHANGED into changed + variable out of the loop. (block_iterate_ind, in + particular, gets called a lot, so every little + optimization helps.) + +Thu Jul 13 08:02:45 1995 <tytso@rsx-11.mit.edu> + + * block.c (block_iterate_ind, block_iterate_dind, + block_iterate_tind): Precompute limit of loop to speed up + block_iterate_ind and company. + + * bitops.h (ext2fs_fast_mark_block_bitmap, + ext2fs_fast_unmark_block_bitmap, ext2fs_fast_test_block_bitmap, + ext2fs_fast_mark_inode_bitmap, ext2fs_fast_unmark_inode_bitmap, + ext2fs_fast_test_inode_bitmap): Add fast version of these + functions, which don't do range checking. + + * bitops.h (ext2fs_get_block_bitmap_start, + ext2fs_get_inode_bitmap_start, ext2fs_get_block_bitmap_end, + ext2fs_get_inode_bitmap_end): Add new accessor functions + which return the start and end points of the bitmaps. + +Tue Jul 11 18:59:41 1995 <tytso@rsx-11.mit.edu> + + * llseek.c (ext2_llseek): If the offset is small enough, use lseek + instead of llseek. The errno if the offset is too large + and lseek is not supported should be EINVAL, not -EINVAL. + +Thu Jun 15 23:43:02 1995 Remy Card <card@bbj> + + * Makefile.in: Added support for ELF shared libraries. + Fixed typos in the compilation rules. + (distclean): Added Makefile. + + * llseek.c (llseek): New function, if llseek() does not exist in the + C library. + (ext2_llseek): Changed to call llseek(). + +Mon Jun 12 08:29:07 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * ext2fs.h: Use __u32 to define blk_t, instead of unsigned long. + +Sun Jun 11 15:02:54 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * mkdir.c (ext2fs_mkdir): Use LINUX_S_IFDIR instead of S_IFDIR. + + * ext2fs.h (LINUX_S_IFDIR): Define a linux specific versions of + the S_*, which are normally defined in <sys/stat.h>. This + allows us to compile e2fsprogs on a non-Linux system, + which may have a different value for S_IFDIR. + +Sat Jun 10 23:47:05 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * bitops.c (clear_bit, set_bit): Remove calls to cli() and sti(); + this is a user-mode application! + +Thu Jun 8 13:13:22 1995 Miles Bader <miles@churchy.gnu.ai.mit.edu> + + * llseek.c: Put the include of <linux/unistd.h> inside the #ifdef + __linux__ so that non-linux systems won't see it. + + * alloc.c: Include <errno.h> if possible. + * badblocks.c: Ditto. + * bb_inode.c: Ditto. + * bitmaps.c: Ditto. + * block.c: Ditto. + * expanddir.c: Ditto. + * get_pathname.c: Ditto. + * initialize.c: Ditto. + * inode.c: Ditto. + * llseek.c: Ditto. + * mkdir.c: Ditto. + * namei.c: Ditto. + * newdir.c: Ditto. + * openfs.c: Ditto. + * rw_bitmaps.c: Ditto. + * unix_io.c: Ditto. + + * Makefile.in: Rewritten to conform to GNU coding standards and + support separate compilation directories. + +Thu May 11 04:13:12 1995 <tytso@rsx-11.mit.edu> + + * initialize.c (ext2fs_initialize): Don't allow more than one + bitmaps's worth of inodes in a group. + Sat Mar 11 14:07:11 1995 Theodore Y. Ts'o <tytso@localhost> * llseek.c (ext2_llseek): Added error checking to the llseek() diff --git a/lib/ext2fs/MAKELOG b/lib/ext2fs/MAKELOG deleted file mode 100644 index bb85c24a..00000000 --- a/lib/ext2fs/MAKELOG +++ /dev/null @@ -1,54 +0,0 @@ -gcc -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -I.. -c bitmaps.c -In file included from ext2fs.h:22, - from bitmaps.c:20: -../ext2fs/io.h:12: warning: ANSI C does not support `long long' -../ext2fs/bitops.h: In function `ext2fs_mark_block_bitmap': -In file included from ext2fs.h:112, - from bitmaps.c:20: -../ext2fs/bitops.h:145: warning: passing arg 1 of `ext2fs_warn_bitmap' from incompatible pointer type -../ext2fs/bitops.h: In function `ext2fs_unmark_block_bitmap': -../ext2fs/bitops.h:154: warning: passing arg 1 of `ext2fs_warn_bitmap' from incompatible pointer type -../ext2fs/bitops.h: At top level: -../ext2fs/bitops.h:160: conflicting types for `ext2fs_test_block_bitmap' -../ext2fs/bitops.h:31: previous declaration of `ext2fs_test_block_bitmap' -../ext2fs/bitops.h: In function `ext2fs_test_block_bitmap': -../ext2fs/bitops.h:163: warning: passing arg 1 of `ext2fs_warn_bitmap' from incompatible pointer type -../ext2fs/bitops.h: In function `ext2fs_mark_inode_bitmap': -../ext2fs/bitops.h:172: warning: passing arg 1 of `ext2fs_warn_bitmap' from incompatible pointer type -../ext2fs/bitops.h: In function `ext2fs_unmark_inode_bitmap': -../ext2fs/bitops.h:181: warning: passing arg 1 of `ext2fs_warn_bitmap' from incompatible pointer type -../ext2fs/bitops.h: At top level: -../ext2fs/bitops.h:187: conflicting types for `ext2fs_test_inode_bitmap' -../ext2fs/bitops.h:36: previous declaration of `ext2fs_test_inode_bitmap' -../ext2fs/bitops.h: In function `ext2fs_test_inode_bitmap': -../ext2fs/bitops.h:190: warning: passing arg 1 of `ext2fs_warn_bitmap' from incompatible pointer type -bitmaps.c: In function `ext2fs_read_inode_bitmap': -bitmaps.c:108: warning: implicit declaration of function `ext2fs_free_inode_bitmap' -bitmaps.c:109: structure has no member named `device' -bitmaps.c:110: structure has no member named `device' -bitmaps.c:110: warning: format argument is not a pointer (arg 3) -bitmaps.c:103: warning: `nbytes' may be used uninitialized in this function -bitmaps.c: In function `ext2fs_read_block_bitmap': -bitmaps.c:154: warning: implicit declaration of function `ext2fs_free_block_bitmap' -bitmaps.c:155: structure has no member named `device' -bitmaps.c:156: structure has no member named `device' -bitmaps.c:156: warning: format argument is not a pointer (arg 3) -bitmaps.c:149: warning: `nbytes' may be used uninitialized in this function -bitmaps.c: In function `ext2fs_allocate_inode_bitmap': -bitmaps.c:194: warning: `map' may be used uninitialized in this function -bitmaps.c: In function `ext2fs_allocate_block_bitmap': -bitmaps.c:235: warning: `map' may be used uninitialized in this function -bitmaps.c: At top level: -bitmaps.c:272: warning: no previous prototype for `ext2fs_free_inode_bitmap' -bitmaps.c:272: warning: type mismatch with previous external decl -bitmaps.c:108: warning: previous external decl of `ext2fs_free_inode_bitmap' -bitmaps.c:272: warning: type mismatch with previous implicit declaration -bitmaps.c:108: warning: previous implicit declaration of `ext2fs_free_inode_bitmap' -bitmaps.c:272: warning: `ext2fs_free_inode_bitmap' was previously implicitly declared to return `int' -bitmaps.c:286: warning: no previous prototype for `ext2fs_free_block_bitmap' -bitmaps.c:286: warning: type mismatch with previous external decl -bitmaps.c:154: warning: previous external decl of `ext2fs_free_block_bitmap' -bitmaps.c:286: warning: type mismatch with previous implicit declaration -bitmaps.c:154: warning: previous implicit declaration of `ext2fs_free_block_bitmap' -bitmaps.c:286: warning: `ext2fs_free_block_bitmap' was previously implicitly declared to return `int' -make: *** [bitmaps.o] Error 1 diff --git a/lib/ext2fs/Makefile b/lib/ext2fs/Makefile deleted file mode 100644 index 5f991cfe..00000000 --- a/lib/ext2fs/Makefile +++ /dev/null @@ -1,107 +0,0 @@ -all:: libext2fs.a - -include ../../MCONFIG - -OBJS= ext2_err.o openfs.o freefs.o closefs.o bitmaps.o rw_bitmaps.o inode.o \ - unix_io.o block.o namei.o newdir.o mkdir.o check_desc.o \ - get_pathname.o bitops.o link.o alloc.o expanddir.o inline.o \ - initialize.o badblocks.o read_bb.o bb_inode.o read_bb_file.o llseek.o - -HFILES= bitops.h ext2_err.h ext2fs.h io.h - -ifdef BUILD_PROFILE_LIBS -all:: libext2fs_p.a -endif - -ifdef BUILD_DLL_SHLIBS -DLL_ADDRESS = 0x66900000 -DLL_JUMPSIZE = 0x1000 -DLL_GOTSIZE = 0x1000 -DLL_VERSION = 1.0 -DLL_IMAGE = libe2fs -DLL_STUB = libext2fs -DLL_LIBS = -L../.. -lcom_err -DLL_MYDIR = ext2fs -DLL_INSTALL_DIR = $(SHLIBDIR) - -include ../Makefile.dll-lib -endif - -COMPILE_ET=../et/compile_et - -CFLAGS_NO= $(WFLAGS) -I.. -CFLAGS= $(OPT) $(CFLAGS_NO) -LDFLAGS= $(OPT) - -RM=rm -f -MV=mv -LN=ln -s - -DISTFILES= Makefile *.c *.h image - -.c.o: - $(CC) $(CFLAGS) -c $*.c -ifdef BUILD_PROFILE_LIBS - $(CC) $(CFLAGS_NO) -pg -o profiled/$*.o -c $*.c -endif -# $(CC) $(CFLAGS_NO) -checker -g -o checker/$*.o -c $*.c -ifdef BUILD_DLL_SHLIBS - (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \ - -o jump/$*.o -c $*.c) -endif - -libext2fs.a: $(OBJS) - $(RM) $@.bak - -$(MV) $@ $@.bak - $(ARCHIVE) $@ $(OBJS) - $(RANLIB) $@ - $(RM) ../$@ - $(LN) ext2fs/$@ ../$@ - -libext2fs_p.a: $(OBJS) - $(RM) $@.bak - -$(MV) $@ $@.bak - (cd profiled; $(ARCHIVE) ../$@ $(OBJS)) - $(RANLIB) $@ - $(RM) ../$@ - $(LN) ext2fs/$@ ../$@ - -libext2fs_chk.a: $(OBJS) - $(RM) $@.bak - -$(MV) $@ $@.bak - (cd checker; $(ARCHIVE) ../$@ $(OBJS)) - $(RANLIB) $@ - $(RM) ../$@ - $(LN) ext2fs/$@ ../$@ - -ext2_err.c ext2_err.h: ext2_err.et - $(COMPILE_ET) ext2_err.et - -install-libs:: all - $(INSTALLLIB) libext2fs.a $(LIBDIR)/libext2fs.a - $(CHMOD) 644 $(LIBDIR)/libext2fs.a - $(RANLIB) $(LIBDIR)/libext2fs.a - $(CHMOD) $(LIBMODE) $(LIBDIR)/libext2fs.a - -install-libs:: $(HFILES) - @rm -rf $(INCLDIR)/ext2fs - @mkdir $(INCLDIR)/ext2fs - for i in $(HFILES); do \ - $(INSTALLINC) $$i $(INCLDIR)/ext2fs/$$i; \ - done - -install-tree:: - -install:: - -clean:: - rm -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/* - rm -f ../libext2fs.a ../libext2fs_p.a ../libext2fs_chk.a - -really-clean:: clean - rm -f .depend ext2_err.c ext2_err.h - -dep depend .depend: ext2_err.h - $(CC) -M $(CFLAGS) *.c >.depend - -include .depend diff --git a/lib/ext2fs/Makefile.in b/lib/ext2fs/Makefile.in new file mode 100644 index 00000000..879ea814 --- /dev/null +++ b/lib/ext2fs/Makefile.in @@ -0,0 +1,289 @@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +top_builddir = ../.. +INSTALL = @INSTALL@ + +@MCONFIG@ + +OBJS= ext2_err.o \ + alloc.o \ + badblocks.o \ + bb_inode.o \ + bitmaps.o \ + bitops.o \ + block.o \ + check_desc.o \ + closefs.o \ + cmp_bitmaps.o \ + dirblock.o \ + expanddir.o \ + freefs.o \ + get_pathname.o \ + getsize.o \ + initialize.o \ + inline.o \ + inode.o \ + ismounted.o \ + link.o \ + llseek.o \ + mkdir.o \ + namei.o \ + newdir.o \ + openfs.o \ + read_bb.o \ + read_bb_file.o \ + rw_bitmaps.o \ + swapfs.o \ + unix_io.o + +SRCS= ext2_err.c \ + $(srcdir)/alloc.c \ + $(srcdir)/badblocks.c \ + $(srcdir)/bb_inode.c \ + $(srcdir)/bitmaps.c \ + $(srcdir)/bitops.c \ + $(srcdir)/block.c \ + $(srcdir)/check_desc.c \ + $(srcdir)/closefs.c \ + $(srcdir)/cmp_bitmaps.c \ + $(srcdir)/dirblock.c \ + $(srcdir)/expanddir.c \ + $(srcdir)/freefs.c \ + $(srcdir)/get_pathname.c \ + $(srcdir)/getsize.c \ + $(srcdir)/initialize.c \ + $(srcdir)/inline.c \ + $(srcdir)/inode.c \ + $(srcdir)/ismounted.c \ + $(srcdir)/link.c \ + $(srcdir)/llseek.c \ + $(srcdir)/mkdir.c \ + $(srcdir)/namei.c \ + $(srcdir)/newdir.c \ + $(srcdir)/openfs.c \ + $(srcdir)/read_bb.c \ + $(srcdir)/read_bb_file.c \ + $(srcdir)/rw_bitmaps.c \ + $(srcdir)/swapfs.c \ + $(srcdir)/unix_io.c + +HFILES= bitops.h ext2fs.h io.h + +LIBRARY= libext2fs +LIBDIR= ext2fs + +DLL_ADDRESS = 0x66900000 +DLL_JUMPSIZE = 0x1000 +DLL_GOTSIZE = 0x1000 +DLL_VERSION = 1.1 +DLL_IMAGE = libe2fs +DLL_STUB = libext2fs +DLL_LIBS = -L../.. -lcom_err +DLL_MYDIR = ext2fs +DLL_INSTALL_DIR = $(libdir) + +ELF_VERSION = 2.0 +ELF_IMAGE = libext2fs +ELF_MYDIR = ext2fs +ELF_INSTALL_DIR = $(libdir) + +BSDLIB_VERSION = 2.0 +BSDLIB_IMAGE = libext2fs +BSDLIB_MYDIR = ext2fs +BSDLIB_INSTALL_DIR = $(libdir) + +@MAKEFILE_LIBRARY@ +@MAKEFILE_DLL@ +@MAKEFILE_ELF@ +@MAKEFILE_BSDLIB@ +@MAKEFILE_PROFILE@ +@MAKEFILE_CHECKER@ + +.c.o: + $(CC) $(CFLAGS) -c $< -o $@ +@PROFILE_CMT@ $(CC) $(CFLAGS) -pg -o profiled/$*.o -c $< +@CHECKER_CMT@ $(CC) $(CFLAGS) -checker -g -o checker/$*.o -c $< +@DLL_CMT@ (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \ +@DLL_CMT@ -o jump/$*.o -c $<) +@ELF_CMT@ $(CC) $(CFLAGS) -fPIC -o elfshared/$*.o -c $< +@BSDLIB_CMT@ $(CC) $(CFLAGS) -fpic -o pic/$*.o -c $< + +COMPILE_ET=../et/compile_et + +DISTFILES= Makefile *.c *.h image + +ext2_err.c ext2_err.h: $(srcdir)/ext2_err.et + $(COMPILE_ET) $(srcdir)/ext2_err.et + +installdirs:: + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(ulibdir) \ + $(DESTDIR)$(includedir)/ext2fs + +install:: all $(HFILES) installdirs + $(INSTALL_DATA) libext2fs.a $(DESTDIR)$(ulibdir)/libext2fs.a + $(CHMOD) 644 $(DESTDIR)$(ulibdir)/libext2fs.a + -$(RANLIB) $(DESTDIR)$(ulibdir)/libext2fs.a + $(CHMOD) $(LIBMODE) $(DESTDIR)$(ulibdir)/libext2fs.a + for i in $(HFILES); do \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/ext2fs/$$i; \ + done + $(INSTALL_DATA) ext2_err.h $(DESTDIR)$(includedir)/ext2fs/ext2_err.h + +uninstall:: + $(RM) -f $(ulibdir)/libext2fs.a + $(RM) -rf $(includedir)/ext2fs + +clean:: + $(RM) -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/* \ + ext2_err.c ext2_err.h \ + ../libext2fs.a ../libext2fs_p.a ../libext2fs_chk.a + +mostlyclean:: clean +distclean:: clean + $(RM) -f .depend ext2_err.c ext2_err.h Makefile + +# +++ Dependency line eater +++ +# +# Makefile dependencies follow. This must be the last section in +# the Makefile.in file +# +ext2_err.o: ext2_err.c +alloc.o: $(srcdir)/alloc.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +badblocks.o: $(srcdir)/badblocks.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +bb_inode.o: $(srcdir)/bb_inode.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +bitmaps.o: $(srcdir)/bitmaps.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +bitops.o: $(srcdir)/bitops.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +block.o: $(srcdir)/block.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +check_desc.o: $(srcdir)/check_desc.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +closefs.o: $(srcdir)/closefs.c \ + $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +cmp_bitmaps.o: $(srcdir)/cmp_bitmaps.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +dirblock.o: $(srcdir)/dirblock.c \ + $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +expanddir.o: $(srcdir)/expanddir.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +freefs.o: $(srcdir)/freefs.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +get_pathname.o: $(srcdir)/get_pathname.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +getsize.o: $(srcdir)/getsize.c \ + $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +initialize.o: $(srcdir)/initialize.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +inline.o: $(srcdir)/inline.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +inode.o: $(srcdir)/inode.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +ismounted.o: $(srcdir)/ismounted.c \ + $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +link.o: $(srcdir)/link.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +llseek.o: $(srcdir)/llseek.c \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h \ + +mkdir.o: $(srcdir)/mkdir.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +namei.o: $(srcdir)/namei.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +newdir.o: $(srcdir)/newdir.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +openfs.o: $(srcdir)/openfs.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +read_bb.o: $(srcdir)/read_bb.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +read_bb_file.o: $(srcdir)/read_bb_file.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +rw_bitmaps.o: $(srcdir)/rw_bitmaps.c \ + $(srcdir)/ext2fs.h \ + $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +swapfs.o: $(srcdir)/swapfs.c \ + $(srcdir)/ext2fs.h $(top_srcdir)/lib/et/com_err.h \ + $(srcdir)/io.h $(top_builddir)/lib/ext2fs/ext2_err.h \ + $(srcdir)/bitops.h +unix_io.o: $(srcdir)/unix_io.c \ + $(top_srcdir)/lib/et/com_err.h \ + $(top_builddir)/lib/ext2fs/ext2_err.h $(srcdir)/io.h + diff --git a/lib/ext2fs/alloc.c b/lib/ext2fs/alloc.c index 26c01118..5465e804 100644 --- a/lib/ext2fs/alloc.c +++ b/lib/ext2fs/alloc.c @@ -11,6 +11,9 @@ #include <time.h> #include <sys/stat.h> #include <sys/types.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> @@ -40,9 +43,9 @@ errcode_t ext2fs_new_inode(ext2_filsys fs, ino_t dir, int mode, dir_group = (dir - 1) / EXT2_INODES_PER_GROUP(fs->super); start_inode = (dir_group * EXT2_INODES_PER_GROUP(fs->super)) + 1; + if (start_inode < EXT2_FIRST_INO) + start_inode = EXT2_FIRST_INO; i = start_inode; - if (i < EXT2_FIRST_INO) - i = EXT2_FIRST_INO; do { if (!ext2fs_test_inode_bitmap(map, i)) diff --git a/lib/ext2fs/badblocks.c b/lib/ext2fs/badblocks.c index 8a405012..f286747b 100644 --- a/lib/ext2fs/badblocks.c +++ b/lib/ext2fs/badblocks.c @@ -13,6 +13,9 @@ #include <time.h> #include <sys/stat.h> #include <sys/types.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> diff --git a/lib/ext2fs/bb_inode.c b/lib/ext2fs/bb_inode.c index 2b0ea9f6..c8dfeba1 100644 --- a/lib/ext2fs/bb_inode.c +++ b/lib/ext2fs/bb_inode.c @@ -17,6 +17,9 @@ #include <time.h> #include <sys/stat.h> #include <sys/types.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> diff --git a/lib/ext2fs/bitmaps.c b/lib/ext2fs/bitmaps.c index 8712e2d5..d5ef0ec7 100644 --- a/lib/ext2fs/bitmaps.c +++ b/lib/ext2fs/bitmaps.c @@ -14,6 +14,9 @@ #include <time.h> #include <sys/stat.h> #include <sys/types.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> @@ -151,37 +154,3 @@ void ext2fs_clear_block_bitmap(ext2fs_block_bitmap bitmap) ((bitmap->real_end - bitmap->start) / 8) + 1); } -void ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap) -{ - if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_INODE_BITMAP)) - return; - - bitmap->magic = 0; - if (bitmap->description) { - free(bitmap->description); - bitmap->description = 0; - } - if (bitmap->bitmap) { - free(bitmap->bitmap); - bitmap->bitmap = 0; - } - free(bitmap); -} - -void ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap) -{ - if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_BLOCK_BITMAP)) - return; - - bitmap->magic = 0; - if (bitmap->description) { - free(bitmap->description); - bitmap->description = 0; - } - if (bitmap->bitmap) { - free(bitmap->bitmap); - bitmap->bitmap = 0; - } - free(bitmap); -} - diff --git a/lib/ext2fs/bitops.c b/lib/ext2fs/bitops.c index c037199e..0dc89677 100644 --- a/lib/ext2fs/bitops.c +++ b/lib/ext2fs/bitops.c @@ -21,54 +21,46 @@ * For the benefit of those who are trying to port Linux to another * architecture, here are some C-language equivalents. You should * recode these in the native assmebly language, if at all possible. - * To guarantee atomicity, these routines call cli() and sti() to - * disable interrupts while they operate. (You have to provide inline - * routines to cli() and sti().) * - * Also note, these routines assume that you have 32 bit integers. - * You will have to change this if you are trying to port Linux to the - * Alpha architecture or to a Cray. :-) - * - * C language equivalents written by Theodore Ts'o, 9/26/92 + * C language equivalents written by Theodore Ts'o, 9/26/92. + * Modified by Pete A. Zaitcev 7/14/95 to be portable to big endian + * systems, as well as non-32 bit systems. */ int set_bit(int nr,void * addr) { - int mask, retval; - int *ADDR = (int *) addr; + int mask, retval; + unsigned char *ADDR = (unsigned char *) addr; - ADDR += nr >> 5; - mask = 1 << (nr & 0x1f); - cli(); + ADDR += nr >> 3; + mask = 1 << (nr & 0x07); retval = (mask & *ADDR) != 0; *ADDR |= mask; - sti(); return retval; } int clear_bit(int nr, void * addr) { - int mask, retval; - int *ADDR = (int *) addr; + int mask, retval; + unsigned char *ADDR = (unsigned char *) addr; - ADDR += nr >> 5; - mask = 1 << (nr & 0x1f); - cli(); + ADDR += nr >> 3; + mask = 1 << (nr & 0x07); retval = (mask & *ADDR) != 0; *ADDR &= ~mask; - sti(); return retval; } int test_bit(int nr, const void * addr) { - int mask; - const int *ADDR = (const int *) addr; + int mask; + const unsigned char *ADDR = (const unsigned char *) addr; - ADDR += nr >> 5; - mask = 1 << (nr & 0x1f); + ADDR += nr >> 3; + mask = 1 << (nr & 0x07); return ((mask & *ADDR) != 0); } + #endif /* !_EXT2_HAVE_ASM_BITOPS_ */ void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg, diff --git a/lib/ext2fs/bitops.h b/lib/ext2fs/bitops.h index 87e7d79e..4b0fa39a 100644 --- a/lib/ext2fs/bitops.h +++ b/lib/ext2fs/bitops.h @@ -1,7 +1,8 @@ /* - * bitops.h --- Bitmap frobbing code. + * bitops.h --- Bitmap frobbing code. The byte swapping routines are + * also included here. * - * Copyright (C) 1993, 1994 Theodore Ts'o. This file may be + * Copyright (C) 1993, 1994, 1995 Theodore Ts'o. This file may be * redistributed under the terms of the GNU Public License. * * Taken from <asm/bitops.h>, Copyright 1992, Linus Torvalds. @@ -11,6 +12,8 @@ extern int set_bit(int nr,void * addr); extern int clear_bit(int nr, void * addr); extern int test_bit(int nr, const void * addr); +extern __u16 ext2fs_swab16(__u16 val); +extern __u32 ext2fs_swab32(__u32 val); /* * EXT2FS bitmap manipulation routines. @@ -35,12 +38,40 @@ extern void ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, ino_t inode); extern int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, ino_t inode); +extern void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap, + blk_t block); +extern void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap, + blk_t block); +extern int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap, + blk_t block); + +extern void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, + ino_t inode); +extern void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, + ino_t inode); +extern int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap, + ino_t inode); +extern blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap); +extern blk_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap); +extern blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap); +extern blk_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap); + /* * The inline routines themselves... * * If NO_INLINE_FUNCS is defined, then we won't try to do inline - * functions at all! + * functions at all; they will be included as normal functions in + * inline.c */ +#ifdef NO_INLINE_FUNCS +#if (defined(__i386__) || defined(__i486__) || defined(__i586__) || \ + defined(__mc68000__) || defined(__sparc__)) + /* This prevents bitops.c from trying to include the C */ + /* function version of these functions */ +#define _EXT2_HAVE_ASM_BITOPS_ +#endif +#endif /* NO_INLINE_FUNCS */ + #if (defined(INCLUDE_INLINE_FUNCS) || !defined(NO_INLINE_FUNCS)) #ifdef INCLUDE_INLINE_FUNCS #define _INLINE_ extern @@ -137,6 +168,61 @@ _INLINE_ int test_bit(int nr, const void * addr) #endif /* __mc68000__ */ +#ifdef __sparc__ + +#define _EXT2_HAVE_ASM_BITOPS_ + +_INLINE_ int set_bit(int nr, void *addr) +{ + int mask, retval; + unsigned long *ADDR = (unsigned long *) addr; + + ADDR += nr >> 5; + mask = 1 << (nr & 31); + retval = ((mask & *ADDR) != 0); + *ADDR |= mask; + return retval; +} + +_INLINE_ int clear_bit(int nr, void *addr) +{ + int mask, retval; + unsigned long *ADDR = (unsigned long *) addr; + + ADDR += nr >> 5; + mask = 1 << (nr & 31); + retval = ((mask & *ADDR) != 0); + *ADDR &= ~mask; + return retval; +} + +_INLINE_ int test_bit(int nr, const void *addr) +{ + int mask; + const unsigned long *ADDR = (const unsigned long *) addr; + + ADDR += nr >> 5; + mask = 1 << (nr & 31); + return ((mask & *ADDR) != 0); +} + +#endif /* __sparc__ */ + +#ifndef _EXT2_HAVE_ASM_SWAB + +_INLINE_ __u16 ext2fs_swab16(__u16 val) +{ + return (val >> 8) | (val << 8); +} + +_INLINE_ __u32 ext2fs_swab32(__u32 val) +{ + return ((val>>24) | ((val>>8)&0xFF00) | + ((val<<8)&0xFF0000) | (val<<24)); +} + +#endif /* !_EXT2_HAVE_ASM_SWAB */ + _INLINE_ void ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block) { @@ -203,5 +289,104 @@ _INLINE_ int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap, return test_bit(inode - bitmap->start, bitmap->bitmap); } +_INLINE_ void ext2fs_fast_mark_block_bitmap(ext2fs_block_bitmap bitmap, + blk_t block) +{ +#ifdef EXT2FS_DEBUG_FAST_OPS + if ((block < bitmap->start) || (block > bitmap->end)) { + ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_MARK, block, + bitmap->description); + return; + } +#endif + set_bit(block - bitmap->start, bitmap->bitmap); +} + +_INLINE_ void ext2fs_fast_unmark_block_bitmap(ext2fs_block_bitmap bitmap, + blk_t block) +{ +#ifdef EXT2FS_DEBUG_FAST_OPS + if ((block < bitmap->start) || (block > bitmap->end)) { + ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_UNMARK, + block, bitmap->description); + return; + } +#endif + clear_bit(block - bitmap->start, bitmap->bitmap); +} + +_INLINE_ int ext2fs_fast_test_block_bitmap(ext2fs_block_bitmap bitmap, + blk_t block) +{ +#ifdef EXT2FS_DEBUG_FAST_OPS + if ((block < bitmap->start) || (block > bitmap->end)) { + ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_TEST, + block, bitmap->description); + return 0; + } +#endif + return test_bit(block - bitmap->start, bitmap->bitmap); +} + +_INLINE_ void ext2fs_fast_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, + ino_t inode) +{ +#ifdef EXT2FS_DEBUG_FAST_OPS + if ((inode < bitmap->start) || (inode > bitmap->end)) { + ext2fs_warn_bitmap(EXT2_ET_BAD_INODE_MARK, + inode, bitmap->description); + return; + } +#endif + set_bit(inode - bitmap->start, bitmap->bitmap); +} + +_INLINE_ void ext2fs_fast_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap, + ino_t inode) +{ +#ifdef EXT2FS_DEBUG_FAST_OPS + if ((inode < bitmap->start) || (inode > bitmap->end)) { + ext2fs_warn_bitmap(EXT2_ET_BAD_INODE_UNMARK, + inode, bitmap->description); + return; + } +#endif + clear_bit(inode - bitmap->start, bitmap->bitmap); +} + +_INLINE_ int ext2fs_fast_test_inode_bitmap(ext2fs_inode_bitmap bitmap, + ino_t inode) +{ +#ifdef EXT2FS_DEBUG_FAST_OPS + if ((inode < bitmap->start) || (inode > bitmap->end)) { + ext2fs_warn_bitmap(EXT2_ET_BAD_INODE_TEST, + inode, bitmap->description); + return 0; + } +#endif + return test_bit(inode - bitmap->start, bitmap->bitmap); +} + +_INLINE_ blk_t ext2fs_get_block_bitmap_start(ext2fs_block_bitmap bitmap) +{ + return bitmap->start; +} + +_INLINE_ blk_t ext2fs_get_inode_bitmap_start(ext2fs_inode_bitmap bitmap) +{ + return bitmap->start; +} + +_INLINE_ blk_t ext2fs_get_block_bitmap_end(ext2fs_block_bitmap bitmap) +{ + return bitmap->end; +} + +_INLINE_ blk_t ext2fs_get_inode_bitmap_end(ext2fs_inode_bitmap bitmap) +{ + return bitmap->end; +} + #undef _INLINE_ #endif + diff --git a/lib/ext2fs/block.c b/lib/ext2fs/block.c index 53c193c2..fe112b31 100644 --- a/lib/ext2fs/block.c +++ b/lib/ext2fs/block.c @@ -9,6 +9,9 @@ #include <string.h> #include <unistd.h> #include <stdlib.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> @@ -33,7 +36,7 @@ struct block_context { static int block_iterate_ind(blk_t *ind_block, struct block_context *ctx) { int ret = 0, changed = 0; - int i, flags; + int i, flags, limit; blk_t *block_nr; if (!(ctx->flags & BLOCK_FLAG_DEPTH_TRAVERSE)) @@ -52,19 +55,42 @@ static int block_iterate_ind(blk_t *ind_block, struct block_context *ctx) ret |= BLOCK_ERROR; return ret; } - for (i = 0; i < (ctx->fs->blocksize >> 2); i++, ctx->bcount++) { - block_nr = (blk_t *) ctx->ind_buf + i; - if (*block_nr || (ctx->flags & BLOCK_FLAG_APPEND)) { + limit = ctx->fs->blocksize >> 2; + if (ctx->fs->flags & EXT2_SWAP_BYTES) { + block_nr = (blk_t *) ctx->ind_buf; + for (i = 0; i < limit; i++, block_nr++) + *block_nr = ext2fs_swab32(*block_nr); + } + block_nr = (blk_t *) ctx->ind_buf; + if (ctx->flags & BLOCK_FLAG_APPEND) { + for (i = 0; i < limit; i++, ctx->bcount++, block_nr++) { + flags = (*ctx->func)(ctx->fs, block_nr, ctx->bcount, + ctx->private); + changed |= flags; + if (flags & BLOCK_ABORT) { + ret |= BLOCK_ABORT; + break; + } + } + } else { + for (i = 0; i < limit; i++, ctx->bcount++, block_nr++) { + if (*block_nr == 0) + continue; flags = (*ctx->func)(ctx->fs, block_nr, ctx->bcount, ctx->private); - changed |= flags & BLOCK_CHANGED; + changed |= flags; if (flags & BLOCK_ABORT) { ret |= BLOCK_ABORT; break; } } } - if (changed) { + if (changed & BLOCK_CHANGED) { + if (ctx->fs->flags & EXT2_SWAP_BYTES) { + block_nr = (blk_t *) ctx->ind_buf; + for (i = 0; i < limit; i++, block_nr++) + *block_nr = ext2fs_swab32(*block_nr); + } ctx->errcode = io_channel_write_blk(ctx->fs->io, *ind_block, 1, ctx->ind_buf); if (ctx->errcode) @@ -79,7 +105,7 @@ static int block_iterate_ind(blk_t *ind_block, struct block_context *ctx) static int block_iterate_dind(blk_t *dind_block, struct block_context *ctx) { int ret = 0, changed = 0; - int i, flags; + int i, flags, limit; blk_t *block_nr; if (!(ctx->flags & BLOCK_FLAG_DEPTH_TRAVERSE)) @@ -98,18 +124,40 @@ static int block_iterate_dind(blk_t *dind_block, struct block_context *ctx) ret |= BLOCK_ERROR; return ret; } - for (i = 0; i < (ctx->fs->blocksize >> 2); i++) { - block_nr = (blk_t *) ctx->dind_buf + i; - if (*block_nr || (ctx->flags & BLOCK_FLAG_APPEND)) { + limit = ctx->fs->blocksize >> 2; + if (ctx->fs->flags & EXT2_SWAP_BYTES) { + block_nr = (blk_t *) ctx->dind_buf; + for (i = 0; i < limit; i++, block_nr++) + *block_nr = ext2fs_swab32(*block_nr); + } + block_nr = (blk_t *) ctx->dind_buf; + if (ctx->flags & BLOCK_FLAG_APPEND) { + for (i = 0; i < limit; i++, block_nr++) { + flags = block_iterate_ind(block_nr, ctx); + changed |= flags; + if (flags & (BLOCK_ABORT | BLOCK_ERROR)) { + ret |= flags & (BLOCK_ABORT | BLOCK_ERROR); + break; + } + } + } else { + for (i = 0; i < limit; i++, block_nr++) { + if (*block_nr == 0) + continue; flags = block_iterate_ind(block_nr, ctx); - changed |= flags & BLOCK_CHANGED; + changed |= flags; if (flags & (BLOCK_ABORT | BLOCK_ERROR)) { ret |= flags & (BLOCK_ABORT | BLOCK_ERROR); break; } } } - if (changed) { + if (changed & BLOCK_CHANGED) { + if (ctx->fs->flags & EXT2_SWAP_BYTES) { + block_nr = (blk_t *) ctx->dind_buf; + for (i = 0; i < limit; i++, block_nr++) + *block_nr = ext2fs_swab32(*block_nr); + } ctx->errcode = io_channel_write_blk(ctx->fs->io, *dind_block, 1, ctx->dind_buf); if (ctx->errcode) @@ -124,7 +172,7 @@ static int block_iterate_dind(blk_t *dind_block, struct block_context *ctx) static int block_iterate_tind(blk_t *tind_block, struct block_context *ctx) { int ret = 0, changed = 0; - int i, flags; + int i, flags, limit; blk_t *block_nr; if (!(ctx->flags & BLOCK_FLAG_DEPTH_TRAVERSE)) @@ -143,17 +191,40 @@ static int block_iterate_tind(blk_t *tind_block, struct block_context *ctx) ret |= BLOCK_ERROR; return ret; } - for (i = 0; i < (ctx->fs->blocksize >> 2); i++) { - block_nr = (blk_t *) ctx->tind_buf + i; - if (*block_nr || (ctx->flags & BLOCK_FLAG_APPEND)) { + limit = ctx->fs->blocksize >> 2; + if (ctx->fs->flags & EXT2_SWAP_BYTES) { + block_nr = (blk_t *) ctx->tind_buf; + for (i = 0; i < limit; i++, block_nr++) + *block_nr = ext2fs_swab32(*block_nr); + } + block_nr = (blk_t *) ctx->tind_buf; + if (ctx->flags & BLOCK_FLAG_APPEND) { + for (i = 0; i < limit; i++, block_nr++) { + flags = block_iterate_dind(block_nr, ctx); + changed |= flags; + if (flags & (BLOCK_ABORT | BLOCK_ERROR)) { + ret |= flags & (BLOCK_ABORT | BLOCK_ERROR); + break; + } + } + } else { + for (i = 0; i < limit; i++, block_nr++) { + if (*block_nr == 0) + continue; flags = block_iterate_dind(block_nr, ctx); + changed |= flags; if (flags & (BLOCK_ABORT | BLOCK_ERROR)) { ret |= flags & (BLOCK_ABORT | BLOCK_ERROR); break; } } } - if (changed) { + if (changed & BLOCK_CHANGED) { + if (ctx->fs->flags & EXT2_SWAP_BYTES) { + block_nr = (blk_t *) ctx->tind_buf; + for (i = 0; i < limit; i++, block_nr++) + *block_nr = ext2fs_swab32(*block_nr); + } ctx->errcode = io_channel_write_blk(ctx->fs->io, *tind_block, 1, ctx->tind_buf); if (ctx->errcode) diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c index 41a5052c..d8b796e3 100644 --- a/lib/ext2fs/closefs.c +++ b/lib/ext2fs/closefs.c @@ -9,6 +9,10 @@ #include <unistd.h> #include <stdlib.h> #include <time.h> +#include <string.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> @@ -21,27 +25,60 @@ errcode_t ext2fs_flush(ext2_filsys fs) errcode_t retval; char *group_ptr; unsigned long fs_state; + struct ext2_super_block *super_shadow = 0; + struct ext2_group_desc *group_shadow = 0; + struct ext2_group_desc *s, *t; EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS); + fs_state = fs->super->s_state; + + fs->super->s_wtime = time(NULL); + if (fs->flags & EXT2_SWAP_BYTES) { + retval = ENOMEM; + if (!(super_shadow = malloc(SUPERBLOCK_SIZE))) + goto errout; + if (!(group_shadow = malloc(fs->blocksize*fs->desc_blocks))) + goto errout; + memset(group_shadow, 0, fs->blocksize*fs->desc_blocks); + + /* swap the superblock */ + *super_shadow = *fs->super; + ext2fs_swap_super(super_shadow); + + /* swap the group descriptors */ + for (j=0, s=fs->group_desc, t=group_shadow; + j < fs->group_desc_count; j++, t++, s++) { + *t = *s; + ext2fs_swap_group_desc(t); + } + } else { + super_shadow = fs->super; + group_shadow = fs->group_desc; + } + /* * Write out master superblock. This has to be done * separately, since it is located at a fixed location * (SUPERBLOCK_OFFSET). */ - fs->super->s_wtime = time(NULL); io_channel_set_blksize(fs->io, SUPERBLOCK_OFFSET); - retval = io_channel_write_blk(fs->io, 1, -SUPERBLOCK_SIZE, fs->super); + retval = io_channel_write_blk(fs->io, 1, -SUPERBLOCK_SIZE, + super_shadow); if (retval) - return retval; + goto errout; io_channel_set_blksize(fs->io, fs->blocksize); /* - * Save the state of the FS and set it to non valid for the - * backup superblocks + * Set the state of the FS to be non-valid. (The state has + * already been backed up earlier, and will be restored when + * we exit.) */ - fs_state = fs->super->s_state; fs->super->s_state &= ~EXT2_VALID_FS; + if (fs->flags & EXT2_SWAP_BYTES) { + *super_shadow = *fs->super; + ext2fs_swap_super(super_shadow); + } /* * Write out the master group descriptors, and the backup @@ -52,28 +89,22 @@ errcode_t ext2fs_flush(ext2_filsys fs) if (i !=0 ) { retval = io_channel_write_blk(fs->io, group_block, -SUPERBLOCK_SIZE, - fs->super); - if (retval) { - fs->super->s_state = fs_state; - return retval; - } + super_shadow); + if (retval) + goto errout; } - group_ptr = (char *) fs->group_desc; + group_ptr = (char *) group_shadow; for (j=0; j < fs->desc_blocks; j++) { retval = io_channel_write_blk(fs->io, group_block+1+j, 1, group_ptr); - if (retval) { - fs->super->s_state = fs_state; - return retval; - } + if (retval) + goto errout; group_ptr += fs->blocksize; } group_block += EXT2_BLOCKS_PER_GROUP(fs->super); } - fs->super->s_state = fs_state; - /* * If the write_bitmaps() function is present, call it to * flush the bitmaps. This is done this way so that a simple @@ -83,10 +114,19 @@ errcode_t ext2fs_flush(ext2_filsys fs) if (fs->write_bitmaps) { retval = fs->write_bitmaps(fs); if (retval) - return retval; + goto errout; } - - return 0; + + retval = 0; +errout: + fs->super->s_state = fs_state; + if (fs->flags & EXT2_SWAP_BYTES) { + if (super_shadow) + free(super_shadow); + if (group_shadow) + free(group_shadow); + } + return retval; } errcode_t ext2fs_close(ext2_filsys fs) diff --git a/lib/ext2fs/cmp_bitmaps.c b/lib/ext2fs/cmp_bitmaps.c new file mode 100644 index 00000000..cc9eb6d7 --- /dev/null +++ b/lib/ext2fs/cmp_bitmaps.c @@ -0,0 +1,65 @@ +/* + * cmp_bitmaps.c --- routines to compare inode and block bitmaps. + * + * Copyright (C) 1995 Theodore Ts'o. This file may be redistributed + * under the terms of the GNU Public License. + */ + +#include <stdio.h> +#include <string.h> +#include <unistd.h> +#include <stdlib.h> +#include <fcntl.h> +#include <time.h> +#include <sys/stat.h> +#include <sys/types.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif + +#include <linux/ext2_fs.h> + +#include "ext2fs.h" + +errcode_t ext2fs_compare_block_bitmap(ext2fs_block_bitmap bm1, + ext2fs_block_bitmap bm2) +{ + int i; + + EXT2_CHECK_MAGIC(bm1, EXT2_ET_MAGIC_BLOCK_BITMAP); + EXT2_CHECK_MAGIC(bm2, EXT2_ET_MAGIC_BLOCK_BITMAP); + + if ((bm1->start != bm2->start) || + (bm1->end != bm2->end) || + (memcmp(bm1->bitmap, bm2->bitmap, (bm1->end - bm1->start)/8))) + return EXT2_ET_NEQ_BLOCK_BITMAP; + + for (i = bm1->end - ((bm1->end - bm1->start) % 8); i <= bm1->end; i++) + if (ext2fs_fast_test_block_bitmap(bm1, i) != + ext2fs_fast_test_block_bitmap(bm2, i)) + return EXT2_ET_NEQ_BLOCK_BITMAP; + + return 0; +} + +errcode_t ext2fs_compare_inode_bitmap(ext2fs_inode_bitmap bm1, + ext2fs_inode_bitmap bm2) +{ + int i; + + EXT2_CHECK_MAGIC(bm1, EXT2_ET_MAGIC_INODE_BITMAP); + EXT2_CHECK_MAGIC(bm2, EXT2_ET_MAGIC_INODE_BITMAP); + + if ((bm1->start != bm2->start) || + (bm1->end != bm2->end) || + (memcmp(bm1->bitmap, bm2->bitmap, (bm1->end - bm1->start)/8))) + return EXT2_ET_NEQ_INODE_BITMAP; + + for (i = bm1->end - ((bm1->end - bm1->start) % 8); i <= bm1->end; i++) + if (ext2fs_fast_test_inode_bitmap(bm1, i) != + ext2fs_fast_test_inode_bitmap(bm2, i)) + return EXT2_ET_NEQ_INODE_BITMAP; + + return 0; +} + diff --git a/lib/ext2fs/dirblock.c b/lib/ext2fs/dirblock.c new file mode 100644 index 00000000..bb2f7175 --- /dev/null +++ b/lib/ext2fs/dirblock.c @@ -0,0 +1,74 @@ +/* + * dirblock.c --- directory block routines. + * + * Copyright (C) 1995 Theodore Ts'o. This file may be redistributed + * under the terms of the GNU Public License. + */ + +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <time.h> +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif + +#include <linux/ext2_fs.h> + +#include "ext2fs.h" + +errcode_t ext2fs_read_dir_block(ext2_filsys fs, blk_t block, + void *buf) +{ + errcode_t retval; + char *p, *end; + struct ext2_dir_entry *dirent; + + retval = io_channel_read_blk(fs->io, block, 1, buf); + if (retval) + return retval; + if ((fs->flags & EXT2_SWAP_BYTES) == 0) + return 0; + p = buf; + end = (char *) buf + fs->blocksize; + while (p < end) { + dirent = (struct ext2_dir_entry *) p; + dirent->inode = ext2fs_swab32(dirent->inode); + dirent->rec_len = ext2fs_swab16(dirent->rec_len); + dirent->name_len = ext2fs_swab16(dirent->name_len); + p += (dirent->rec_len < 8) ? 8 : dirent->rec_len; + } + return 0; +} + +errcode_t ext2fs_write_dir_block(ext2_filsys fs, blk_t block, + void *inbuf) +{ + errcode_t retval; + char *p, *end, *write_buf; + char *buf = 0; + struct ext2_dir_entry *dirent; + + if (fs->flags & EXT2_SWAP_BYTES) { + write_buf = buf = malloc(fs->blocksize); + if (!buf) + return ENOMEM; + memcpy(buf, inbuf, fs->blocksize); + p = buf; + end = buf + fs->blocksize; + while (p < end) { + dirent = (struct ext2_dir_entry *) p; + p += (dirent->rec_len < 8) ? 8 : dirent->rec_len; + dirent->inode = ext2fs_swab32(dirent->inode); + dirent->rec_len = ext2fs_swab16(dirent->rec_len); + dirent->name_len = ext2fs_swab16(dirent->name_len); + } + } else + write_buf = inbuf; + retval = io_channel_write_blk(fs->io, block, 1, write_buf); + if (buf) + free(buf); + return retval; +} + + diff --git a/lib/ext2fs/jump/jump.funcs b/lib/ext2fs/dll/jump.funcs index a8f5674b..730ee315 100644 --- a/lib/ext2fs/jump/jump.funcs +++ b/lib/ext2fs/dll/jump.funcs @@ -73,3 +73,23 @@ 00000000 T _initialize_ext2_error_table libext2fs ext2_err 00000000 T _ext2_llseek libext2fs llseek 00000000 T _ext2fs_set_inode_callback libext2fs inode +00000000 T _ext2fs_compare_block_bitmap libext2fs cmp_bitmaps +00000000 T _ext2fs_compare_inode_bitmap libext2fs cmp_bitmaps +00000000 T _ext2fs_read_dir_block libext2fs dirblock +00000000 T _ext2fs_write_dir_block libext2fs dirblock +00000000 T _ext2fs_swab16 libext2fs inline +00000000 T _ext2fs_swab32 libext2fs inline +00000000 T _ext2fs_fast_mark_block_bitmap libext2fs inline +00000000 T _ext2fs_fast_unmark_block_bitmap libext2fs inline +00000000 T _ext2fs_fast_test_block_bitmap libext2fs inline +00000000 T _ext2fs_fast_mark_inode_bitmap libext2fs inline +00000000 T _ext2fs_fast_unmark_inode_bitmap libext2fs inline +00000000 T _ext2fs_fast_test_inode_bitmap libext2fs inline +00000000 T _ext2fs_get_block_bitmap_start libext2fs inline +00000000 T _ext2fs_get_inode_bitmap_start libext2fs inline +00000000 T _ext2fs_get_block_bitmap_end libext2fs inline +00000000 T _ext2fs_get_inode_bitmap_end libext2fs inline +00000000 T _ext2fs_swap_super libext2fs swapfs +00000000 T _ext2fs_swap_group_desc libext2fs swapfs +00000000 T _ext2fs_get_device_size libext2fs getsize +00000000 T _ext2fs_check_if_mounted libext2fs ismounted diff --git a/lib/ext2fs/dll/jump.ignore b/lib/ext2fs/dll/jump.ignore new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/lib/ext2fs/dll/jump.ignore diff --git a/lib/ext2fs/jump/jump.import b/lib/ext2fs/dll/jump.import index 53208d55..53208d55 100644 --- a/lib/ext2fs/jump/jump.import +++ b/lib/ext2fs/dll/jump.import diff --git a/lib/ext2fs/jump/jump.params b/lib/ext2fs/dll/jump.params index ea74d630..cc96847c 100644 --- a/lib/ext2fs/jump/jump.params +++ b/lib/ext2fs/dll/jump.params @@ -3,4 +3,4 @@ Text=0x66900000 Data=0x00000000 Jump=0x00001000 GOT=0x00001000 -Version=1.0.0 +Version=1.1.0 diff --git a/lib/ext2fs/dll/jump.undefs b/lib/ext2fs/dll/jump.undefs new file mode 100644 index 00000000..294a0b7f --- /dev/null +++ b/lib/ext2fs/dll/jump.undefs @@ -0,0 +1,2 @@ +6690b080 D __NEEDS_SHRLIB_libc_4 +6690b098 D __NEEDS_SHRLIB_libet_1 diff --git a/lib/ext2fs/jump/jump.vars b/lib/ext2fs/dll/jump.vars index edbbf7c7..edbbf7c7 100644 --- a/lib/ext2fs/jump/jump.vars +++ b/lib/ext2fs/dll/jump.vars diff --git a/lib/ext2fs/expanddir.c b/lib/ext2fs/expanddir.c index 5af9853d..b2597c9f 100644 --- a/lib/ext2fs/expanddir.c +++ b/lib/ext2fs/expanddir.c @@ -9,6 +9,9 @@ #include <string.h> #include <unistd.h> #include <stdlib.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> @@ -55,7 +58,7 @@ static int expand_dir_proc(ext2_filsys fs, } memset(block, 0, fs->blocksize); } - retval = io_channel_write_blk(fs->io, new_blk, 1, block); + retval = ext2fs_write_dir_block(fs, new_blk, block); if (retval) { es->err = retval; return BLOCK_ABORT; diff --git a/lib/ext2fs/ext2_err.c b/lib/ext2fs/ext2_err.c deleted file mode 100644 index f9759493..00000000 --- a/lib/ext2fs/ext2_err.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * ext2_err.c: - * This file is automatically generated; please do not edit it. - */ -#ifdef __STDC__ -#define NOARGS void -#else -#define NOARGS -#define const -#endif - -static const char * const text[] = { - "EXT2FS Library version 0.5b", - "Wrong magic number for ext2_filsys structure", - "Wrong magic number for badblocks_list structure", - "Wrong magic number for badblocks_iterate structure", - "Wrong magic number for inode_scan structure", - "Wrong magic number for io_channel structure", - "Wrong magic number for unix io_channel structure", - "Wrong magic number for io_manager structure", - "Wrong magic number for block_bitmap structure", - "Wrong magic number for inode_bitmap structure", - "Wrong magic number --- RESERVED_1", - "Wrong magic number --- RESERVED_2", - "Wrong magic number --- RESERVED_3", - "Wrong magic number --- RESERVED_4", - "Wrong magic number --- RESERVED_5", - "Wrong magic number --- RESERVED_6", - "Wrong magic number --- RESERVED_7", - "Wrong magic number --- RESERVED_8", - "Wrong magic number --- RESERVED_9", - "Bad magic number in super-block", - "Filesystem revision too high", - "Can't seek to superblock", - "Can't read superblock", - "Can't write superblock", - "Attempt to write to filesystem opened read-only", - "Can't read group descriptors", - "Can't write group descriptors", - "Corrupt group descriptor: bad block for block bitmap", - "Corrupt group descriptor: bad block for inode bitmap", - "Corrupt group descriptor: bad block for inode table", - "Can't write an inode bitmap", - "Can't read an inode bitmap", - "Can't write an block bitmap", - "Can't read an block bitmap", - "Can't write an inode table", - "Can't read an inode table", - "Can't read next inode", - "Filesystem has unexpected block size", - "EXT2 directory corrupted", - "Attempt to read block from filesystem resulted in short read", - "Attempt to write block from filesystem resulted in short write", - "No free space in the directory", - "Inode bitmap not loaded", - "BLOCK bitmap not loaded", - "Illegal inode number", - "Illegal block number", - "Internal error in ext2fs_expand_dir", - "Not enough space to build proposed filesystem", - "Illegal block number passed to ext2fs_mark_block_bitmap", - "Illegal block number passed to ext2fs_unmark_block_bitmap", - "Illegal block number passed to ext2fs_test_block_bitmap", - "Illegal inode number passed to ext2fs_mark_inode_bitmap", - "Illegal inode number passed to ext2fs_unmark_inode_bitmap", - "Illegal inode number passed to ext2fs_test_inode_bitmap", - "Attempt to fudge end of block bitmap past the real end", - "Attempt to fudge end of inode bitmap past the real end", - "Illegal indirect block found" , - "Illegal doubly indirect block found" , - "Illegal triply indirect block found" , - 0 -}; - -struct error_table { - char const * const * msgs; - long base; - int n_msgs; -}; -struct et_list { - struct et_list *next; - const struct error_table * table; -}; -extern struct et_list *_et_list; - -static const struct error_table et = { text, 2133571328L, 59 }; - -static struct et_list link = { 0, 0 }; - -void initialize_ext2_error_table (NOARGS); - -void initialize_ext2_error_table (NOARGS) { - if (!link.table) { - link.next = _et_list; - link.table = &et; - _et_list = &link; - } -} diff --git a/lib/ext2fs/ext2_err.et b/lib/ext2fs/ext2_err.et index f439f5a2..71298b81 100644 --- a/lib/ext2fs/ext2_err.et +++ b/lib/ext2fs/ext2_err.et @@ -5,7 +5,7 @@ error_table ext2 ec EXT2_ET_BASE, - "EXT2FS Library version 0.5b" + "EXT2FS Library version 0.5c" ec EXT2_ET_MAGIC_EXT2FS_FILSYS, "Wrong magic number for ext2_filsys structure" @@ -181,5 +181,14 @@ ec EXT2_ET_BAD_DIND_BLOCK, ec EXT2_ET_BAD_TIND_BLOCK, "Illegal triply indirect block found" +ec EXT2_ET_NEQ_BLOCK_BITMAP, + "Block bitmaps are not the same" + +ec EXT2_ET_NEQ_INODE_BITMAP, + "Inode bitmaps are not the same" + +ec EXT2_ET_BAD_DEVICE_NAME, + "Illegal or malformed device name" + end diff --git a/lib/ext2fs/ext2_err.h b/lib/ext2fs/ext2_err.h deleted file mode 100644 index 0a93b1a1..00000000 --- a/lib/ext2fs/ext2_err.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * ext2_err.h: - * This file is automatically generated; please do not edit it. - */ -#ifdef __STDC__ -#define NOARGS void -#else -#define NOARGS -#define const -#endif - -#define EXT2_ET_BASE (2133571328L) -#define EXT2_ET_MAGIC_EXT2FS_FILSYS (2133571329L) -#define EXT2_ET_MAGIC_BADBLOCKS_LIST (2133571330L) -#define EXT2_ET_MAGIC_BADBLOCKS_ITERATE (2133571331L) -#define EXT2_ET_MAGIC_INODE_SCAN (2133571332L) -#define EXT2_ET_MAGIC_IO_CHANNEL (2133571333L) -#define EXT2_ET_MAGIC_UNIX_IO_CHANNEL (2133571334L) -#define EXT2_ET_MAGIC_IO_MANAGER (2133571335L) -#define EXT2_ET_MAGIC_BLOCK_BITMAP (2133571336L) -#define EXT2_ET_MAGIC_INODE_BITMAP (2133571337L) -#define EXT2_ET_MAGIC_RESERVED_1 (2133571338L) -#define EXT2_ET_MAGIC_RESERVED_2 (2133571339L) -#define EXT2_ET_MAGIC_RESERVED_3 (2133571340L) -#define EXT2_ET_MAGIC_RESERVED_4 (2133571341L) -#define EXT2_ET_MAGIC_RESERVED_5 (2133571342L) -#define EXT2_ET_MAGIC_RESERVED_6 (2133571343L) -#define EXT2_ET_MAGIC_RESERVED_7 (2133571344L) -#define EXT2_ET_MAGIC_RESERVED_8 (2133571345L) -#define EXT2_ET_MAGIC_RESERVED_9 (2133571346L) -#define EXT2_ET_BAD_MAGIC (2133571347L) -#define EXT2_ET_REV_TOO_HIGH (2133571348L) -#define EXT2_ET_SB_LSEEK (2133571349L) -#define EXT2_ET_SB_READ (2133571350L) -#define EXT2_ET_SB_WRITE (2133571351L) -#define EXT2_ET_RO_FILSYS (2133571352L) -#define EXT2_ET_GDESC_READ (2133571353L) -#define EXT2_ET_GDESC_WRITE (2133571354L) -#define EXT2_ET_GDESC_BAD_BLOCK_MAP (2133571355L) -#define EXT2_ET_GDESC_BAD_INODE_MAP (2133571356L) -#define EXT2_ET_GDESC_BAD_INODE_TABLE (2133571357L) -#define EXT2_ET_INODE_BITMAP_WRITE (2133571358L) -#define EXT2_ET_INODE_BITMAP_READ (2133571359L) -#define EXT2_ET_BLOCK_BITMAP_WRITE (2133571360L) -#define EXT2_ET_BLOCK_BITMAP_READ (2133571361L) -#define EXT2_ET_INODE_TABLE_WRITE (2133571362L) -#define EXT2_ET_INODE_TABLE_READ (2133571363L) -#define EXT2_ET_NEXT_INODE_READ (2133571364L) -#define EXT2_ET_UNEXPECTED_BLOCK_SIZE (2133571365L) -#define EXT2_ET_DIR_CORRUPTED (2133571366L) -#define EXT2_ET_SHORT_READ (2133571367L) -#define EXT2_ET_SHORT_WRITE (2133571368L) -#define EXT2_ET_DIR_NO_SPACE (2133571369L) -#define EXT2_ET_NO_INODE_BITMAP (2133571370L) -#define EXT2_ET_NO_BLOCK_BITMAP (2133571371L) -#define EXT2_ET_BAD_INODE_NUM (2133571372L) -#define EXT2_ET_BAD_BLOCK_NUM (2133571373L) -#define EXT2_ET_EXPAND_DIR_ERR (2133571374L) -#define EXT2_ET_TOOSMALL (2133571375L) -#define EXT2_ET_BAD_BLOCK_MARK (2133571376L) -#define EXT2_ET_BAD_BLOCK_UNMARK (2133571377L) -#define EXT2_ET_BAD_BLOCK_TEST (2133571378L) -#define EXT2_ET_BAD_INODE_MARK (2133571379L) -#define EXT2_ET_BAD_INODE_UNMARK (2133571380L) -#define EXT2_ET_BAD_INODE_TEST (2133571381L) -#define EXT2_ET_FUDGE_BLOCK_BITMAP_END (2133571382L) -#define EXT2_ET_FUDGE_INODE_BITMAP_END (2133571383L) -#define EXT2_ET_BAD_IND_BLOCK (2133571384L) -#define EXT2_ET_BAD_DIND_BLOCK (2133571385L) -#define EXT2_ET_BAD_TIND_BLOCK (2133571386L) -extern void initialize_ext2_error_table (NOARGS); -#define ERROR_TABLE_BASE_ext2 (2133571328L) - -/* for compatibility with older versions... */ -#define init_ext2_err_tbl initialize_ext2_error_table -#define ext2_err_base ERROR_TABLE_BASE_ext2 diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h index 672466b3..140c1269 100644 --- a/lib/ext2fs/ext2fs.h +++ b/lib/ext2fs/ext2fs.h @@ -21,7 +21,9 @@ */ #define EXT2_LIB_CURRENT_REV 0 -typedef unsigned long blk_t; +#include <linux/types.h> + +typedef __u32 blk_t; typedef unsigned int dgrp_t; #include "et/com_err.h" @@ -64,6 +66,7 @@ typedef struct ext2fs_struct_block_bitmap *ext2fs_block_bitmap; #define EXT2_FLAG_VALID 0x08 #define EXT2_FLAG_IB_DIRTY 0x10 #define EXT2_FLAG_BB_DIRTY 0x20 +#define EXT2_SWAP_BYTES 0x40 struct struct_ext2_filsys { int magic; @@ -128,8 +131,21 @@ struct struct_badblocks_iterate { /* * Block interate flags + * + * BLOCK_FLAG_APPEND, or BLOCK_FLAG_HOLE, indicates that the interator + * function should be called on blocks where the block number is zero. + * This is used by ext2fs_expand_dir() to be able to add a new block + * to an inode. It can also be used for programs that want to be able + * to deal with files that contain "holes". + * + * BLOCK_FLAG_TRAVERSE indicates that the iterator function for the + * indirect, doubly indirect, etc. blocks should be called after all + * of the blocks containined in the indirect blocks are processed. + * This is useful if you are going to be deallocating blocks from an + * inode. */ #define BLOCK_FLAG_APPEND 1 +#define BLOCK_FLAG_HOLE 1 #define BLOCK_FLAG_DEPTH_TRAVERSE 2 /* @@ -169,6 +185,38 @@ struct ext2_struct_inode_scan { }; /* + * ext2fs_check_if_mounted flags + */ +#define EXT2_MF_MOUNTED 1 +#define EXT2_MF_ISROOT 2 +#define EXT2_MF_READONLY 4 + +/* + * Ext2/linux mode flags. We define them here so that we don't need + * to depend on the OS's sys/stat.h, since we may be compiling on a + * non-Linux system. + */ +#define LINUX_S_IFMT 00170000 +#define LINUX_S_IFSOCK 0140000 +#define LINUX_S_IFLNK 0120000 +#define LINUX_S_IFREG 0100000 +#define LINUX_S_IFBLK 0060000 +#define LINUX_S_IFDIR 0040000 +#define LINUX_S_IFCHR 0020000 +#define LINUX_S_IFIFO 0010000 +#define LINUX_S_ISUID 0004000 +#define LINUX_S_ISGID 0002000 +#define LINUX_S_ISVTX 0001000 + +#define LINUX_S_ISLNK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFLNK) +#define LINUX_S_ISREG(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFREG) +#define LINUX_S_ISDIR(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFDIR) +#define LINUX_S_ISCHR(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFCHR) +#define LINUX_S_ISBLK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFBLK) +#define LINUX_S_ISFIFO(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFIFO) +#define LINUX_S_ISSOCK(m) (((m) & LINUX_S_IFMT) == LINUX_S_IFSOCK) + +/* * For checking structure magic numbers... */ @@ -208,20 +256,18 @@ extern errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs); extern errcode_t ext2fs_write_block_bitmap (ext2_filsys fs); extern errcode_t ext2fs_read_inode_bitmap (ext2_filsys fs); extern errcode_t ext2fs_read_block_bitmap(ext2_filsys fs); -errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs, - const char *descr, - ext2fs_block_bitmap *ret); -errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs, - const char *descr, - ext2fs_inode_bitmap *ret); -errcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap, - ino_t end, ino_t *oend); -errcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap, - blk_t end, blk_t *oend); -void ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap); -void ext2fs_clear_block_bitmap(ext2fs_block_bitmap bitmap); -void ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap); -void ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap); +extern errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs, + const char *descr, + ext2fs_block_bitmap *ret); +extern errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs, + const char *descr, + ext2fs_inode_bitmap *ret); +extern errcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap, + ino_t end, ino_t *oend); +extern errcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap, + blk_t end, blk_t *oend); +extern void ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap); +extern void ext2fs_clear_block_bitmap(ext2fs_block_bitmap bitmap); extern errcode_t ext2fs_read_bitmaps(ext2_filsys fs); extern errcode_t ext2fs_write_bitmaps(ext2_filsys fs); @@ -243,11 +289,30 @@ extern errcode_t ext2fs_check_desc(ext2_filsys fs); extern errcode_t ext2fs_close(ext2_filsys fs); extern errcode_t ext2fs_flush(ext2_filsys fs); +/* cmp_bitmaps.c */ +extern errcode_t ext2fs_compare_block_bitmap(ext2fs_block_bitmap bm1, + ext2fs_block_bitmap bm2); +extern errcode_t ext2fs_compare_inode_bitmap(ext2fs_inode_bitmap bm1, + ext2fs_inode_bitmap bm2); + + +/* dirblock.c */ +extern errcode_t ext2fs_read_dir_block(ext2_filsys fs, blk_t block, + void *buf); +extern errcode_t ext2fs_write_dir_block(ext2_filsys fs, blk_t block, + void *buf); + /* expanddir.c */ extern errcode_t ext2fs_expand_dir(ext2_filsys fs, ino_t dir); /* freefs.c */ extern void ext2fs_free(ext2_filsys fs); +extern void ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap); +extern void ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap); + +/* getsize.c */ +extern errcode_t ext2fs_get_device_size(const char *file, int blocksize, + blk_t *retblocks); /* initialize.c */ extern errcode_t ext2fs_initialize(const char *name, int flags, @@ -279,6 +344,9 @@ extern errcode_t ext2fs_write_inode(ext2_filsys fs, unsigned long ino, extern errcode_t ext2fs_get_blocks(ext2_filsys fs, ino_t ino, blk_t *blocks); extern errcode_t ext2fs_check_directory(ext2_filsys fs, ino_t ino); +/* ismounted.c */ +extern errcode_t ext2fs_check_if_mounted(const char *file, int *mount_flags); + /* namei.c */ extern errcode_t ext2fs_dir_iterate(ext2_filsys fs, ino_t dir, @@ -327,6 +395,10 @@ extern errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f, void (*invalid)(ext2_filsys fs, blk_t blk)); +/* swapfs.c */ +extern void ext2fs_swap_super(struct ext2_super_block * super); +extern void ext2fs_swap_group_desc(struct ext2_group_desc *gdp); + /* inline functions */ extern void ext2fs_mark_super_dirty(ext2_filsys fs); extern void ext2fs_mark_changed(ext2_filsys fs); diff --git a/lib/ext2fs/freefs.c b/lib/ext2fs/freefs.c index d9d4fe98..63b52356 100644 --- a/lib/ext2fs/freefs.c +++ b/lib/ext2fs/freefs.c @@ -27,9 +27,43 @@ void ext2fs_free(ext2_filsys fs) if (fs->group_desc) free(fs->group_desc); if (fs->block_map) - free(fs->block_map); + ext2fs_free_block_bitmap(fs->block_map); if (fs->inode_map) - free(fs->inode_map); + ext2fs_free_inode_bitmap(fs->inode_map); free(fs); } +void ext2fs_free_inode_bitmap(ext2fs_inode_bitmap bitmap) +{ + if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_INODE_BITMAP)) + return; + + bitmap->magic = 0; + if (bitmap->description) { + free(bitmap->description); + bitmap->description = 0; + } + if (bitmap->bitmap) { + free(bitmap->bitmap); + bitmap->bitmap = 0; + } + free(bitmap); +} + +void ext2fs_free_block_bitmap(ext2fs_block_bitmap bitmap) +{ + if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_BLOCK_BITMAP)) + return; + + bitmap->magic = 0; + if (bitmap->description) { + free(bitmap->description); + bitmap->description = 0; + } + if (bitmap->bitmap) { + free(bitmap->bitmap); + bitmap->bitmap = 0; + } + free(bitmap); +} + diff --git a/lib/ext2fs/get_pathname.c b/lib/ext2fs/get_pathname.c index a5db2e09..da6b249a 100644 --- a/lib/ext2fs/get_pathname.c +++ b/lib/ext2fs/get_pathname.c @@ -9,6 +9,9 @@ #include <string.h> #include <unistd.h> #include <stdlib.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> diff --git a/lib/ext2fs/getsize.c b/lib/ext2fs/getsize.c new file mode 100644 index 00000000..79186249 --- /dev/null +++ b/lib/ext2fs/getsize.c @@ -0,0 +1,123 @@ +/* + * getsize.c --- get the size of a partition. + * + * Copyright (C) 1995 Theodore Ts'o. This file may be + * redistributed under the terms of the GNU Public License. + */ + +#include <stdio.h> +#if HAVE_UNISTD_H +#include <unistd.h> +#endif +#if HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#include <fcntl.h> +#ifdef HAVE_LINUX_FS_H +#include <linux/fs.h> +#endif +#ifdef HAVE_LINUX_FD_H +#include <sys/ioctl.h> +#include <linux/fd.h> +#endif +#ifdef HAVE_SYS_DISKLABEL_H +#include <sys/ioctl.h> +#include <sys/disklabel.h> +#endif /* HAVE_SYS_DISKLABEL_H */ + +#include <linux/ext2_fs.h> +#include "ext2fs.h" + +static int valid_offset (int fd, ext2_loff_t offset) +{ + char ch; + + if (ext2_llseek (fd, offset, 0) < 0) + return 0; + if (read (fd, &ch, 1) < 1) + return 0; + return 1; +} + +/* + * Returns the number of blocks in a partition + */ +errcode_t ext2fs_get_device_size(const char *file, int blocksize, + blk_t *retblocks) +{ + int fd; + int size; + ext2_loff_t high, low; +#ifdef FDGETPRM + struct floppy_struct this_floppy; +#endif +#ifdef HAVE_SYS_DISKLABEL_H + struct disklabel lab; + struct partition *pp; + char ch; +#endif /* HAVE_SYS_DISKLABEL_H */ + + fd = open(file, O_RDWR); + if (fd < 0) + return errno; + +#ifdef BLKGETSIZE + if (ioctl(fd, BLKGETSIZE, &size) >= 0) { + close(fd); + *retblocks = size / (blocksize / 512); + return 0; + } +#endif +#ifdef FDGETPRM + if (ioctl(fd, FDGETPRM, &this_floppy) >= 0) { + close(fd); + *retblocks = this_floppy.size / (blocksize / 512); + return 0; + } +#endif +#ifdef HAVE_SYS_DISKLABEL_H + size = strlen(file) - 1; + if (size >= 0) { + ch = file[size]; + if (isdigit(ch)) + size = 0; + else if (ch >= 'a' && ch <= 'h') + size = ch - 'a'; + else + size = -1; + } + if (size >= 0 && (ioctl(fd, DIOCGDINFO, (char *)&lab) >= 0)) { + pp = &lab.d_partitions[size]; + if (pp->p_size) { + close(fd); + *retblocks = pp->p_size / (blocksize / 512); + return 0; + } + } +#endif /* HAVE_SYS_DISKLABEL_H */ + + /* + * OK, we couldn't figure it out by using a specialized ioctl, + * which is generally the besy way. So do binary search to + * find the size of the partition. + */ + low = 0; + for (high = 1024; valid_offset (fd, high); high *= 2) + low = high; + while (low < high - 1) + { + const ext2_loff_t mid = (low + high) / 2; + + if (valid_offset (fd, mid)) + low = mid; + else + high = mid; + } + valid_offset (fd, 0); + close(fd); + *retblocks = (low + 1) / blocksize; + return 0; +} diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c index 22e7eaf3..7428b0d4 100644 --- a/lib/ext2fs/initialize.c +++ b/lib/ext2fs/initialize.c @@ -11,11 +11,26 @@ #include <time.h> #include <sys/stat.h> #include <sys/types.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> #include "ext2fs.h" +#if defined(__linux__) && defined(EXT2_OS_LINUX) +#define CREATOR_OS EXT2_OS_LINUX +#elif defined(__gnu__) && defined(EXT2_OS_HURD) +#define CREATOR_OS EXT2_OS_HURD +#elif defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD) +#define CREATOR_OS EXT2_OS_FREEBSD +#elif defined(LITES) && defined(EXT2_OS_LITES) +#define CREATOR_OS EXT2_OS_LITES +#else +#define CREATOR_OS EXT2_OS_LINUX /* by default */ +#endif + errcode_t ext2fs_initialize(const char *name, int flags, struct ext2_super_block *param, io_manager manager, ext2_filsys *ret_fs) @@ -72,9 +87,7 @@ errcode_t ext2fs_initialize(const char *name, int flags, set_field(s_checkinterval, EXT2_DFL_CHECKINTERVAL); super->s_lastcheck = time(NULL); -#ifdef EXT2_OS_LINUX - super->s_creator_os = EXT2_OS_LINUX; -#endif + super->s_creator_os = CREATOR_OS; fs->blocksize = EXT2_BLOCK_SIZE(super); fs->fragsize = EXT2_FRAG_SIZE(super); @@ -104,11 +117,14 @@ retry: /* * There should be at least as many inodes as the user * requested. Figure out how many inodes per group that - * should be. + * should be. But make sure that we don't allocate more than + * one bitmap's worth of inodes */ super->s_inodes_per_group = (super->s_inodes_count + fs->group_desc_count - 1) / fs->group_desc_count; + if (super->s_inodes_per_group > fs->blocksize*8) + super->s_inodes_per_group = fs->blocksize*8; /* * Make sure the number of inodes per group completely fills diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c index 6a9c1785..ae69bc21 100644 --- a/lib/ext2fs/inode.c +++ b/lib/ext2fs/inode.c @@ -11,11 +11,16 @@ #include <stdlib.h> #include <sys/stat.h> #include <sys/types.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> #include "ext2fs.h" +static void inocpy_with_swap(struct ext2_inode *t, struct ext2_inode *f); + errcode_t ext2fs_open_inode_scan(ext2_filsys fs, int buffer_blocks, ext2_inode_scan *ret_scan) { @@ -77,9 +82,6 @@ errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ino_t *ino, EXT2_CHECK_MAGIC(scan, EXT2_ET_MAGIC_INODE_SCAN); - if (!scan->inode_buffer) - return EINVAL; - if (scan->inodes_left <= 0) { if (scan->blocks_left <= 0) { if (scan->done_group) { @@ -120,7 +122,11 @@ errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ino_t *ino, return EXT2_ET_NEXT_INODE_READ; scan->inode_scan_ptr = (struct ext2_inode *) scan->inode_buffer; } - *inode = *scan->inode_scan_ptr++; + if (scan->fs->flags & EXT2_SWAP_BYTES) + inocpy_with_swap(inode, scan->inode_scan_ptr++); + else + *inode = *scan->inode_scan_ptr++; + scan->inodes_left--; scan->current_inode++; *ino = scan->current_inode; @@ -171,8 +177,12 @@ errcode_t ext2fs_read_inode (ext2_filsys fs, unsigned long ino, return retval; inode_buffer_block = block_nr; } - memcpy (inode, (struct ext2_inode *) inode_buffer + i, - sizeof (struct ext2_inode)); + if (fs->flags & EXT2_SWAP_BYTES) + inocpy_with_swap(inode, + (struct ext2_inode *) inode_buffer + i); + else + memcpy (inode, (struct ext2_inode *) inode_buffer + i, + sizeof (struct ext2_inode)); return 0; } @@ -217,8 +227,12 @@ errcode_t ext2fs_write_inode(ext2_filsys fs, unsigned long ino, return retval; inode_buffer_block = block_nr; } - memcpy ((struct ext2_inode *) inode_buffer + i, inode, - sizeof (struct ext2_inode)); + if (fs->flags & EXT2_SWAP_BYTES) + inocpy_with_swap((struct ext2_inode *) inode_buffer + i, + inode); + else + memcpy ((struct ext2_inode *) inode_buffer + i, inode, + sizeof (struct ext2_inode)); retval = io_channel_write_blk(fs->io, block_nr, 1, inode_buffer); if (retval) return retval; @@ -264,10 +278,33 @@ errcode_t ext2fs_check_directory(ext2_filsys fs, ino_t ino) retval = ext2fs_read_inode(fs, ino, &inode); if (retval) return retval; - if (!S_ISDIR(inode.i_mode)) + if (!LINUX_S_ISDIR(inode.i_mode)) return ENOTDIR; return 0; } +static void inocpy_with_swap(struct ext2_inode *t, struct ext2_inode *f) +{ + unsigned i; - + t->i_mode = ext2fs_swab16(f->i_mode); + t->i_uid = ext2fs_swab16(f->i_uid); + t->i_size = ext2fs_swab32(f->i_size); + t->i_atime = ext2fs_swab32(f->i_atime); + t->i_ctime = ext2fs_swab32(f->i_ctime); + t->i_mtime = ext2fs_swab32(f->i_mtime); + t->i_dtime = ext2fs_swab32(f->i_dtime); + t->i_gid = ext2fs_swab16(f->i_gid); + t->i_links_count = ext2fs_swab16(f->i_links_count); + t->i_blocks = ext2fs_swab32(f->i_blocks); + t->i_flags = ext2fs_swab32(f->i_flags); + for (i = 0; i < EXT2_N_BLOCKS; i++) + t->i_block[i] = ext2fs_swab32(f->i_block[i]); + t->i_version = ext2fs_swab32(f->i_version); + t->i_file_acl = ext2fs_swab32(f->i_file_acl); + t->i_dir_acl = ext2fs_swab32(f->i_dir_acl); + t->i_faddr = ext2fs_swab32(f->i_faddr); + t->osd2.linux2.l_i_frag = f->osd2.linux2.l_i_frag; + t->osd2.linux2.l_i_fsize = f->osd2.linux2.l_i_fsize; + t->osd2.linux2.i_pad1 = ext2fs_swab16(f->osd2.linux2.i_pad1); +} diff --git a/lib/ext2fs/ismounted.c b/lib/ext2fs/ismounted.c new file mode 100644 index 00000000..58c88fba --- /dev/null +++ b/lib/ext2fs/ismounted.c @@ -0,0 +1,121 @@ +/* + * getsize.c --- get the size of a partition. + * + * Copyright (C) 1995 Theodore Ts'o. This file may be + * redistributed under the terms of the GNU Public License. + */ + +#include <stdio.h> +#if HAVE_UNISTD_H +#include <unistd.h> +#endif +#if HAVE_STDLIB_H +#include <stdlib.h> +#endif +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif +#include <fcntl.h> +#ifdef HAVE_LINUX_FS_H +#include <linux/fs.h> +#endif +#ifdef HAVE_LINUX_FD_H +#include <linux/fd.h> +#endif +#ifdef HAVE_MNTENT_H +#include <mntent.h> +#endif +#ifdef HAVE_GETMNTINFO +#include <paths.h> +#include <sys/param.h> +#include <sys/mount.h> +#endif /* HAVE_GETMNTINFO */ + +#include <linux/ext2_fs.h> +#include "ext2fs.h" + +#ifdef HAVE_MNTENT_H +/* + * XXX we only check to see if the mount is readonly when it's the + * root filesystem EXT2_FS_READONLY. + */ +static errcode_t check_mntent(const char *file, int *mount_flags) +{ + FILE * f; + struct mntent * mnt; + int fd; + + *mount_flags = 0; + if ((f = setmntent (MOUNTED, "r")) == NULL) + return errno; + while ((mnt = getmntent (f)) != NULL) + if (strcmp(file, mnt->mnt_fsname) == 0) + break; + endmntent (f); + if (mnt == 0) + return 0; + *mount_flags = EXT2_MF_MOUNTED; + + if (!strcmp(mnt->mnt_dir, "/")) { + *mount_flags |= EXT2_MF_ISROOT; + fd = open(MOUNTED, O_RDWR); + if (fd < 0) { + if (errno == EROFS) + *mount_flags |= EXT2_MF_READONLY; + } else + close(fd); + } + return 0; +} +#endif + +#ifdef HAVE_GETMNTINFO +static errcode_t check_getmntinfo(const char *file, int *mount_flags) +{ + struct statfs *mp; + int len, n; + const char *s1; + char *s2; + + n = getmntinfo(&mp, MNT_NOWAIT); + if (n == 0) + return errno; + + len = sizeof(_PATH_DEV) - 1; + s1 = file; + if (strncmp(_PATH_DEV, s1, len) == 0) + s1 += len; + + *mount_flags = 0; + while (--n >= 0) { + s2 = mp->f_mntfromname; + if (strncmp(_PATH_DEV, s2, len) == 0) { + s2 += len - 1; + *s2 = 'r'; + } + if (strcmp(s1, s2) == 0 || strcmp(s1, &s2[1]) == 0) { + *mount_flags = EXT2_MF_MOUNTED; + break; + } + ++mp; + } + return 0; +} +#endif /* HAVE_GETMNTINFO */ + +/* + * Is_mounted is set to 1 if the device is mounted, 0 otherwise + */ +errcode_t ext2fs_check_if_mounted(const char *file, int *mount_flags) +{ +#ifdef HAVE_MNTENT_H + return check_mntent(file, mount_flags); +#else +#ifdef HAVE_GETMNTINFO + return check_getmntinfo(file, mount_flags); +#else + *mount_flags = 0; + return 0; +#endif /* HAVE_GETMNTINFO */ +#endif /* HAVE_MNTENT_H */ +} diff --git a/lib/ext2fs/jump/jump.undefs b/lib/ext2fs/jump/jump.undefs deleted file mode 100644 index 94699926..00000000 --- a/lib/ext2fs/jump/jump.undefs +++ /dev/null @@ -1,2 +0,0 @@ -66909078 D __NEEDS_SHRLIB_libc_4 -6690908c D __NEEDS_SHRLIB_libet_1 diff --git a/lib/ext2fs/llseek.c b/lib/ext2fs/llseek.c index 00fe3cdc..02e0ede8 100644 --- a/lib/ext2fs/llseek.c +++ b/lib/ext2fs/llseek.c @@ -9,12 +9,25 @@ #include <errno.h> #include <unistd.h> -#include <linux/unistd.h> #include "et/com_err.h" #include "ext2fs/io.h" #ifdef __linux__ +#ifdef HAVE_LLSEEK +#include <unistd.h> +#include <syscall.h> + +#else /* HAVE_LLSEEK */ + +#ifdef __alpha__ + +#define llseek lseek + +#else /* !__alpha__ */ + +#include <linux/unistd.h> + #ifndef __NR__llseek #define __NR__llseek 140 #endif @@ -26,54 +39,62 @@ static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high, unsigned long, offset_low,ext2_loff_t *,result, unsigned int, origin) +static ext2_loff_t llseek (unsigned int fd, ext2_loff_t offset, + unsigned int origin) +{ + ext2_loff_t result; + int retval; + + retval = _llseek (fd, ((unsigned long long) offset) >> 32, + ((unsigned long long) offset) & 0xffffffff, + &result, origin); + return (retval == -1 ? (ext2_loff_t) retval : result); +} + +#endif /* HAVE_LLSEEK */ + +#endif /* __alpha__ */ + ext2_loff_t ext2_llseek (unsigned int fd, ext2_loff_t offset, unsigned int origin) { - unsigned long offset_high; - unsigned long offset_low; ext2_loff_t result; - int retval; static int do_compat = 0; + if ((sizeof(off_t) >= sizeof(ext2_loff_t)) || + (offset < ((ext2_loff_t) 1 << ((sizeof(off_t)*8) -1)))) + return lseek(fd, (off_t) offset, origin); + if (do_compat) { - compat_lseek: - if ((sizeof(off_t) < sizeof(ext2_loff_t)) && - (offset >= ((ext2_loff_t) 1 << ((sizeof(off_t)*8) -1)))) { - errno = -EINVAL; - return -1; - } - return lseek (fd, (off_t) offset, origin); + errno = EINVAL; + return -1; } - offset_high = ((unsigned long long) offset) >> 32; - offset_low = ((unsigned long long) offset) & 0xffffffff; - retval = _llseek (fd, offset_high, offset_low, &result, origin); - if (retval == -1 && errno == ENOSYS) { + result = llseek (fd, offset, origin); + if (result == -1 && errno == ENOSYS) { /* * Just in case this code runs on top of an old kernel * which does not support the llseek system call */ do_compat++; - goto compat_lseek; + errno = EINVAL; } - if (retval == -1) - result = -1; return result; } -#else +#else /* !linux */ ext2_loff_t ext2_llseek (unsigned int fd, ext2_loff_t offset, unsigned int origin) { if ((sizeof(off_t) < sizeof(ext2_loff_t)) && (offset >= ((ext2_loff_t) 1 << ((sizeof(off_t)*8) -1)))) { - errno = -EINVAL; + errno = EINVAL; return -1; } return lseek (fd, (off_t) offset, origin); } -#endif +#endif /* linux */ diff --git a/lib/ext2fs/mkdir.c b/lib/ext2fs/mkdir.c index 8bcb5426..af3b9b7b 100644 --- a/lib/ext2fs/mkdir.c +++ b/lib/ext2fs/mkdir.c @@ -13,6 +13,9 @@ #include <time.h> #include <sys/stat.h> #include <sys/types.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> @@ -35,7 +38,8 @@ errcode_t ext2fs_mkdir(ext2_filsys fs, ino_t parent, ino_t inum, * Allocate an inode, if necessary */ if (!ino) { - retval = ext2fs_new_inode(fs, parent, S_IFDIR | 0755, 0, &ino); + retval = ext2fs_new_inode(fs, parent, LINUX_S_IFDIR | 0755, + 0, &ino); if (retval) goto cleanup; } @@ -58,7 +62,7 @@ errcode_t ext2fs_mkdir(ext2_filsys fs, ino_t parent, ino_t inum, * Create the inode structure.... */ memset(&inode, 0, sizeof(struct ext2_inode)); - inode.i_mode = S_IFDIR | 0755; + inode.i_mode = LINUX_S_IFDIR | 0755; inode.i_uid = inode.i_gid = 0; inode.i_blocks = fs->blocksize / 512; inode.i_block[0] = blk; @@ -69,7 +73,7 @@ errcode_t ext2fs_mkdir(ext2_filsys fs, ino_t parent, ino_t inum, /* * Write out the inode and inode data block */ - retval = io_channel_write_blk(fs->io, blk, 1, block); + retval = ext2fs_write_dir_block(fs, blk, block); if (retval) goto cleanup; retval = ext2fs_write_inode(fs, ino, &inode); diff --git a/lib/ext2fs/namei.c b/lib/ext2fs/namei.c index da382f71..496c7266 100644 --- a/lib/ext2fs/namei.c +++ b/lib/ext2fs/namei.c @@ -9,6 +9,9 @@ #include <string.h> #include <unistd.h> #include <stdlib.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> @@ -87,7 +90,7 @@ static int process_dir_block(ext2_filsys fs, if (blockcnt < 0) return 0; - ctx->errcode = io_channel_read_blk(fs->io, *blocknr, 1, ctx->buf); + ctx->errcode = ext2fs_read_dir_block(fs, *blocknr, ctx->buf); if (ctx->errcode) return BLOCK_ABORT; @@ -116,8 +119,7 @@ next: } if (changed) { - ctx->errcode = io_channel_write_blk(fs->io, *blocknr, 1, - ctx->buf); + ctx->errcode = ext2fs_write_dir_block(fs, *blocknr, ctx->buf); if (ctx->errcode) return BLOCK_ABORT; } diff --git a/lib/ext2fs/newdir.c b/lib/ext2fs/newdir.c index d1018c17..22547266 100644 --- a/lib/ext2fs/newdir.c +++ b/lib/ext2fs/newdir.c @@ -9,6 +9,9 @@ #include <string.h> #include <unistd.h> #include <stdlib.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c index d6f5432d..b674ace0 100644 --- a/lib/ext2fs/openfs.c +++ b/lib/ext2fs/openfs.c @@ -1,16 +1,25 @@ /* * openfs.c --- open an ext2 filesystem * - * Copyright (C) 1993, 1994 Theodore Ts'o. This file may be redistributed - * under the terms of the GNU Public License. + * Copyright (C) 1993, 1994, 1995 Theodore Ts'o. + * + * This file may be redistributed under the terms of the GNU Public + * License. */ #include <stdio.h> #include <string.h> +#if HAVE_UNISTD_H #include <unistd.h> +#endif +#if HAVE_STDLIB_H #include <stdlib.h> +#endif #include <fcntl.h> #include <time.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <sys/stat.h> #include <sys/types.h> @@ -27,8 +36,9 @@ errcode_t ext2fs_open(const char *name, int flags, int superblock, { ext2_filsys fs; errcode_t retval; - int i, group_block; + int i, j, group_block, groups_per_block; char *dest; + struct ext2_group_desc *gdp; EXT2_CHECK_MAGIC(manager, EXT2_ET_MAGIC_IO_MANAGER); @@ -77,6 +87,13 @@ errcode_t ext2fs_open(const char *name, int flags, int superblock, fs->super); if (retval) goto cleanup; + + if ((fs->super->s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC)) || + (fs->flags & EXT2_SWAP_BYTES)) { + fs->flags |= EXT2_SWAP_BYTES; + + ext2fs_swap_super(fs->super); + } if (fs->super->s_magic != EXT2_SUPER_MAGIC) { retval = EXT2_ET_BAD_MAGIC; @@ -126,6 +143,13 @@ errcode_t ext2fs_open(const char *name, int flags, int superblock, if (retval) goto cleanup; group_block++; + if (fs->flags & EXT2_SWAP_BYTES) { + gdp = (struct ext2_group_desc *) dest; + groups_per_block = fs->blocksize / + sizeof(struct ext2_group_desc); + for (j=0; j < groups_per_block; j++) + ext2fs_swap_group_desc(gdp++); + } dest += fs->blocksize; } diff --git a/lib/ext2fs/read_bb_file.c b/lib/ext2fs/read_bb_file.c index c24674ba..04e15819 100644 --- a/lib/ext2fs/read_bb_file.c +++ b/lib/ext2fs/read_bb_file.c @@ -41,7 +41,7 @@ errcode_t ext2fs_read_bb_FILE(ext2_filsys fs, FILE *f, while (!feof (f)) { if (fgets(buf, sizeof(buf), f) == NULL) break; - count = sscanf(buf, "%lu", &blockno); + count = sscanf(buf, "%u", &blockno); if (count <= 0) continue; if ((blockno < fs->super->s_first_data_block) || diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c index 95232940..18b0d3e5 100644 --- a/lib/ext2fs/rw_bitmaps.c +++ b/lib/ext2fs/rw_bitmaps.c @@ -13,6 +13,9 @@ #include <time.h> #include <sys/stat.h> #include <sys/types.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include <linux/ext2_fs.h> @@ -100,7 +103,7 @@ errcode_t ext2fs_write_block_bitmap (ext2_filsys fs) static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) { int i; - char *block_bitmap, *inode_bitmap; + char *block_bitmap = 0, *inode_bitmap = 0; char *buf; errcode_t retval; int block_nbytes = EXT2_BLOCKS_PER_GROUP(fs->super) / 8; @@ -130,39 +133,31 @@ static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block) inode_bitmap = fs->inode_map->bitmap; } free(buf); - buf = malloc(fs->blocksize); - if (!buf) { - retval = ENOMEM; - goto cleanup; - } for (i = 0; i < fs->group_desc_count; i++) { - if (do_block) { + if (block_bitmap) { retval = io_channel_read_blk (fs->io, fs->group_desc[i].bg_block_bitmap, - 1, buf); + -block_nbytes, block_bitmap); if (retval) { retval = EXT2_ET_BLOCK_BITMAP_READ; goto cleanup; } - memcpy(block_bitmap, buf, block_nbytes); block_bitmap += block_nbytes; } - if (do_inode) { + if (inode_bitmap) { retval = io_channel_read_blk (fs->io, fs->group_desc[i].bg_inode_bitmap, - 1, buf); + -inode_nbytes, inode_bitmap); if (retval) { retval = EXT2_ET_INODE_BITMAP_READ; goto cleanup; } - memcpy(inode_bitmap, buf, inode_nbytes); inode_bitmap += inode_nbytes; } } - free(buf); return 0; cleanup: diff --git a/lib/ext2fs/rw_bitmaps.size b/lib/ext2fs/rw_bitmaps.size deleted file mode 100644 index 5a3c9449..00000000 --- a/lib/ext2fs/rw_bitmaps.size +++ /dev/null @@ -1,2 +0,0 @@ -text data bss dec hex -1720 0 0 1720 6b8 diff --git a/lib/ext2fs/swapfs.c b/lib/ext2fs/swapfs.c new file mode 100644 index 00000000..371b8f9d --- /dev/null +++ b/lib/ext2fs/swapfs.c @@ -0,0 +1,58 @@ +/* + * swapfs.c --- swap ext2 filesystem data structures + * + * Copyright (C) 1995 Theodore Ts'o. This file may be redistributed + * under the terms of the GNU Public License. + */ + +#include <stdio.h> +#include <unistd.h> +#include <stdlib.h> +#include <time.h> + +#include <linux/ext2_fs.h> + +#include "ext2fs.h" + +void ext2fs_swap_super(struct ext2_super_block * super) +{ + super->s_inodes_count = ext2fs_swab32(super->s_inodes_count); + super->s_blocks_count = ext2fs_swab32(super->s_blocks_count); + super->s_r_blocks_count = ext2fs_swab32(super->s_r_blocks_count); + super->s_free_blocks_count = ext2fs_swab32(super->s_free_blocks_count); + super->s_free_inodes_count = ext2fs_swab32(super->s_free_inodes_count); + super->s_first_data_block = ext2fs_swab32(super->s_first_data_block); + super->s_log_block_size = ext2fs_swab32(super->s_log_block_size); + super->s_log_frag_size = ext2fs_swab32(super->s_log_frag_size); + super->s_blocks_per_group = ext2fs_swab32(super->s_blocks_per_group); + super->s_frags_per_group = ext2fs_swab32(super->s_frags_per_group); + super->s_inodes_per_group = ext2fs_swab32(super->s_inodes_per_group); + super->s_mtime = ext2fs_swab32(super->s_mtime); + super->s_wtime = ext2fs_swab32(super->s_wtime); + super->s_mnt_count = ext2fs_swab16(super->s_mnt_count); + super->s_max_mnt_count = ext2fs_swab16(super->s_max_mnt_count); + super->s_magic = ext2fs_swab16(super->s_magic); + super->s_state = ext2fs_swab16(super->s_state); + super->s_errors = ext2fs_swab16(super->s_errors); + super->s_lastcheck = ext2fs_swab32(super->s_lastcheck); + super->s_checkinterval = ext2fs_swab32(super->s_checkinterval); + super->s_creator_os = ext2fs_swab32(super->s_creator_os); + super->s_rev_level = ext2fs_swab32(super->s_rev_level); +#ifdef EXT2_DEF_RESUID + super->s_def_resuid = ext2fs_swab16(super->s_def_resuid); + super->s_def_resgid = ext2fs_swab16(super->s_def_resgid); +#endif +} + +void ext2fs_swap_group_desc(struct ext2_group_desc *gdp) +{ + gdp->bg_block_bitmap = ext2fs_swab32(gdp->bg_block_bitmap); + gdp->bg_inode_bitmap = ext2fs_swab32(gdp->bg_inode_bitmap); + gdp->bg_inode_table = ext2fs_swab32(gdp->bg_inode_table); + gdp->bg_free_blocks_count = ext2fs_swab16(gdp->bg_free_blocks_count); + gdp->bg_free_inodes_count = ext2fs_swab16(gdp->bg_free_inodes_count); + gdp->bg_used_dirs_count = ext2fs_swab16(gdp->bg_used_dirs_count); +} + + + diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c index 5126583e..b9955150 100644 --- a/lib/ext2fs/unix_io.c +++ b/lib/ext2fs/unix_io.c @@ -15,9 +15,12 @@ #include <time.h> #include <sys/stat.h> #include <sys/types.h> +#if HAVE_ERRNO_H +#include <errno.h> +#endif #include "et/com_err.h" -#include "ext2_err.h" +#include "ext2fs/ext2_err.h" #include "io.h" /* @@ -63,6 +66,8 @@ static errcode_t unix_open(const char *name, int flags, io_channel *channel) struct unix_private_data *data = NULL; errcode_t retval; + if (name == 0) + return EXT2_ET_BAD_DEVICE_NAME; io = (io_channel) malloc(sizeof(struct struct_io_channel)); if (!io) return ENOMEM; diff --git a/lib/ss/.depend b/lib/ss/.depend index b35a6829..3851e3bd 100644 --- a/lib/ss/.depend +++ b/lib/ss/.depend @@ -1,78 +1,74 @@ -data.o : data.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/libio.h /usr/include/_G_config.h ss_internal.h /usr/include/string.h \ - /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ss.h ../ss/mit-sipb-copyright.h \ - ../ss/ss_err.h copyright.h -error.o : error.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/libio.h /usr/include/_G_config.h copyright.h ../et/com_err.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \ - ss_internal.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - ss.h ../ss/mit-sipb-copyright.h ../ss/ss_err.h -execute_cmd.o : execute_cmd.c /usr/include/stdlib.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ - /usr/include/alloca.h ss_internal.h /usr/include/stdio.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/string.h ss.h ../ss/mit-sipb-copyright.h \ - ../ss/ss_err.h copyright.h -help.o : help.c /usr/include/unistd.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ - /usr/include/stdlib.h /usr/include/errno.h /usr/include/linux/errno.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h \ - /usr/include/alloca.h /usr/include/sys/param.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/limits.h \ +data.o : ./data.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/libio.h /usr/include/_G_config.h ./ss_internal.h /usr/include/string.h \ + /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ./ss.h ../ss/mit-sipb-copyright.h \ + ../ss/ss_err.h ./copyright.h +error.o : ./error.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/libio.h /usr/include/_G_config.h ./copyright.h ./../et/com_err.h \ + /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h ./ss_internal.h /usr/include/string.h \ + /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ./ss.h ../ss/mit-sipb-copyright.h \ + ../ss/ss_err.h +execute_cmd.o : ./execute_cmd.c ./ss_internal.h /usr/include/stdio.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \ + /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ./ss.h ../ss/mit-sipb-copyright.h \ + ../ss/ss_err.h ./copyright.h +help.o : ./help.c /usr/include/sys/param.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/limits.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/syslimits.h /usr/include/limits.h \ - /usr/include/posix1_lim.h /usr/include/linux/limits.h /usr/include/posix2_lim.h \ - /usr/include/linux/param.h /usr/include/asm/param.h /usr/include/sys/file.h \ - /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/sys/wait.h /usr/include/waitflags.h \ - /usr/include/linux/wait.h /usr/include/waitstatus.h /usr/include/endian.h /usr/include/bytesex.h \ - ss_internal.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ - /usr/include/string.h ss.h ../ss/mit-sipb-copyright.h ../ss/ss_err.h copyright.h \ - /usr/include/sys/dir.h /usr/include/dirent.h /usr/include/linux/dirent.h -invocation.o : invocation.c /usr/include/stdlib.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h ss_internal.h \ - /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \ - ss.h ../ss/mit-sipb-copyright.h ../ss/ss_err.h copyright.h -list_rqs.o : list_rqs.c copyright.h ss_internal.h /usr/include/stdio.h /usr/include/features.h \ + /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/posix1_lim.h /usr/include/linux/limits.h \ + /usr/include/posix2_lim.h /usr/include/linux/param.h /usr/include/asm/param.h \ + /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ + /usr/include/sys/file.h /usr/include/fcntl.h /usr/include/gnu/types.h /usr/include/linux/fcntl.h \ + /usr/include/sys/wait.h /usr/include/waitflags.h /usr/include/linux/wait.h /usr/include/waitstatus.h \ + /usr/include/endian.h /usr/include/bytesex.h ./ss_internal.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ + ./ss.h ../ss/mit-sipb-copyright.h ../ss/ss_err.h ./copyright.h /usr/include/sys/dir.h \ + /usr/include/dirent.h /usr/include/linux/dirent.h +invocation.o : ./invocation.c ./ss_internal.h /usr/include/stdio.h /usr/include/features.h \ /usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \ - /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ss.h ../ss/mit-sipb-copyright.h \ - ../ss/ss_err.h /usr/include/signal.h /usr/include/sys/types.h /usr/include/linux/types.h \ - /usr/include/asm/types.h /usr/include/linux/signal.h /usr/include/setjmp.h /usr/include/jmp_buf.h \ - /usr/include/i386/jmp_buf.h /usr/include/sys/wait.h /usr/include/gnu/types.h \ - /usr/include/waitflags.h /usr/include/linux/wait.h /usr/include/waitstatus.h \ - /usr/include/endian.h /usr/include/bytesex.h -listen.o : listen.c copyright.h ss_internal.h /usr/include/stdio.h /usr/include/features.h \ + /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ./ss.h ../ss/mit-sipb-copyright.h \ + ../ss/ss_err.h ./copyright.h +list_rqs.o : ./list_rqs.c ./copyright.h ./ss_internal.h /usr/include/stdio.h \ + /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h \ + /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ./ss.h \ + ../ss/mit-sipb-copyright.h ../ss/ss_err.h /usr/include/signal.h /usr/include/sys/types.h \ + /usr/include/linux/types.h /usr/include/asm/types.h /usr/include/linux/signal.h \ + /usr/include/setjmp.h /usr/include/jmp_buf.h /usr/include/i386/jmp_buf.h /usr/include/sys/wait.h \ + /usr/include/gnu/types.h /usr/include/waitflags.h /usr/include/linux/wait.h \ + /usr/include/waitstatus.h /usr/include/endian.h /usr/include/bytesex.h +listen.o : ./listen.c ./copyright.h ./ss_internal.h /usr/include/stdio.h /usr/include/features.h \ /usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \ - /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ss.h ../ss/mit-sipb-copyright.h \ + /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ./ss.h ../ss/mit-sipb-copyright.h \ ../ss/ss_err.h /usr/include/setjmp.h /usr/include/jmp_buf.h /usr/include/i386/jmp_buf.h \ /usr/include/signal.h /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ /usr/include/linux/signal.h /usr/include/sys/param.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/limits.h \ /usr/lib/gcc-lib/i486-linux/2.5.8/include/syslimits.h /usr/include/limits.h \ /usr/include/posix1_lim.h /usr/include/linux/limits.h /usr/include/posix2_lim.h \ /usr/include/linux/param.h /usr/include/asm/param.h -pager.o : pager.c /usr/include/unistd.h /usr/include/features.h /usr/include/sys/cdefs.h \ +pager.o : ./pager.c /usr/include/unistd.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/posix_opt.h /usr/include/gnu/types.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ - /usr/include/sys/types.h /usr/include/linux/types.h /usr/include/asm/types.h \ - ss_internal.h /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \ - /usr/include/string.h ss.h ../ss/mit-sipb-copyright.h ../ss/ss_err.h copyright.h \ - /usr/include/sys/file.h /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/signal.h \ - /usr/include/linux/signal.h -parse.o : parse.c /usr/include/stdlib.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h /usr/include/errno.h /usr/include/linux/errno.h \ - /usr/lib/gcc-lib/i486-linux/2.5.8/include/float.h /usr/include/alloca.h ss_internal.h \ + /usr/include/confname.h /usr/include/sys/types.h /usr/include/linux/types.h \ + /usr/include/asm/types.h /usr/include/errno.h /usr/include/linux/errno.h ./ss_internal.h \ /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \ - ss.h ../ss/mit-sipb-copyright.h ../ss/ss_err.h copyright.h -prompt.o : prompt.c copyright.h /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h ss_internal.h \ - /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ss.h \ - ../ss/mit-sipb-copyright.h ../ss/ss_err.h -request_tbl.o : request_tbl.c copyright.h ss_internal.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h \ - /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ss.h \ + ./ss.h ../ss/mit-sipb-copyright.h ../ss/ss_err.h ./copyright.h /usr/include/sys/file.h \ + /usr/include/fcntl.h /usr/include/linux/fcntl.h /usr/include/signal.h /usr/include/linux/signal.h +parse.o : ./parse.c /usr/include/errno.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/linux/errno.h ./ss_internal.h /usr/include/stdio.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h \ + ./ss.h ../ss/mit-sipb-copyright.h ../ss/ss_err.h ./copyright.h +prompt.o : ./prompt.c ./copyright.h /usr/include/stdio.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h ./ss_internal.h \ + /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ./ss.h \ ../ss/mit-sipb-copyright.h ../ss/ss_err.h -requests.o : requests.c mit-sipb-copyright.h /usr/include/stdio.h /usr/include/features.h \ - /usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h ss_internal.h \ - /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ss.h \ +request_tbl.o : ./request_tbl.c /usr/include/errno.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/linux/errno.h ./copyright.h ./ss_internal.h \ + /usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h /usr/include/string.h \ + /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ./ss.h ../ss/mit-sipb-copyright.h \ + ../ss/ss_err.h +requests.o : ./requests.c ./mit-sipb-copyright.h /usr/include/stdio.h /usr/include/features.h \ + /usr/include/sys/cdefs.h /usr/include/libio.h /usr/include/_G_config.h ./ss_internal.h \ + /usr/include/string.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stddef.h ./ss.h \ ../ss/mit-sipb-copyright.h ../ss/ss_err.h -ss_err.o : ss_err.c -std_rqs.o : std_rqs.c ../ss/ss.h ../ss/mit-sipb-copyright.h ../ss/ss_err.h -test_ss.o : test_ss.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ - /usr/include/libio.h /usr/include/_G_config.h ss.h ../ss/mit-sipb-copyright.h \ +ss_err.o : ./ss_err.c +std_rqs.o : ./std_rqs.c ../ss/ss.h ../ss/mit-sipb-copyright.h ../ss/ss_err.h +test_ss.o : ./test_ss.c /usr/include/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \ + /usr/include/libio.h /usr/include/_G_config.h ./ss.h ../ss/mit-sipb-copyright.h \ ../ss/ss_err.h diff --git a/lib/ss/ChangeLog b/lib/ss/ChangeLog index 9c255538..21c7df1b 100644 --- a/lib/ss/ChangeLog +++ b/lib/ss/ChangeLog @@ -1,6 +1,72 @@ +Wed Oct 25 11:58:20 1995 <tytso@rsts-11.mit.edu> + + * ss_internal.h: Removed malloc, realloc, free definitions, and + #include <stdlib.h> instead. + +Mon Sep 4 21:46:00 1995 Remy Card <card@bbj> + + * Makefile.in: Added support for BSD shared libraries. + (distclean): Use the -f option when removing files. + +Fri Aug 18 15:15:09 1995 Theodore Y. Ts'o <tytso@dcl> + + * Makefile.in (mk_cmds): Remove usage of $<, since it's not + portable. + +Sat Aug 12 03:11:02 1995 Remy Card <card@bbj> + + * Makefile.in (install): Install static libraries in $(ulibdir) + (/usr/lib on Linux) instead of $(libdir) (/lib on Linux). + +Thu Aug 10 14:23:31 1995 Remy Card <card@bbj> + + * Makefile.in (distclean): Remove mk_cmds.sh. + +Sat Aug 5 11:44:29 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * mk_cmds.sh.in: Remove the old .c file before moving the new file + into place. + + * Makefile.in (DLL_INSTALL_DIR, ELF_INSTALL_DIR): Set the + installation directories correctly. + + * Makefile.in (clean): Don't remove mk_cmds.sh, since it's built + from the configure script. + +Tue Jul 11 20:47:46 1995 <tytso@rsx-11.mit.edu> + + * help.c (ss_help): Use malloc instead of alloca for maximal + portability. Check return value of malloc before using + buffer. Allocate memory when printing usage message. + +Thu Jun 15 23:46:16 1995 Remy Card <card@bbj> + + * Makefile.in: Added support for ELF shared libraries. + Fixed typos in the compilation rules. + (distclean): Added mk_cmds.sh. + +Sat Jun 10 19:57:07 1995 Theodore Y. Ts'o <tytso@lurch.mit.edu> + + * mk_cmds.sh.in: Use SS_DIR instead of srcdir to determine the + location of the ss directory. + +Thu Jun 8 13:18:48 1995 Miles Bader <miles@churchy.gnu.ai.mit.edu> + + * help.c (ss_help): Use alloca to allocate space for filenames + instead of fixed buffers. + * error.c (ss_error, & includes): Change the selection of + varargs/stdarg to work with configure. + * pager.c: Include <errno.h> if possible. + * parse.c: Ditto. + * request_tbl.c: Ditto. + + * Makefile.in: Rewritten to conform to GNU coding standards and + support separate compilation directories. + Don't preprocess mk_cmds.sh, as this is now done by configure. + Sat Mar 11 18:14:52 1995 Theodore Y. Ts'o <tytso@localhost> - * Makefile (DLL_INSTALL_DIR): Install libss in /lib, since it's + * Makefile.in (DLL_INSTALL_DIR): Install libss in /lib, since it's needed by debugfs (which is installed in /sbin). diff --git a/lib/ss/MAKELOG b/lib/ss/MAKELOG deleted file mode 100644 index 5356fcb7..00000000 --- a/lib/ss/MAKELOG +++ /dev/null @@ -1,156 +0,0 @@ -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c ss_err.c -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/ss_err.o -c ss_err.c) -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c std_rqs.c -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/std_rqs.o -c std_rqs.c) -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c invocation.c -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/invocation.o -c invocation.c) -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c help.c -help.c: In function `ss_help': -help.c:45: warning: implicit declaration of function `ss_list_requests' -help.c: At top level: -help.c:101: warning: function declaration isn't a prototype -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/help.o -c help.c) -help.c: In function `ss_help': -help.c:45: warning: implicit declaration of function `ss_list_requests' -help.c: At top level: -help.c:101: warning: function declaration isn't a prototype -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c execute_cmd.c -execute_cmd.c:69: warning: function declaration isn't a prototype -execute_cmd.c:122: warning: function declaration isn't a prototype -execute_cmd.c:155: warning: return-type defaults to `int' -execute_cmd.c:155: warning: function declaration isn't a prototype -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/execute_cmd.o -c execute_cmd.c) -execute_cmd.c:69: warning: function declaration isn't a prototype -execute_cmd.c:122: warning: function declaration isn't a prototype -execute_cmd.c:155: warning: return-type defaults to `int' -execute_cmd.c:155: warning: function declaration isn't a prototype -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c listen.c -listen.c:33: warning: function declaration isn't a prototype -listen.c:49: warning: function declaration isn't a prototype -listen.c: In function `ss_listen': -listen.c:60: warning: function declaration isn't a prototype -listen.c:60: warning: function declaration isn't a prototype -listen.c:60: warning: function declaration isn't a prototype -listen.c:70: warning: function declaration isn't a prototype -listen.c:72: warning: implicit declaration of function `sigblock' -listen.c:72: warning: implicit declaration of function `sigmask' -listen.c:76: warning: implicit declaration of function `sigsetmask' -listen.c:60: warning: variable `sig_cont' may be clobbered by `longjmp' or `vfork' -listen.c:63: warning: variable `end' may be clobbered by `longjmp' or `vfork' -listen.c: At top level: -listen.c:132: warning: function declaration isn't a prototype -listen.c: In function `ss_quit': -listen.c:138: warning: control reaches end of non-void function -listen.c: At top level: -listen.c:23: warning: `rcs_id' defined but not used -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/listen.o -c listen.c) -listen.c:33: warning: function declaration isn't a prototype -listen.c:49: warning: function declaration isn't a prototype -listen.c: In function `ss_listen': -listen.c:60: warning: function declaration isn't a prototype -listen.c:60: warning: function declaration isn't a prototype -listen.c:60: warning: function declaration isn't a prototype -listen.c:70: warning: function declaration isn't a prototype -listen.c:72: warning: implicit declaration of function `sigblock' -listen.c:72: warning: implicit declaration of function `sigmask' -listen.c:76: warning: implicit declaration of function `sigsetmask' -listen.c:60: warning: variable `sig_cont' may be clobbered by `longjmp' or `vfork' -listen.c:63: warning: variable `end' may be clobbered by `longjmp' or `vfork' -listen.c: At top level: -listen.c:132: warning: function declaration isn't a prototype -listen.c: In function `ss_quit': -listen.c:138: warning: control reaches end of non-void function -listen.c: At top level: -listen.c:23: warning: `rcs_id' defined but not used -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c parse.c -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/parse.o -c parse.c) -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c error.c -error.c:87: warning: no previous prototype for `ss_error' -error.c: In function `ss_error': -error.c:103: warning: implicit declaration of function `free' -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/error.o -c error.c) -error.c:87: warning: no previous prototype for `ss_error' -error.c: In function `ss_error': -error.c:103: warning: implicit declaration of function `free' -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c prompt.c -prompt.c:23: warning: no previous prototype for `ss_set_prompt' -prompt.c:33: warning: no previous prototype for `ss_get_prompt' -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/prompt.o -c prompt.c) -prompt.c:23: warning: no previous prototype for `ss_set_prompt' -prompt.c:33: warning: no previous prototype for `ss_get_prompt' -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c request_tbl.c -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/request_tbl.o -c request_tbl.c) -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c list_rqs.c -list_rqs.c:25: warning: function declaration isn't a prototype -list_rqs.c: In function `ss_list_requests': -list_rqs.c:39: warning: function declaration isn't a prototype -list_rqs.c:51: warning: implicit declaration of function `sigblock' -list_rqs.c:51: warning: implicit declaration of function `sigmask' -list_rqs.c:53: warning: implicit declaration of function `ss_pager_create' -list_rqs.c:55: warning: implicit declaration of function `sigsetmask' -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/list_rqs.o -c list_rqs.c) -list_rqs.c:25: warning: function declaration isn't a prototype -list_rqs.c: In function `ss_list_requests': -list_rqs.c:39: warning: function declaration isn't a prototype -list_rqs.c:51: warning: implicit declaration of function `sigblock' -list_rqs.c:51: warning: implicit declaration of function `sigmask' -list_rqs.c:53: warning: implicit declaration of function `ss_pager_create' -list_rqs.c:55: warning: implicit declaration of function `sigsetmask' -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c pager.c -pager.c:23: warning: function declaration isn't a prototype -pager.c:36: warning: function declaration isn't a prototype -pager.c: In function `ss_page_stdin': -pager.c:77: warning: implicit declaration of function `sigblock' -pager.c:78: warning: implicit declaration of function `sigmask' -pager.c:79: warning: implicit declaration of function `sigsetmask' -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/pager.o -c pager.c) -pager.c:23: warning: function declaration isn't a prototype -pager.c:36: warning: function declaration isn't a prototype -pager.c: In function `ss_page_stdin': -pager.c:77: warning: implicit declaration of function `sigblock' -pager.c:78: warning: implicit declaration of function `sigmask' -pager.c:79: warning: implicit declaration of function `sigsetmask' -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c requests.c -requests.c:23: warning: no previous prototype for `ss_self_identify' -requests.c:33: warning: no previous prototype for `ss_subsystem_name' -requests.c:41: warning: no previous prototype for `ss_subsystem_version' -requests.c:50: warning: no previous prototype for `ss_unimplemented' -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/requests.o -c requests.c) -requests.c:23: warning: no previous prototype for `ss_self_identify' -requests.c:33: warning: no previous prototype for `ss_subsystem_name' -requests.c:41: warning: no previous prototype for `ss_subsystem_version' -requests.c:50: warning: no previous prototype for `ss_unimplemented' -gcc -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -c data.c -data.c:12: warning: `copyright' defined but not used -(export JUMP_DIR=`pwd`/jump; gcc -B/usr/dll/jump/ -I. -I.. -I../et -O2 -fomit-frame-pointer -ansi -D_POSIX_SOURCE -pedantic -Wall -Wwrite-strings -Wpointer-arith -Wcast-qual -Wenum-clash -Wcast-align -Wtraditional -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wshadow -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H \ - -o jump/data.o -c data.c) -data.c:12: warning: `copyright' defined but not used -(cd jump; export JUMP_DIR=`pwd`; \ - /usr/dll/bin/mkimage -l libss -v 1.0.0 \ - -a 0x66880000 -j 0x1000 -g 0x1000 -- \ - ss_err.o std_rqs.o invocation.o help.o execute_cmd.o listen.o parse.o error.o prompt.o request_tbl.o list_rqs.o pager.o requests.o data.o -lc -L../.. -lcom_err "`gcc --print-libgcc-file-name`" -lc) -Warning - non-absolute pathname specified for library -listen.o: Undefined symbol _sigmask referenced from text segment -list_rqs.o: Undefined symbol _sigmask referenced from text segment -pager.o: Undefined symbol _sigmask referenced from text segment -system: No such file or directory - -/usr/dll/bin/mkimage: error running 'ld -x -T 66880000 -o libss.so.1.0.0 /u3/src/e2fsprogs-0.5b/lib/ss/jump/__jump.o ss_err.o std_rqs.o invocation.o help.o execute_cmd.o listen.o parse.o error.o prompt.o request_tbl.o list_rqs.o pager.o requests.o data.o -lc -L../.. -lcom_err /usr/lib/gcc-lib/i486-linux/2.5.8/libgcc.a -lc' - -mkimage v2.11 -Reading configuration files from /u3/src/e2fsprogs-0.5b/lib/ss/jump -executing:ld -x -T 66880000 -o libss.so.1.0.0 /u3/src/e2fsprogs-0.5b/lib/ss/jump/__jump.o ss_err.o std_rqs.o invocation.o help.o execute_cmd.o listen.o parse.o error.o prompt.o request_tbl.o list_rqs.o pager.o requests.o data.o -lc -L../.. -lcom_err /usr/lib/gcc-lib/i486-linux/2.5.8/libgcc.a -lc -make: *** [libss.so.1.0.0] Error 1 diff --git a/lib/ss/Makefile b/lib/ss/Makefile deleted file mode 100644 index 2f5ae92d..00000000 --- a/lib/ss/Makefile +++ /dev/null @@ -1,164 +0,0 @@ -# -# Makefile for lib/ss -# - -include ../../MCONFIG - -ifdef BUILD_DLL_SHLIBS -DLL_ADDRESS = 0x66880000 -DLL_JUMPSIZE = 0x1000 -DLL_GOTSIZE = 0x1000 -DLL_VERSION = 1.0 -DLL_IMAGE = libss -DLL_STUB = libss -DLL_LIBS = -L../.. -lcom_err -DLL_MYDIR = ss -DLL_INSTALL_DIR = $(SHLIBDIR) -endif - -RM=rm -f -MV=mv -LN=ln -s -TAGS=etags -COMPILE_ET=../et/compile_et -MK_CMDS=../ss/mk_cmds - -DEFS= -DWAIT_USES_INT -DHAS_STDLIB_H -DHAS_UNISTD_H -DPOSIX_SIGNALS - -# hard coded .. is so that ss/ss_err.h works -# hard coded ../et is so com_err.h works -CFLAGS= -I. -I.. -I../et $(OPT) $(WFLAGS) $(DEFS) - -# hard coded for target install -srcdir= . - -# for the library - -LIB= libss.a - -# with ss_err.o first, ss_err.h should get rebuilt first too. should not -# be relying on this, though. -OBJS= ss_err.o \ - std_rqs.o \ - invocation.o help.o \ - execute_cmd.o listen.o parse.o error.o prompt.o \ - request_tbl.o list_rqs.o pager.o requests.o \ - data.o - -SRCS= invocation.c help.c \ - execute_cmd.c listen.c parse.c error.c prompt.c \ - request_tbl.c list_rqs.c pager.c requests.c \ - data.c \ - ss_err.h -# ss_err.h here, so that make depend catches it. - -ifdef BUILD_DLL_SHLIBS -include ../Makefile.dll-lib -endif - -CODE= $(SRCS) $(MKCMDSFILES) - -MKCMDSOBJS= mk_cmds.o utils.o options.o ct.tab.o cmd_tbl.lex.o - -MKCMDSFILES= mk_cmds.c utils.c options.c ct.y cmd_tbl.lex.l - -MKCMDSCSRCS= mk_cmds.c utils.c options.c ct.tab.c cmd_tbl.lex.c - - -HFILES= ss.h ss_internal.h copyright.h - -# for 'tags' and dependencies - -CFILES= $(SRCS) $(MKCMDSCSRCS) test_ss.c - -# for building archives - -FILES= $(SRCS) $(MKCMDSFILES) $(HFILES) \ - ss_err.et std_rqs.ct Makefile \ - test_ss.c ss mit-sipb-copyright.h copyright.h - -# -# stuff to build -# - -.c.o: - $(CC) $(CFLAGS) -c $*.c -ifdef BUILD_DLL_SHLIBS - (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \ - -o jump/$*.o -c $*.c) -endif - -all:: mk_cmds libss.a # libss_p.a lint - -dist: archives - -install:: - -install-libs:: all - $(INSTALLLIB) libss.a $(LIBDIR)/libss.a - $(CHMOD) 644 $(LIBDIR)/libss.a - $(RANLIB) $(LIBDIR)/libss.a - $(CHMOD) $(LIBMODE) $(LIBDIR)/libss.a - -install-libs:: $(HFILES) copyright.h - @rm -rf $(INCLDIR)/ss - @mkdir $(INCLDIR)/ss - for i in $(HFILES) copyright.h; do \ - $(INSTALLINC) $(srcdir)/$$i $(INCLDIR)/ss/$$i; \ - done - -install-libs:: copyright.h - $(INSTALLINC) $(srcdir)/copyright.h $(INCLDIR)/ss/mit-sipb-copyright.h - -install-tree:: - -std_rqs.c: std_rqs.ct - $(MK_CMDS) std_rqs.ct - -ss_err.c ss_err.h: ss_err.et - $(COMPILE_ET) ss_err.et - -dep depend .depend: ss_err.h - $(CPP) -M $(CFLAGS) *.c >.depend - -ct.tab.c ct.tab.h: ct.y - rm -f ct.tab.* y.* - yacc -d $(srcdir)/ct.y - mv -f y.tab.c ct.tab.c - mv -f y.tab.h ct.tab.h - -# install_library_target(ss,$(OBJS),$(SRCS),) -all:: libss.a - -libss.a: $(OBJS) - $(RM) $@.bak - -$(MV) $@ $@.bak - $(ARCHIVE) $@ $(OBJS) - $(RANLIB) $@ - $(RM) ../$@ - $(LN) ss/$@ ../$@ - - -clean:: - $(RM) ../libss.a libss.a mk_cmds - $(RM) *.o *~ \#* *.bak core - -really-clean:: clean - $(RM) .depend ss_err.h ss_err.c - -install-libs:: - $(INSTALLLIB) libss.a $(LIBDIR)/libss.a - $(CHMOD) 644 $(LIBDIR)/libss.a - $(RANLIB) $(LIBDIR)/libss.a - $(CHMOD) 444 $(LIBDIR)/libss.a - - -libss.o: $(OBJS) - $(LD) -r -s -o $@ $(OBJS) - $(CHMOD) -x $@ - -mk_cmds: mk_cmds.sh - ./config_script mk_cmds.sh $(AWK) > mk_cmds - chmod +x mk_cmds - -include .depend diff --git a/lib/ss/Makefile.in b/lib/ss/Makefile.in new file mode 100644 index 00000000..aaab8128 --- /dev/null +++ b/lib/ss/Makefile.in @@ -0,0 +1,207 @@ +# +# Makefile for lib/ss +# + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +top_builddir = ../.. +INSTALL = @INSTALL@ + +@MCONFIG@ + +LIBRARY= libss +LIBDIR= ss + +DLL_ADDRESS = 0x66880000 +DLL_JUMPSIZE = 0x1000 +DLL_GOTSIZE = 0x1000 +DLL_VERSION = 1.0 +DLL_IMAGE = libss +DLL_STUB = libss +DLL_LIBS = -L../.. -lcom_err +DLL_MYDIR = ss +DLL_INSTALL_DIR = $(libdir) + +ELF_VERSION = 2.0 +ELF_IMAGE = libss +ELF_MYDIR = ss +ELF_INSTALL_DIR = $(libdir) + +BSDLIB_VERSION = 1.0 +BSDLIB_IMAGE = libss +BSDLIB_MYDIR = ss +BSDLIB_INSTALL_DIR = $(libdir) + +TAGS=etags +COMPILE_ET=../et/compile_et +MK_CMDS=./mk_cmds + +# -I.. is so that ss/ss_err.h works +# -I$(srcdir)/.. is so that ss/ss.h works +# -I$(srcdir)/../et is so com_err.h works +XTRA_CFLAGS=-DPOSIX_SIGNALS -I$(srcdir)/../et + +.c.o: + $(CC) $(CFLAGS) -c $< +@PROFILE_CMT@ $(CC) $(CFLAGS) -pg -o profiled/$*.o -c $< +@CHECKER_CMT@ $(CC) $(CFLAGS) -checker -g -o checker/$*.o -c $< +@DLL_CMT@ (export JUMP_DIR=`pwd`/jump; $(CC) -B$(JUMP_PREFIX) $(CFLAGS) \ +@DLL_CMT@ -o jump/$*.o -c $<) +@ELF_CMT@ $(CC) $(CFLAGS) -fPIC -o elfshared/$*.o -c $< +@BSDLIB_CMT@ $(CC) $(CFLAGS) -fpic -o pic/$*.o -c $< + +# for the library + +LIB= libss.a + +# with ss_err.o first, ss_err.h should get rebuilt first too. should not +# be relying on this, though. +OBJS= ss_err.o \ + std_rqs.o \ + invocation.o help.o \ + execute_cmd.o listen.o parse.o error.o prompt.o \ + request_tbl.o list_rqs.o pager.o requests.o \ + data.o + +SRCS= $(srcdir)/invocation.c $(srcdir)/help.c \ + $(srcdir)/execute_cmd.c $(srcdir)/listen.c $(srcdir)/parse.c \ + $(srcdir)/error.c $(srcdir)/prompt.c $(srcdir)/request_tbl.c \ + $(srcdir)/list_rqs.c $(srcdir)/pager.c $(srcdir)/requests.c \ + $(srcdir)/data.c + +all:: mk_cmds + +@MAKEFILE_LIBRARY@ +@MAKEFILE_DLL@ +@MAKEFILE_ELF@ +@MAKEFILE_BSDLIB@ +@MAKEFILE_PROFILE@ +@MAKEFILE_CHECKER@ + +CODE= $(SRCS) $(MKCMDSFILES) + +MKCMDSOBJS= mk_cmds.o utils.o options.o ct.tab.o cmd_tbl.lex.o + +MKCMDSFILES= mk_cmds.c utils.c options.c ct.y cmd_tbl.lex.l + +MKCMDSCSRCS= mk_cmds.c utils.c options.c ct.tab.c cmd_tbl.lex.c + + +HFILES= ss.h ss_internal.h copyright.h + +# for 'tags' and dependencies + +CFILES= $(SRCS) $(MKCMDSCSRCS) test_ss.c + +# for building archives + +FILES= $(SRCS) $(MKCMDSFILES) $(HFILES) \ + ss_err.et std_rqs.ct Makefile \ + test_ss.c ss mit-sipb-copyright.h copyright.h + +all:: libss.a # libss_p.a lint + +std_rqs.c: std_rqs.ct $(MK_CMDS) + $(MK_CMDS) $(srcdir)/std_rqs.ct + +ss_err.c ss_err.h: ss_err.et + $(COMPILE_ET) $(srcdir)/ss_err.et + +ct.tab.c ct.tab.h: ct.y + $(RM) -f ct.tab.* y.* + $(YACC) -d $(srcdir)/ct.y + $(MV) -f y.tab.c ct.tab.c + $(MV) -f y.tab.h ct.tab.h + +#libss.o: $(OBJS) +# $(LD) -r -s -o $@ $(OBJS) +# $(CHMOD) -x $@ + +mk_cmds: mk_cmds.sh + $(CP) mk_cmds.sh $@ && $(CHMOD) +x mk_cmds + +installdirs:: + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(ulibdir) \ + $(DESTDIR)$(includedir)/ss + +install:: libss.a $(HFILES) copyright.h installdirs + $(INSTALL_DATA) libss.a $(DESTDIR)$(ulibdir)/libss.a + $(CHMOD) 644 $(DESTDIR)$(ulibdir)/libss.a + -$(RANLIB) $(DESTDIR)$(ulibdir)/libss.a + $(CHMOD) $(LIBMODE) $(DESTDIR)$(ulibdir)/libss.a + $(RM) -f $(includedir)/ss/* + for i in $(HFILES) copyright.h; do \ + $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir)/ss/$$i; \ + done + +uninstall:: + $(RM) -f $(ulibdir)/libss.a + $(RM) -rf $(includedir)/ss + +clean:: + $(RM) -f ../libss.a libss.a mk_cmds + $(RM) -f *.o *~ \#* *.bak core + +mostlyclean:: clean +distclean:: clean + $(RM) -f .depend ss_err.h ss_err.c mk_cmds.sh Makefile + +# +++ Dependency line eater +++ +# +# Makefile dependencies follow. This must be the last section in +# the Makefile.in file +# +invocation.o: $(srcdir)/invocation.c $(srcdir)/ss_internal.h \ + $(srcdir)/ss.h \ + $(srcdir)/mit-sipb-copyright.h $(top_builddir)/lib/ss/ss_err.h \ + $(srcdir)/copyright.h +help.o: $(srcdir)/help.c \ + $(srcdir)/ss_internal.h \ + $(srcdir)/ss.h $(srcdir)/mit-sipb-copyright.h \ + $(top_builddir)/lib/ss/ss_err.h $(srcdir)/copyright.h +execute_cmd.o: $(srcdir)/execute_cmd.c $(srcdir)/ss_internal.h \ + $(srcdir)/ss.h \ + $(srcdir)/mit-sipb-copyright.h $(top_builddir)/lib/ss/ss_err.h \ + $(srcdir)/copyright.h +listen.o: $(srcdir)/listen.c $(srcdir)/copyright.h \ + $(srcdir)/ss_internal.h \ + $(srcdir)/ss.h $(srcdir)/mit-sipb-copyright.h \ + $(top_builddir)/lib/ss/ss_err.h +parse.o: $(srcdir)/parse.c \ + $(srcdir)/ss_internal.h \ + $(srcdir)/ss.h \ + $(srcdir)/mit-sipb-copyright.h $(top_builddir)/lib/ss/ss_err.h \ + $(srcdir)/copyright.h +error.o: $(srcdir)/error.c \ + $(srcdir)/copyright.h \ + $(srcdir)/../et/com_err.h \ + $(srcdir)/ss_internal.h \ + $(srcdir)/ss.h \ + $(srcdir)/mit-sipb-copyright.h $(top_builddir)/lib/ss/ss_err.h +prompt.o: $(srcdir)/prompt.c $(srcdir)/copyright.h \ + $(srcdir)/ss_internal.h \ + $(srcdir)/ss.h \ + $(srcdir)/mit-sipb-copyright.h $(top_builddir)/lib/ss/ss_err.h +request_tbl.o: $(srcdir)/request_tbl.c \ + $(srcdir)/copyright.h $(srcdir)/ss_internal.h \ + $(srcdir)/ss.h $(srcdir)/mit-sipb-copyright.h \ + $(top_builddir)/lib/ss/ss_err.h +list_rqs.o: $(srcdir)/list_rqs.c $(srcdir)/copyright.h \ + $(srcdir)/ss_internal.h \ + $(srcdir)/ss.h $(srcdir)/mit-sipb-copyright.h \ + $(top_builddir)/lib/ss/ss_err.h +pager.o: $(srcdir)/pager.c \ + $(srcdir)/ss_internal.h \ + $(srcdir)/ss.h \ + $(srcdir)/mit-sipb-copyright.h $(top_builddir)/lib/ss/ss_err.h \ + $(srcdir)/copyright.h +requests.o: $(srcdir)/requests.c $(srcdir)/mit-sipb-copyright.h \ + $(srcdir)/ss_internal.h \ + $(srcdir)/ss.h \ + $(top_builddir)/lib/ss/ss_err.h +data.o: $(srcdir)/data.c \ + $(srcdir)/ss_internal.h \ + $(srcdir)/ss.h \ + $(srcdir)/mit-sipb-copyright.h $(top_builddir)/lib/ss/ss_err.h \ + $(srcdir)/copyright.h diff --git a/lib/ss/config_script b/lib/ss/config_script deleted file mode 100644 index e3de35c8..00000000 --- a/lib/ss/config_script +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh -# -# This program takes a shell script and configures for the following -# variables: @DIR@ -# @AWK@ -# @SED@ -# -# Usage: config_script <filename> [<awk>] [<sed>] -# - -FILE=$1 -AWK=$2 -SED=$3 - -# Grr.... not all Unix's have the dirname command -TMP=`echo $1 | sed -e 's;[^/]*$;;' -e 's/^$/./'` -DIR=`cd ${TMP}; pwd` - -if test "${AWK}x" = "x" ; then - AWK=awk -fi -if test "${SED}x" = "x" ; then - SED=sed -fi -sed -e "s;@DIR@;${DIR};" -e "s;@AWK@;${AWK};" -e "s;@SED@;${SED};" $FILE diff --git a/lib/ss/error.c b/lib/ss/error.c index 3b7165a7..80ebc823 100644 --- a/lib/ss/error.c +++ b/lib/ss/error.c @@ -22,20 +22,10 @@ #include <com_err.h> #include "ss_internal.h" -#ifdef _STDARG_H_ -#define STDARG -#endif - -#ifdef _STDARG_H -#define STDARG -#endif - -#ifndef __STDC__ -/* we didn't get it in com_err.h if it wasn't STDC. */ -#ifndef STDARG -/* and we don't need it, either, if we're using stdarg.h... */ -#include <varargs.h> -#endif +#ifdef HAVE_STDARG_H +#include <stdarg.h> +#else +#include <vararg.h> #endif #undef ss_error @@ -78,7 +68,7 @@ char * ss_name(sci_idx) } } -#ifdef STDARG +#ifdef HAVE_STDARG_H void ss_error (int sci_idx, long code, const char * fmt, ...) #else void ss_error (va_alist) @@ -87,7 +77,7 @@ void ss_error (va_alist) { register char const *whoami; va_list pvar; -#ifndef STDARG +#ifndef HAVE_STDARG_H int sci_idx; long code; char * fmt; diff --git a/lib/ss/help.c b/lib/ss/help.c index f956ca80..3f3c7f53 100644 --- a/lib/ss/help.c +++ b/lib/ss/help.c @@ -4,12 +4,13 @@ * For copyright info, see copyright.h. */ -#ifdef HAS_UNISTD_H +#ifdef HAVE_UNISTD_H #include <unistd.h> #endif -#ifdef HAS_STDLIB_H +#ifdef HAVE_STDLIB_H #include <stdlib.h> #endif +#include <fcntl.h> #include <sys/param.h> #include <sys/types.h> #include <sys/file.h> @@ -29,7 +30,7 @@ void ss_help (argc, argv, sci_idx, info_ptr) int sci_idx; pointer info_ptr; { - char buffer[MAXPATHLEN]; + char *buffer; char const *request_name; int code; int fd, child; @@ -47,9 +48,16 @@ void ss_help (argc, argv, sci_idx, info_ptr) } else if (argc != 2) { /* should do something better than this */ + buffer = malloc(80+2*strlen(request_name)); + if (!buffer) { + ss_perror(sci_idx, 0, + "couldn't allocate memory to print usage message"); + return; + } sprintf(buffer, "usage:\n\t%s [topic|command]\nor\t%s\n", request_name, request_name); ss_perror(sci_idx, 0, buffer); + free(buffer); return; } info = ss_info(sci_idx); @@ -61,21 +69,32 @@ void ss_help (argc, argv, sci_idx, info_ptr) ss_perror(sci_idx, SS_ET_NO_INFO_DIR, (char *)NULL); return; } - for (idx = 0; info->info_dirs[idx] != (char *)NULL; idx++) { + for (fd = -1, idx = 0; info->info_dirs[idx] != (char *)NULL; idx++) { + buffer = malloc(strlen (info->info_dirs[idx]) + 1 + + strlen (argv[1]) + 6); + if (!buffer) { + ss_perror(sci_idx, 0, + "couldn't allocate memory for help filename"); + return; + } (void) strcpy(buffer, info->info_dirs[idx]); (void) strcat(buffer, "/"); (void) strcat(buffer, argv[1]); (void) strcat(buffer, ".info"); - if ((fd = open(&buffer[0], O_RDONLY)) >= 0) goto got_it; + fd = open(buffer, O_RDONLY); + free(buffer); + if (fd >= 0) + break; } - if ((fd = open(&buffer[0], O_RDONLY)) < 0) { - char buf[MAXPATHLEN]; - strcpy(buf, "No info found for "); + if (fd < 0) { +#define MSG "No info found for " + char *buf = malloc(strlen (MSG) + strlen (argv[1]) + 1); + strcpy(buf, MSG); strcat(buf, argv[1]); ss_perror(sci_idx, 0, buf); + free(buf); return; } -got_it: switch (child = fork()) { case -1: ss_perror(sci_idx, errno, "Can't fork for pager"); @@ -91,7 +110,7 @@ got_it: } } -#ifndef USE_DIRENT_H +#ifndef HAVE_DIRENT_H #include <sys/dir.h> #else #include <dirent.h> diff --git a/lib/ss/list_rqs.c b/lib/ss/list_rqs.c index 8c797ad9..5a9abe50 100644 --- a/lib/ss/list_rqs.c +++ b/lib/ss/list_rqs.c @@ -42,12 +42,8 @@ void ss_list_requests(argc, argv, sci_idx, info_ptr) #endif sigret_t (*func)(); #ifndef NO_FORK -#ifndef WAIT_USES_INT - union wait waitb; -#else int waitb; #endif -#endif DONT_USE(argc); DONT_USE(argv); diff --git a/lib/ss/mk_cmds.sh b/lib/ss/mk_cmds.sh.in index eda3888a..48660815 100644 --- a/lib/ss/mk_cmds.sh +++ b/lib/ss/mk_cmds.sh.in @@ -2,7 +2,7 @@ # # -DIR=@DIR@ +DIR=@SS_DIR@ AWK=@AWK@ SED=@SED@ @@ -18,6 +18,7 @@ if grep "^#__ERROR_IN_FILE" ${TMP} > /dev/null; then rm ${TMP} exit 1 else + rm -f ${BASE}.c mv ${TMP} ${BASE}.c exit 0 fi diff --git a/lib/ss/pager.c b/lib/ss/pager.c index ff915dac..bc5c9b52 100644 --- a/lib/ss/pager.c +++ b/lib/ss/pager.c @@ -7,9 +7,12 @@ * For copyright information, see copyright.h. */ -#ifdef HAS_UNISTD_H +#ifdef HAVE_UNISTD_H #include <unistd.h> #endif +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif #include "ss_internal.h" #include "copyright.h" diff --git a/lib/ss/parse.c b/lib/ss/parse.c index 68a50649..38b8e5bd 100644 --- a/lib/ss/parse.c +++ b/lib/ss/parse.c @@ -7,6 +7,9 @@ #ifdef HAS_STDLIB_H #include <stdlib.h> #endif +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif #include "ss_internal.h" #include "copyright.h" diff --git a/lib/ss/request_tbl.c b/lib/ss/request_tbl.c index b15ba91f..e1cbfe80 100644 --- a/lib/ss/request_tbl.c +++ b/lib/ss/request_tbl.c @@ -4,6 +4,10 @@ * For copyright information, see copyright.h. */ +#ifdef HAVE_ERRNO_H +#include <errno.h> +#endif + #include "copyright.h" #include "ss_internal.h" diff --git a/lib/ss/ss_err.c b/lib/ss/ss_err.c deleted file mode 100644 index 7b97a007..00000000 --- a/lib/ss/ss_err.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * ss_err.c: - * This file is automatically generated; please do not edit it. - */ -#ifdef __STDC__ -#define NOARGS void -#else -#define NOARGS -#define const -#endif - -static const char * const text[] = { - "Subsystem aborted", - "Version mismatch", - "No current invocation", - "No info directory", - "Command not found", - "Command line aborted", - "End-of-file reached", - "Permission denied", - "Request table not found", - "No info available", - "Shell escapes are disabled", - "Sorry, this request is not yet implemented", - 0 -}; - -struct error_table { - char const * const * msgs; - long base; - int n_msgs; -}; -struct et_list { - struct et_list *next; - const struct error_table * table; -}; -extern struct et_list *_et_list; - -static const struct error_table et = { text, 748800L, 12 }; - -static struct et_list link = { 0, 0 }; - -void initialize_ss_error_table (NOARGS); - -void initialize_ss_error_table (NOARGS) { - if (!link.table) { - link.next = _et_list; - link.table = &et; - _et_list = &link; - } -} |