Many files:
Checkin of e2fsprogs 0.5b
diff --git a/lib/Makefile.dll-lib b/lib/Makefile.dll-lib
new file mode 100644
index 0000000..dee8e62
--- /dev/null
+++ b/lib/Makefile.dll-lib
@@ -0,0 +1,70 @@
+#
+# This is a Makefile stub which handles the creation of Linux DLL-style shared
+# libraries.
+#
+# In order to use this stub, the following makefile variables must be defined.
+#
+# DLL_ADDRESS = 0x80000000
+# DLL_JUMPSIZE = 0x1000
+# DLL_GOTSIZE = 0x1000
+# DLL_VERSION = 1.0
+# DLL_IMAGE = libce
+# DLL_STUB = libcom_err
+# DLL_MYDIR = et
+# DLL_INSTALL_DIR = $(SHLIBDIR)
+#
+
+all:: image stubs
+
+#
+# This is a horrible hack to try to find libgcc.a --- the DLL documentation
+# states that you should just be able to do -lgcc, but modern gcc
+# installation packages don't install /usr/lib/libgcc.a --- as well they
+# shouldn't since libgcc.a can be gcc version dependent.
+# If this hack doesn't work, try replacing it with a hardcoded path to
+# libgcc.a, or -lgcc.
+#
+#DLL_LIBGCC ="`$(CC) -v 2>&1 | head -1 | \
+# sed -e 's;[^/]*;;' -e 's/specs/libgcc.a/'`"
+DLL_LIBGCC ="`$(CC) --print-libgcc-file-name`"
+
+image: $(DLL_IMAGE).so.$(DLL_VERSION)
+
+stubs: $(DLL_STUB).sa $(OBJS)
+
+$(DLL_IMAGE).so.$(DLL_VERSION): $(OBJS)
+ (cd jump; export JUMP_DIR=`pwd`; \
+ $(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) .
+
+$(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)/$@ ../$@
+
+install:: $(DLL_IMAGE).so.$(DLL_VERSION)
+ $(INSTALLBIN) $(DLL_IMAGE).so.$(DLL_VERSION) \
+ $(DLL_INSTALL_DIR)/$(DLL_IMAGE).so.$(DLL_VERSION)
+ -ldconfig
+
+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-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)
+
+clean::
+ (cd jump; $(RM) *~ *.o *.s jump.log size.nm)
+ $(RM) ../$(DLL_STUB).sa $(DLL_STUB).sa $(DLL_IMAGE).so.$(DLL_VERSION)
diff --git a/lib/e2p/.depend b/lib/e2p/.depend
index 12950ef..f3bd916 100644
--- a/lib/e2p/.depend
+++ b/lib/e2p/.depend
@@ -1,77 +1,86 @@
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/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 /usr/include/sys/ioctl.h \
- /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.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 \
+ /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/stdio.h /usr/include/libio.h /usr/include/_G_config.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/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 /usr/include/sys/ioctl.h \
- /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.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 \
+ /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/stdio.h /usr/include/libio.h /usr/include/_G_config.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/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 /usr/include/sys/ioctl.h \
- /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.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 \
+ /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/stdio.h /usr/include/libio.h /usr/include/_G_config.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/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 /usr/include/sys/ioctl.h \
- /usr/include/linux/ioctl.h /usr/include/termios.h /usr/include/linux/termios.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 \
+ /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/stdio.h /usr/include/libio.h /usr/include/_G_config.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 \
/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/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/stdio.h /usr/include/libio.h /usr/include/_G_config.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/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 \
/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/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/stdio.h /usr/include/libio.h /usr/include/_G_config.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/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 \
/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/linux/limits.h \
- /usr/include/linux/dirent.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/stdio.h /usr/include/features.h /usr/include/sys/cdefs.h \
- /usr/include/libio.h /usr/include/_G_config.h /usr/include/time.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/sys/types.h /usr/include/linux/types.h /usr/include/linux/limits.h \
- /usr/include/linux/dirent.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/libio.h /usr/include/_G_config.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/sys/types.h /usr/include/linux/types.h /usr/include/linux/limits.h \
- /usr/include/linux/dirent.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/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 \
- /usr/include/libio.h /usr/include/_G_config.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/sys/types.h /usr/include/linux/types.h /usr/include/linux/limits.h \
- /usr/include/linux/dirent.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/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 \
- /usr/include/libio.h /usr/include/_G_config.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/sys/types.h /usr/include/linux/types.h /usr/include/linux/limits.h \
- /usr/include/linux/dirent.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/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 \
/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/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/stdio.h /usr/include/libio.h /usr/include/_G_config.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/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 \
/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/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/stdio.h /usr/include/libio.h /usr/include/_G_config.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/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
new file mode 100644
index 0000000..f96ffa8
--- /dev/null
+++ b/lib/e2p/ChangeLog
@@ -0,0 +1,15 @@
+Mon Nov 7 21:59:12 1994 Remy Card <card@bbj>
+
+ * ls.c (list_super): List the new fields s_def_resuid and
+ s_def_resgid.
+
+ (print_user): New function which prints the uid and the user name.
+
+ (print_group): New function which prints the gid and the group name.
+
+Wed Aug 17 21:50:39 1994 Remy Card (card@bbj)
+
+ * pf.c (print_flags): New attributes are recognized and a long
+ format can be used.
+
+
diff --git a/lib/e2p/Makefile b/lib/e2p/Makefile
index e890bb5..8ade7fa 100644
--- a/lib/e2p/Makefile
+++ b/lib/e2p/Makefile
@@ -5,14 +5,14 @@
# 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)
-ARCHIVE=ar r
-RANLIB=ranlib
RM=rm -f
MV=mv
LN=ln -s
@@ -21,12 +21,35 @@
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 libe2p_p.a
+all:: libe2p.a
+
+ifdef BUILD_PROFILE_LIBS
+all:: libe2p_p.a
+endif
libe2p.a: $(OBJS)
$(RM) $@.bak
@@ -52,12 +75,21 @@
$(RM) ../$@
$(LN) e2p/$@ ../$@
-install:
+install::
-clean:
+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
+really-clean:: clean
rm -f .depend
dep depend .depend:
diff --git a/lib/e2p/e2p.h b/lib/e2p/e2p.h
index d459e87..8ff770f 100644
--- a/lib/e2p/e2p.h
+++ b/lib/e2p/e2p.h
@@ -14,7 +14,7 @@
void * private);
void list_super (struct ext2_super_block * s);
void print_fs_errors (FILE * f, unsigned short errors);
-void print_flags (FILE * f, unsigned long flags);
+void print_flags (FILE * f, unsigned long flags, int long_format);
void print_fs_state (FILE * f, unsigned short state);
int setflags (int fd, unsigned long flags);
int setversion (int fd, unsigned long version);
diff --git a/lib/e2p/jump/jump.funcs b/lib/e2p/jump/jump.funcs
new file mode 100644
index 0000000..61a69fb
--- /dev/null
+++ b/lib/e2p/jump/jump.funcs
@@ -0,0 +1,13 @@
+00000000 T _fgetflags libe2p jump/fgetflags
+00000000 T _fsetflags libe2p jump/fsetflags
+00000000 T _fgetversion libe2p jump/fgetversion
+00000000 T _fsetversion libe2p jump/fsetversion
+00000000 T _getflags libe2p jump/getflags
+00000000 T _getversion libe2p jump/getversion
+00000000 T _iterate_on_dir libe2p jump/iod
+00000000 T _list_super libe2p jump/ls
+00000000 T _print_fs_errors libe2p jump/pe
+00000000 T _print_flags libe2p jump/pf
+00000000 T _print_fs_state libe2p jump/ps
+00000000 T _setflags libe2p jump/setflags
+00000000 T _setversion libe2p jump/setversion
diff --git a/lib/e2p/jump/jump.import b/lib/e2p/jump/jump.import
new file mode 100644
index 0000000..51b1fd8
--- /dev/null
+++ b/lib/e2p/jump/jump.import
@@ -0,0 +1,164 @@
+/usr/lib/libc.sa(__libc.o):00001000 a __GOT_SIZE
+/usr/lib/libc.sa(__libc.o):6008f0b0 A _AL
+/usr/lib/libc.sa(__libc.o):6008f198 A _AL_PARM
+/usr/lib/libc.sa(__libc.o):6008f060 A _AM
+/usr/lib/libc.sa(__libc.o):6008f0b4 A _BC
+/usr/lib/libc.sa(__libc.o):6008f064 A _BS
+/usr/lib/libc.sa(__libc.o):6008f0bc A _BT
+/usr/lib/libc.sa(__libc.o):6008f068 A _CA
+/usr/lib/libc.sa(__libc.o):6008f0c0 A _CD
+/usr/lib/libc.sa(__libc.o):6008f0c4 A _CE
+/usr/lib/libc.sa(__libc.o):6008f0c8 A _CL
+/usr/lib/libc.sa(__libc.o):6008f0cc A _CM
+/usr/lib/libc.sa(__libc.o):6008f048 A _COLS
+/usr/lib/libc.sa(__libc.o):6008f0d0 A _CR
+/usr/lib/libc.sa(__libc.o):6008f0d4 A _CS
+/usr/lib/libc.sa(__libc.o):6008f06c A _DA
+/usr/lib/libc.sa(__libc.o):6008f070 A _DB
+/usr/lib/libc.sa(__libc.o):6008f0d8 A _DC
+/usr/lib/libc.sa(__libc.o):6008f0dc A _DL
+/usr/lib/libc.sa(__libc.o):6008f19c A _DL_PARM
+/usr/lib/libc.sa(__libc.o):6008f0e0 A _DM
+/usr/lib/libc.sa(__libc.o):6008f0e4 A _DO
+/usr/lib/libc.sa(__libc.o):6008f1a4 A _DOWN_PARM
+/usr/lib/libc.sa(__libc.o):6008f03c A _Def_term
+/usr/lib/libc.sa(__libc.o):6008f0e8 A _ED
+/usr/lib/libc.sa(__libc.o):6008f0ec A _EI
+/usr/lib/libc.sa(__libc.o):6008f074 A _EO
+/usr/lib/libc.sa(__libc.o):6008f1b8 A _GT
+/usr/lib/libc.sa(__libc.o):6008f078 A _HC
+/usr/lib/libc.sa(__libc.o):6008f118 A _HO
+/usr/lib/libc.sa(__libc.o):6008f07c A _HZ
+/usr/lib/libc.sa(__libc.o):6008f11c A _IC
+/usr/lib/libc.sa(__libc.o):6008f120 A _IM
+/usr/lib/libc.sa(__libc.o):6008f080 A _IN
+/usr/lib/libc.sa(__libc.o):6008f124 A _IP
+/usr/lib/libc.sa(__libc.o):6008f0f0 A _K0
+/usr/lib/libc.sa(__libc.o):6008f0f4 A _K1
+/usr/lib/libc.sa(__libc.o):6008f0f8 A _K2
+/usr/lib/libc.sa(__libc.o):6008f0fc A _K3
+/usr/lib/libc.sa(__libc.o):6008f100 A _K4
+/usr/lib/libc.sa(__libc.o):6008f104 A _K5
+/usr/lib/libc.sa(__libc.o):6008f108 A _K6
+/usr/lib/libc.sa(__libc.o):6008f10c A _K7
+/usr/lib/libc.sa(__libc.o):6008f110 A _K8
+/usr/lib/libc.sa(__libc.o):6008f114 A _K9
+/usr/lib/libc.sa(__libc.o):6008f128 A _KD
+/usr/lib/libc.sa(__libc.o):6008f12c A _KE
+/usr/lib/libc.sa(__libc.o):6008f130 A _KH
+/usr/lib/libc.sa(__libc.o):6008f134 A _KL
+/usr/lib/libc.sa(__libc.o):6008f138 A _KR
+/usr/lib/libc.sa(__libc.o):6008f13c A _KS
+/usr/lib/libc.sa(__libc.o):6008f140 A _KU
+/usr/lib/libc.sa(__libc.o):6008f1a8 A _LEFT_PARM
+/usr/lib/libc.sa(__libc.o):6008f044 A _LINES
+/usr/lib/libc.sa(__libc.o):6008f144 A _LL
+/usr/lib/libc.sa(__libc.o):6008f148 A _MA
+/usr/lib/libc.sa(__libc.o):6008f300 A _MCAppPath
+/usr/lib/libc.sa(__libc.o):6008f084 A _MI
+/usr/lib/libc.sa(__libc.o):6008f088 A _MS
+/usr/lib/libc.sa(__libc.o):6008f030 A _My_term
+/usr/lib/libc.sa(__libc.o):6008f08c A _NC
+/usr/lib/libc.sa(__libc.o):6008f14c A _ND
+/usr/lib/libc.sa(__libc.o):6008f150 A _NL
+/usr/lib/libc.sa(__libc.o):6008f1bc A _NONL
+/usr/lib/libc.sa(__libc.o):6008f090 A _NS
+/usr/lib/libc.sa(__libc.o):6008f094 A _OS
+/usr/lib/libc.sa(__libc.o):6008f1b0 A _PC
+/usr/lib/libc.sa(__libc.o):6008f154 A _RC
+/usr/lib/libc.sa(__libc.o):6008f1ac A _RIGHT_PARM
+/usr/lib/libc.sa(__libc.o):6008f158 A _SC
+/usr/lib/libc.sa(__libc.o):6008f15c A _SE
+/usr/lib/libc.sa(__libc.o):6008f160 A _SF
+/usr/lib/libc.sa(__libc.o):6008f164 A _SO
+/usr/lib/libc.sa(__libc.o):6008f168 A _SR
+/usr/lib/libc.sa(__libc.o):6008f16c A _TA
+/usr/lib/libc.sa(__libc.o):6008f170 A _TE
+/usr/lib/libc.sa(__libc.o):6008f174 A _TI
+/usr/lib/libc.sa(__libc.o):6008f178 A _UC
+/usr/lib/libc.sa(__libc.o):6008f17c A _UE
+/usr/lib/libc.sa(__libc.o):6008f098 A _UL
+/usr/lib/libc.sa(__libc.o):6008f180 A _UP
+/usr/lib/libc.sa(__libc.o):6008f1c0 A _UPPERCASE
+/usr/lib/libc.sa(__libc.o):6008f1a0 A _UP_PARM
+/usr/lib/libc.sa(__libc.o):6008f188 A _US
+/usr/lib/libc.sa(__libc.o):6008f18c A _VB
+/usr/lib/libc.sa(__libc.o):6008f194 A _VE
+/usr/lib/libc.sa(__libc.o):6008f190 A _VS
+/usr/lib/libc.sa(__libc.o):6008f09c A _XB
+/usr/lib/libc.sa(__libc.o):6008f0a0 A _XN
+/usr/lib/libc.sa(__libc.o):6008f0a8 A _XS
+/usr/lib/libc.sa(__libc.o):6008f0a4 A _XT
+/usr/lib/libc.sa(__libc.o):6008f0ac A _XX
+/usr/lib/libc.sa(__libc.o):6008f2a4 A __IO_file_jumps
+/usr/lib/libc.sa(__libc.o):6008f1f4 A __IO_list_all
+/usr/lib/libc.sa(__libc.o):6008f2a8 A __IO_proc_jumps
+/usr/lib/libc.sa(__libc.o):6008f1ec A __IO_stderr_
+/usr/lib/libc.sa(__libc.o):6008f1e4 A __IO_stdin_
+/usr/lib/libc.sa(__libc.o):6008f1e8 A __IO_stdout_
+/usr/lib/libc.sa(__libc.o):6008f2ac A __IO_str_jumps
+/usr/lib/libc.sa(__libc.o):6008f214 A ____brk_addr
+/usr/lib/libc.sa(__libc.o):6008f01c A ___ctype_b
+/usr/lib/libc.sa(__libc.o):6008f020 A ___ctype_tolower
+/usr/lib/libc.sa(__libc.o):6008f024 A ___ctype_toupper
+/usr/lib/libc.sa(__libc.o):6008f1fc A ___environ
+/usr/lib/libc.sa(__libc.o):6008f250 A ___exit_funcs
+/usr/lib/libc.sa(__libc.o):6008f2f0 A ___glob_closedir_hook
+/usr/lib/libc.sa(__libc.o):6008f2f4 A ___glob_opendir_hook
+/usr/lib/libc.sa(__libc.o):6008f2f8 A ___glob_readdir_hook
+/usr/lib/libc.sa(__libc.o):6008f278 A ___ttyname
+/usr/lib/libc.sa(__libc.o):6008f238 A __collate_info
+/usr/lib/libc.sa(__libc.o):6008f23c A __ctype_info
+/usr/lib/libc.sa(__libc.o):6008f028 A __echoit
+/usr/lib/libc.sa(__libc.o):6008f034 A __endwin
+/usr/lib/libc.sa(__libc.o):6008f288 A __gdbm_fetch_val
+/usr/lib/libc.sa(__libc.o):6008f280 A __gdbm_file
+/usr/lib/libc.sa(__libc.o):6008f284 A __gdbm_memory
+/usr/lib/libc.sa(__libc.o):6008f240 A __monetary_info
+/usr/lib/libc.sa(__libc.o):6008f234 A __null_auth
+/usr/lib/libc.sa(__libc.o):6008f244 A __numeric_info
+/usr/lib/libc.sa(__libc.o):6008f2ec A __obstack
+/usr/lib/libc.sa(__libc.o):6008f1c8 A __pfast
+/usr/lib/libc.sa(__libc.o):6008f02c A __rawmode
+/usr/lib/libc.sa(__libc.o):6008f1dc A __res
+/usr/lib/libc.sa(__libc.o):6008f04c A __res_iflg
+/usr/lib/libc.sa(__libc.o):6008f050 A __res_lflg
+/usr/lib/libc.sa(__libc.o):6008f270 A __res_opcodes
+/usr/lib/libc.sa(__libc.o):6008f274 A __res_resultcodes
+/usr/lib/libc.sa(__libc.o):6008f248 A __response_info
+/usr/lib/libc.sa(__libc.o):6008f2fc A __sigintr
+/usr/lib/libc.sa(__libc.o):6008f00c A __sys_errlist
+/usr/lib/libc.sa(__libc.o):6008f010 A __sys_nerr
+/usr/lib/libc.sa(__libc.o):6008f014 A __sys_siglist
+/usr/lib/libc.sa(__libc.o):6008f24c A __time_info
+/usr/lib/libc.sa(__libc.o):6008f05c A __tty
+/usr/lib/libc.sa(__libc.o):6008f040 A __tty_ch
+/usr/lib/libc.sa(__libc.o):6008f1cc A __unctrl
+/usr/lib/libc.sa(__libc.o):6008f27c A __win
+/usr/lib/libc.sa(__libc.o):6008f058 A _curscr
+/usr/lib/libc.sa(__libc.o):6008f228 A _daylight
+/usr/lib/libc.sa(__libc.o):6008f200 A _errno
+/usr/lib/libc.sa(__libc.o):6008f1d0 A _gdbm_errno
+/usr/lib/libc.sa(__libc.o):6008f28c A _gdbm_version
+/usr/lib/libc.sa(__libc.o):6008f008 A _h_errlist
+/usr/lib/libc.sa(__libc.o):6008f1d8 A _h_errno
+/usr/lib/libc.sa(__libc.o):6008f2a0 A _h_nerr
+/usr/lib/libc.sa(__libc.o):6008f1c4 A _normtty
+/usr/lib/libc.sa(__libc.o):6008f204 A _optarg
+/usr/lib/libc.sa(__libc.o):6008f20c A _opterr
+/usr/lib/libc.sa(__libc.o):6008f208 A _optind
+/usr/lib/libc.sa(__libc.o):6008f2e4 A _optopt
+/usr/lib/libc.sa(__libc.o):6008f218 A _ospeed
+/usr/lib/libc.sa(__libc.o):6008f26c A _re_max_failures
+/usr/lib/libc.sa(__libc.o):6008f210 A _re_syntax_options
+/usr/lib/libc.sa(__libc.o):6008f1e0 A _rexecoptions
+/usr/lib/libc.sa(__libc.o):6008f230 A _rpc_createerr
+/usr/lib/libc.sa(__libc.o):6008f25c A _stderr
+/usr/lib/libc.sa(__libc.o):6008f254 A _stdin
+/usr/lib/libc.sa(__libc.o):6008f258 A _stdout
+/usr/lib/libc.sa(__libc.o):6008f054 A _stdscr
+/usr/lib/libc.sa(__libc.o):6008f2e8 A _svc_fdset
+/usr/lib/libc.sa(__libc.o):6008f224 A _timezone
+/usr/lib/libc.sa(__libc.o):6008f21c A _tputs_baud_rate
+/usr/lib/libc.sa(__libc.o):6008f038 A _ttytype
+/usr/lib/libc.sa(__libc.o):6008f220 A _tzname
diff --git a/lib/e2p/jump/jump.params b/lib/e2p/jump/jump.params
new file mode 100644
index 0000000..7d3efe9
--- /dev/null
+++ b/lib/e2p/jump/jump.params
@@ -0,0 +1,6 @@
+Name=libe2p
+Text=0x66980000
+Data=0x00000000
+Jump=0x00001000
+GOT=0x00001000
+Version=1.0.0
diff --git a/lib/e2p/jump/jump.undefs b/lib/e2p/jump/jump.undefs
new file mode 100644
index 0000000..4492562
--- /dev/null
+++ b/lib/e2p/jump/jump.undefs
@@ -0,0 +1 @@
+66983040 D __NEEDS_SHRLIB_libc_4
diff --git a/lib/e2p/ls.c b/lib/e2p/ls.c
index 982f044..f879a3c 100644
--- a/lib/e2p/ls.c
+++ b/lib/e2p/ls.c
@@ -9,13 +9,40 @@
* Public License
*/
+#include <grp.h>
+#include <pwd.h>
#include <stdio.h>
#include <time.h>
+#include <sys/types.h>
#include <linux/ext2_fs.h>
#include "e2p.h"
+static void print_user (unsigned short uid)
+{
+ struct passwd *pw;
+
+ printf ("%u ", uid);
+ pw = getpwuid (uid);
+ if (pw == NULL)
+ printf ("(user unknown)\n");
+ else
+ printf ("(user %s)\n", pw->pw_name);
+}
+
+static void print_group (unsigned short gid)
+{
+ struct group *gr;
+
+ printf ("%u ", gid);
+ gr = getgrgid (gid);
+ if (gr == NULL)
+ printf ("(group unknown)\n");
+ else
+ printf ("(group %s)\n", gr->gr_name);
+}
+
void list_super (struct ext2_super_block * s)
{
printf ("Filesystem magic number: 0x%04X\n", s->s_magic);
@@ -49,4 +76,10 @@
next = s->s_lastcheck + s->s_checkinterval;
printf ("Next check after: %s", ctime (&next));
}
+#ifdef EXT2_DEF_RESUID
+ printf ("Reserved blocks uid: ");
+ print_user (s->s_def_resuid);
+ printf ("Reserved blocks gid: ");
+ print_group (s->s_def_resuid);
+#endif
}
diff --git a/lib/e2p/pf.c b/lib/e2p/pf.c
index 58f05de..e4f072f 100644
--- a/lib/e2p/pf.c
+++ b/lib/e2p/pf.c
@@ -19,22 +19,69 @@
#include "e2p.h"
-void print_flags (FILE * f, unsigned long flags)
+static const unsigned long flags_array[] = {
+ EXT2_SECRM_FL,
+ EXT2_UNRM_FL,
+ EXT2_COMPR_FL,
+ EXT2_SYNC_FL,
+#ifdef EXT2_IMMUTABLE_FL
+ EXT2_IMMUTABLE_FL,
+#endif
+#ifdef EXT2_APPEND_FL
+ EXT2_APPEND_FL,
+#endif
+#ifdef EXT2_NODUMP_FL
+ EXT2_NODUMP_FL,
+#endif
+ 0};
+
+static const char * short_flags[] = {
+ "s",
+ "u",
+ "c",
+ "S",
+#ifdef EXT2_IMMUTABLE_FL
+ "i",
+#endif
+#ifdef EXT2_APPEND_FL
+ "a",
+#endif
+#ifdef EXT2_NODUMP_FL
+ "d",
+#endif
+ NULL};
+
+static const char * long_flags[] = {
+ "Secure_Deletion, ",
+ "Undelete, ",
+ "Compressed_File, ",
+ "Synchronous_Updates, ",
+#ifdef EXT2_IMMUTABLE_FL
+ "Immutable, ",
+#endif
+#ifdef EXT2_NODUMP_FL
+ "Append_Only, ",
+#endif
+#ifdef EXT2_NODUMP_FL
+ "No_Dump, ",
+#endif
+ NULL};
+
+void print_flags (FILE * f, unsigned long flags, int long_format)
{
- if (flags & EXT2_SYNC_FL)
- fprintf (f, "S");
+ int i;
+ const char ** flags_names;
+
+ if (long_format)
+ flags_names = long_flags;
else
- fprintf (f, "-");
- if (flags & EXT2_COMPR_FL)
- fprintf (f, "c");
- else
- fprintf (f, "-");
- if (flags & EXT2_SECRM_FL)
- fprintf (f, "s");
- else
- fprintf (f, "-");
- if (flags & EXT2_UNRM_FL)
- fprintf (f, "u");
- else
- fprintf (f, "-");
+ flags_names = short_flags;
+
+ for (i = 0; flags_array[i] != 0; i++)
+ {
+ if (flags & flags_array[i])
+ fprintf (f, flags_names[i]);
+ else
+ fprintf (f, "-");
+ }
}
diff --git a/lib/et/.depend b/lib/et/.depend
index c0ebdfb..2556ee4 100644
--- a/lib/et/.depend
+++ b/lib/et/.depend
@@ -1,13 +1,17 @@
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 mit-sipb-copyright.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/stdarg.h \
- error_table.h internal.h /usr/include/errno.h /usr/include/linux/errno.h com_err.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 error_table.h mit-sipb-copyright.h \
- internal.h /usr/include/errno.h /usr/include/linux/errno.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 \
- /usr/include/libio.h /usr/include/_G_config.h error_table.h mit-sipb-copyright.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
diff --git a/lib/et/ChangeLog b/lib/et/ChangeLog
new file mode 100644
index 0000000..3c37224
--- /dev/null
+++ b/lib/et/ChangeLog
@@ -0,0 +1,9 @@
+Mon Nov 7 21:17:48 1994 Remy Card <card@bbj>
+
+ * Makefile: Added a dummy install target in case shared libraries
+ are not built.
+
+Thu Sep 8 22:33:33 1994 (tytso@rsx-11)
+
+ * com_err.c (default_com_err_proc): Reversed order of \n\r to make
+ jik happy.
diff --git a/lib/et/Makefile b/lib/et/Makefile
index 6b4cd47..2dcf1ef 100644
--- a/lib/et/Makefile
+++ b/lib/et/Makefile
@@ -1,29 +1,57 @@
+#
+# Makefile for lib/et
+#
+
+all:: compile_et libcom_err.a
+
include ../../MCONFIG
-ARCHIVE=ar r
-RANLIB=ranlib
-RM=rm -f
-MV=mv
-LN=ln -s
-TAGS=etags
-
-CFLAGS_NO=
-CFLAGS= $(CFLAGS_NO) $(OPT)
-
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
-all: compile_et libcom_err.a libcom_err_p.a
compile_et: compile_et.sh
./config_script compile_et.sh $(AWK) > compile_et
@@ -45,27 +73,32 @@
$(RM) ../$@
$(LN) et/$@ ../$@
-clean:
+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
+really-clean:: clean
$(RM) .depend
-install:: libcom_err.a
- $(INSTALLLIB) libcom_err.a $(DESTDIR)$(LIBDIR)/libcom_err.a
- $(CHMOD) 644 $(DESTDIR)$(LIBDIR)/libcom_err.a
- $(RANLIB) $(DESTDIR)$(LIBDIR)/libcom_err.a
- $(CHMOD) $(LIBMODE) $(DESTDIR)$(LIBDIR)/libcom_err.a
+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:: $(HFILES)
- @rm -rf ${DESTDIR}$(INCLDIR)/et
- @mkdir ${DESTDIR}$(INCLDIR)/et
+install-libs:: $(HFILES)
+ @rm -rf $(INCLDIR)/et
+ @mkdir $(INCLDIR)/et
for i in $(HFILES); do \
- $(INSTALLINC) $$i ${DESTDIR}$(INCLDIR)/et/$$i; \
+ $(INSTALLINC) $$i $(INCLDIR)/et/$$i; \
done
+install-tree::
+
+install::
+
##
com_err.ps : com_err.dvi
diff --git a/lib/et/com_err.c b/lib/et/com_err.c
index 9f4ba5f..8ee332a 100644
--- a/lib/et/com_err.c
+++ b/lib/et/com_err.c
@@ -5,42 +5,24 @@
*/
#include <stdio.h>
+#include "com_err.h"
#include "mit-sipb-copyright.h"
+#include "error_table.h"
+#include "internal.h"
-#if __STDC__ || defined(STDARG_PROTOTYPES)
-#include <stdarg.h>
-#else
+#if !defined(__STDC__) && !defined(STDARG_PROTOTYPES)
#include <varargs.h>
#define VARARGS
#endif
-#include "error_table.h"
-#include "internal.h"
-
-#ifdef notdef
-/*
- * Protect us from header version (externally visible) of com_err, so
- * we can survive in a <varargs.h> environment. I think.
- */
-#define com_err com_err_external
-#include "com_err.h"
-#undef com_err
-#else
-#include "com_err.h"
-#endif
-
-#if ! lint
-static const char rcsid[] =
- "$Header$";
-#endif /* ! lint */
-
static void
#ifdef __STDC__
- default_com_err_proc (const char *whoami, long code, const char *fmt, va_list args)
+ default_com_err_proc (const char *whoami, errcode_t code, const
+ char *fmt, va_list args)
#else
default_com_err_proc (whoami, code, fmt, args)
const char *whoami;
- long code;
+ errcode_t code;
const char *fmt;
va_list args;
#endif
@@ -56,32 +38,37 @@
if (fmt) {
vfprintf (stderr, fmt, args);
}
- putc('\n', stderr);
/* should do this only on a tty in raw mode */
putc('\r', stderr);
+ putc('\n', stderr);
fflush(stderr);
}
#ifdef __STDC__
-typedef void (*errf) (const char *, long, const char *, va_list);
+typedef void (*errf) (const char *, errcode_t, const char *, va_list);
#else
typedef void (*errf) ();
#endif
errf com_err_hook = default_com_err_proc;
+#ifdef __STDC__
+void com_err_va (const char *whoami, errcode_t code, const char *fmt,
+ va_list args)
+#else
void com_err_va (whoami, code, fmt, args)
const char *whoami;
- long code;
+ errcode_t code;
const char *fmt;
va_list args;
+#endif
{
(*com_err_hook) (whoami, code, fmt, args);
}
#ifndef VARARGS
void com_err (const char *whoami,
- long code,
+ errcode_t code,
const char *fmt, ...)
{
#else
@@ -89,7 +76,7 @@
va_dcl
{
const char *whoami, *fmt;
- long code;
+ errcode_t code;
#endif
va_list pvar;
@@ -98,7 +85,7 @@
#ifdef VARARGS
va_start (pvar);
whoami = va_arg (pvar, const char *);
- code = va_arg (pvar, long);
+ code = va_arg (pvar, errcode_t);
fmt = va_arg (pvar, const char *);
#else
va_start(pvar, fmt);
diff --git a/lib/et/com_err.h b/lib/et/com_err.h
index 54904c3..f28dce8 100644
--- a/lib/et/com_err.h
+++ b/lib/et/com_err.h
@@ -13,25 +13,27 @@
typedef long errcode_t;
#ifdef __STDC__
-#ifndef __HIGHC__ /* gives us STDC but not stdarg */
#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
+
/* ANSI C -- use prototypes etc */
void com_err (const char *, long, const char *, ...);
+void com_err_va (const char *whoami, errcode_t code, const char *fmt,
+ va_list args);
char const *error_message (long);
-void (*com_err_hook) (const char *, long, const char *, va_list);
+extern void (*com_err_hook) (const char *, long, const char *, va_list);
void (*set_com_err_hook (void (*) (const char *, long, const char *, va_list)))
(const char *, long, const char *, va_list);
void (*reset_com_err_hook (void)) (const char *, long, const char *, va_list);
+int init_error_table(const char * const *msgs, int base, int count);
#else
/* no prototypes */
void com_err ();
+void com_err_va ();
char *error_message ();
-void (*com_err_hook) ();
+extern void (*com_err_hook) ();
void (*set_com_err_hook ()) ();
void (*reset_com_err_hook ()) ();
+int init_error_table();
#endif
#define __COM_ERR_H
diff --git a/lib/et/error_message.c b/lib/et/error_message.c
index 043b02e..c6c2b39 100644
--- a/lib/et/error_message.c
+++ b/lib/et/error_message.c
@@ -11,21 +11,23 @@
#include <stdio.h>
#include <string.h>
+#include <errno.h>
+#include "com_err.h"
#include "error_table.h"
#include "mit-sipb-copyright.h"
#include "internal.h"
-static const char rcsid[] =
- "$Header$";
-static const char copyright[] =
- "Copyright 1986, 1987, 1988 by the Student Information Processing Board\nand the department of Information Systems\nof the Massachusetts Institute of Technology";
-
static char buffer[25];
struct et_list * _et_list = (struct et_list *) NULL;
+
+#ifdef __STDC__
+const char * error_message (errcode_t code)
+#else
const char * error_message (code)
-long code;
+ errcode_t code;
+#endif
{
int offset;
struct et_list *et;
@@ -36,10 +38,18 @@
offset = code & ((1<<ERRCODE_RANGE)-1);
table_num = code - offset;
if (!table_num) {
+#ifdef HAS_SYS_ERRLIST
if (offset < sys_nerr)
return(sys_errlist[offset]);
else
goto oops;
+#else
+ cp = strerror(offset);
+ if (cp)
+ return(cp);
+ else
+ goto oops;
+#endif
}
for (et = _et_list; et; et = et->next) {
if (et->table->base == table_num) {
diff --git a/lib/et/error_table.h b/lib/et/error_table.h
index 78f7db2..31971f0 100644
--- a/lib/et/error_table.h
+++ b/lib/et/error_table.h
@@ -10,7 +10,7 @@
#ifndef __STDC__
#define const
#endif
-extern int errno;
+
struct error_table {
char const * const * msgs;
long base;
@@ -25,6 +25,11 @@
#define ERRCODE_RANGE 8 /* # of bits to shift table number */
#define BITS_PER_CHAR 6 /* # bits to shift per character in name */
+#ifdef __STDC__
+extern const char *error_table_name(int num);
+#else
extern const char *error_table_name();
+#endif
+
#define _ET_H
#endif
diff --git a/lib/et/et_name.c b/lib/et/et_name.c
index 19da71d..db4099f 100644
--- a/lib/et/et_name.c
+++ b/lib/et/et_name.c
@@ -8,13 +8,6 @@
#include "mit-sipb-copyright.h"
#include "internal.h"
-#ifndef lint
-static const char copyright[] =
- "Copyright 1987,1988 by Student Information Processing Board, Massachusetts Institute of Technology";
-static const char rcsid_et_name_c[] =
- "$Header$";
-#endif
-
static const char char_set[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
diff --git a/lib/et/init_et.c b/lib/et/init_et.c
index 856f0fd..8e5af84 100644
--- a/lib/et/init_et.c
+++ b/lib/et/init_et.c
@@ -10,6 +10,11 @@
*/
#include <stdio.h>
+#include <errno.h>
+#ifdef HAS_STDLIB_H
+#include <stdlib.h>
+#endif
+#include "com_err.h"
#include "error_table.h"
#include "mit-sipb-copyright.h"
@@ -17,13 +22,6 @@
#define const
#endif
-#ifndef lint
-static const char rcsid_init_et_c[] =
- "$Header$";
-#endif
-
-extern char *malloc(), *realloc();
-
struct foobar {
struct et_list etl;
struct error_table et;
@@ -31,10 +29,14 @@
extern struct et_list * _et_list;
+#ifdef __STDC__
+int init_error_table(const char * const *msgs, int base, int count)
+#else
int init_error_table(msgs, base, count)
const char * const * msgs;
int base;
int count;
+#endif
{
struct foobar * new_et;
@@ -43,7 +45,7 @@
new_et = (struct foobar *) malloc(sizeof(struct foobar));
if (!new_et)
- return errno; /* oops */
+ return ENOMEM; /* oops */
new_et->etl.table = &new_et->et;
new_et->et.msgs = msgs;
new_et->et.base = base;
diff --git a/lib/et/jump/jump.funcs b/lib/et/jump/jump.funcs
new file mode 100644
index 0000000..c5cdbc4
--- /dev/null
+++ b/lib/et/jump/jump.funcs
@@ -0,0 +1,6 @@
+00000000 T _error_message libcom_err jump/error_message
+00000000 T _init_error_table libcom_err jump/init_et
+00000000 T _com_err_va libcom_err jump/com_err
+00000000 T _com_err libcom_err jump/com_err
+00000000 T _set_com_err_hook libcom_err jump/com_err
+00000000 T _reset_com_err_hook libcom_err jump/com_err
diff --git a/lib/et/jump/jump.ignore b/lib/et/jump/jump.ignore
new file mode 100644
index 0000000..0bcb551
--- /dev/null
+++ b/lib/et/jump/jump.ignore
@@ -0,0 +1 @@
+00000000 T _error_table_name libxyzzy jump/et_name
diff --git a/lib/et/jump/jump.import b/lib/et/jump/jump.import
new file mode 100644
index 0000000..51b1fd8
--- /dev/null
+++ b/lib/et/jump/jump.import
@@ -0,0 +1,164 @@
+/usr/lib/libc.sa(__libc.o):00001000 a __GOT_SIZE
+/usr/lib/libc.sa(__libc.o):6008f0b0 A _AL
+/usr/lib/libc.sa(__libc.o):6008f198 A _AL_PARM
+/usr/lib/libc.sa(__libc.o):6008f060 A _AM
+/usr/lib/libc.sa(__libc.o):6008f0b4 A _BC
+/usr/lib/libc.sa(__libc.o):6008f064 A _BS
+/usr/lib/libc.sa(__libc.o):6008f0bc A _BT
+/usr/lib/libc.sa(__libc.o):6008f068 A _CA
+/usr/lib/libc.sa(__libc.o):6008f0c0 A _CD
+/usr/lib/libc.sa(__libc.o):6008f0c4 A _CE
+/usr/lib/libc.sa(__libc.o):6008f0c8 A _CL
+/usr/lib/libc.sa(__libc.o):6008f0cc A _CM
+/usr/lib/libc.sa(__libc.o):6008f048 A _COLS
+/usr/lib/libc.sa(__libc.o):6008f0d0 A _CR
+/usr/lib/libc.sa(__libc.o):6008f0d4 A _CS
+/usr/lib/libc.sa(__libc.o):6008f06c A _DA
+/usr/lib/libc.sa(__libc.o):6008f070 A _DB
+/usr/lib/libc.sa(__libc.o):6008f0d8 A _DC
+/usr/lib/libc.sa(__libc.o):6008f0dc A _DL
+/usr/lib/libc.sa(__libc.o):6008f19c A _DL_PARM
+/usr/lib/libc.sa(__libc.o):6008f0e0 A _DM
+/usr/lib/libc.sa(__libc.o):6008f0e4 A _DO
+/usr/lib/libc.sa(__libc.o):6008f1a4 A _DOWN_PARM
+/usr/lib/libc.sa(__libc.o):6008f03c A _Def_term
+/usr/lib/libc.sa(__libc.o):6008f0e8 A _ED
+/usr/lib/libc.sa(__libc.o):6008f0ec A _EI
+/usr/lib/libc.sa(__libc.o):6008f074 A _EO
+/usr/lib/libc.sa(__libc.o):6008f1b8 A _GT
+/usr/lib/libc.sa(__libc.o):6008f078 A _HC
+/usr/lib/libc.sa(__libc.o):6008f118 A _HO
+/usr/lib/libc.sa(__libc.o):6008f07c A _HZ
+/usr/lib/libc.sa(__libc.o):6008f11c A _IC
+/usr/lib/libc.sa(__libc.o):6008f120 A _IM
+/usr/lib/libc.sa(__libc.o):6008f080 A _IN
+/usr/lib/libc.sa(__libc.o):6008f124 A _IP
+/usr/lib/libc.sa(__libc.o):6008f0f0 A _K0
+/usr/lib/libc.sa(__libc.o):6008f0f4 A _K1
+/usr/lib/libc.sa(__libc.o):6008f0f8 A _K2
+/usr/lib/libc.sa(__libc.o):6008f0fc A _K3
+/usr/lib/libc.sa(__libc.o):6008f100 A _K4
+/usr/lib/libc.sa(__libc.o):6008f104 A _K5
+/usr/lib/libc.sa(__libc.o):6008f108 A _K6
+/usr/lib/libc.sa(__libc.o):6008f10c A _K7
+/usr/lib/libc.sa(__libc.o):6008f110 A _K8
+/usr/lib/libc.sa(__libc.o):6008f114 A _K9
+/usr/lib/libc.sa(__libc.o):6008f128 A _KD
+/usr/lib/libc.sa(__libc.o):6008f12c A _KE
+/usr/lib/libc.sa(__libc.o):6008f130 A _KH
+/usr/lib/libc.sa(__libc.o):6008f134 A _KL
+/usr/lib/libc.sa(__libc.o):6008f138 A _KR
+/usr/lib/libc.sa(__libc.o):6008f13c A _KS
+/usr/lib/libc.sa(__libc.o):6008f140 A _KU
+/usr/lib/libc.sa(__libc.o):6008f1a8 A _LEFT_PARM
+/usr/lib/libc.sa(__libc.o):6008f044 A _LINES
+/usr/lib/libc.sa(__libc.o):6008f144 A _LL
+/usr/lib/libc.sa(__libc.o):6008f148 A _MA
+/usr/lib/libc.sa(__libc.o):6008f300 A _MCAppPath
+/usr/lib/libc.sa(__libc.o):6008f084 A _MI
+/usr/lib/libc.sa(__libc.o):6008f088 A _MS
+/usr/lib/libc.sa(__libc.o):6008f030 A _My_term
+/usr/lib/libc.sa(__libc.o):6008f08c A _NC
+/usr/lib/libc.sa(__libc.o):6008f14c A _ND
+/usr/lib/libc.sa(__libc.o):6008f150 A _NL
+/usr/lib/libc.sa(__libc.o):6008f1bc A _NONL
+/usr/lib/libc.sa(__libc.o):6008f090 A _NS
+/usr/lib/libc.sa(__libc.o):6008f094 A _OS
+/usr/lib/libc.sa(__libc.o):6008f1b0 A _PC
+/usr/lib/libc.sa(__libc.o):6008f154 A _RC
+/usr/lib/libc.sa(__libc.o):6008f1ac A _RIGHT_PARM
+/usr/lib/libc.sa(__libc.o):6008f158 A _SC
+/usr/lib/libc.sa(__libc.o):6008f15c A _SE
+/usr/lib/libc.sa(__libc.o):6008f160 A _SF
+/usr/lib/libc.sa(__libc.o):6008f164 A _SO
+/usr/lib/libc.sa(__libc.o):6008f168 A _SR
+/usr/lib/libc.sa(__libc.o):6008f16c A _TA
+/usr/lib/libc.sa(__libc.o):6008f170 A _TE
+/usr/lib/libc.sa(__libc.o):6008f174 A _TI
+/usr/lib/libc.sa(__libc.o):6008f178 A _UC
+/usr/lib/libc.sa(__libc.o):6008f17c A _UE
+/usr/lib/libc.sa(__libc.o):6008f098 A _UL
+/usr/lib/libc.sa(__libc.o):6008f180 A _UP
+/usr/lib/libc.sa(__libc.o):6008f1c0 A _UPPERCASE
+/usr/lib/libc.sa(__libc.o):6008f1a0 A _UP_PARM
+/usr/lib/libc.sa(__libc.o):6008f188 A _US
+/usr/lib/libc.sa(__libc.o):6008f18c A _VB
+/usr/lib/libc.sa(__libc.o):6008f194 A _VE
+/usr/lib/libc.sa(__libc.o):6008f190 A _VS
+/usr/lib/libc.sa(__libc.o):6008f09c A _XB
+/usr/lib/libc.sa(__libc.o):6008f0a0 A _XN
+/usr/lib/libc.sa(__libc.o):6008f0a8 A _XS
+/usr/lib/libc.sa(__libc.o):6008f0a4 A _XT
+/usr/lib/libc.sa(__libc.o):6008f0ac A _XX
+/usr/lib/libc.sa(__libc.o):6008f2a4 A __IO_file_jumps
+/usr/lib/libc.sa(__libc.o):6008f1f4 A __IO_list_all
+/usr/lib/libc.sa(__libc.o):6008f2a8 A __IO_proc_jumps
+/usr/lib/libc.sa(__libc.o):6008f1ec A __IO_stderr_
+/usr/lib/libc.sa(__libc.o):6008f1e4 A __IO_stdin_
+/usr/lib/libc.sa(__libc.o):6008f1e8 A __IO_stdout_
+/usr/lib/libc.sa(__libc.o):6008f2ac A __IO_str_jumps
+/usr/lib/libc.sa(__libc.o):6008f214 A ____brk_addr
+/usr/lib/libc.sa(__libc.o):6008f01c A ___ctype_b
+/usr/lib/libc.sa(__libc.o):6008f020 A ___ctype_tolower
+/usr/lib/libc.sa(__libc.o):6008f024 A ___ctype_toupper
+/usr/lib/libc.sa(__libc.o):6008f1fc A ___environ
+/usr/lib/libc.sa(__libc.o):6008f250 A ___exit_funcs
+/usr/lib/libc.sa(__libc.o):6008f2f0 A ___glob_closedir_hook
+/usr/lib/libc.sa(__libc.o):6008f2f4 A ___glob_opendir_hook
+/usr/lib/libc.sa(__libc.o):6008f2f8 A ___glob_readdir_hook
+/usr/lib/libc.sa(__libc.o):6008f278 A ___ttyname
+/usr/lib/libc.sa(__libc.o):6008f238 A __collate_info
+/usr/lib/libc.sa(__libc.o):6008f23c A __ctype_info
+/usr/lib/libc.sa(__libc.o):6008f028 A __echoit
+/usr/lib/libc.sa(__libc.o):6008f034 A __endwin
+/usr/lib/libc.sa(__libc.o):6008f288 A __gdbm_fetch_val
+/usr/lib/libc.sa(__libc.o):6008f280 A __gdbm_file
+/usr/lib/libc.sa(__libc.o):6008f284 A __gdbm_memory
+/usr/lib/libc.sa(__libc.o):6008f240 A __monetary_info
+/usr/lib/libc.sa(__libc.o):6008f234 A __null_auth
+/usr/lib/libc.sa(__libc.o):6008f244 A __numeric_info
+/usr/lib/libc.sa(__libc.o):6008f2ec A __obstack
+/usr/lib/libc.sa(__libc.o):6008f1c8 A __pfast
+/usr/lib/libc.sa(__libc.o):6008f02c A __rawmode
+/usr/lib/libc.sa(__libc.o):6008f1dc A __res
+/usr/lib/libc.sa(__libc.o):6008f04c A __res_iflg
+/usr/lib/libc.sa(__libc.o):6008f050 A __res_lflg
+/usr/lib/libc.sa(__libc.o):6008f270 A __res_opcodes
+/usr/lib/libc.sa(__libc.o):6008f274 A __res_resultcodes
+/usr/lib/libc.sa(__libc.o):6008f248 A __response_info
+/usr/lib/libc.sa(__libc.o):6008f2fc A __sigintr
+/usr/lib/libc.sa(__libc.o):6008f00c A __sys_errlist
+/usr/lib/libc.sa(__libc.o):6008f010 A __sys_nerr
+/usr/lib/libc.sa(__libc.o):6008f014 A __sys_siglist
+/usr/lib/libc.sa(__libc.o):6008f24c A __time_info
+/usr/lib/libc.sa(__libc.o):6008f05c A __tty
+/usr/lib/libc.sa(__libc.o):6008f040 A __tty_ch
+/usr/lib/libc.sa(__libc.o):6008f1cc A __unctrl
+/usr/lib/libc.sa(__libc.o):6008f27c A __win
+/usr/lib/libc.sa(__libc.o):6008f058 A _curscr
+/usr/lib/libc.sa(__libc.o):6008f228 A _daylight
+/usr/lib/libc.sa(__libc.o):6008f200 A _errno
+/usr/lib/libc.sa(__libc.o):6008f1d0 A _gdbm_errno
+/usr/lib/libc.sa(__libc.o):6008f28c A _gdbm_version
+/usr/lib/libc.sa(__libc.o):6008f008 A _h_errlist
+/usr/lib/libc.sa(__libc.o):6008f1d8 A _h_errno
+/usr/lib/libc.sa(__libc.o):6008f2a0 A _h_nerr
+/usr/lib/libc.sa(__libc.o):6008f1c4 A _normtty
+/usr/lib/libc.sa(__libc.o):6008f204 A _optarg
+/usr/lib/libc.sa(__libc.o):6008f20c A _opterr
+/usr/lib/libc.sa(__libc.o):6008f208 A _optind
+/usr/lib/libc.sa(__libc.o):6008f2e4 A _optopt
+/usr/lib/libc.sa(__libc.o):6008f218 A _ospeed
+/usr/lib/libc.sa(__libc.o):6008f26c A _re_max_failures
+/usr/lib/libc.sa(__libc.o):6008f210 A _re_syntax_options
+/usr/lib/libc.sa(__libc.o):6008f1e0 A _rexecoptions
+/usr/lib/libc.sa(__libc.o):6008f230 A _rpc_createerr
+/usr/lib/libc.sa(__libc.o):6008f25c A _stderr
+/usr/lib/libc.sa(__libc.o):6008f254 A _stdin
+/usr/lib/libc.sa(__libc.o):6008f258 A _stdout
+/usr/lib/libc.sa(__libc.o):6008f054 A _stdscr
+/usr/lib/libc.sa(__libc.o):6008f2e8 A _svc_fdset
+/usr/lib/libc.sa(__libc.o):6008f224 A _timezone
+/usr/lib/libc.sa(__libc.o):6008f21c A _tputs_baud_rate
+/usr/lib/libc.sa(__libc.o):6008f038 A _ttytype
+/usr/lib/libc.sa(__libc.o):6008f220 A _tzname
diff --git a/lib/et/jump/jump.params b/lib/et/jump/jump.params
new file mode 100644
index 0000000..d88c8c2
--- /dev/null
+++ b/lib/et/jump/jump.params
@@ -0,0 +1,6 @@
+Name=libet
+Text=0x66800000
+Data=0x00000000
+Jump=0x00001000
+GOT=0x00001000
+Version=1.0.0
diff --git a/lib/et/jump/jump.undefs b/lib/et/jump/jump.undefs
new file mode 100644
index 0000000..c61658a
--- /dev/null
+++ b/lib/et/jump/jump.undefs
@@ -0,0 +1 @@
+66804000 D __NEEDS_SHRLIB_libc_4
diff --git a/lib/et/jump/jump.vars b/lib/et/jump/jump.vars
new file mode 100644
index 0000000..c0aad65
--- /dev/null
+++ b/lib/et/jump/jump.vars
@@ -0,0 +1,2 @@
+00000004 D __et_list libcom_err jump/error_message
+00000004 D _com_err_hook libcom_err jump/com_err
diff --git a/lib/ext2fs/.depend b/lib/ext2fs/.depend
index 653e191..dd371f6 100644
--- a/lib/ext2fs/.depend
+++ b/lib/ext2fs/.depend
@@ -1,350 +1,198 @@
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/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/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
- /usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
- /usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
- /usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
- /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
- /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
- /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
- /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
- /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
- /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
- /usr/include/linux/sysv_fs_sb.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
+ /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 \
/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/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/fcntl.h /usr/include/linux/fcntl.h \
- /usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
- /usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
- /usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
- /usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
- /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
- /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
- /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
- /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
- /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
- /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
- /usr/include/linux/sysv_fs_sb.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
+ /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/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 \
/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/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/fcntl.h /usr/include/linux/fcntl.h \
- /usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
- /usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
- /usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
- /usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
- /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
- /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
- /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
- /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
- /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
- /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
- /usr/include/linux/sysv_fs_sb.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
+ /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/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 \
/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/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/fcntl.h /usr/include/linux/fcntl.h \
- /usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
- /usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
- /usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
- /usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
- /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
- /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
- /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
- /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
- /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
- /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
- /usr/include/linux/sysv_fs_sb.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
-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/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
- /usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
- /usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
- /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
- /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
- /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
- /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
- /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
- /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
- /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.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/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 \
+ /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/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 \
/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/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/linux/fs.h /usr/include/linux/linkage.h \
- /usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
- /usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
- /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
- /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
- /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
- /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
- /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
- /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
- /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.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/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 \
+ /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/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/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 \
/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/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/time.h /usr/include/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
- /usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
- /usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
- /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
- /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
- /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
- /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
- /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
- /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
- /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.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
+ /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/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/linux/fs.h /usr/include/linux/linkage.h \
- /usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
- /usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
- /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
- /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
- /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
- /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
- /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
- /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
- /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.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
+ /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
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/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/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
- /usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
- /usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
- /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
- /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
- /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
- /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
- /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
- /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
- /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.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
+ /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/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/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
- /usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
- /usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
- /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
- /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
- /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
- /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
- /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
- /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
- /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.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
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/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/fcntl.h /usr/include/linux/fcntl.h \
- /usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
- /usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
- /usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
- /usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
- /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
- /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
- /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
- /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
- /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
- /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
- /usr/include/linux/sysv_fs_sb.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
+ /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/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 \
/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/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/fcntl.h /usr/include/linux/fcntl.h \
- /usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
- /usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
- /usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
- /usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
- /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
- /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
- /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
- /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
- /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
- /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
- /usr/include/linux/sysv_fs_sb.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
+ /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/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 \
/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/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/sys/stat.h /usr/include/linux/stat.h \
- /usr/include/linux/fs.h /usr/include/linux/linkage.h /usr/include/linux/limits.h \
- /usr/include/linux/wait.h /usr/include/linux/dirent.h /usr/include/linux/vfs.h \
- /usr/include/linux/net.h /usr/include/linux/socket.h /usr/include/linux/sockios.h \
- /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h \
- /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h \
- /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h \
- /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h \
- /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h \
- /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h \
- /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.h /usr/include/linux/ext2_fs.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/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 \
/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/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/linux/fs.h /usr/include/linux/linkage.h \
- /usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
- /usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
- /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
- /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
- /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
- /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
- /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
- /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
- /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.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
+ /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 \
+ /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/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/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/fcntl.h /usr/include/linux/fcntl.h \
- /usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
- /usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
- /usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
- /usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
- /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
- /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
- /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
- /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
- /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
- /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
- /usr/include/linux/sysv_fs_sb.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
+ /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/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 \
/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/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/linux/fs.h /usr/include/linux/linkage.h \
- /usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
- /usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
- /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
- /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
- /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
- /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
- /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
- /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
- /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.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
+ /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 \
/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/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/linux/fs.h /usr/include/linux/linkage.h \
- /usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
- /usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
- /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
- /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
- /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
- /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
- /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
- /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
- /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.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
+ /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 \
/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/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/fcntl.h /usr/include/linux/fcntl.h \
- /usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
- /usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
- /usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
- /usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
- /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
- /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
- /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
- /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
- /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
- /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
- /usr/include/linux/sysv_fs_sb.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
+ /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/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 \
/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/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/fcntl.h /usr/include/linux/fcntl.h \
- /usr/include/time.h /usr/include/sys/stat.h /usr/include/linux/stat.h /usr/include/linux/fs.h \
- /usr/include/linux/linkage.h /usr/include/linux/limits.h /usr/include/linux/wait.h \
- /usr/include/linux/dirent.h /usr/include/linux/vfs.h /usr/include/linux/net.h \
- /usr/include/linux/socket.h /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h \
- /usr/include/linux/minix_fs_i.h /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h \
- /usr/include/linux/hpfs_fs_i.h /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h \
- /usr/include/linux/nfs_fs_i.h /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h \
- /usr/include/linux/sysv_fs_i.h /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h \
- /usr/include/linux/ext2_fs_sb.h /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h \
- /usr/include/linux/iso_fs_sb.h /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h \
- /usr/include/linux/sysv_fs_sb.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
+ /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/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 \
/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/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/fcntl.h /usr/include/linux/fcntl.h /usr/include/time.h /usr/include/sys/stat.h \
- /usr/include/linux/stat.h /usr/include/linux/fs.h /usr/include/linux/linkage.h \
- /usr/include/linux/limits.h /usr/include/linux/wait.h /usr/include/linux/dirent.h \
- /usr/include/linux/vfs.h /usr/include/linux/net.h /usr/include/linux/socket.h \
- /usr/include/linux/sockios.h /usr/include/linux/pipe_fs_i.h /usr/include/linux/minix_fs_i.h \
- /usr/include/linux/ext_fs_i.h /usr/include/linux/ext2_fs_i.h /usr/include/linux/hpfs_fs_i.h \
- /usr/include/linux/msdos_fs_i.h /usr/include/linux/iso_fs_i.h /usr/include/linux/nfs_fs_i.h \
- /usr/include/linux/nfs.h /usr/include/linux/xia_fs_i.h /usr/include/linux/sysv_fs_i.h \
- /usr/include/linux/minix_fs_sb.h /usr/include/linux/ext_fs_sb.h /usr/include/linux/ext2_fs_sb.h \
- /usr/include/linux/hpfs_fs_sb.h /usr/include/linux/msdos_fs_sb.h /usr/include/linux/iso_fs_sb.h \
- /usr/include/linux/nfs_fs_sb.h /usr/include/linux/xia_fs_sb.h /usr/include/linux/sysv_fs_sb.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/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 \
+ /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/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/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 \
/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/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/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
+ /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
diff --git a/lib/ext2fs/ChangeLog b/lib/ext2fs/ChangeLog
new file mode 100644
index 0000000..5fd3bfe
--- /dev/null
+++ b/lib/ext2fs/ChangeLog
@@ -0,0 +1,155 @@
+Sat Mar 11 14:07:11 1995 Theodore Y. Ts'o <tytso@localhost>
+
+ * llseek.c (ext2_llseek): Added error checking to the llseek()
+ compat code to protect against overflow. This only
+ applies to 1.0 and early 1.1 kernels, which don't support
+ the llseek() system call.
+
+Thu Nov 24 16:29:00 1994 Theodore Y. Ts'o (tytso@rt-11)
+
+ * unix_io.c (unix_open): Initialize the read_error and write_error
+ io_channel pointers to be null.
+
+ * bb_inode.c (clear_bad_block_proc): If an illegal block number is
+ found, clear it but don't try to update the filesystem
+ accounting information, since that's hopeless anyway.
+
+ * block.c (bloblock_iterate_ind, bloblock_iterate_dind,
+ bloblock_iterate_tind): Check to see if the indirect blocks are
+ valid before trying to read them.
+
+ * ext2_err.et (EXT2_ET_BAD_IND_BLOCK, EX2_ET_BAD_DIND_BLOCK,
+ EXT2_ET_BAD_TIND_BLOCK): Add new error codes.
+
+ * bitops.h (ext2fs_mark_block_bitmap, ext2fs_unmark_block_bitmap,
+ ext2fs_test_block_bitmap, ext2fs_mark_inode_bitmap,
+ ext2fs_unmark_inode_bitmap, ext2fs_test_inode_bitmap): If an
+ illegal block or inode number is passed in, return instead
+ of trying to test, set, or clear the bit.
+
+Mon Nov 7 21:32:33 1994 Remy Card <card@bbj>
+
+ * Makefile: Added a dummy install target in case shared libraries
+ are not built.
+
+Mon Oct 24 14:11:44 1994 (tytso@rsx-11)
+
+ * bitmaps.c (ext2fs_allocate_block_bitmap): Fix calculation of how
+ the real last block of the bitmap should be calculated.
+
+Wed Sep 7 10:05:36 1994 (tytso@rsx-11)
+
+ * bitmaps.c (ext2fs_fudge_inode_bitmap_end,
+ ext2fs_fudge_block_bitmap_end, ext2fs_clear_inode_bitmap,
+ ext2fs_clear_block_bitmap, ext2fs_free_inode_bitmap,
+ ext2fs_free_block_bitmap): Add magic number checking for
+ the inode and block bitmaps.
+
+ * bitmaps.c (ext2fs_allocate_block_bitmap): Fix to set the correct
+ magic number for a block bitmap instead of an inode bitmap.
+
+ * inode.c (ext2fs_close_inode_scan, ext2fs_get_next_inode): Add
+ magic number checking for the inode_scan structure.
+
+ * badblocks.c (badblocks_list_free, badblocks_list_add,
+ badblocks_list_test, badblocks_list_iterate_begin,
+ badblocks_list_iterate, badblocks_list_iterate_end): Add
+ magic number checking for the badblocks_list and
+ badblocks_iterate structures.
+
+ * ext2_err.et (EXT2_ET_MAGIC_UNIX_IO_CHANNEL):
+ * unix_io.c (unix_open, unix_close, unix_set_blksize, unix_read_blk,
+ unix_write_blk, unix_flush): Add magic number checking
+ both for io_channel structure and unix_private_data
+ structure.
+
+ * openfs.c (ext2fs_open): Add check for io_manager structure's
+ magic number.
+
+ * rw_bitmaps.c (ext2fs_write_inode_bitmap, ext2fs_write_block_bitmap,
+ ext2fs_read_inode_bitmap, ext2fs_read_block_bitmap,
+ ext2fs_read_bitmaps, ext2fs_write_bitmaps):
+ * read_bb.c (ext2fs_read_bb_inode):
+ * read_bb_file.c (ext2fs_read_bb_FILE):
+ * newdir.c (ext2fs_new_dir_block):
+ * namei.c (ext2fs_dir_iterate, ext2fs_lookup, ext2fs_namei):
+ * link.c (ext2fs_link, ext2fs_unlink):
+ * inode.c (ext2fs_open_inode_scan, ext2fs_read_inode,
+ ext2fs_write_inode, ext2fs_get_blocks,
+ ext2fs_check_directory):
+ * get_pathname.c (ext2fs_get_pathname):
+ * expanddir.c (ext2fs_expand_dir):
+ * block.c (ext2fs_block_iterate):
+ * bitmaps.c (ext2fs_allocate_inode_bitmap,
+ ext2fs_allocate_block_bitmap):
+ * bb_inode.c (ext2fs_update_bb_inode):
+ * alloc.c (ext2fs_new_inode,ext2fs_new_block,ext2fs_get_free_blocks):
+ * check_desc.c (ext2fs_check_desc):
+ * closefs.c (ext2fs_close, ext2fs_flush):
+ * freefs.c (ext2fs_free): Add check for ext2_filsys magic number.
+
+ * Makefile:
+ * ext2fs.h:
+ * openfs.c:
+ * check_desc.c (ext2fs_check_desc): Move ext2fs_check_desc from
+ openfs.c into its own file.
+
+ * ext2fs.h (EXT2_CHECK_MAGIC): Added macro for checking for
+ structure magic numbers.
+
+ * closefs.c (ext2fs_flush): Folded in Remy Card's changes to clear
+ the EXT2_VALID_FS flag in the backup superblock blocks, so that if
+ someone uses the -b option to specify the use of the backup
+ superblock --- this usually means that the main superblock is
+ toast. :-)
+
+ * ext2fs.h:
+ * ext2_err.et (EXT2_ET_REV_TOO_HIGH):
+ * openfs.c (ext2fs_open): Folded in Remy Card's changes to add a
+ revision level to the superblock.
+
+Sun Aug 21 00:50:08 1994 Theodore Y. Ts'o (tytso@rt-11)
+
+ * ext2fs.h:
+ * bitmaps.c:
+ * bitops.c
+ * bitops.h:
+ * openfs.c:
+ * initialize.c: Completely revamped the inode and block bitmap
+ structures, so that they can be better chance of being extensible
+ in a shared library. They are now their own type, instead of
+ being a char *. Also, the function signatures of
+ ext2fs_test_block_bitmap, ext2fs_mark_block_bitmap,
+ ext2fs_unmark_block_bitmap, ext2fs_test_inode_bitmap,
+ ext2fs_mark_inode_bitmap, and ext2fs_unmark_inode_bitmap were
+ changed to eliminate the ext2_filsys argument, since it is no
+ longer necessary.
+
+Wed Aug 17 21:46:44 1994 Remy Card (card@bbj)
+
+ * unix_io.c (unix_read_blk and unix_write_blk): use the llseek
+ system call if available.
+
+ * llseek.c: new file. This is the stub calling the llseek system
+ call which allows supports for 2GB+ file systems.
+
+ * initialize.c (ext2fs_initialize): Ext2fs_initialize now stores
+ the creator operating system.
+
+Wed Aug 17 10:03:24 1994 Theodore Y. Ts'o (tytso@rt-11)
+
+ * initialize.c (ext2fs_initialize): Ext2fs_initialize now sets up
+ the group descriptor statistics in addition to everything else.
+ This relieves mke2fs of the responsibility of doing it.
+
+ * bitops.c, bitops.h: Add assembly inline functions for the 68000.
+ Added a new #define, _EXT2_HAVE_ASM_BITOPS_ to control whether or
+ not the generic C function equivalents should be included or not.
+
+ * openfs.c (ext2fs_open): If a superblock is specified, then use
+ the backup group descriptors that go along with this superblock,
+ instead of using the primary group descriptors. This allows
+ e2fsck to recover filesystems where the primary group descriptors
+ have been trashed.
+
+
diff --git a/lib/ext2fs/MAKELOG b/lib/ext2fs/MAKELOG
new file mode 100644
index 0000000..bb85c24
--- /dev/null
+++ b/lib/ext2fs/MAKELOG
@@ -0,0 +1,54 @@
+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
index 82c7280..5f991cf 100644
--- a/lib/ext2fs/Makefile
+++ b/lib/ext2fs/Makefile
@@ -1,32 +1,54 @@
+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)
-ARCHIVE=ar r
-RANLIB=ranlib
RM=rm -f
MV=mv
LN=ln -s
-OBJS= ext2_err.o openfs.o freefs.o closefs.o bitmaps.o inode.o unix_io.o \
- block.o namei.o newdir.o mkdir.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
-
-HFILES= bitops.h ext2_err.h ext2fs.h io.h
-
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
-
-all: libext2fs.a libext2fs_p.a
+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
@@ -55,23 +77,28 @@
ext2_err.c ext2_err.h: ext2_err.et
$(COMPILE_ET) ext2_err.et
-install:: all
- $(INSTALLLIB) libext2fs.a ${DESTDIR}$(LIBDIR)/libext2fs.a
- $(CHMOD) 644 ${DESTDIR}$(LIBDIR)/libext2fs.a
- $(RANLIB) ${DESTDIR}$(LIBDIR)/libext2fs.a
- $(CHMOD) $(LIBMODE) ${DESTDIR}$(LIBDIR)/libext2fs.a
+install-libs:: all
+ $(INSTALLLIB) libext2fs.a $(LIBDIR)/libext2fs.a
+ $(CHMOD) 644 $(LIBDIR)/libext2fs.a
+ $(RANLIB) $(LIBDIR)/libext2fs.a
+ $(CHMOD) $(LIBMODE) $(LIBDIR)/libext2fs.a
-install:: $(HFILES)
- @rm -rf ${DESTDIR}$(INCLDIR)/ext2fs
- @mkdir ${DESTDIR}$(INCLDIR)/ext2fs
+install-libs:: $(HFILES)
+ @rm -rf $(INCLDIR)/ext2fs
+ @mkdir $(INCLDIR)/ext2fs
for i in $(HFILES); do \
- $(INSTALLINC) $$i ${DESTDIR}$(INCLDIR)/ext2fs/$$i; \
+ $(INSTALLINC) $$i $(INCLDIR)/ext2fs/$$i; \
done
-clean:
- rm -f \#* *.s *.o *.a *~ *.bak core profiled/* checker/*
+install-tree::
-really-clean: clean
+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
diff --git a/lib/ext2fs/alloc.c b/lib/ext2fs/alloc.c
index c456ad1..26c0111 100644
--- a/lib/ext2fs/alloc.c
+++ b/lib/ext2fs/alloc.c
@@ -12,7 +12,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -23,13 +22,15 @@
*
* Should have a special policy for directories.
*/
-errcode_t ext2fs_new_inode(ext2_filsys fs, ino_t dir, int mode, char *map,
- ino_t *ret)
+errcode_t ext2fs_new_inode(ext2_filsys fs, ino_t dir, int mode,
+ ext2fs_inode_bitmap map, ino_t *ret)
{
int dir_group = 0;
ino_t i;
ino_t start_inode;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (!map)
map = fs->inode_map;
if (!map)
@@ -44,14 +45,14 @@
i = EXT2_FIRST_INO;
do {
- if (!ext2fs_test_inode_bitmap(fs, map, i))
+ if (!ext2fs_test_inode_bitmap(map, i))
break;
i++;
if (i > fs->super->s_inodes_count)
i = EXT2_FIRST_INO;
} while (i != start_inode);
- if (ext2fs_test_inode_bitmap(fs, map, i))
+ if (ext2fs_test_inode_bitmap(map, i))
return ENOSPC;
*ret = i;
return 0;
@@ -61,10 +62,13 @@
* Stupid algorithm --- we now just search forward starting from the
* goal. Should put in a smarter one someday....
*/
-errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal, char *map, blk_t *ret)
+errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal,
+ ext2fs_block_bitmap map, blk_t *ret)
{
blk_t i = goal;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (!map)
map = fs->block_map;
if (!map)
@@ -72,7 +76,7 @@
if (!i)
i = fs->super->s_first_data_block;
do {
- if (!ext2fs_test_block_bitmap(fs, map, i)) {
+ if (!ext2fs_test_block_bitmap(map, i)) {
*ret = i;
return 0;
}
@@ -83,24 +87,27 @@
return ENOSPC;
}
-static int check_blocks_free(ext2_filsys fs, char *map, blk_t blk, int num)
+static int check_blocks_free(ext2_filsys fs, ext2fs_block_bitmap map,
+ blk_t blk, int num)
{
int i;
for (i=0; i < num; i++) {
if ((blk+i) > fs->super->s_blocks_count)
return 0;
- if (ext2fs_test_block_bitmap(fs, map, blk+i))
+ if (ext2fs_test_block_bitmap(map, blk+i))
return 0;
}
return 1;
}
errcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start, blk_t finish,
- int num, char *map, blk_t *ret)
+ int num, ext2fs_block_bitmap map, blk_t *ret)
{
blk_t b = start;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (!map)
map = fs->block_map;
if (!map)
diff --git a/lib/ext2fs/badblocks.c b/lib/ext2fs/badblocks.c
index 5e8cd43..8a40501 100644
--- a/lib/ext2fs/badblocks.c
+++ b/lib/ext2fs/badblocks.c
@@ -14,7 +14,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -30,6 +29,7 @@
if (!bb)
return ENOMEM;
memset(bb, 0, sizeof(struct struct_badblocks_list));
+ bb->magic = EXT2_ET_MAGIC_BADBLOCKS_LIST;
bb->size = size ? size : 10;
bb->list = malloc(bb->size * sizeof(blk_t));
if (!bb->list) {
@@ -45,6 +45,9 @@
*/
void badblocks_list_free(badblocks_list bb)
{
+ if (bb->magic != EXT2_ET_MAGIC_BADBLOCKS_LIST)
+ return;
+
if (bb->list)
free(bb->list);
bb->list = 0;
@@ -58,6 +61,8 @@
{
int i;
+ EXT2_CHECK_MAGIC(bb, EXT2_ET_MAGIC_BADBLOCKS_LIST);
+
for (i=0; i < bb->num; i++)
if (bb->list[i] == blk)
return 0;
@@ -84,6 +89,8 @@
{
int i;
+ EXT2_CHECK_MAGIC(bb, EXT2_ET_MAGIC_BADBLOCKS_LIST);
+
for (i=0; i < bb->num; i++)
if (bb->list[i] == blk)
return 1;
@@ -96,10 +103,13 @@
{
badblocks_iterate iter;
+ EXT2_CHECK_MAGIC(bb, EXT2_ET_MAGIC_BADBLOCKS_LIST);
+
iter = malloc(sizeof(struct struct_badblocks_iterate));
if (!iter)
return ENOMEM;
+ iter->magic = EXT2_ET_MAGIC_BADBLOCKS_ITERATE;
iter->bb = bb;
iter->ptr = 0;
*ret = iter;
@@ -108,7 +118,15 @@
int badblocks_list_iterate(badblocks_iterate iter, blk_t *blk)
{
- badblocks_list bb = iter->bb;
+ badblocks_list bb;
+
+ if (iter->magic != EXT2_ET_MAGIC_BADBLOCKS_ITERATE)
+ return 0;
+
+ bb = iter->bb;
+
+ if (bb->magic != EXT2_ET_MAGIC_BADBLOCKS_LIST)
+ return 0;
if (iter->ptr < bb->num) {
*blk = bb->list[iter->ptr++];
@@ -120,6 +138,9 @@
void badblocks_list_iterate_end(badblocks_iterate iter)
{
+ if (!iter || (iter->magic != EXT2_ET_MAGIC_BADBLOCKS_ITERATE))
+ return;
+
iter->bb = 0;
free(iter);
}
diff --git a/lib/ext2fs/bb_inode.c b/lib/ext2fs/bb_inode.c
index d345f1d..2b0ea9f 100644
--- a/lib/ext2fs/bb_inode.c
+++ b/lib/ext2fs/bb_inode.c
@@ -18,7 +18,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -48,7 +47,10 @@
errcode_t retval;
struct set_badblock_record rec;
struct ext2_inode inode;
+ blk_t blk;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (!fs->block_map)
return EXT2_ET_NO_BLOCK_BITMAP;
@@ -70,7 +72,8 @@
/*
* First clear the old bad blocks (while saving the indirect blocks)
*/
- retval = ext2fs_block_iterate(fs, EXT2_BAD_INO, 0, 0,
+ retval = ext2fs_block_iterate(fs, EXT2_BAD_INO,
+ BLOCK_FLAG_DEPTH_TRAVERSE, 0,
clear_bad_block_proc, &rec);
if (retval)
goto cleanup;
@@ -81,11 +84,24 @@
/*
* Now set the bad blocks!
+ *
+ * First, mark the bad blocks as used. This prevents a bad
+ * block from being used as an indirecto block for the bad
+ * block inode (!).
*/
if (bb_list) {
retval = badblocks_list_iterate_begin(bb_list, &rec.bb_iter);
if (retval)
goto cleanup;
+ while (badblocks_list_iterate(rec.bb_iter, &blk)) {
+ ext2fs_mark_block_bitmap(fs->block_map, blk);
+ }
+ badblocks_list_iterate_end(rec.bb_iter);
+ ext2fs_mark_bb_dirty(fs);
+
+ retval = badblocks_list_iterate_begin(bb_list, &rec.bb_iter);
+ if (retval)
+ goto cleanup;
retval = ext2fs_block_iterate(fs, EXT2_BAD_INO,
BLOCK_FLAG_APPEND, 0,
set_bad_block_proc, &rec);
@@ -138,6 +154,15 @@
if (!*block_nr)
return 0;
+ /*
+ * If the block number is outrageous, clear it and ignore it.
+ */
+ if (*block_nr >= fs->super->s_blocks_count ||
+ *block_nr < fs->super->s_first_data_block) {
+ *block_nr = 0;
+ return BLOCK_CHANGED;
+ }
+
if (blockcnt < 0) {
if (rec->ind_blocks_size >= rec->max_ind_blocks) {
rec->max_ind_blocks += 10;
@@ -155,7 +180,7 @@
/*
* Mark the block as unused, and update accounting information
*/
- ext2fs_unmark_block_bitmap(fs, fs->block_map, *block_nr);
+ ext2fs_unmark_block_bitmap(fs->block_map, *block_nr);
ext2fs_mark_bb_dirty(fs);
group = ext2fs_group_of_blk(fs, *block_nr);
fs->group_desc[group].bg_free_blocks_count++;
@@ -188,34 +213,38 @@
if (!badblocks_list_iterate(rec->bb_iter, &blk))
return BLOCK_ABORT;
rec->bad_block_count++;
- } else if (rec->ind_blocks_ptr < rec->ind_blocks_size)
+ } else {
/*
* An indirect block; fetch a block from the
- * previously used indirect block list.
+ * previously used indirect block list. The block
+ * most be not marked as used; if so, get another one.
+ * If we run out of reserved indirect blocks, allocate
+ * a new one.
*/
- blk = rec->ind_blocks[rec->ind_blocks_ptr++];
- else {
- /*
- * An indirect block, and we're out of reserved
- * indirect blocks. Allocate a new one.
- */
- retval = ext2fs_new_block(fs, 0, 0, &blk);
- if (retval) {
- rec->err = retval;
- return BLOCK_ABORT;
+ retry:
+ if (rec->ind_blocks_ptr < rec->ind_blocks_size) {
+ blk = rec->ind_blocks[rec->ind_blocks_ptr++];
+ if (ext2fs_test_block_bitmap(fs->block_map, blk))
+ goto retry;
+ } else {
+ retval = ext2fs_new_block(fs, 0, 0, &blk);
+ if (retval) {
+ rec->err = retval;
+ return BLOCK_ABORT;
+ }
}
retval = io_channel_write_blk(fs->io, blk, 1, rec->block_buf);
if (retval) {
rec->err = retval;
return BLOCK_ABORT;
}
+ ext2fs_mark_block_bitmap(fs->block_map, blk);
+ ext2fs_mark_bb_dirty(fs);
}
/*
- * Mark the block as used, and update block counts
+ * Update block counts
*/
- ext2fs_mark_block_bitmap(fs, fs->block_map, blk);
- ext2fs_mark_bb_dirty(fs);
group = ext2fs_group_of_blk(fs, blk);
fs->group_desc[group].bg_free_blocks_count--;
fs->super->s_free_blocks_count--;
diff --git a/lib/ext2fs/bitmaps.c b/lib/ext2fs/bitmaps.c
index c12433a..8712e2d 100644
--- a/lib/ext2fs/bitmaps.c
+++ b/lib/ext2fs/bitmaps.c
@@ -15,244 +15,173 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include "ext2fs.h"
-errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs)
+errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs,
+ const char *descr,
+ ext2fs_inode_bitmap *ret)
{
- int i;
- int nbytes;
- errcode_t retval;
- char * inode_bitmap = fs->inode_map;
- char * bitmap_block = NULL;
-
- if (!(fs->flags & EXT2_FLAG_RW))
- return EXT2_ET_RO_FILSYS;
- if (!inode_bitmap)
- return 0;
- nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8;
- bitmap_block = malloc(fs->blocksize);
- if (!bitmap_block)
- return ENOMEM;
- memset(bitmap_block, 0xff, fs->blocksize);
- for (i = 0; i < fs->group_desc_count; i++) {
- memcpy(bitmap_block, inode_bitmap, nbytes);
- retval = io_channel_write_blk(fs->io,
- fs->group_desc[i].bg_inode_bitmap, 1,
- bitmap_block);
- if (retval)
- return EXT2_ET_INODE_BITMAP_WRITE;
- inode_bitmap += nbytes;
- }
- fs->flags |= EXT2_FLAG_CHANGED;
- fs->flags &= ~EXT2_FLAG_IB_DIRTY;
- free(bitmap_block);
- return 0;
-}
-
-errcode_t ext2fs_write_block_bitmap (ext2_filsys fs)
-{
- int i;
- int j;
- int nbytes;
- int nbits;
- errcode_t retval;
- char * block_bitmap = fs->block_map;
- char * bitmap_block = NULL;
-
- if (!(fs->flags & EXT2_FLAG_RW))
- return EXT2_ET_RO_FILSYS;
- if (!block_bitmap)
- return 0;
- nbytes = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
- bitmap_block = malloc(fs->blocksize);
- if (!bitmap_block)
- return ENOMEM;
- memset(bitmap_block, 0xff, fs->blocksize);
- for (i = 0; i < fs->group_desc_count; i++) {
- memcpy(bitmap_block, block_bitmap, nbytes);
- if (i == fs->group_desc_count - 1) {
- /* Force bitmap padding for the last group */
- nbits = (fs->super->s_blocks_count
- - fs->super->s_first_data_block)
- % EXT2_BLOCKS_PER_GROUP(fs->super);
- for (j = nbits; j < fs->blocksize * 8; j++)
- set_bit(j, bitmap_block);
- }
- retval = io_channel_write_blk(fs->io,
- fs->group_desc[i].bg_block_bitmap, 1,
- bitmap_block);
- if (retval)
- return EXT2_ET_BLOCK_BITMAP_WRITE;
- block_bitmap += nbytes;
- }
- fs->flags |= EXT2_FLAG_CHANGED;
- fs->flags &= ~EXT2_FLAG_BB_DIRTY;
- free(bitmap_block);
- return 0;
-}
-
-errcode_t ext2fs_read_inode_bitmap (ext2_filsys fs)
-{
- int i;
- char * inode_bitmap;
- char *buf = 0;
- errcode_t retval;
- int nbytes;
-
- fs->write_bitmaps = ext2fs_write_bitmaps;
-
- if (fs->inode_map)
- free(fs->inode_map);
- nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8;
- fs->flags &= ~EXT2_FLAG_IB_DIRTY;
- fs->inode_map = malloc((nbytes * fs->group_desc_count) + 1);
- if (!fs->inode_map)
- return ENOMEM;
- inode_bitmap = fs->inode_map;
-
- buf = malloc(fs->blocksize);
- if (!buf)
- return ENOMEM;
-
- for (i = 0; i < fs->group_desc_count; i++) {
- retval = io_channel_read_blk(fs->io,
- fs->group_desc[i].bg_inode_bitmap, 1,
- buf);
- if (retval) {
- retval = EXT2_ET_INODE_BITMAP_READ;
- goto cleanup;
- }
- memcpy(inode_bitmap, buf, nbytes);
- inode_bitmap += nbytes;
- }
- free(buf);
- return 0;
-
-cleanup:
- free(fs->inode_map);
- fs->inode_map = 0;
- if (buf)
- free(buf);
- return retval;
-}
-
-errcode_t ext2fs_read_block_bitmap(ext2_filsys fs)
-{
- int i;
- char * block_bitmap;
- char *buf = 0;
- errcode_t retval;
- int nbytes;
-
- fs->write_bitmaps = ext2fs_write_bitmaps;
-
- if (fs->block_map)
- free(fs->block_map);
- nbytes = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
- fs->flags &= ~EXT2_FLAG_BB_DIRTY;
- fs->block_map = malloc((nbytes * fs->group_desc_count) + 1);
- if (!fs->block_map)
- return ENOMEM;
- block_bitmap = fs->block_map;
-
- buf = malloc(fs->blocksize);
- if (!buf)
- return ENOMEM;
-
- for (i = 0; i < fs->group_desc_count; i++) {
- retval = io_channel_read_blk(fs->io,
- fs->group_desc[i].bg_block_bitmap, 1,
- buf);
- if (retval) {
- retval = EXT2_ET_BLOCK_BITMAP_READ;
- goto cleanup;
- }
- memcpy(block_bitmap, buf, nbytes);
- block_bitmap += nbytes;
- }
- free(buf);
- return 0;
-
-cleanup:
- free(fs->block_map);
- fs->block_map = 0;
- if (buf)
- free(buf);
- return retval;
-}
-
-errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs, char **ret)
-{
- char *map;
- int size;
-
- fs->write_bitmaps = ext2fs_write_bitmaps;
-
- size = (fs->super->s_inodes_count / 8) + 1;
- map = malloc(size);
- if (!map)
- return ENOMEM;
- memset(map, 0, size);
- *ret = map;
- return 0;
-}
-
-errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs, char **ret)
-{
- char *map;
+ ext2fs_inode_bitmap bitmap;
int size;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
fs->write_bitmaps = ext2fs_write_bitmaps;
-
- size = (fs->super->s_blocks_count / 8) + 1;
- map = malloc(size);
- if (!map)
+
+ bitmap = malloc(sizeof(struct ext2fs_struct_inode_bitmap));
+ if (!bitmap)
return ENOMEM;
- memset(map, 0, size);
- *ret = map;
+
+ bitmap->magic = EXT2_ET_MAGIC_INODE_BITMAP;
+ bitmap->fs = fs;
+ bitmap->start = 1;
+ bitmap->end = fs->super->s_inodes_count;
+ bitmap->real_end = (EXT2_INODES_PER_GROUP(fs->super)
+ * fs->group_desc_count);
+ if (descr) {
+ bitmap->description = malloc(strlen(descr)+1);
+ if (!bitmap->description) {
+ free(bitmap);
+ return ENOMEM;
+ }
+ strcpy(bitmap->description, descr);
+ } else
+ bitmap->description = 0;
+
+ size = ((bitmap->real_end - bitmap->start) / 8) + 1;
+ bitmap->bitmap = malloc(size);
+ if (!bitmap->bitmap) {
+ free(bitmap->description);
+ free(bitmap);
+ return ENOMEM;
+ }
+
+ memset(bitmap->bitmap, 0, size);
+ *ret = bitmap;
return 0;
}
-errcode_t ext2fs_read_bitmaps(ext2_filsys fs)
+errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs,
+ const char *descr,
+ ext2fs_block_bitmap *ret)
{
- errcode_t retval;
+ ext2fs_block_bitmap bitmap;
+ int size;
+
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
fs->write_bitmaps = ext2fs_write_bitmaps;
- if (!fs->inode_map) {
- retval = ext2fs_read_inode_bitmap(fs);
- if (retval)
- return retval;
+ bitmap = malloc(sizeof(struct ext2fs_struct_inode_bitmap));
+ if (!bitmap)
+ return ENOMEM;
+
+ bitmap->magic = EXT2_ET_MAGIC_BLOCK_BITMAP;
+ bitmap->fs = fs;
+ bitmap->start = fs->super->s_first_data_block;
+ bitmap->end = fs->super->s_blocks_count-1;
+ bitmap->real_end = (EXT2_BLOCKS_PER_GROUP(fs->super)
+ * fs->group_desc_count)-1 + bitmap->start;
+ if (descr) {
+ bitmap->description = malloc(strlen(descr)+1);
+ if (!bitmap->description) {
+ free(bitmap);
+ return ENOMEM;
+ }
+ strcpy(bitmap->description, descr);
+ } else
+ bitmap->description = 0;
+
+ size = ((bitmap->real_end - bitmap->start) / 8) + 1;
+ bitmap->bitmap = malloc(size);
+ if (!bitmap->bitmap) {
+ free(bitmap->description);
+ free(bitmap);
+ return ENOMEM;
}
- if (!fs->block_map) {
- retval = ext2fs_read_block_bitmap(fs);
- if (retval)
- return retval;
- }
+
+ memset(bitmap->bitmap, 0, size);
+ *ret = bitmap;
return 0;
}
-errcode_t ext2fs_write_bitmaps(ext2_filsys fs)
+errcode_t ext2fs_fudge_inode_bitmap_end(ext2fs_inode_bitmap bitmap,
+ ino_t end, ino_t *oend)
{
- errcode_t retval;
-
- if (fs->block_map && ext2fs_test_bb_dirty(fs)) {
- retval = ext2fs_write_block_bitmap(fs);
- if (retval)
- return retval;
- }
- if (fs->inode_map && ext2fs_test_ib_dirty(fs)) {
- retval = ext2fs_write_inode_bitmap(fs);
- if (retval)
- return retval;
- }
+ EXT2_CHECK_MAGIC(bitmap, EXT2_ET_MAGIC_INODE_BITMAP);
+
+ if (end > bitmap->real_end)
+ return EXT2_ET_FUDGE_INODE_BITMAP_END;
+ if (oend)
+ *oend = bitmap->end;
+ bitmap->end = end;
return 0;
-}
+}
+errcode_t ext2fs_fudge_block_bitmap_end(ext2fs_block_bitmap bitmap,
+ blk_t end, blk_t *oend)
+{
+ EXT2_CHECK_MAGIC(bitmap, EXT2_ET_MAGIC_BLOCK_BITMAP);
+
+ if (end > bitmap->real_end)
+ return EXT2_ET_FUDGE_BLOCK_BITMAP_END;
+ if (oend)
+ *oend = bitmap->end;
+ bitmap->end = end;
+ return 0;
+}
+void ext2fs_clear_inode_bitmap(ext2fs_inode_bitmap bitmap)
+{
+ if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_INODE_BITMAP))
+ return;
+ memset(bitmap->bitmap, 0,
+ ((bitmap->real_end - bitmap->start) / 8) + 1);
+}
+void ext2fs_clear_block_bitmap(ext2fs_block_bitmap bitmap)
+{
+ if (!bitmap || (bitmap->magic != EXT2_ET_MAGIC_BLOCK_BITMAP))
+ return;
+
+ memset(bitmap->bitmap, 0,
+ ((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 a53d8ee..c037199 100644
--- a/lib/ext2fs/bitops.c
+++ b/lib/ext2fs/bitops.c
@@ -10,12 +10,12 @@
#include <stdio.h>
#include <sys/types.h>
-#include <linux/fs.h>
+
#include <linux/ext2_fs.h>
#include "ext2fs.h"
-#if (!defined(__i386__) && !defined(__i486__) && !defined(__i586__))
+#ifndef _EXT2_HAVE_ASM_BITOPS_
/*
* For the benefit of those who are trying to port Linux to another
@@ -69,27 +69,14 @@
mask = 1 << (nr & 0x1f);
return ((mask & *ADDR) != 0);
}
-#endif /* !i386 */
+#endif /* !_EXT2_HAVE_ASM_BITOPS_ */
-/*
- * These are routines print warning messages; they are called by
- * inline routines.
- */
-const char *ext2fs_block_string = "block";
-const char *ext2fs_inode_string = "inode";
-const char *ext2fs_mark_string = "mark";
-const char *ext2fs_unmark_string = "unmark";
-const char *ext2fs_test_string = "test";
-
-void ext2fs_warn_bitmap(ext2_filsys fs, const char *op, const char *type,
- int arg)
+void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg,
+ const char *description)
{
- char func[80];
-
- sprintf(func, "ext2fs_%s_%s_bitmap", op, type);
- com_err(func, 0, "INTERNAL ERROR: illegal %s #%d for %s",
- type, arg, fs->device_name);
+ if (description)
+ com_err(0, errcode, "#%u for %s", arg, description);
+ else
+ com_err(0, errcode, "#%u", arg);
}
-
-
diff --git a/lib/ext2fs/bitops.h b/lib/ext2fs/bitops.h
index c01cc86..87e7d79 100644
--- a/lib/ext2fs/bitops.h
+++ b/lib/ext2fs/bitops.h
@@ -22,19 +22,18 @@
extern const char *ext2fs_mark_string;
extern const char *ext2fs_unmark_string;
extern const char *ext2fs_test_string;
-extern void ext2fs_warn_bitmap(ext2_filsys fs, const char *op,
- const char *type, int arg);
+extern void ext2fs_warn_bitmap(errcode_t errcode, unsigned long arg,
+ const char *description);
-extern void ext2fs_mark_block_bitmap(ext2_filsys fs, char *bitmap, int block);
-extern void ext2fs_unmark_block_bitmap(ext2_filsys fs, char *bitmap,
- int block);
-extern int ext2fs_test_block_bitmap(ext2_filsys fs, const char *bitmap,
- int block);
-extern void ext2fs_mark_inode_bitmap(ext2_filsys fs, char *bitmap, int inode);
-extern void ext2fs_unmark_inode_bitmap(ext2_filsys fs, char *bitmap,
- int inode);
-extern int ext2fs_test_inode_bitmap(ext2_filsys fs, const char *bitmap,
- int inode);
+extern void ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
+extern void ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
+ blk_t block);
+extern int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap, blk_t block);
+
+extern void ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap, ino_t inode);
+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);
/*
* The inline routines themselves...
@@ -50,6 +49,9 @@
#endif
#if (defined(__i386__) || defined(__i486__) || defined(__i586__))
+
+#define _EXT2_HAVE_ASM_BITOPS_
+
/*
* These are done by inline assembly for speed reasons.....
*
@@ -99,73 +101,106 @@
#endif /* i386 */
-_INLINE_ void ext2fs_mark_block_bitmap(ext2_filsys fs, char *bitmap,
- int block)
+#ifdef __mc68000__
+
+#define _EXT2_HAVE_ASM_BITOPS_
+
+_INLINE_ int set_bit(int nr,void * addr)
{
- if ((block < fs->super->s_first_data_block) ||
- (block >= fs->super->s_blocks_count)) {
- ext2fs_warn_bitmap(fs, ext2fs_mark_string,
- ext2fs_block_string, block);
- return;
- }
- set_bit(block - fs->super->s_first_data_block, bitmap);
+ char retval;
+
+ __asm__ __volatile__ ("bfset %2@{%1:#1}; sne %0"
+ : "=d" (retval) : "d" (nr), "a" (addr));
+
+ return retval;
}
-_INLINE_ void ext2fs_unmark_block_bitmap(ext2_filsys fs, char *bitmap,
- int block)
+_INLINE_ int clear_bit(int nr, void * addr)
{
- if ((block < fs->super->s_first_data_block) ||
- (block >= fs->super->s_blocks_count)) {
- ext2fs_warn_bitmap(fs, ext2fs_unmark_string,
- ext2fs_block_string, block);
- return;
- }
- clear_bit(block - fs->super->s_first_data_block, bitmap);
+ char retval;
+
+ __asm__ __volatile__ ("bfclr %2@{%1:#1}; sne %0"
+ : "=d" (retval) : "d" (nr), "a" (addr));
+
+ return retval;
}
-_INLINE_ int ext2fs_test_block_bitmap(ext2_filsys fs, const char *bitmap,
- int block)
+_INLINE_ int test_bit(int nr, const void * addr)
{
- if ((block < fs->super->s_first_data_block) ||
- (block >= fs->super->s_blocks_count)) {
- ext2fs_warn_bitmap(fs, ext2fs_test_string,
- ext2fs_block_string, block);
+ char retval;
+
+ __asm__ __volatile__ ("bftst %2@{%1:#1}; sne %0"
+ : "=d" (retval) : "d" (nr), "a" (addr));
+
+ return retval;
+}
+
+#endif /* __mc68000__ */
+
+_INLINE_ void ext2fs_mark_block_bitmap(ext2fs_block_bitmap bitmap,
+ blk_t block)
+{
+ if ((block < bitmap->start) || (block > bitmap->end)) {
+ ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_MARK, block,
+ bitmap->description);
+ return;
+ }
+ set_bit(block - bitmap->start, bitmap->bitmap);
+}
+
+_INLINE_ void ext2fs_unmark_block_bitmap(ext2fs_block_bitmap bitmap,
+ blk_t block)
+{
+ if ((block < bitmap->start) || (block > bitmap->end)) {
+ ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_UNMARK,
+ block, bitmap->description);
+ return;
+ }
+ clear_bit(block - bitmap->start, bitmap->bitmap);
+}
+
+_INLINE_ int ext2fs_test_block_bitmap(ext2fs_block_bitmap bitmap,
+ blk_t block)
+{
+ if ((block < bitmap->start) || (block > bitmap->end)) {
+ ext2fs_warn_bitmap(EXT2_ET_BAD_BLOCK_TEST,
+ block, bitmap->description);
return 0;
}
- return test_bit(block - fs->super->s_first_data_block, bitmap);
+ return test_bit(block - bitmap->start, bitmap->bitmap);
}
-_INLINE_ void ext2fs_mark_inode_bitmap(ext2_filsys fs, char *bitmap,
- int inode)
+_INLINE_ void ext2fs_mark_inode_bitmap(ext2fs_inode_bitmap bitmap,
+ ino_t inode)
{
- if ((inode < 1) || (inode > fs->super->s_inodes_count)) {
- ext2fs_warn_bitmap(fs, ext2fs_mark_string,
- ext2fs_inode_string, inode);
+ if ((inode < bitmap->start) || (inode > bitmap->end)) {
+ ext2fs_warn_bitmap(EXT2_ET_BAD_INODE_MARK,
+ inode, bitmap->description);
return;
}
- set_bit(inode - 1, bitmap);
+ set_bit(inode - bitmap->start, bitmap->bitmap);
}
-_INLINE_ void ext2fs_unmark_inode_bitmap(ext2_filsys fs, char *bitmap,
- int inode)
+_INLINE_ void ext2fs_unmark_inode_bitmap(ext2fs_inode_bitmap bitmap,
+ ino_t inode)
{
- if ((inode < 1) || (inode > fs->super->s_inodes_count)) {
- ext2fs_warn_bitmap(fs, ext2fs_unmark_string,
- ext2fs_inode_string, inode);
+ if ((inode < bitmap->start) || (inode > bitmap->end)) {
+ ext2fs_warn_bitmap(EXT2_ET_BAD_INODE_UNMARK,
+ inode, bitmap->description);
return;
}
- clear_bit(inode - 1, bitmap);
+ clear_bit(inode - bitmap->start, bitmap->bitmap);
}
-_INLINE_ int ext2fs_test_inode_bitmap(ext2_filsys fs, const char *bitmap,
- int inode)
+_INLINE_ int ext2fs_test_inode_bitmap(ext2fs_inode_bitmap bitmap,
+ ino_t inode)
{
- if ((inode < 1) || (inode > fs->super->s_inodes_count)) {
- ext2fs_warn_bitmap(fs, ext2fs_test_string,
- ext2fs_inode_string, inode);
+ if ((inode < bitmap->start) || (inode > bitmap->end)) {
+ ext2fs_warn_bitmap(EXT2_ET_BAD_INODE_TEST,
+ inode, bitmap->description);
return 0;
}
- return test_bit(inode - 1, bitmap);
+ return test_bit(inode - bitmap->start, bitmap->bitmap);
}
#undef _INLINE_
diff --git a/lib/ext2fs/block.c b/lib/ext2fs/block.c
index d2c87ce..53c193c 100644
--- a/lib/ext2fs/block.c
+++ b/lib/ext2fs/block.c
@@ -9,7 +9,7 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
-#include <linux/fs.h>
+
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -40,6 +40,12 @@
ret = (*ctx->func)(ctx->fs, ind_block, -1, ctx->private);
if (!*ind_block || (ret & BLOCK_ABORT))
return ret;
+ if (*ind_block >= ctx->fs->super->s_blocks_count ||
+ *ind_block < ctx->fs->super->s_first_data_block) {
+ ctx->errcode = EXT2_ET_BAD_IND_BLOCK;
+ ret |= BLOCK_ERROR;
+ return ret;
+ }
ctx->errcode = io_channel_read_blk(ctx->fs->io, *ind_block,
1, ctx->ind_buf);
if (ctx->errcode) {
@@ -80,6 +86,12 @@
ret = (*ctx->func)(ctx->fs, dind_block, -2, ctx->private);
if (!*dind_block || (ret & BLOCK_ABORT))
return ret;
+ if (*dind_block >= ctx->fs->super->s_blocks_count ||
+ *dind_block < ctx->fs->super->s_first_data_block) {
+ ctx->errcode = EXT2_ET_BAD_DIND_BLOCK;
+ ret |= BLOCK_ERROR;
+ return ret;
+ }
ctx->errcode = io_channel_read_blk(ctx->fs->io, *dind_block,
1, ctx->dind_buf);
if (ctx->errcode) {
@@ -119,6 +131,12 @@
ret = (*ctx->func)(ctx->fs, tind_block, -3, ctx->private);
if (!*tind_block || (ret & BLOCK_ABORT))
return ret;
+ if (*tind_block >= ctx->fs->super->s_blocks_count ||
+ *tind_block < ctx->fs->super->s_first_data_block) {
+ ctx->errcode = EXT2_ET_BAD_TIND_BLOCK;
+ ret |= BLOCK_ERROR;
+ return ret;
+ }
ctx->errcode = io_channel_read_blk(ctx->fs->io, *tind_block,
1, ctx->tind_buf);
if (ctx->errcode) {
@@ -165,6 +183,8 @@
struct ext2_inode inode;
errcode_t retval;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
ret = ext2fs_get_blocks(fs, ino, blocks);
if (ret)
return ret;
diff --git a/lib/ext2fs/check_desc.c b/lib/ext2fs/check_desc.c
new file mode 100644
index 0000000..a8d5d95
--- /dev/null
+++ b/lib/ext2fs/check_desc.c
@@ -0,0 +1,63 @@
+/*
+ * check_desc.c --- Check the group descriptors of an ext2 filesystem
+ *
+ * Copyright (C) 1993, 1994 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>
+
+#include <linux/ext2_fs.h>
+
+#include "ext2fs.h"
+
+/*
+ * This routine sanity checks the group descriptors
+ */
+errcode_t ext2fs_check_desc(ext2_filsys fs)
+{
+ int i;
+ int block = fs->super->s_first_data_block;
+ int next, inode_blocks_per_group;
+
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
+ inode_blocks_per_group = fs->super->s_inodes_per_group /
+ EXT2_INODES_PER_BLOCK (fs->super);
+
+ for (i = 0; i < fs->group_desc_count; i++) {
+ next = block + fs->super->s_blocks_per_group;
+ /*
+ * Check to make sure block bitmap for group is
+ * located within the group.
+ */
+ if (fs->group_desc[i].bg_block_bitmap < block ||
+ fs->group_desc[i].bg_block_bitmap >= next)
+ return EXT2_ET_GDESC_BAD_BLOCK_MAP;
+ /*
+ * Check to make sure inode bitmap for group is
+ * located within the group
+ */
+ if (fs->group_desc[i].bg_inode_bitmap < block ||
+ fs->group_desc[i].bg_inode_bitmap >= next)
+ return EXT2_ET_GDESC_BAD_INODE_MAP;
+ /*
+ * Check to make sure inode table for group is located
+ * within the group
+ */
+ if (fs->group_desc[i].bg_inode_table < block ||
+ fs->group_desc[i].bg_inode_table+inode_blocks_per_group >=
+ next)
+ return EXT2_ET_GDESC_BAD_INODE_TABLE;
+
+ block = next;
+ }
+ return 0;
+}
diff --git a/lib/ext2fs/closefs.c b/lib/ext2fs/closefs.c
index d25f312..41a5052 100644
--- a/lib/ext2fs/closefs.c
+++ b/lib/ext2fs/closefs.c
@@ -10,7 +10,6 @@
#include <stdlib.h>
#include <time.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -21,7 +20,10 @@
int group_block;
errcode_t retval;
char *group_ptr;
+ unsigned long fs_state;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
/*
* Write out master superblock. This has to be done
* separately, since it is located at a fixed location
@@ -35,6 +37,13 @@
io_channel_set_blksize(fs->io, fs->blocksize);
/*
+ * Save the state of the FS and set it to non valid for the
+ * backup superblocks
+ */
+ fs_state = fs->super->s_state;
+ fs->super->s_state &= ~EXT2_VALID_FS;
+
+ /*
* Write out the master group descriptors, and the backup
* superblocks and group descriptors.
*/
@@ -44,21 +53,27 @@
retval = io_channel_write_blk(fs->io, group_block,
-SUPERBLOCK_SIZE,
fs->super);
- if (retval)
+ if (retval) {
+ fs->super->s_state = fs_state;
return retval;
+ }
}
group_ptr = (char *) fs->group_desc;
for (j=0; j < fs->desc_blocks; j++) {
retval = io_channel_write_blk(fs->io,
group_block+1+j, 1,
group_ptr);
- if (retval)
+ if (retval) {
+ fs->super->s_state = fs_state;
return retval;
+ }
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
@@ -78,6 +93,8 @@
{
errcode_t retval;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (fs->flags & EXT2_FLAG_DIRTY) {
retval = ext2fs_flush(fs);
if (retval)
diff --git a/lib/ext2fs/expanddir.c b/lib/ext2fs/expanddir.c
index 1bc3f49..5af9853 100644
--- a/lib/ext2fs/expanddir.c
+++ b/lib/ext2fs/expanddir.c
@@ -9,7 +9,7 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
-#include <linux/fs.h>
+
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -62,7 +62,7 @@
}
free(block);
*blocknr = new_blk;
- ext2fs_mark_block_bitmap(fs, fs->block_map, new_blk);
+ ext2fs_mark_block_bitmap(fs->block_map, new_blk);
ext2fs_mark_bb_dirty(fs);
group = ext2fs_group_of_blk(fs, new_blk);
fs->group_desc[group].bg_free_blocks_count--;
@@ -80,6 +80,8 @@
struct expand_dir_struct es;
struct ext2_inode inode;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (!(fs->flags & EXT2_FLAG_RW))
return EXT2_ET_RO_FILSYS;
diff --git a/lib/ext2fs/ext2_err.c b/lib/ext2fs/ext2_err.c
index 86bfcd3..f975949 100644
--- a/lib/ext2fs/ext2_err.c
+++ b/lib/ext2fs/ext2_err.c
@@ -10,8 +10,27 @@
#endif
static const char * const text[] = {
- "EXT2FS Library version 0.0",
+ "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",
@@ -39,6 +58,17 @@
"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
};
@@ -53,7 +83,7 @@
};
extern struct et_list *_et_list;
-static const struct error_table et = { text, 2133571328L, 29 };
+static const struct error_table et = { text, 2133571328L, 59 };
static struct et_list link = { 0, 0 };
diff --git a/lib/ext2fs/ext2_err.et b/lib/ext2fs/ext2_err.et
index 69eacda..f439f5a 100644
--- a/lib/ext2fs/ext2_err.et
+++ b/lib/ext2fs/ext2_err.et
@@ -1,15 +1,72 @@
#
-# Copyright (C) 1993 Theodore Ts'o. This file may be redistributed
+# Copyright (C) 1993, 1994 Theodore Ts'o. This file may be redistributed
# under the terms of the GNU Public License.
#
error_table ext2
ec EXT2_ET_BASE,
- "EXT2FS Library version 0.0"
+ "EXT2FS Library version 0.5b"
+
+ec EXT2_ET_MAGIC_EXT2FS_FILSYS,
+ "Wrong magic number for ext2_filsys structure"
+
+ec EXT2_ET_MAGIC_BADBLOCKS_LIST,
+ "Wrong magic number for badblocks_list structure"
+
+ec EXT2_ET_MAGIC_BADBLOCKS_ITERATE,
+ "Wrong magic number for badblocks_iterate structure"
+
+ec EXT2_ET_MAGIC_INODE_SCAN,
+ "Wrong magic number for inode_scan structure"
+
+ec EXT2_ET_MAGIC_IO_CHANNEL,
+ "Wrong magic number for io_channel structure"
+
+ec EXT2_ET_MAGIC_UNIX_IO_CHANNEL,
+ "Wrong magic number for unix io_channel structure"
+
+ec EXT2_ET_MAGIC_IO_MANAGER,
+ "Wrong magic number for io_manager structure"
+
+ec EXT2_ET_MAGIC_BLOCK_BITMAP,
+ "Wrong magic number for block_bitmap structure"
+
+ec EXT2_ET_MAGIC_INODE_BITMAP,
+ "Wrong magic number for inode_bitmap structure"
+
+ec EXT2_ET_MAGIC_RESERVED_1,
+ "Wrong magic number --- RESERVED_1"
+
+ec EXT2_ET_MAGIC_RESERVED_2,
+ "Wrong magic number --- RESERVED_2"
+
+ec EXT2_ET_MAGIC_RESERVED_3,
+ "Wrong magic number --- RESERVED_3"
+
+ec EXT2_ET_MAGIC_RESERVED_4,
+ "Wrong magic number --- RESERVED_4"
+
+ec EXT2_ET_MAGIC_RESERVED_5,
+ "Wrong magic number --- RESERVED_5"
+
+ec EXT2_ET_MAGIC_RESERVED_6,
+ "Wrong magic number --- RESERVED_6"
+
+ec EXT2_ET_MAGIC_RESERVED_7,
+ "Wrong magic number --- RESERVED_7"
+
+ec EXT2_ET_MAGIC_RESERVED_8,
+ "Wrong magic number --- RESERVED_8"
+
+ec EXT2_ET_MAGIC_RESERVED_9,
+ "Wrong magic number --- RESERVED_9"
ec EXT2_ET_BAD_MAGIC,
"Bad magic number in super-block"
+ec EXT2_ET_REV_TOO_HIGH,
+ "Filesystem revision too high"
+
ec EXT2_ET_SB_LSEEK,
"Can't seek to superblock"
@@ -91,5 +148,38 @@
ec EXT2_ET_TOOSMALL,
"Not enough space to build proposed filesystem"
+ec EXT2_ET_BAD_BLOCK_MARK,
+ "Illegal block number passed to ext2fs_mark_block_bitmap"
+
+ec EXT2_ET_BAD_BLOCK_UNMARK,
+ "Illegal block number passed to ext2fs_unmark_block_bitmap"
+
+ec EXT2_ET_BAD_BLOCK_TEST,
+ "Illegal block number passed to ext2fs_test_block_bitmap"
+
+ec EXT2_ET_BAD_INODE_MARK,
+ "Illegal inode number passed to ext2fs_mark_inode_bitmap"
+
+ec EXT2_ET_BAD_INODE_UNMARK,
+ "Illegal inode number passed to ext2fs_unmark_inode_bitmap"
+
+ec EXT2_ET_BAD_INODE_TEST,
+ "Illegal inode number passed to ext2fs_test_inode_bitmap"
+
+ec EXT2_ET_FUDGE_BLOCK_BITMAP_END,
+ "Attempt to fudge end of block bitmap past the real end"
+
+ec EXT2_ET_FUDGE_INODE_BITMAP_END,
+ "Attempt to fudge end of inode bitmap past the real end"
+
+ec EXT2_ET_BAD_IND_BLOCK,
+ "Illegal indirect block found"
+
+ec EXT2_ET_BAD_DIND_BLOCK,
+ "Illegal doubly indirect block found"
+
+ec EXT2_ET_BAD_TIND_BLOCK,
+ "Illegal triply indirect block found"
+
end
diff --git a/lib/ext2fs/ext2_err.h b/lib/ext2fs/ext2_err.h
index 1e72ced..0a93b1a 100644
--- a/lib/ext2fs/ext2_err.h
+++ b/lib/ext2fs/ext2_err.h
@@ -10,34 +10,64 @@
#endif
#define EXT2_ET_BASE (2133571328L)
-#define EXT2_ET_BAD_MAGIC (2133571329L)
-#define EXT2_ET_SB_LSEEK (2133571330L)
-#define EXT2_ET_SB_READ (2133571331L)
-#define EXT2_ET_SB_WRITE (2133571332L)
-#define EXT2_ET_RO_FILSYS (2133571333L)
-#define EXT2_ET_GDESC_READ (2133571334L)
-#define EXT2_ET_GDESC_WRITE (2133571335L)
-#define EXT2_ET_GDESC_BAD_BLOCK_MAP (2133571336L)
-#define EXT2_ET_GDESC_BAD_INODE_MAP (2133571337L)
-#define EXT2_ET_GDESC_BAD_INODE_TABLE (2133571338L)
-#define EXT2_ET_INODE_BITMAP_WRITE (2133571339L)
-#define EXT2_ET_INODE_BITMAP_READ (2133571340L)
-#define EXT2_ET_BLOCK_BITMAP_WRITE (2133571341L)
-#define EXT2_ET_BLOCK_BITMAP_READ (2133571342L)
-#define EXT2_ET_INODE_TABLE_WRITE (2133571343L)
-#define EXT2_ET_INODE_TABLE_READ (2133571344L)
-#define EXT2_ET_NEXT_INODE_READ (2133571345L)
-#define EXT2_ET_UNEXPECTED_BLOCK_SIZE (2133571346L)
-#define EXT2_ET_DIR_CORRUPTED (2133571347L)
-#define EXT2_ET_SHORT_READ (2133571348L)
-#define EXT2_ET_SHORT_WRITE (2133571349L)
-#define EXT2_ET_DIR_NO_SPACE (2133571350L)
-#define EXT2_ET_NO_INODE_BITMAP (2133571351L)
-#define EXT2_ET_NO_BLOCK_BITMAP (2133571352L)
-#define EXT2_ET_BAD_INODE_NUM (2133571353L)
-#define EXT2_ET_BAD_BLOCK_NUM (2133571354L)
-#define EXT2_ET_EXPAND_DIR_ERR (2133571355L)
-#define EXT2_ET_TOOSMALL (2133571356L)
+#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)
diff --git a/lib/ext2fs/ext2fs.h b/lib/ext2fs/ext2fs.h
index 998527a..672466b 100644
--- a/lib/ext2fs/ext2fs.h
+++ b/lib/ext2fs/ext2fs.h
@@ -15,6 +15,12 @@
#define SUPERBLOCK_OFFSET 1024
#define SUPERBLOCK_SIZE 1024
+/*
+ * The last ext2fs revision level that this version of the library is
+ * able to support.
+ */
+#define EXT2_LIB_CURRENT_REV 0
+
typedef unsigned long blk_t;
typedef unsigned int dgrp_t;
@@ -22,6 +28,32 @@
#include "ext2fs/io.h"
#include "ext2fs/ext2_err.h"
+typedef struct struct_ext2_filsys *ext2_filsys;
+
+struct ext2fs_struct_inode_bitmap {
+ int magic;
+ ext2_filsys fs;
+ ino_t start, end;
+ ino_t real_end;
+ char *description;
+ char *bitmap;
+ int reserved[8];
+};
+
+typedef struct ext2fs_struct_inode_bitmap *ext2fs_inode_bitmap;
+
+struct ext2fs_struct_block_bitmap {
+ int magic;
+ ext2_filsys fs;
+ blk_t start, end;
+ ino_t real_end;
+ char *description;
+ char *bitmap;
+ int reserved[8];
+};
+
+typedef struct ext2fs_struct_block_bitmap *ext2fs_block_bitmap;
+
/*
* Flags for the ext2_filsys structure
*/
@@ -33,9 +65,8 @@
#define EXT2_FLAG_IB_DIRTY 0x10
#define EXT2_FLAG_BB_DIRTY 0x20
-typedef struct struct_ext2_filsys *ext2_filsys;
-
struct struct_ext2_filsys {
+ int magic;
io_channel io;
int flags;
char * device_name;
@@ -46,11 +77,12 @@
unsigned long desc_blocks;
struct ext2_group_desc * group_desc;
int inode_blocks_per_group;
- char * inode_map;
- char * block_map;
+ ext2fs_inode_bitmap inode_map;
+ ext2fs_block_bitmap block_map;
errcode_t (*get_blocks)(ext2_filsys fs, ino_t ino, blk_t *blocks);
errcode_t (*check_directory)(ext2_filsys fs, ino_t ino);
errcode_t (*write_bitmaps)(ext2_filsys fs);
+ int reserved[16];
/*
* Not used by ext2fs library; reserved for the use of the
@@ -66,10 +98,12 @@
typedef struct struct_badblocks_list *badblocks_list;
struct struct_badblocks_list {
+ int magic;
int num;
int size;
blk_t *list;
int badblocks_flags;
+ int reserved[8];
};
#define BADBLOCKS_FLAG_DIRTY 1
@@ -77,12 +111,14 @@
typedef struct struct_badblocks_iterate *badblocks_iterate;
struct struct_badblocks_iterate {
+ int magic;
badblocks_list bb;
int ptr;
+ int reserved[8];
};
-
-#include "ext2fs/bitops.h"
+#include "ext2fs/bitops.h"
+
/*
* Return flags for the block iterator functions
*/
@@ -112,7 +148,10 @@
/*
* Inode scan definitions
*/
+typedef struct ext2_struct_inode_scan *ext2_inode_scan;
+
struct ext2_struct_inode_scan {
+ int magic;
ext2_filsys fs;
ino_t current_inode;
blk_t current_block;
@@ -121,21 +160,33 @@
int inode_buffer_blocks;
char * inode_buffer;
struct ext2_inode * inode_scan_ptr;
+ errcode_t (*done_group)(ext2_filsys fs,
+ ext2_inode_scan scan,
+ dgrp_t group,
+ void * private);
+ void * done_group_data;
+ int reserved[8];
};
-typedef struct ext2_struct_inode_scan *ext2_inode_scan;
+/*
+ * For checking structure magic numbers...
+ */
+#define EXT2_CHECK_MAGIC(struct, code) \
+ if ((struct)->magic != (code)) return (code)
+
/*
* function prototypes
*/
/* alloc.c */
extern errcode_t ext2fs_new_inode(ext2_filsys fs, ino_t dir, int mode,
- char *map, ino_t *ret);
+ ext2fs_inode_bitmap map, ino_t *ret);
extern errcode_t ext2fs_new_block(ext2_filsys fs, blk_t goal,
- char *map, blk_t *ret);
+ ext2fs_block_bitmap map, blk_t *ret);
extern errcode_t ext2fs_get_free_blocks(ext2_filsys fs, blk_t start,
- blk_t finish, int num, char *map,
+ blk_t finish, int num,
+ ext2fs_block_bitmap map,
blk_t *ret);
/* badblocks.c */
@@ -157,8 +208,20 @@
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);
-extern errcode_t ext2fs_allocate_inode_bitmap(ext2_filsys fs, char **ret);
-extern errcode_t ext2fs_allocate_block_bitmap(ext2_filsys fs, char **ret);
+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_read_bitmaps(ext2_filsys fs);
extern errcode_t ext2fs_write_bitmaps(ext2_filsys fs);
@@ -173,6 +236,9 @@
void *private),
void *private);
+/* check_desc.c */
+extern errcode_t ext2fs_check_desc(ext2_filsys fs);
+
/* closefs.c */
extern errcode_t ext2fs_close(ext2_filsys fs);
extern errcode_t ext2fs_flush(ext2_filsys fs);
@@ -194,6 +260,18 @@
extern void ext2fs_close_inode_scan(ext2_inode_scan scan);
extern errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ino_t *ino,
struct ext2_inode *inode);
+void ext2fs_set_inode_callback(ext2_inode_scan scan,
+ errcode_t (*done_group)(ext2_filsys fs,
+ ext2_inode_scan scan,
+ dgrp_t group,
+ void * private),
+ void *done_group_data);
+void ext2fs_set_inode_callback(ext2_inode_scan scan,
+ errcode_t (*done_group)(ext2_filsys fs,
+ ext2_inode_scan scan,
+ dgrp_t group,
+ void * private),
+ void *done_group_data);
extern errcode_t ext2fs_read_inode (ext2_filsys fs, unsigned long ino,
struct ext2_inode * inode);
extern errcode_t ext2fs_write_inode(ext2_filsys fs, unsigned long ino,
@@ -229,7 +307,6 @@
extern errcode_t ext2fs_open(const char *name, int flags, int superblock,
int block_size, io_manager manager,
ext2_filsys *ret_fs);
-extern errcode_t ext2fs_check_desc(ext2_filsys fs);
/* get_pathname.c */
extern errcode_t ext2fs_get_pathname(ext2_filsys fs, ino_t dir, ino_t ino,
diff --git a/lib/ext2fs/freefs.c b/lib/ext2fs/freefs.c
index ecd169a..d9d4fe9 100644
--- a/lib/ext2fs/freefs.c
+++ b/lib/ext2fs/freefs.c
@@ -9,14 +9,13 @@
#include <unistd.h>
#include <stdlib.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include "ext2fs.h"
void ext2fs_free(ext2_filsys fs)
{
- if (!fs)
+ if (!fs || (fs->magic != EXT2_ET_MAGIC_EXT2FS_FILSYS))
return;
if (fs->io) {
io_channel_close(fs->io);
diff --git a/lib/ext2fs/get_pathname.c b/lib/ext2fs/get_pathname.c
index 591af6d..a5db2e0 100644
--- a/lib/ext2fs/get_pathname.c
+++ b/lib/ext2fs/get_pathname.c
@@ -9,7 +9,7 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
-#include <linux/fs.h>
+
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -92,7 +92,11 @@
return 0;
}
- ret = malloc(strlen(parent_name)+strlen(gp.name)+2);
+ if (gp.name)
+ ret = malloc(strlen(parent_name)+strlen(gp.name)+2);
+ else
+ ret = malloc(strlen(parent_name)+5); /* strlen("???") + 2 */
+
if (!ret) {
retval = ENOMEM;
goto cleanup;
@@ -121,6 +125,8 @@
char *buf;
errcode_t retval;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
buf = malloc(fs->blocksize);
if (!buf)
return ENOMEM;
diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
index e7e07c4..22e7eaf 100644
--- a/lib/ext2fs/initialize.c
+++ b/lib/ext2fs/initialize.c
@@ -12,7 +12,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -29,6 +28,8 @@
int overhead = 0;
blk_t group_block;
int i, j;
+ int numblocks;
+ char *buf;
if (!param || !param->s_blocks_count)
return EINVAL;
@@ -38,6 +39,7 @@
return ENOMEM;
memset(fs, 0, sizeof(struct struct_ext2_filsys));
+ fs->magic = EXT2_ET_MAGIC_EXT2FS_FILSYS;
fs->flags = flags | EXT2_FLAG_RW;
retval = manager->open(name, IO_FLAG_RW, &fs->io);
if (retval)
@@ -70,6 +72,10 @@
set_field(s_checkinterval, EXT2_DFL_CHECKINTERVAL);
super->s_lastcheck = time(NULL);
+#ifdef EXT2_OS_LINUX
+ super->s_creator_os = EXT2_OS_LINUX;
+#endif
+
fs->blocksize = EXT2_BLOCK_SIZE(super);
fs->fragsize = EXT2_FRAG_SIZE(super);
frags_per_block = fs->blocksize / fs->fragsize;
@@ -78,10 +84,13 @@
super->s_frags_per_group = super->s_blocks_per_group * frags_per_block;
super->s_blocks_count = param->s_blocks_count;
+ super->s_r_blocks_count = param->s_r_blocks_count;
+ if (super->s_r_blocks_count >= param->s_blocks_count) {
+ retval = EINVAL;
+ goto cleanup;
+ }
retry:
- set_field(s_r_blocks_count, super->s_blocks_count/20); /* 5% default */
-
fs->group_desc_count = (super->s_blocks_count -
super->s_first_data_block +
EXT2_BLOCKS_PER_GROUP(super) - 1)
@@ -149,14 +158,24 @@
* count.
*/
- retval = ext2fs_allocate_block_bitmap(fs, &fs->block_map);
+ buf = malloc(strlen(fs->device_name) + 80);
+ if (!buf) {
+ retval = ENOMEM;
+ goto cleanup;
+ }
+
+ sprintf(buf, "block bitmap for %s", fs->device_name);
+ retval = ext2fs_allocate_block_bitmap(fs, buf, &fs->block_map);
if (retval)
goto cleanup;
- retval = ext2fs_allocate_inode_bitmap(fs, &fs->inode_map);
+ sprintf(buf, "inode bitmap for %s", fs->device_name);
+ retval = ext2fs_allocate_inode_bitmap(fs, 0, &fs->inode_map);
if (retval)
goto cleanup;
+ free(buf);
+
fs->group_desc = malloc(fs->desc_blocks * fs->blocksize);
if (!fs->group_desc) {
retval = ENOMEM;
@@ -164,11 +183,34 @@
}
memset(fs->group_desc, 0, fs->desc_blocks * fs->blocksize);
+ /*
+ * Reserve the superblock and group descriptors for each
+ * group, and fill in the correct group statistics for group.
+ * Note that although the block bitmap, inode bitmap, and
+ * inode table have not been allocated (and in fact won't be
+ * by this routine), they are accounted for nevertheless.
+ */
group_block = super->s_first_data_block;
for (i = 0; i < fs->group_desc_count; i++) {
for (j=0; j < fs->desc_blocks+1; j++)
- ext2fs_mark_block_bitmap(fs, fs->block_map,
+ ext2fs_mark_block_bitmap(fs->block_map,
group_block + j);
+
+ if (i == fs->group_desc_count-1) {
+ numblocks = (fs->super->s_blocks_count -
+ fs->super->s_first_data_block) %
+ fs->super->s_blocks_per_group;
+ if (!numblocks)
+ numblocks = fs->super->s_blocks_per_group;
+ } else
+ numblocks = fs->super->s_blocks_per_group;
+ numblocks -= 3 + fs->desc_blocks + fs->inode_blocks_per_group;
+
+ fs->group_desc[i].bg_free_blocks_count = numblocks;
+ fs->group_desc[i].bg_free_inodes_count =
+ fs->super->s_inodes_per_group;
+ fs->group_desc[i].bg_used_dirs_count = 0;
+
group_block += super->s_blocks_per_group;
}
diff --git a/lib/ext2fs/inline.c b/lib/ext2fs/inline.c
index 6ec7387..599fceb 100644
--- a/lib/ext2fs/inline.c
+++ b/lib/ext2fs/inline.c
@@ -17,7 +17,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#define INCLUDE_INLINE_FUNCS
diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c
index ba3cee8..6a9c178 100644
--- a/lib/ext2fs/inode.c
+++ b/lib/ext2fs/inode.c
@@ -12,7 +12,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -22,16 +21,21 @@
{
ext2_inode_scan scan;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
scan = (ext2_inode_scan) malloc(sizeof(struct ext2_struct_inode_scan));
if (!scan)
return ENOMEM;
memset(scan, 0, sizeof(struct ext2_struct_inode_scan));
+ scan->magic = EXT2_ET_MAGIC_INODE_SCAN;
scan->fs = fs;
scan->current_group = -1;
scan->inode_buffer_blocks = buffer_blocks ? buffer_blocks : 8;
scan->groups_left = fs->group_desc_count;
scan->inode_buffer = malloc(scan->inode_buffer_blocks * fs->blocksize);
+ scan->done_group = 0;
+ scan->done_group_data = 0;
if (!scan->inode_buffer) {
free(scan);
return ENOMEM;
@@ -42,33 +46,63 @@
void ext2fs_close_inode_scan(ext2_inode_scan scan)
{
+ if (!scan || (scan->magic != EXT2_ET_MAGIC_INODE_SCAN))
+ return;
+
free(scan->inode_buffer);
scan->inode_buffer = NULL;
free(scan);
return;
}
+void ext2fs_set_inode_callback(ext2_inode_scan scan,
+ errcode_t (*done_group)(ext2_filsys fs,
+ ext2_inode_scan scan,
+ dgrp_t group,
+ void * private),
+ void *done_group_data)
+{
+ if (!scan || (scan->magic != EXT2_ET_MAGIC_INODE_SCAN))
+ return;
+
+ scan->done_group = done_group;
+ scan->done_group_data = done_group_data;
+}
+
errcode_t ext2fs_get_next_inode(ext2_inode_scan scan, ino_t *ino,
struct ext2_inode *inode)
{
errcode_t retval;
int num_blocks;
+ 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->groups_left <= 0) {
- *ino = 0;
- return 0;
+ if (scan->done_group) {
+ retval = (scan->done_group)
+ (scan->fs, scan,
+ scan->current_group,
+ scan->done_group_data);
+ if (retval)
+ return retval;
}
- scan->current_group++;
- scan->groups_left--;
+ do {
+ if (scan->groups_left <= 0) {
+ *ino = 0;
+ return 0;
+ }
+ scan->current_group++;
+ scan->groups_left--;
- scan->current_block = scan->fs->group_desc[scan->current_group].bg_inode_table;
- scan->blocks_left = (EXT2_INODES_PER_GROUP(scan->fs->super) /
- EXT2_INODES_PER_BLOCK(scan->fs->super));
+ scan->current_block =
+ scan->fs->group_desc[scan->current_group].bg_inode_table;
+ scan->blocks_left = (EXT2_INODES_PER_GROUP(scan->fs->super) /
+ EXT2_INODES_PER_BLOCK(scan->fs->super));
+ } while (scan->current_block == 0);
} else {
scan->current_block += scan->inode_buffer_blocks;
}
@@ -109,6 +143,8 @@
errcode_t retval;
int i;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (ino > fs->super->s_inodes_count)
return EXT2_ET_BAD_INODE_NUM;
if (inode_buffer_size != fs->blocksize) {
@@ -149,6 +185,8 @@
errcode_t retval;
int i;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (!(fs->flags & EXT2_FLAG_RW))
return EXT2_ET_RO_FILSYS;
@@ -194,6 +232,8 @@
int i;
errcode_t retval;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (ino > fs->super->s_inodes_count)
return EXT2_ET_BAD_INODE_NUM;
@@ -214,6 +254,8 @@
struct ext2_inode inode;
errcode_t retval;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (ino > fs->super->s_inodes_count)
return EXT2_ET_BAD_INODE_NUM;
diff --git a/lib/ext2fs/io.h b/lib/ext2fs/io.h
index fd054f8..7a44a11 100644
--- a/lib/ext2fs/io.h
+++ b/lib/ext2fs/io.h
@@ -5,10 +5,23 @@
* under the terms of the GNU Public License.
*/
+/*
+ * ext2_loff_t is defined here since unix_io.c needs it.
+ */
+#if defined(__GNUC__) || defined(HAS_LONG_LONG)
+typedef long long ext2_loff_t;
+#else
+typedef long ext2_loff_t;
+#endif
+
+/* llseek.c */
+ext2_loff_t ext2_llseek (unsigned int, ext2_loff_t, unsigned int);
+
typedef struct struct_io_manager *io_manager;
typedef struct struct_io_channel *io_channel;
struct struct_io_channel {
+ int magic;
io_manager manager;
char *name;
int block_size;
@@ -26,10 +39,12 @@
size_t size,
int actual_bytes_written,
errcode_t error);
+ int reserved[16];
void *private_data;
};
struct struct_io_manager {
+ int magic;
const char *name;
errcode_t (*open)(const char *name, int flags, io_channel *channel);
errcode_t (*close)(io_channel channel);
@@ -39,6 +54,7 @@
errcode_t (*write_blk)(io_channel channel, unsigned long block,
int count, const void *data);
errcode_t (*flush)(io_channel channel);
+ int reserved[16];
};
#define IO_FLAG_RW 1
diff --git a/lib/ext2fs/jump/jump.funcs b/lib/ext2fs/jump/jump.funcs
new file mode 100644
index 0000000..a8f5674
--- /dev/null
+++ b/lib/ext2fs/jump/jump.funcs
@@ -0,0 +1,75 @@
+00000000 T _ext2fs_open libext2fs openfs
+00000000 T _ext2fs_check_desc libext2fs openfs
+00000000 T _ext2fs_free libext2fs freefs
+00000000 T _ext2fs_flush libext2fs closefs
+00000000 T _ext2fs_close libext2fs closefs
+00000000 T _ext2fs_allocate_inode_bitmap libext2fs bitmaps
+00000000 T _ext2fs_allocate_block_bitmap libext2fs bitmaps
+00000000 T _ext2fs_free_inode_bitmap libext2fs bitmaps
+00000000 T _ext2fs_free_block_bitmap libext2fs bitmaps
+00000000 T _ext2fs_fudge_inode_bitmap_end libext2fs bitmaps
+00000000 T _ext2fs_fudge_block_bitmap_end libext2fs bitmaps
+00000000 T _ext2fs_clear_inode_bitmap libext2fs bitmaps
+00000000 T _ext2fs_clear_block_bitmap libext2fs bitmaps
+00000000 T _ext2fs_write_inode_bitmap libext2fs rw_bitmaps
+00000000 T _ext2fs_write_block_bitmap libext2fs rw_bitmaps
+00000000 T _ext2fs_read_inode_bitmap libext2fs rw_bitmaps
+00000000 T _ext2fs_read_block_bitmap libext2fs rw_bitmaps
+00000000 T _ext2fs_read_bitmaps libext2fs rw_bitmaps
+00000000 T _ext2fs_write_bitmaps libext2fs rw_bitmaps
+00000000 T _ext2fs_open_inode_scan libext2fs inode
+00000000 T _ext2fs_close_inode_scan libext2fs inode
+00000000 T _ext2fs_get_next_inode libext2fs inode
+00000000 T _ext2fs_read_inode libext2fs inode
+00000000 T _ext2fs_write_inode libext2fs inode
+00000000 T _ext2fs_get_blocks libext2fs inode
+00000000 T _ext2fs_check_directory libext2fs inode
+00000000 T _ext2fs_block_iterate libext2fs block
+00000000 T _ext2fs_dir_iterate libext2fs namei
+00000000 T _ext2fs_lookup libext2fs namei
+00000000 T _ext2fs_namei libext2fs namei
+00000000 T _ext2fs_new_dir_block libext2fs newdir
+00000000 T _ext2fs_mkdir libext2fs mkdir
+00000000 T _ext2fs_get_pathname libext2fs get_pathname
+00000000 T _ext2fs_warn_bitmap libext2fs bitops
+00000000 T _ext2fs_link libext2fs link
+00000000 T _ext2fs_unlink libext2fs link
+00000000 T _ext2fs_new_inode libext2fs alloc
+00000000 T _ext2fs_new_block libext2fs alloc
+00000000 T _ext2fs_get_free_blocks libext2fs alloc
+00000000 T _ext2fs_expand_dir libext2fs expanddir
+00000000 T _set_bit libext2fs inline
+00000000 T _clear_bit libext2fs inline
+00000000 T _test_bit libext2fs inline
+00000000 T _ext2fs_mark_block_bitmap libext2fs inline
+00000000 T _ext2fs_unmark_block_bitmap libext2fs inline
+00000000 T _ext2fs_test_block_bitmap libext2fs inline
+00000000 T _ext2fs_mark_inode_bitmap libext2fs inline
+00000000 T _ext2fs_unmark_inode_bitmap libext2fs inline
+00000000 T _ext2fs_test_inode_bitmap libext2fs inline
+00000000 T _ext2fs_mark_super_dirty libext2fs inline
+00000000 T _ext2fs_mark_changed libext2fs inline
+00000000 T _ext2fs_test_changed libext2fs inline
+00000000 T _ext2fs_mark_valid libext2fs inline
+00000000 T _ext2fs_unmark_valid libext2fs inline
+00000000 T _ext2fs_test_valid libext2fs inline
+00000000 T _ext2fs_mark_ib_dirty libext2fs inline
+00000000 T _ext2fs_mark_bb_dirty libext2fs inline
+00000000 T _ext2fs_test_ib_dirty libext2fs inline
+00000000 T _ext2fs_test_bb_dirty libext2fs inline
+00000000 T _ext2fs_group_of_blk libext2fs inline
+00000000 T _ext2fs_group_of_ino libext2fs inline
+00000000 T _ext2fs_initialize libext2fs initialize
+00000000 T _badblocks_list_create libext2fs badblocks
+00000000 T _badblocks_list_free libext2fs badblocks
+00000000 T _badblocks_list_add libext2fs badblocks
+00000000 T _badblocks_list_test libext2fs badblocks
+00000000 T _badblocks_list_iterate_begin libext2fs badblocks
+00000000 T _badblocks_list_iterate libext2fs badblocks
+00000000 T _badblocks_list_iterate_end libext2fs badblocks
+00000000 T _ext2fs_read_bb_inode libext2fs read_bb
+00000000 T _ext2fs_update_bb_inode libext2fs bb_inode
+00000000 T _ext2fs_read_bb_FILE libext2fs read_bb_file
+00000000 T _initialize_ext2_error_table libext2fs ext2_err
+00000000 T _ext2_llseek libext2fs llseek
+00000000 T _ext2fs_set_inode_callback libext2fs inode
diff --git a/lib/ext2fs/jump/jump.import b/lib/ext2fs/jump/jump.import
new file mode 100644
index 0000000..53208d5
--- /dev/null
+++ b/lib/ext2fs/jump/jump.import
@@ -0,0 +1,166 @@
+00000004 D __et_list libcom_err jump/error_message
+00000004 D _com_err_hook libcom_err jump/com_err
+/usr/lib/libc.sa(__libc.o):00001000 a __GOT_SIZE
+/usr/lib/libc.sa(__libc.o):6008f0b0 A _AL
+/usr/lib/libc.sa(__libc.o):6008f198 A _AL_PARM
+/usr/lib/libc.sa(__libc.o):6008f060 A _AM
+/usr/lib/libc.sa(__libc.o):6008f0b4 A _BC
+/usr/lib/libc.sa(__libc.o):6008f064 A _BS
+/usr/lib/libc.sa(__libc.o):6008f0bc A _BT
+/usr/lib/libc.sa(__libc.o):6008f068 A _CA
+/usr/lib/libc.sa(__libc.o):6008f0c0 A _CD
+/usr/lib/libc.sa(__libc.o):6008f0c4 A _CE
+/usr/lib/libc.sa(__libc.o):6008f0c8 A _CL
+/usr/lib/libc.sa(__libc.o):6008f0cc A _CM
+/usr/lib/libc.sa(__libc.o):6008f048 A _COLS
+/usr/lib/libc.sa(__libc.o):6008f0d0 A _CR
+/usr/lib/libc.sa(__libc.o):6008f0d4 A _CS
+/usr/lib/libc.sa(__libc.o):6008f06c A _DA
+/usr/lib/libc.sa(__libc.o):6008f070 A _DB
+/usr/lib/libc.sa(__libc.o):6008f0d8 A _DC
+/usr/lib/libc.sa(__libc.o):6008f0dc A _DL
+/usr/lib/libc.sa(__libc.o):6008f19c A _DL_PARM
+/usr/lib/libc.sa(__libc.o):6008f0e0 A _DM
+/usr/lib/libc.sa(__libc.o):6008f0e4 A _DO
+/usr/lib/libc.sa(__libc.o):6008f1a4 A _DOWN_PARM
+/usr/lib/libc.sa(__libc.o):6008f03c A _Def_term
+/usr/lib/libc.sa(__libc.o):6008f0e8 A _ED
+/usr/lib/libc.sa(__libc.o):6008f0ec A _EI
+/usr/lib/libc.sa(__libc.o):6008f074 A _EO
+/usr/lib/libc.sa(__libc.o):6008f1b8 A _GT
+/usr/lib/libc.sa(__libc.o):6008f078 A _HC
+/usr/lib/libc.sa(__libc.o):6008f118 A _HO
+/usr/lib/libc.sa(__libc.o):6008f07c A _HZ
+/usr/lib/libc.sa(__libc.o):6008f11c A _IC
+/usr/lib/libc.sa(__libc.o):6008f120 A _IM
+/usr/lib/libc.sa(__libc.o):6008f080 A _IN
+/usr/lib/libc.sa(__libc.o):6008f124 A _IP
+/usr/lib/libc.sa(__libc.o):6008f0f0 A _K0
+/usr/lib/libc.sa(__libc.o):6008f0f4 A _K1
+/usr/lib/libc.sa(__libc.o):6008f0f8 A _K2
+/usr/lib/libc.sa(__libc.o):6008f0fc A _K3
+/usr/lib/libc.sa(__libc.o):6008f100 A _K4
+/usr/lib/libc.sa(__libc.o):6008f104 A _K5
+/usr/lib/libc.sa(__libc.o):6008f108 A _K6
+/usr/lib/libc.sa(__libc.o):6008f10c A _K7
+/usr/lib/libc.sa(__libc.o):6008f110 A _K8
+/usr/lib/libc.sa(__libc.o):6008f114 A _K9
+/usr/lib/libc.sa(__libc.o):6008f128 A _KD
+/usr/lib/libc.sa(__libc.o):6008f12c A _KE
+/usr/lib/libc.sa(__libc.o):6008f130 A _KH
+/usr/lib/libc.sa(__libc.o):6008f134 A _KL
+/usr/lib/libc.sa(__libc.o):6008f138 A _KR
+/usr/lib/libc.sa(__libc.o):6008f13c A _KS
+/usr/lib/libc.sa(__libc.o):6008f140 A _KU
+/usr/lib/libc.sa(__libc.o):6008f1a8 A _LEFT_PARM
+/usr/lib/libc.sa(__libc.o):6008f044 A _LINES
+/usr/lib/libc.sa(__libc.o):6008f144 A _LL
+/usr/lib/libc.sa(__libc.o):6008f148 A _MA
+/usr/lib/libc.sa(__libc.o):6008f300 A _MCAppPath
+/usr/lib/libc.sa(__libc.o):6008f084 A _MI
+/usr/lib/libc.sa(__libc.o):6008f088 A _MS
+/usr/lib/libc.sa(__libc.o):6008f030 A _My_term
+/usr/lib/libc.sa(__libc.o):6008f08c A _NC
+/usr/lib/libc.sa(__libc.o):6008f14c A _ND
+/usr/lib/libc.sa(__libc.o):6008f150 A _NL
+/usr/lib/libc.sa(__libc.o):6008f1bc A _NONL
+/usr/lib/libc.sa(__libc.o):6008f090 A _NS
+/usr/lib/libc.sa(__libc.o):6008f094 A _OS
+/usr/lib/libc.sa(__libc.o):6008f1b0 A _PC
+/usr/lib/libc.sa(__libc.o):6008f154 A _RC
+/usr/lib/libc.sa(__libc.o):6008f1ac A _RIGHT_PARM
+/usr/lib/libc.sa(__libc.o):6008f158 A _SC
+/usr/lib/libc.sa(__libc.o):6008f15c A _SE
+/usr/lib/libc.sa(__libc.o):6008f160 A _SF
+/usr/lib/libc.sa(__libc.o):6008f164 A _SO
+/usr/lib/libc.sa(__libc.o):6008f168 A _SR
+/usr/lib/libc.sa(__libc.o):6008f16c A _TA
+/usr/lib/libc.sa(__libc.o):6008f170 A _TE
+/usr/lib/libc.sa(__libc.o):6008f174 A _TI
+/usr/lib/libc.sa(__libc.o):6008f178 A _UC
+/usr/lib/libc.sa(__libc.o):6008f17c A _UE
+/usr/lib/libc.sa(__libc.o):6008f098 A _UL
+/usr/lib/libc.sa(__libc.o):6008f180 A _UP
+/usr/lib/libc.sa(__libc.o):6008f1c0 A _UPPERCASE
+/usr/lib/libc.sa(__libc.o):6008f1a0 A _UP_PARM
+/usr/lib/libc.sa(__libc.o):6008f188 A _US
+/usr/lib/libc.sa(__libc.o):6008f18c A _VB
+/usr/lib/libc.sa(__libc.o):6008f194 A _VE
+/usr/lib/libc.sa(__libc.o):6008f190 A _VS
+/usr/lib/libc.sa(__libc.o):6008f09c A _XB
+/usr/lib/libc.sa(__libc.o):6008f0a0 A _XN
+/usr/lib/libc.sa(__libc.o):6008f0a8 A _XS
+/usr/lib/libc.sa(__libc.o):6008f0a4 A _XT
+/usr/lib/libc.sa(__libc.o):6008f0ac A _XX
+/usr/lib/libc.sa(__libc.o):6008f2a4 A __IO_file_jumps
+/usr/lib/libc.sa(__libc.o):6008f1f4 A __IO_list_all
+/usr/lib/libc.sa(__libc.o):6008f2a8 A __IO_proc_jumps
+/usr/lib/libc.sa(__libc.o):6008f1ec A __IO_stderr_
+/usr/lib/libc.sa(__libc.o):6008f1e4 A __IO_stdin_
+/usr/lib/libc.sa(__libc.o):6008f1e8 A __IO_stdout_
+/usr/lib/libc.sa(__libc.o):6008f2ac A __IO_str_jumps
+/usr/lib/libc.sa(__libc.o):6008f214 A ____brk_addr
+/usr/lib/libc.sa(__libc.o):6008f01c A ___ctype_b
+/usr/lib/libc.sa(__libc.o):6008f020 A ___ctype_tolower
+/usr/lib/libc.sa(__libc.o):6008f024 A ___ctype_toupper
+/usr/lib/libc.sa(__libc.o):6008f1fc A ___environ
+/usr/lib/libc.sa(__libc.o):6008f250 A ___exit_funcs
+/usr/lib/libc.sa(__libc.o):6008f2f0 A ___glob_closedir_hook
+/usr/lib/libc.sa(__libc.o):6008f2f4 A ___glob_opendir_hook
+/usr/lib/libc.sa(__libc.o):6008f2f8 A ___glob_readdir_hook
+/usr/lib/libc.sa(__libc.o):6008f278 A ___ttyname
+/usr/lib/libc.sa(__libc.o):6008f238 A __collate_info
+/usr/lib/libc.sa(__libc.o):6008f23c A __ctype_info
+/usr/lib/libc.sa(__libc.o):6008f028 A __echoit
+/usr/lib/libc.sa(__libc.o):6008f034 A __endwin
+/usr/lib/libc.sa(__libc.o):6008f288 A __gdbm_fetch_val
+/usr/lib/libc.sa(__libc.o):6008f280 A __gdbm_file
+/usr/lib/libc.sa(__libc.o):6008f284 A __gdbm_memory
+/usr/lib/libc.sa(__libc.o):6008f240 A __monetary_info
+/usr/lib/libc.sa(__libc.o):6008f234 A __null_auth
+/usr/lib/libc.sa(__libc.o):6008f244 A __numeric_info
+/usr/lib/libc.sa(__libc.o):6008f2ec A __obstack
+/usr/lib/libc.sa(__libc.o):6008f1c8 A __pfast
+/usr/lib/libc.sa(__libc.o):6008f02c A __rawmode
+/usr/lib/libc.sa(__libc.o):6008f1dc A __res
+/usr/lib/libc.sa(__libc.o):6008f04c A __res_iflg
+/usr/lib/libc.sa(__libc.o):6008f050 A __res_lflg
+/usr/lib/libc.sa(__libc.o):6008f270 A __res_opcodes
+/usr/lib/libc.sa(__libc.o):6008f274 A __res_resultcodes
+/usr/lib/libc.sa(__libc.o):6008f248 A __response_info
+/usr/lib/libc.sa(__libc.o):6008f2fc A __sigintr
+/usr/lib/libc.sa(__libc.o):6008f00c A __sys_errlist
+/usr/lib/libc.sa(__libc.o):6008f010 A __sys_nerr
+/usr/lib/libc.sa(__libc.o):6008f014 A __sys_siglist
+/usr/lib/libc.sa(__libc.o):6008f24c A __time_info
+/usr/lib/libc.sa(__libc.o):6008f05c A __tty
+/usr/lib/libc.sa(__libc.o):6008f040 A __tty_ch
+/usr/lib/libc.sa(__libc.o):6008f1cc A __unctrl
+/usr/lib/libc.sa(__libc.o):6008f27c A __win
+/usr/lib/libc.sa(__libc.o):6008f058 A _curscr
+/usr/lib/libc.sa(__libc.o):6008f228 A _daylight
+/usr/lib/libc.sa(__libc.o):6008f200 A _errno
+/usr/lib/libc.sa(__libc.o):6008f1d0 A _gdbm_errno
+/usr/lib/libc.sa(__libc.o):6008f28c A _gdbm_version
+/usr/lib/libc.sa(__libc.o):6008f008 A _h_errlist
+/usr/lib/libc.sa(__libc.o):6008f1d8 A _h_errno
+/usr/lib/libc.sa(__libc.o):6008f2a0 A _h_nerr
+/usr/lib/libc.sa(__libc.o):6008f1c4 A _normtty
+/usr/lib/libc.sa(__libc.o):6008f204 A _optarg
+/usr/lib/libc.sa(__libc.o):6008f20c A _opterr
+/usr/lib/libc.sa(__libc.o):6008f208 A _optind
+/usr/lib/libc.sa(__libc.o):6008f2e4 A _optopt
+/usr/lib/libc.sa(__libc.o):6008f218 A _ospeed
+/usr/lib/libc.sa(__libc.o):6008f26c A _re_max_failures
+/usr/lib/libc.sa(__libc.o):6008f210 A _re_syntax_options
+/usr/lib/libc.sa(__libc.o):6008f1e0 A _rexecoptions
+/usr/lib/libc.sa(__libc.o):6008f230 A _rpc_createerr
+/usr/lib/libc.sa(__libc.o):6008f25c A _stderr
+/usr/lib/libc.sa(__libc.o):6008f254 A _stdin
+/usr/lib/libc.sa(__libc.o):6008f258 A _stdout
+/usr/lib/libc.sa(__libc.o):6008f054 A _stdscr
+/usr/lib/libc.sa(__libc.o):6008f2e8 A _svc_fdset
+/usr/lib/libc.sa(__libc.o):6008f224 A _timezone
+/usr/lib/libc.sa(__libc.o):6008f21c A _tputs_baud_rate
+/usr/lib/libc.sa(__libc.o):6008f038 A _ttytype
+/usr/lib/libc.sa(__libc.o):6008f220 A _tzname
diff --git a/lib/ext2fs/jump/jump.params b/lib/ext2fs/jump/jump.params
new file mode 100644
index 0000000..ea74d63
--- /dev/null
+++ b/lib/ext2fs/jump/jump.params
@@ -0,0 +1,6 @@
+Name=libe2fs
+Text=0x66900000
+Data=0x00000000
+Jump=0x00001000
+GOT=0x00001000
+Version=1.0.0
diff --git a/lib/ext2fs/jump/jump.undefs b/lib/ext2fs/jump/jump.undefs
new file mode 100644
index 0000000..9469992
--- /dev/null
+++ b/lib/ext2fs/jump/jump.undefs
@@ -0,0 +1,2 @@
+66909078 D __NEEDS_SHRLIB_libc_4
+6690908c D __NEEDS_SHRLIB_libet_1
diff --git a/lib/ext2fs/jump/jump.vars b/lib/ext2fs/jump/jump.vars
new file mode 100644
index 0000000..edbbf7c
--- /dev/null
+++ b/lib/ext2fs/jump/jump.vars
@@ -0,0 +1 @@
+00000004 D _unix_io_manager libext2fs unix_io
diff --git a/lib/ext2fs/link.c b/lib/ext2fs/link.c
index f0dbbc5..042183b 100644
--- a/lib/ext2fs/link.c
+++ b/lib/ext2fs/link.c
@@ -9,7 +9,7 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
-#include <linux/fs.h>
+
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -86,6 +86,8 @@
errcode_t retval;
struct link_struct ls;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (!(fs->flags & EXT2_FLAG_RW))
return EXT2_ET_RO_FILSYS;
@@ -129,6 +131,8 @@
errcode_t retval;
struct link_struct ls;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (!(fs->flags & EXT2_FLAG_RW))
return EXT2_ET_RO_FILSYS;
diff --git a/lib/ext2fs/llseek.c b/lib/ext2fs/llseek.c
new file mode 100644
index 0000000..00fe3cd
--- /dev/null
+++ b/lib/ext2fs/llseek.c
@@ -0,0 +1,79 @@
+/*
+ * llseek.c -- stub calling the llseek system call
+ *
+ * Copyright (C) 1994 Remy Card. This file may be redistributed
+ * under the terms of the GNU Public License.
+ */
+
+#include <sys/types.h>
+
+#include <errno.h>
+#include <unistd.h>
+#include <linux/unistd.h>
+#include "et/com_err.h"
+#include "ext2fs/io.h"
+
+#ifdef __linux__
+
+#ifndef __NR__llseek
+#define __NR__llseek 140
+#endif
+
+static int _llseek (unsigned int, unsigned long,
+ unsigned long, ext2_loff_t *, unsigned int);
+
+static _syscall5(int,_llseek,unsigned int,fd,unsigned long,offset_high,
+ unsigned long, offset_low,ext2_loff_t *,result,
+ unsigned int, origin)
+
+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 (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);
+ }
+
+ 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) {
+ /*
+ * 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;
+ }
+ if (retval == -1)
+ result = -1;
+ return result;
+}
+
+#else
+
+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;
+ return -1;
+ }
+ return lseek (fd, (off_t) offset, origin);
+}
+
+#endif
+
+
diff --git a/lib/ext2fs/mkdir.c b/lib/ext2fs/mkdir.c
index 03e49d8..8bcb542 100644
--- a/lib/ext2fs/mkdir.c
+++ b/lib/ext2fs/mkdir.c
@@ -14,7 +14,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -30,6 +29,8 @@
char *block = 0;
int group;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
/*
* Allocate an inode, if necessary
*/
@@ -109,9 +110,9 @@
/*
* Update accounting....
*/
- ext2fs_mark_block_bitmap(fs, fs->block_map, blk);
+ ext2fs_mark_block_bitmap(fs->block_map, blk);
ext2fs_mark_bb_dirty(fs);
- ext2fs_mark_inode_bitmap(fs, fs->inode_map, ino);
+ ext2fs_mark_inode_bitmap(fs->inode_map, ino);
ext2fs_mark_ib_dirty(fs);
group = ext2fs_group_of_blk(fs, blk);
diff --git a/lib/ext2fs/namei.c b/lib/ext2fs/namei.c
index 3bb6d57..da382f7 100644
--- a/lib/ext2fs/namei.c
+++ b/lib/ext2fs/namei.c
@@ -9,7 +9,7 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
-#include <linux/fs.h>
+
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -46,6 +46,8 @@
struct dir_context ctx;
errcode_t retval;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
retval = ext2fs_check_directory(fs, dir);
if (retval)
return retval;
@@ -155,6 +157,8 @@
errcode_t retval;
struct lookup_struct ls;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
ls.name = name;
ls.len = namelen;
ls.inode = inode;
@@ -176,6 +180,8 @@
int len;
errcode_t retval;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
buf = malloc(fs->blocksize);
if (!buf)
return ENOMEM;
diff --git a/lib/ext2fs/newdir.c b/lib/ext2fs/newdir.c
index 948bad9..d1018c1 100644
--- a/lib/ext2fs/newdir.c
+++ b/lib/ext2fs/newdir.c
@@ -9,7 +9,7 @@
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
-#include <linux/fs.h>
+
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -24,6 +24,8 @@
struct ext2_dir_entry *dir = NULL;
int rec_len;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
buf = malloc(fs->blocksize);
if (!buf)
return ENOMEM;
diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index b63b7aa..d6f5432 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -14,7 +14,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -31,11 +30,14 @@
int i, group_block;
char *dest;
+ EXT2_CHECK_MAGIC(manager, EXT2_ET_MAGIC_IO_MANAGER);
+
fs = (ext2_filsys) malloc(sizeof(struct struct_ext2_filsys));
if (!fs)
return ENOMEM;
memset(fs, 0, sizeof(struct struct_ext2_filsys));
+ fs->magic = EXT2_ET_MAGIC_EXT2FS_FILSYS;
fs->flags = flags;
retval = manager->open(name, (flags & EXT2_FLAG_RW) ? IO_FLAG_RW : 0,
&fs->io);
@@ -65,9 +67,11 @@
goto cleanup;
}
io_channel_set_blksize(fs->io, block_size);
+ group_block = superblock + 1;
} else {
io_channel_set_blksize(fs->io, SUPERBLOCK_OFFSET);
superblock = 1;
+ group_block = 0;
}
retval = io_channel_read_blk(fs->io, superblock, -SUPERBLOCK_SIZE,
fs->super);
@@ -78,6 +82,12 @@
retval = EXT2_ET_BAD_MAGIC;
goto cleanup;
}
+#ifdef EXT2_CURRENT_REV
+ if (fs->super->s_rev_level > EXT2_LIB_CURRENT_REV) {
+ retval = EXT2_ET_REV_TOO_HIGH;
+ goto cleanup;
+ }
+#endif
fs->blocksize = EXT2_BLOCK_SIZE(fs->super);
fs->fragsize = EXT2_FRAG_SIZE(fs->super);
fs->inode_blocks_per_group = (fs->super->s_inodes_per_group /
@@ -108,7 +118,8 @@
retval = ENOMEM;
goto cleanup;
}
- group_block = fs->super->s_first_data_block + 1;
+ if (!group_block)
+ group_block = fs->super->s_first_data_block + 1;
dest = (char *) fs->group_desc;
for (i=0 ; i < fs->desc_blocks; i++) {
retval = io_channel_read_blk(fs->io, group_block, 1, dest);
@@ -125,45 +136,3 @@
return retval;
}
-/*
- * This routine sanity checks the group descriptors
- */
-errcode_t ext2fs_check_desc(ext2_filsys fs)
-{
- int i;
- int block = fs->super->s_first_data_block;
- int next, inode_blocks_per_group;
-
- inode_blocks_per_group = fs->super->s_inodes_per_group /
- EXT2_INODES_PER_BLOCK (fs->super);
-
- for (i = 0; i < fs->group_desc_count; i++) {
- next = block + fs->super->s_blocks_per_group;
- /*
- * Check to make sure block bitmap for group is
- * located within the group.
- */
- if (fs->group_desc[i].bg_block_bitmap < block ||
- fs->group_desc[i].bg_block_bitmap >= next)
- return EXT2_ET_GDESC_BAD_BLOCK_MAP;
- /*
- * Check to make sure inode bitmap for group is
- * located within the group
- */
- if (fs->group_desc[i].bg_inode_bitmap < block ||
- fs->group_desc[i].bg_inode_bitmap >= next)
- return EXT2_ET_GDESC_BAD_INODE_MAP;
- /*
- * Check to make sure inode table for group is located
- * within the group
- */
- if (fs->group_desc[i].bg_inode_table < block ||
- fs->group_desc[i].bg_inode_table+inode_blocks_per_group >=
- next)
- return EXT2_ET_GDESC_BAD_INODE_TABLE;
-
- block = next;
- }
- return 0;
-}
-
diff --git a/lib/ext2fs/read_bb.c b/lib/ext2fs/read_bb.c
index 65663a0..1a9f774 100644
--- a/lib/ext2fs/read_bb.c
+++ b/lib/ext2fs/read_bb.c
@@ -14,7 +14,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -51,6 +50,8 @@
struct ext2_inode inode;
int numblocks;
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
if (!*bb_list) {
retval = ext2fs_read_inode(fs, EXT2_BAD_INO, &inode);
if (retval)
diff --git a/lib/ext2fs/read_bb_file.c b/lib/ext2fs/read_bb_file.c
index db7b910..c24674b 100644
--- a/lib/ext2fs/read_bb_file.c
+++ b/lib/ext2fs/read_bb_file.c
@@ -14,7 +14,6 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <linux/fs.h>
#include <linux/ext2_fs.h>
#include "ext2fs.h"
@@ -29,6 +28,9 @@
errcode_t retval;
blk_t blockno;
int count;
+ char buf[128];
+
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
if (!*bb_list) {
retval = badblocks_list_create(bb_list, 10);
@@ -37,9 +39,11 @@
}
while (!feof (f)) {
- count = fscanf (f, "%lu", &blockno);
- if (count <= 0)
+ if (fgets(buf, sizeof(buf), f) == NULL)
break;
+ count = sscanf(buf, "%lu", &blockno);
+ if (count <= 0)
+ continue;
if ((blockno < fs->super->s_first_data_block) ||
(blockno >= fs->super->s_blocks_count)) {
if (invalid)
@@ -47,7 +51,8 @@
continue;
}
retval = badblocks_list_add(*bb_list, blockno);
- return retval;
+ if (retval)
+ return retval;
}
return 0;
}
diff --git a/lib/ext2fs/rw_bitmaps.c b/lib/ext2fs/rw_bitmaps.c
new file mode 100644
index 0000000..9523294
--- /dev/null
+++ b/lib/ext2fs/rw_bitmaps.c
@@ -0,0 +1,218 @@
+/*
+ * rw_bitmaps.c --- routines to read and write the inode and block bitmaps.
+ *
+ * Copyright (C) 1993,1994 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>
+
+#include <linux/ext2_fs.h>
+
+#include "ext2fs.h"
+
+errcode_t ext2fs_write_inode_bitmap(ext2_filsys fs)
+{
+ int i;
+ int nbytes;
+ errcode_t retval;
+ char * inode_bitmap = fs->inode_map->bitmap;
+ char * bitmap_block = NULL;
+
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
+ if (!(fs->flags & EXT2_FLAG_RW))
+ return EXT2_ET_RO_FILSYS;
+ if (!inode_bitmap)
+ return 0;
+ nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8;
+ bitmap_block = malloc(fs->blocksize);
+ if (!bitmap_block)
+ return ENOMEM;
+ memset(bitmap_block, 0xff, fs->blocksize);
+ for (i = 0; i < fs->group_desc_count; i++) {
+ memcpy(bitmap_block, inode_bitmap, nbytes);
+ retval = io_channel_write_blk(fs->io,
+ fs->group_desc[i].bg_inode_bitmap, 1,
+ bitmap_block);
+ if (retval)
+ return EXT2_ET_INODE_BITMAP_WRITE;
+ inode_bitmap += nbytes;
+ }
+ fs->flags |= EXT2_FLAG_CHANGED;
+ fs->flags &= ~EXT2_FLAG_IB_DIRTY;
+ free(bitmap_block);
+ return 0;
+}
+
+errcode_t ext2fs_write_block_bitmap (ext2_filsys fs)
+{
+ int i;
+ int j;
+ int nbytes;
+ int nbits;
+ errcode_t retval;
+ char * block_bitmap = fs->block_map->bitmap;
+ char * bitmap_block = NULL;
+
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
+ if (!(fs->flags & EXT2_FLAG_RW))
+ return EXT2_ET_RO_FILSYS;
+ if (!block_bitmap)
+ return 0;
+ nbytes = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
+ bitmap_block = malloc(fs->blocksize);
+ if (!bitmap_block)
+ return ENOMEM;
+ memset(bitmap_block, 0xff, fs->blocksize);
+ for (i = 0; i < fs->group_desc_count; i++) {
+ memcpy(bitmap_block, block_bitmap, nbytes);
+ if (i == fs->group_desc_count - 1) {
+ /* Force bitmap padding for the last group */
+ nbits = (fs->super->s_blocks_count
+ - fs->super->s_first_data_block)
+ % EXT2_BLOCKS_PER_GROUP(fs->super);
+ if (nbits)
+ for (j = nbits; j < fs->blocksize * 8; j++)
+ set_bit(j, bitmap_block);
+ }
+ retval = io_channel_write_blk(fs->io,
+ fs->group_desc[i].bg_block_bitmap, 1,
+ bitmap_block);
+ if (retval)
+ return EXT2_ET_BLOCK_BITMAP_WRITE;
+ block_bitmap += nbytes;
+ }
+ fs->flags |= EXT2_FLAG_CHANGED;
+ fs->flags &= ~EXT2_FLAG_BB_DIRTY;
+ free(bitmap_block);
+ return 0;
+}
+
+static errcode_t read_bitmaps(ext2_filsys fs, int do_inode, int do_block)
+{
+ int i;
+ char *block_bitmap, *inode_bitmap;
+ char *buf;
+ errcode_t retval;
+ int block_nbytes = EXT2_BLOCKS_PER_GROUP(fs->super) / 8;
+ int inode_nbytes = EXT2_INODES_PER_GROUP(fs->super) / 8;
+
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
+ fs->write_bitmaps = ext2fs_write_bitmaps;
+
+ buf = malloc(strlen(fs->device_name) + 80);
+ if (do_block) {
+ if (fs->block_map)
+ ext2fs_free_block_bitmap(fs->block_map);
+ sprintf(buf, "block bitmap for %s", fs->device_name);
+ retval = ext2fs_allocate_block_bitmap(fs, buf, &fs->block_map);
+ if (retval)
+ goto cleanup;
+ block_bitmap = fs->block_map->bitmap;
+ }
+ if (do_inode) {
+ if (fs->inode_map)
+ ext2fs_free_inode_bitmap(fs->inode_map);
+ sprintf(buf, "inode bitmap for %s", fs->device_name);
+ retval = ext2fs_allocate_inode_bitmap(fs, buf, &fs->inode_map);
+ if (retval)
+ goto cleanup;
+ 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) {
+ retval = io_channel_read_blk
+ (fs->io,
+ fs->group_desc[i].bg_block_bitmap,
+ 1, buf);
+ if (retval) {
+ retval = EXT2_ET_BLOCK_BITMAP_READ;
+ goto cleanup;
+ }
+ memcpy(block_bitmap, buf, block_nbytes);
+ block_bitmap += block_nbytes;
+ }
+ if (do_inode) {
+ retval = io_channel_read_blk
+ (fs->io,
+ fs->group_desc[i].bg_inode_bitmap,
+ 1, buf);
+ 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:
+ if (do_block) {
+ free(fs->block_map);
+ fs->block_map = 0;
+ }
+ if (do_inode) {
+ free(fs->inode_map);
+ fs->inode_map = 0;
+ }
+ if (buf)
+ free(buf);
+ return retval;
+}
+
+errcode_t ext2fs_read_inode_bitmap (ext2_filsys fs)
+{
+ return read_bitmaps(fs, 1, 0);
+}
+
+errcode_t ext2fs_read_block_bitmap(ext2_filsys fs)
+{
+ return read_bitmaps(fs, 0, 1);
+}
+
+errcode_t ext2fs_read_bitmaps(ext2_filsys fs)
+{
+
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
+ return read_bitmaps(fs, !fs->inode_map, !fs->block_map);
+}
+
+errcode_t ext2fs_write_bitmaps(ext2_filsys fs)
+{
+ errcode_t retval;
+
+ EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+
+ if (fs->block_map && ext2fs_test_bb_dirty(fs)) {
+ retval = ext2fs_write_block_bitmap(fs);
+ if (retval)
+ return retval;
+ }
+ if (fs->inode_map && ext2fs_test_ib_dirty(fs)) {
+ retval = ext2fs_write_inode_bitmap(fs);
+ if (retval)
+ return retval;
+ }
+ return 0;
+}
+
diff --git a/lib/ext2fs/rw_bitmaps.size b/lib/ext2fs/rw_bitmaps.size
new file mode 100644
index 0000000..5a3c944
--- /dev/null
+++ b/lib/ext2fs/rw_bitmaps.size
@@ -0,0 +1,2 @@
+text data bss dec hex
+1720 0 0 1720 6b8
diff --git a/lib/ext2fs/unix_io.c b/lib/ext2fs/unix_io.c
index 1137870..5126583 100644
--- a/lib/ext2fs/unix_io.c
+++ b/lib/ext2fs/unix_io.c
@@ -20,7 +20,15 @@
#include "ext2_err.h"
#include "io.h"
+/*
+ * For checking structure magic numbers...
+ */
+
+#define EXT2_CHECK_MAGIC(struct, code) \
+ if ((struct)->magic != (code)) return (code)
+
struct unix_private_data {
+ int magic;
int dev;
int flags;
char *buf;
@@ -36,7 +44,8 @@
int count, const void *data);
static errcode_t unix_flush(io_channel channel);
-struct struct_io_manager struct_unix_manager = {
+static struct struct_io_manager struct_unix_manager = {
+ EXT2_ET_MAGIC_IO_MANAGER,
"Unix I/O Manager",
unix_open,
unix_close,
@@ -57,6 +66,8 @@
io = (io_channel) malloc(sizeof(struct struct_io_channel));
if (!io)
return ENOMEM;
+ memset(io, 0, sizeof(struct struct_io_channel));
+ io->magic = EXT2_ET_MAGIC_IO_CHANNEL;
data = (struct unix_private_data *)
malloc(sizeof(struct unix_private_data));
if (!data) {
@@ -71,9 +82,12 @@
}
strcpy(io->name, name);
io->private_data = data;
+ io->block_size = 1024;
+ io->read_error = 0;
+ io->write_error = 0;
memset(data, 0, sizeof(struct unix_private_data));
- io->block_size = 1024;
+ data->magic = EXT2_ET_MAGIC_UNIX_IO_CHANNEL;
data->buf = malloc(io->block_size);
data->buf_block_nr = -1;
if (!data->buf) {
@@ -104,7 +118,10 @@
struct unix_private_data *data;
errcode_t retval = 0;
+ EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
data = (struct unix_private_data *) channel->private_data;
+ EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_UNIX_IO_CHANNEL);
+
if (close(data->dev) < 0)
retval = errno;
if (data->buf)
@@ -121,7 +138,10 @@
{
struct unix_private_data *data;
+ EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
data = (struct unix_private_data *) channel->private_data;
+ EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_UNIX_IO_CHANNEL);
+
if (channel->block_size != blksize) {
channel->block_size = blksize;
free(data->buf);
@@ -140,9 +160,12 @@
struct unix_private_data *data;
errcode_t retval;
size_t size;
+ ext2_loff_t location;
int actual = 0;
+ EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
data = (struct unix_private_data *) channel->private_data;
+ EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_UNIX_IO_CHANNEL);
/*
* If it's in the cache, use it!
@@ -151,9 +174,12 @@
memcpy(buf, data->buf, channel->block_size);
return 0;
}
+#if 0
+ printf("read_block %lu (%d)\n", block, count);
+#endif
size = (count < 0) ? -count : count * channel->block_size;
- if (lseek(data->dev, block * channel->block_size, SEEK_SET) !=
- block * channel->block_size) {
+ location = (ext2_loff_t) block * channel->block_size;
+ if (ext2_llseek(data->dev, location, SEEK_SET) != location) {
retval = errno;
goto error_out;
}
@@ -183,10 +209,13 @@
{
struct unix_private_data *data;
size_t size;
+ ext2_loff_t location;
int actual = 0;
errcode_t retval;
+ EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
data = (struct unix_private_data *) channel->private_data;
+ EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_UNIX_IO_CHANNEL);
if (count == 1)
size = channel->block_size;
@@ -197,9 +226,9 @@
else
size = count * channel->block_size;
}
-
- if (lseek(data->dev, block * channel->block_size, SEEK_SET) !=
- block * channel->block_size) {
+
+ location = (ext2_loff_t) block * channel->block_size;
+ if (ext2_llseek(data->dev, location, SEEK_SET) != location) {
retval = errno;
goto error_out;
}
@@ -228,6 +257,12 @@
*/
static errcode_t unix_flush(io_channel channel)
{
+ struct unix_private_data *data;
+
+ EXT2_CHECK_MAGIC(channel, EXT2_ET_MAGIC_IO_CHANNEL);
+ data = (struct unix_private_data *) channel->private_data;
+ EXT2_CHECK_MAGIC(data, EXT2_ET_MAGIC_UNIX_IO_CHANNEL);
+
return 0;
}
diff --git a/lib/fpopen.c b/lib/fpopen.c
new file mode 100644
index 0000000..f12ab90
--- /dev/null
+++ b/lib/fpopen.c
@@ -0,0 +1,91 @@
+/*
+ * fpopen.c --- unlike the libc popen, it directly executes the
+ * command instead of call out to the shell.
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <ctype.h>
+
+#define MAX_ARGV 256
+
+extern FILE *fpopen(const char *cmd, const char *mode);
+
+FILE *fpopen(const char *cmd, const char *mode)
+{
+ char *argv[MAX_ARGV];
+ int i = 0;
+ char *buf, *prog = 0;
+ char *p;
+ int do_stdin;
+ int fds[2];
+ pid_t pid;
+
+ if (!mode) {
+ errno = EFAULT;
+ return NULL;
+ }
+
+ switch (*mode) {
+ case 'r':
+ do_stdin = 0;
+ break;
+ case 'w':
+ do_stdin = 1;
+ break;
+ default:
+ errno = EINVAL;
+ return NULL;
+ }
+
+ /*
+ * Create the argv vector....
+ */
+ buf = malloc(strlen(cmd)+1);
+ if (!buf)
+ return NULL;
+ strcpy(buf, cmd);
+ p = buf;
+ while (p && *p) {
+ if (isspace(*p)) {
+ p++;
+ continue;
+ }
+ if (i == 0)
+ prog = p;
+ argv[i++] = p;
+ p = strchr(p, ' ');
+ if (p)
+ *p++ = 0;
+ }
+
+ argv[i] = 0;
+
+ /*
+ * Get the pipe
+ */
+ if (pipe(fds) < 0)
+ return NULL;
+
+ /* Fork and execute the correct program. */
+ if ((pid = fork()) < 0) {
+ perror("fork");
+ return NULL;
+ } else if (pid == 0) {
+ if (do_stdin) {
+ close(fds[1]);
+ dup2(fds[0], 0);
+ } else {
+ close(fds[0]);
+ dup2(fds[1], 1);
+ }
+ (void) execvp(prog, argv);
+ perror(prog);
+ exit(1);
+ }
+ return fdopen(do_stdin ? fds[1] : fds[0], mode);
+}
+
diff --git a/lib/ss/.depend b/lib/ss/.depend
index 64a78dc..b35a682 100644
--- a/lib/ss/.depend
+++ b/lib/ss/.depend
@@ -6,50 +6,59 @@
/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 \
+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/sys/param.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/limits.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 \
/usr/lib/gcc-lib/i486-linux/2.5.8/include/syslimits.h /usr/include/limits.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/sys/types.h \
- /usr/include/linux/types.h /usr/include/sys/file.h /usr/include/fcntl.h /usr/include/linux/fcntl.h \
- /usr/include/sys/wait.h /usr/include/gnu/types.h /usr/include/waitflags.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 copyright.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/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/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/waitstatus.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 \
../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/linux/signal.h \
- /usr/include/sys/param.h /usr/lib/gcc-lib/i486-linux/2.5.8/include/limits.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
-pager.o : pager.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 /usr/include/sys/types.h /usr/include/linux/types.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 \
+ /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 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
+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/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 \
diff --git a/lib/ss/ChangeLog b/lib/ss/ChangeLog
new file mode 100644
index 0000000..9c25553
--- /dev/null
+++ b/lib/ss/ChangeLog
@@ -0,0 +1,6 @@
+Sat Mar 11 18:14:52 1995 Theodore Y. Ts'o <tytso@localhost>
+
+ * Makefile (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
new file mode 100644
index 0000000..5356fcb
--- /dev/null
+++ b/lib/ss/MAKELOG
@@ -0,0 +1,156 @@
+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
index af82f91..2f5ae92 100644
--- a/lib/ss/Makefile
+++ b/lib/ss/Makefile
@@ -1,7 +1,21 @@
+#
+# Makefile for lib/ss
+#
+
include ../../MCONFIG
-ARCHIVE=ar r
-RANLIB=ranlib
+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
@@ -9,9 +23,11 @@
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)
+CFLAGS= -I. -I.. -I../et $(OPT) $(WFLAGS) $(DEFS)
# hard coded for target install
srcdir= .
@@ -36,6 +52,10 @@
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
@@ -61,25 +81,36 @@
# 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:: all
- $(INSTALLLIB) libss.a ${DESTDIR}$(LIBDIR)/libss.a
- $(CHMOD) 644 ${DESTDIR}$(LIBDIR)/libss.a
- $(RANLIB) ${DESTDIR}$(LIBDIR)/libss.a
- $(CHMOD) $(LIBMODE) ${DESTDIR}$(LIBDIR)/libss.a
+install::
-install:: $(HFILES) copyright.h
- @rm -rf ${DESTDIR}$(INCLDIR)/ss
- @mkdir ${DESTDIR}$(INCLDIR)/ss
+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 ${DESTDIR}$(INCLDIR)/ss/$$i; \
+ $(INSTALLINC) $(srcdir)/$$i $(INCLDIR)/ss/$$i; \
done
-install:: copyright.h
- $(INSTALLFILE) $(srcdir)/copyright.h ${DESTDIR}$(INCLDIR)/ss/mit-sipb-copyright.h
+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
@@ -107,19 +138,19 @@
$(RM) ../$@
$(LN) ss/$@ ../$@
-clean:
- $(RM) libss.a mk_cmds
+
+clean::
+ $(RM) ../libss.a libss.a mk_cmds
$(RM) *.o *~ \#* *.bak core
-really-clean: clean
- $(RM) .depend ss_err.h
+really-clean:: clean
+ $(RM) .depend ss_err.h ss_err.c
-#install::
-# $(INSTALLLIB) libss.a $(DESTDIR)$(LIBDIR)/libss.a
-# $(CHMOD) 644 $(DESTDIR)$(LIBDIR)/libss.a
-# $(RANLIB) $(DESTDIR)$(LIBDIR)/libss.a
-# $(CHMOD) 444 $(DESTDIR)$(LIBDIR)/libss.a
-##
+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)
diff --git a/lib/ss/data.c b/lib/ss/data.c
index dd6341c..45e49d7 100644
--- a/lib/ss/data.c
+++ b/lib/ss/data.c
@@ -9,7 +9,7 @@
#include "ss_internal.h"
#include "copyright.h"
-const static char copyright[] =
+static const char copyright[] =
"Copyright 1987, 1988, 1989 by the Massachusetts Institute of Technology";
ss_data **_ss_table = (ss_data **)NULL;
diff --git a/lib/ss/execute_cmd.c b/lib/ss/execute_cmd.c
index 9442f33..be13dd8 100644
--- a/lib/ss/execute_cmd.c
+++ b/lib/ss/execute_cmd.c
@@ -4,15 +4,13 @@
* For copyright info, see copyright.h.
*/
+#ifdef HAS_STDLIB_H
+#include <stdlib.h>
+#endif
#include "ss_internal.h"
#include "copyright.h"
#include <stdio.h>
-#ifndef lint
-static char const rcsid[] =
- "$Header$";
-#endif
-
/*
* get_request(tbl, idx)
*
diff --git a/lib/ss/help.c b/lib/ss/help.c
index ad3b90b..f956ca8 100644
--- a/lib/ss/help.c
+++ b/lib/ss/help.c
@@ -4,6 +4,12 @@
* For copyright info, see copyright.h.
*/
+#ifdef HAS_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAS_STDLIB_H
+#include <stdlib.h>
+#endif
#include <sys/param.h>
#include <sys/types.h>
#include <sys/file.h>
@@ -79,7 +85,7 @@
ss_page_stdin();
default:
(void) close(fd); /* what can we do if it fails? */
- while (wait((union wait *)NULL) != child) {
+ while (wait(0) != child) {
/* do nothing if wrong pid */
};
}
diff --git a/lib/ss/invocation.c b/lib/ss/invocation.c
index 678bbcd..c4c15ca 100644
--- a/lib/ss/invocation.c
+++ b/lib/ss/invocation.c
@@ -3,15 +3,14 @@
*
* For copyright information, see copyright.h.
*/
+
+#ifdef HAS_STDLIB_H
+#include <stdlib.h>
+#endif
#include "ss_internal.h"
#include "copyright.h"
#define size sizeof(ss_data *)
-#ifndef lint
-static char const rcsid[] =
- "$Header$";
-#endif
-
int ss_create_invocation(subsystem_name, version_string, info_ptr,
request_table_ptr, code_ptr)
char *subsystem_name, *version_string;
diff --git a/lib/ss/jump/jump.funcs b/lib/ss/jump/jump.funcs
new file mode 100644
index 0000000..a8b08c6
--- /dev/null
+++ b/lib/ss/jump/jump.funcs
@@ -0,0 +1,26 @@
+00000000 T _initialize_ss_error_table libss jump/ss_err
+00000000 T _ss_create_invocation libss jump/invocation
+00000000 T _ss_delete_invocation libss jump/invocation
+00000000 T _ss_help libss jump/help
+00000000 T _ss_add_info_dir libss jump/help
+00000000 T _ss_delete_info_dir libss jump/help
+00000000 T _ss_execute_command libss jump/execute_cmd
+00000000 T _ss_execute_line libss jump/execute_cmd
+00000000 T _ss_listen libss jump/listen
+00000000 T _ss_abort_subsystem libss jump/listen
+00000000 T _ss_quit libss jump/listen
+00000000 T _ss_parse libss jump/parse
+00000000 T _ss_name libss jump/error
+00000000 T _ss_error libss jump/error
+00000000 T _ss_perror libss jump/error
+00000000 T _ss_set_prompt libss jump/prompt
+00000000 T _ss_get_prompt libss jump/prompt
+00000000 T _ss_add_request_table libss jump/request_tbl
+00000000 T _ss_delete_request_table libss jump/request_tbl
+00000000 T _ss_list_requests libss jump/list_rqs
+00000000 T _ss_pager_create libss jump/pager
+00000000 T _ss_page_stdin libss jump/pager
+00000000 T _ss_self_identify libss jump/requests
+00000000 T _ss_subsystem_name libss jump/requests
+00000000 T _ss_subsystem_version libss jump/requests
+00000000 T _ss_unimplemented libss jump/requests
diff --git a/lib/ss/jump/jump.import b/lib/ss/jump/jump.import
new file mode 100644
index 0000000..53208d5
--- /dev/null
+++ b/lib/ss/jump/jump.import
@@ -0,0 +1,166 @@
+00000004 D __et_list libcom_err jump/error_message
+00000004 D _com_err_hook libcom_err jump/com_err
+/usr/lib/libc.sa(__libc.o):00001000 a __GOT_SIZE
+/usr/lib/libc.sa(__libc.o):6008f0b0 A _AL
+/usr/lib/libc.sa(__libc.o):6008f198 A _AL_PARM
+/usr/lib/libc.sa(__libc.o):6008f060 A _AM
+/usr/lib/libc.sa(__libc.o):6008f0b4 A _BC
+/usr/lib/libc.sa(__libc.o):6008f064 A _BS
+/usr/lib/libc.sa(__libc.o):6008f0bc A _BT
+/usr/lib/libc.sa(__libc.o):6008f068 A _CA
+/usr/lib/libc.sa(__libc.o):6008f0c0 A _CD
+/usr/lib/libc.sa(__libc.o):6008f0c4 A _CE
+/usr/lib/libc.sa(__libc.o):6008f0c8 A _CL
+/usr/lib/libc.sa(__libc.o):6008f0cc A _CM
+/usr/lib/libc.sa(__libc.o):6008f048 A _COLS
+/usr/lib/libc.sa(__libc.o):6008f0d0 A _CR
+/usr/lib/libc.sa(__libc.o):6008f0d4 A _CS
+/usr/lib/libc.sa(__libc.o):6008f06c A _DA
+/usr/lib/libc.sa(__libc.o):6008f070 A _DB
+/usr/lib/libc.sa(__libc.o):6008f0d8 A _DC
+/usr/lib/libc.sa(__libc.o):6008f0dc A _DL
+/usr/lib/libc.sa(__libc.o):6008f19c A _DL_PARM
+/usr/lib/libc.sa(__libc.o):6008f0e0 A _DM
+/usr/lib/libc.sa(__libc.o):6008f0e4 A _DO
+/usr/lib/libc.sa(__libc.o):6008f1a4 A _DOWN_PARM
+/usr/lib/libc.sa(__libc.o):6008f03c A _Def_term
+/usr/lib/libc.sa(__libc.o):6008f0e8 A _ED
+/usr/lib/libc.sa(__libc.o):6008f0ec A _EI
+/usr/lib/libc.sa(__libc.o):6008f074 A _EO
+/usr/lib/libc.sa(__libc.o):6008f1b8 A _GT
+/usr/lib/libc.sa(__libc.o):6008f078 A _HC
+/usr/lib/libc.sa(__libc.o):6008f118 A _HO
+/usr/lib/libc.sa(__libc.o):6008f07c A _HZ
+/usr/lib/libc.sa(__libc.o):6008f11c A _IC
+/usr/lib/libc.sa(__libc.o):6008f120 A _IM
+/usr/lib/libc.sa(__libc.o):6008f080 A _IN
+/usr/lib/libc.sa(__libc.o):6008f124 A _IP
+/usr/lib/libc.sa(__libc.o):6008f0f0 A _K0
+/usr/lib/libc.sa(__libc.o):6008f0f4 A _K1
+/usr/lib/libc.sa(__libc.o):6008f0f8 A _K2
+/usr/lib/libc.sa(__libc.o):6008f0fc A _K3
+/usr/lib/libc.sa(__libc.o):6008f100 A _K4
+/usr/lib/libc.sa(__libc.o):6008f104 A _K5
+/usr/lib/libc.sa(__libc.o):6008f108 A _K6
+/usr/lib/libc.sa(__libc.o):6008f10c A _K7
+/usr/lib/libc.sa(__libc.o):6008f110 A _K8
+/usr/lib/libc.sa(__libc.o):6008f114 A _K9
+/usr/lib/libc.sa(__libc.o):6008f128 A _KD
+/usr/lib/libc.sa(__libc.o):6008f12c A _KE
+/usr/lib/libc.sa(__libc.o):6008f130 A _KH
+/usr/lib/libc.sa(__libc.o):6008f134 A _KL
+/usr/lib/libc.sa(__libc.o):6008f138 A _KR
+/usr/lib/libc.sa(__libc.o):6008f13c A _KS
+/usr/lib/libc.sa(__libc.o):6008f140 A _KU
+/usr/lib/libc.sa(__libc.o):6008f1a8 A _LEFT_PARM
+/usr/lib/libc.sa(__libc.o):6008f044 A _LINES
+/usr/lib/libc.sa(__libc.o):6008f144 A _LL
+/usr/lib/libc.sa(__libc.o):6008f148 A _MA
+/usr/lib/libc.sa(__libc.o):6008f300 A _MCAppPath
+/usr/lib/libc.sa(__libc.o):6008f084 A _MI
+/usr/lib/libc.sa(__libc.o):6008f088 A _MS
+/usr/lib/libc.sa(__libc.o):6008f030 A _My_term
+/usr/lib/libc.sa(__libc.o):6008f08c A _NC
+/usr/lib/libc.sa(__libc.o):6008f14c A _ND
+/usr/lib/libc.sa(__libc.o):6008f150 A _NL
+/usr/lib/libc.sa(__libc.o):6008f1bc A _NONL
+/usr/lib/libc.sa(__libc.o):6008f090 A _NS
+/usr/lib/libc.sa(__libc.o):6008f094 A _OS
+/usr/lib/libc.sa(__libc.o):6008f1b0 A _PC
+/usr/lib/libc.sa(__libc.o):6008f154 A _RC
+/usr/lib/libc.sa(__libc.o):6008f1ac A _RIGHT_PARM
+/usr/lib/libc.sa(__libc.o):6008f158 A _SC
+/usr/lib/libc.sa(__libc.o):6008f15c A _SE
+/usr/lib/libc.sa(__libc.o):6008f160 A _SF
+/usr/lib/libc.sa(__libc.o):6008f164 A _SO
+/usr/lib/libc.sa(__libc.o):6008f168 A _SR
+/usr/lib/libc.sa(__libc.o):6008f16c A _TA
+/usr/lib/libc.sa(__libc.o):6008f170 A _TE
+/usr/lib/libc.sa(__libc.o):6008f174 A _TI
+/usr/lib/libc.sa(__libc.o):6008f178 A _UC
+/usr/lib/libc.sa(__libc.o):6008f17c A _UE
+/usr/lib/libc.sa(__libc.o):6008f098 A _UL
+/usr/lib/libc.sa(__libc.o):6008f180 A _UP
+/usr/lib/libc.sa(__libc.o):6008f1c0 A _UPPERCASE
+/usr/lib/libc.sa(__libc.o):6008f1a0 A _UP_PARM
+/usr/lib/libc.sa(__libc.o):6008f188 A _US
+/usr/lib/libc.sa(__libc.o):6008f18c A _VB
+/usr/lib/libc.sa(__libc.o):6008f194 A _VE
+/usr/lib/libc.sa(__libc.o):6008f190 A _VS
+/usr/lib/libc.sa(__libc.o):6008f09c A _XB
+/usr/lib/libc.sa(__libc.o):6008f0a0 A _XN
+/usr/lib/libc.sa(__libc.o):6008f0a8 A _XS
+/usr/lib/libc.sa(__libc.o):6008f0a4 A _XT
+/usr/lib/libc.sa(__libc.o):6008f0ac A _XX
+/usr/lib/libc.sa(__libc.o):6008f2a4 A __IO_file_jumps
+/usr/lib/libc.sa(__libc.o):6008f1f4 A __IO_list_all
+/usr/lib/libc.sa(__libc.o):6008f2a8 A __IO_proc_jumps
+/usr/lib/libc.sa(__libc.o):6008f1ec A __IO_stderr_
+/usr/lib/libc.sa(__libc.o):6008f1e4 A __IO_stdin_
+/usr/lib/libc.sa(__libc.o):6008f1e8 A __IO_stdout_
+/usr/lib/libc.sa(__libc.o):6008f2ac A __IO_str_jumps
+/usr/lib/libc.sa(__libc.o):6008f214 A ____brk_addr
+/usr/lib/libc.sa(__libc.o):6008f01c A ___ctype_b
+/usr/lib/libc.sa(__libc.o):6008f020 A ___ctype_tolower
+/usr/lib/libc.sa(__libc.o):6008f024 A ___ctype_toupper
+/usr/lib/libc.sa(__libc.o):6008f1fc A ___environ
+/usr/lib/libc.sa(__libc.o):6008f250 A ___exit_funcs
+/usr/lib/libc.sa(__libc.o):6008f2f0 A ___glob_closedir_hook
+/usr/lib/libc.sa(__libc.o):6008f2f4 A ___glob_opendir_hook
+/usr/lib/libc.sa(__libc.o):6008f2f8 A ___glob_readdir_hook
+/usr/lib/libc.sa(__libc.o):6008f278 A ___ttyname
+/usr/lib/libc.sa(__libc.o):6008f238 A __collate_info
+/usr/lib/libc.sa(__libc.o):6008f23c A __ctype_info
+/usr/lib/libc.sa(__libc.o):6008f028 A __echoit
+/usr/lib/libc.sa(__libc.o):6008f034 A __endwin
+/usr/lib/libc.sa(__libc.o):6008f288 A __gdbm_fetch_val
+/usr/lib/libc.sa(__libc.o):6008f280 A __gdbm_file
+/usr/lib/libc.sa(__libc.o):6008f284 A __gdbm_memory
+/usr/lib/libc.sa(__libc.o):6008f240 A __monetary_info
+/usr/lib/libc.sa(__libc.o):6008f234 A __null_auth
+/usr/lib/libc.sa(__libc.o):6008f244 A __numeric_info
+/usr/lib/libc.sa(__libc.o):6008f2ec A __obstack
+/usr/lib/libc.sa(__libc.o):6008f1c8 A __pfast
+/usr/lib/libc.sa(__libc.o):6008f02c A __rawmode
+/usr/lib/libc.sa(__libc.o):6008f1dc A __res
+/usr/lib/libc.sa(__libc.o):6008f04c A __res_iflg
+/usr/lib/libc.sa(__libc.o):6008f050 A __res_lflg
+/usr/lib/libc.sa(__libc.o):6008f270 A __res_opcodes
+/usr/lib/libc.sa(__libc.o):6008f274 A __res_resultcodes
+/usr/lib/libc.sa(__libc.o):6008f248 A __response_info
+/usr/lib/libc.sa(__libc.o):6008f2fc A __sigintr
+/usr/lib/libc.sa(__libc.o):6008f00c A __sys_errlist
+/usr/lib/libc.sa(__libc.o):6008f010 A __sys_nerr
+/usr/lib/libc.sa(__libc.o):6008f014 A __sys_siglist
+/usr/lib/libc.sa(__libc.o):6008f24c A __time_info
+/usr/lib/libc.sa(__libc.o):6008f05c A __tty
+/usr/lib/libc.sa(__libc.o):6008f040 A __tty_ch
+/usr/lib/libc.sa(__libc.o):6008f1cc A __unctrl
+/usr/lib/libc.sa(__libc.o):6008f27c A __win
+/usr/lib/libc.sa(__libc.o):6008f058 A _curscr
+/usr/lib/libc.sa(__libc.o):6008f228 A _daylight
+/usr/lib/libc.sa(__libc.o):6008f200 A _errno
+/usr/lib/libc.sa(__libc.o):6008f1d0 A _gdbm_errno
+/usr/lib/libc.sa(__libc.o):6008f28c A _gdbm_version
+/usr/lib/libc.sa(__libc.o):6008f008 A _h_errlist
+/usr/lib/libc.sa(__libc.o):6008f1d8 A _h_errno
+/usr/lib/libc.sa(__libc.o):6008f2a0 A _h_nerr
+/usr/lib/libc.sa(__libc.o):6008f1c4 A _normtty
+/usr/lib/libc.sa(__libc.o):6008f204 A _optarg
+/usr/lib/libc.sa(__libc.o):6008f20c A _opterr
+/usr/lib/libc.sa(__libc.o):6008f208 A _optind
+/usr/lib/libc.sa(__libc.o):6008f2e4 A _optopt
+/usr/lib/libc.sa(__libc.o):6008f218 A _ospeed
+/usr/lib/libc.sa(__libc.o):6008f26c A _re_max_failures
+/usr/lib/libc.sa(__libc.o):6008f210 A _re_syntax_options
+/usr/lib/libc.sa(__libc.o):6008f1e0 A _rexecoptions
+/usr/lib/libc.sa(__libc.o):6008f230 A _rpc_createerr
+/usr/lib/libc.sa(__libc.o):6008f25c A _stderr
+/usr/lib/libc.sa(__libc.o):6008f254 A _stdin
+/usr/lib/libc.sa(__libc.o):6008f258 A _stdout
+/usr/lib/libc.sa(__libc.o):6008f054 A _stdscr
+/usr/lib/libc.sa(__libc.o):6008f2e8 A _svc_fdset
+/usr/lib/libc.sa(__libc.o):6008f224 A _timezone
+/usr/lib/libc.sa(__libc.o):6008f21c A _tputs_baud_rate
+/usr/lib/libc.sa(__libc.o):6008f038 A _ttytype
+/usr/lib/libc.sa(__libc.o):6008f220 A _tzname
diff --git a/lib/ss/jump/jump.params b/lib/ss/jump/jump.params
new file mode 100644
index 0000000..2947e28
--- /dev/null
+++ b/lib/ss/jump/jump.params
@@ -0,0 +1,6 @@
+Name=libss
+Text=0x66880000
+Data=0x00000000
+Jump=0x00001000
+GOT=0x00001000
+Version=1.0.0
diff --git a/lib/ss/jump/jump.undefs b/lib/ss/jump/jump.undefs
new file mode 100644
index 0000000..1a2f89a
--- /dev/null
+++ b/lib/ss/jump/jump.undefs
@@ -0,0 +1,2 @@
+66885010 D __NEEDS_SHRLIB_libc_4
+66885024 D __NEEDS_SHRLIB_libet_1
diff --git a/lib/ss/jump/jump.vars b/lib/ss/jump/jump.vars
new file mode 100644
index 0000000..95cd8e4
--- /dev/null
+++ b/lib/ss/jump/jump.vars
@@ -0,0 +1,3 @@
+00000020 K _ss_std_requests libss jump/std_rqs
+00000004 D __ss_table libss jump/data
+00000004 D __ss_pager_name libss jump/data
diff --git a/lib/ss/list_rqs.c b/lib/ss/list_rqs.c
index 14877bb..8c797ad 100644
--- a/lib/ss/list_rqs.c
+++ b/lib/ss/list_rqs.c
@@ -21,7 +21,7 @@
" ";
static char const NL[2] = "\n";
-ss_list_requests(argc, argv, sci_idx, info_ptr)
+void ss_list_requests(argc, argv, sci_idx, info_ptr)
int argc;
char **argv;
int sci_idx;
@@ -35,22 +35,38 @@
char buffer[BUFSIZ];
FILE *output;
int fd;
+#ifdef POSIX_SIGNALS
+ sigset_t omask, igmask;
+#else
int mask;
+#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);
+#ifdef POSIX_SIGNALS
+ sigemptyset(&igmask);
+ sigaddset(&igmask, SIGINT);
+ sigprocmask(SIG_BLOCK, &igmask, &omask);
+#else
mask = sigblock(sigmask(SIGINT));
+#endif
func = signal(SIGINT, SIG_IGN);
fd = ss_pager_create();
output = fdopen(fd, "w");
+#ifdef POSIX_SIGNALS
+ sigprocmask(SIG_SETMASK, &omask, (sigset_t *) 0);
+#else
sigsetmask(mask);
+#endif
fprintf (output, "Available %s requests:\n\n",
ss_info (sci_idx) -> subsystem_name);
diff --git a/lib/ss/listen.c b/lib/ss/listen.c
index 13844a0..765b757 100644
--- a/lib/ss/listen.c
+++ b/lib/ss/listen.c
@@ -61,7 +61,11 @@
char input[BUFSIZ];
char buffer[BUFSIZ];
char *end = buffer;
+#ifdef POSIX_SIGNALS
+ sigset_t omask, igmask;
+#else
int mask;
+#endif
int code;
jmp_buf old_jmpb;
ss_data *old_info = current_info;
@@ -69,11 +73,21 @@
current_info = info = ss_info(sci_idx);
sig_cont = (sigret_t (*)()) 0;
info->abort = 0;
+#ifdef POSIX_SIGNALS
+ sigemptyset(&igmask);
+ sigaddset(&igmask, SIGINT);
+ sigprocmask(SIG_BLOCK, &igmask, &omask);
+#else
mask = sigblock(sigmask(SIGINT));
+#endif
memcpy(old_jmpb, listen_jmpb, sizeof(jmp_buf));
sig_int = signal(SIGINT, listen_int_handler);
setjmp(listen_jmpb);
+#ifdef POSIX_SIGNALS
+ sigprocmask(SIG_SETMASK, &omask, (sigset_t *) 0);
+#else
(void) sigsetmask(mask);
+#endif
while(!info->abort) {
print_prompt();
*end = '\0';
diff --git a/lib/ss/pager.c b/lib/ss/pager.c
index b951fa6..ff915da 100644
--- a/lib/ss/pager.c
+++ b/lib/ss/pager.c
@@ -7,6 +7,10 @@
* For copyright information, see copyright.h.
*/
+#ifdef HAS_UNISTD_H
+#include <unistd.h>
+#endif
+
#include "ss_internal.h"
#include "copyright.h"
#include <stdio.h>
@@ -26,7 +30,6 @@
* handle SIGINT sensibly
* allow finer control -- put-page-break-here
*/
-void ss_page_stdin();
#ifndef NO_FORK
int ss_pager_create()
@@ -71,9 +74,17 @@
(void) close(i);
(void) signal(SIGINT, SIG_DFL);
{
+#ifdef POSIX_SIGNALS
+ sigset_t mask;
+
+ sigprocmask(SIG_BLOCK, 0, &mask);
+ sigdelset(&mask, SIGINT);
+ sigprocmask(SIG_SETMASK, &mask, 0);
+#else
int mask = sigblock(0);
mask &= ~sigmask(SIGINT);
sigsetmask(mask);
+#endif
}
if (_ss_pager_name == (char *)NULL) {
if ((_ss_pager_name = getenv("PAGER")) == (char *)NULL)
diff --git a/lib/ss/parse.c b/lib/ss/parse.c
index e1dec31..68a5064 100644
--- a/lib/ss/parse.c
+++ b/lib/ss/parse.c
@@ -4,14 +4,13 @@
* For copyright info, see copyright.h.
*/
+#ifdef HAS_STDLIB_H
+#include <stdlib.h>
+#endif
+
#include "ss_internal.h"
#include "copyright.h"
-#ifndef lint
-static char const rcsid[] =
- "$Header$";
-#endif
-
enum parse_mode { WHITESPACE, TOKEN, QUOTED_STRING };
/*
diff --git a/lib/ss/prompt.c b/lib/ss/prompt.c
index bc95d82..67d79eb 100644
--- a/lib/ss/prompt.c
+++ b/lib/ss/prompt.c
@@ -13,19 +13,23 @@
#include <stdio.h>
#include "ss_internal.h"
-static const char rcsid[] =
- "$Header$";
-
-ss_set_prompt(sci_idx, new_prompt)
+#ifdef __STDC__
+void ss_set_prompt(int sci_idx, char *new_prompt)
+#else
+void ss_set_prompt(sci_idx, new_prompt)
int sci_idx;
char *new_prompt;
+#endif
{
ss_info(sci_idx)->prompt = new_prompt;
}
-char *
-ss_get_prompt(sci_idx)
+#ifdef __STDC__
+char *ss_get_prompt(int sci_idx)
+#else
+char *ss_get_prompt(sci_idx)
int sci_idx;
+#endif
{
return(ss_info(sci_idx)->prompt);
}
diff --git a/lib/ss/requests.c b/lib/ss/requests.c
index bfe69f1..5205337 100644
--- a/lib/ss/requests.c
+++ b/lib/ss/requests.c
@@ -10,8 +10,12 @@
#include <stdio.h>
#include "ss_internal.h"
-#define DECLARE(name) name(argc,argv,sci_idx)int argc,sci_idx;char **argv;
-
+#ifdef __STDC__
+#define DECLARE(name) void name(int argc,char **argv, int sci_idx)
+#else
+#define DECLARE(name) void name(argc,argv,sci_idx)int argc,sci_idx;char **argv;
+#endif
+
/*
* ss_self_identify -- assigned by default to the "." request
*/
diff --git a/lib/ss/ss.h b/lib/ss/ss.h
index 4fa3ebe..29aa9dc 100644
--- a/lib/ss/ss.h
+++ b/lib/ss/ss.h
@@ -47,9 +47,11 @@
#define SS_OPT_DONT_SUMMARIZE 0x0002
void ss_help __SS_PROTO;
-char *ss_current_request();
-char *ss_name();
+#if 0
+char *ss_current_request(); /* This is actually a macro */
+#endif
#ifdef __STDC__
+char *ss_name(int sci_idx);
void ss_error (int, long, char const *, ...);
void ss_perror (int, long, char const *);
int ss_create_invocation(char *, char *, char *, ss_request_table *, int *);
@@ -57,7 +59,9 @@
int ss_listen(int);
void ss_add_request_table(int, ss_request_table *, int, int *);
void ss_delete_request_table(int, ss_request_table *, int *);
+void ss_abort_subsystem(int sci_idx, int code);
#else
+char *ss_name();
void ss_error ();
void ss_perror ();
int ss_create_invocation();
@@ -65,7 +69,7 @@
int ss_listen();
void ss_add_request_table();
void ss_delete_request_table();
-#endif
void ss_abort_subsystem();
+#endif
extern ss_request_table ss_std_requests;
#endif /* _ss_h */
diff --git a/lib/ss/ss_internal.h b/lib/ss/ss_internal.h
index 4b9ea23..fc4a2ad 100644
--- a/lib/ss/ss_internal.h
+++ b/lib/ss/ss_internal.h
@@ -11,11 +11,13 @@
#ifdef __STDC__
+#define NOARGS void
#define PROTOTYPE(p) p
typedef void * pointer;
#else
+#define NOARGS
#define const
#define volatile
#define PROTOTYPE(p) ()
@@ -95,12 +97,12 @@
#define ss_info(sci_idx) (_ss_table[sci_idx])
#define ss_current_request(sci_idx,code_ptr) \
(*code_ptr=0,ss_info(sci_idx)->current_request)
-void ss_unknown_function();
-void ss_delete_info_dir();
-int ss_execute_line();
-char **ss_parse();
+void ss_delete_info_dir PROTOTYPE((int sci_idx, char *info_dir,
+ int *code_ptr));
+int ss_execute_line PROTOTYPE((int sci_idx, char *line_ptr));
+char **ss_parse PROTOTYPE((int sci_idx, char *line_ptr, int *argc_ptr));
ss_abbrev_info *ss_abbrev_initialize PROTOTYPE((char *, int *));
-void ss_page_stdin();
+void ss_page_stdin(NOARGS);
extern ss_data **_ss_table;
extern char *ss_et_msgs[];
diff --git a/lib/ss/test_ss.c b/lib/ss/test_ss.c
index 502256d..ee9c087 100644
--- a/lib/ss/test_ss.c
+++ b/lib/ss/test_ss.c
@@ -9,8 +9,8 @@
* $Locker$
*
* $Log$
- * Revision 1.1 1997/04/26 13:21:42 tytso
- * Checkin of e2fsprogs 0.5
+ * Revision 1.2 1997/04/26 13:34:09 tytso
+ * Checkin of e2fsprogs 0.5b
*
* Revision 1.1 1993/06/03 12:31:25 tytso
* Initial revision