Index: trunk/minix/lib/other/Makedepend-ack
===================================================================
--- trunk/minix/lib/other/Makedepend-ack	(revision 9)
+++ 	(revision )
@@ -1,79 +1,0 @@
-depend-ack:
-	rm .depend-ack
-	touch .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _allocmem.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _brk.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _devctl.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' __pm_findproc.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _freemem.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _getnpid.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _getsigset.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _getnprocnr.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _getpprocnr.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _getprocnr.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _getsysinfo.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _reboot.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _seekdir.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _svrctl.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' asynchio.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' basename.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' bcmp.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' bcopy.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' bzero.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' configfile.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' crypt.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' ctermid.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' cuserid.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' environ.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' errno.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' fdopen.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' ffs.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' flock.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' fslib.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' fts.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' fsversion.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getgrent.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getlogin.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getpagesize.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getpass.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getpwent.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getttyent.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getw.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' hypot.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' index.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' itoa.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' loadname.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' lock.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' lrand.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' lsearch.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' memccpy.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' mstats.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' mtab.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' nlist.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' paramvalue.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' peekpoke.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' popen.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' putenv.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' putw.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' random.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' rindex.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' setenv.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' setgroups.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' settimeofday.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' stderr.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' strdup.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' strtok_r.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' swab.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' sys_eniop.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' syscall.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' sysconf.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' syslog.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' taskcall.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' telldir.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' termcap.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' ttyname.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' ttyslot.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' v8regerror.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' v8regexp.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' v8regsub.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
-	mkdep 'cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' writev.c | sed -e 's:^\(.\):../obj-ack//./other/\1:' >> .depend-ack
Index: trunk/minix/lib/other/Makedepend-gnu
===================================================================
--- trunk/minix/lib/other/Makedepend-gnu	(revision 9)
+++ 	(revision )
@@ -1,79 +1,0 @@
-depend-gnu:
-	rm .depend-gnu
-	touch .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _allocmem.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _brk.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _devctl.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' __pm_findproc.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _freemem.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _getnpid.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _getsigset.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _getnprocnr.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _getpprocnr.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _getprocnr.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _getsysinfo.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _reboot.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _seekdir.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' _svrctl.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' asynchio.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' basename.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' bcmp.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' bcopy.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' bzero.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' configfile.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' crypt.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' ctermid.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' cuserid.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' environ.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' errno.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' fdopen.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' ffs.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' flock.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' fslib.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' fts.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' fsversion.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getgrent.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getlogin.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getpagesize.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getpass.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getpwent.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getttyent.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' getw.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' hypot.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' index.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' itoa.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' loadname.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' lock.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' lrand.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' lsearch.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' memccpy.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' mstats.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' mtab.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' nlist.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' paramvalue.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' peekpoke.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' popen.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' putenv.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' putw.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' random.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' rindex.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' setenv.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' setgroups.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' settimeofday.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' stderr.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' strdup.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' strtok_r.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' swab.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' sys_eniop.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' syscall.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' sysconf.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' syslog.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' taskcall.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' telldir.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' termcap.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' ttyname.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' ttyslot.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' v8regerror.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' v8regexp.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' v8regsub.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
-	mkdep 'gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -E' writev.c | sed -e '/<built-in>/d' -e '/<command line>/d' -e 's:^\(.\):../obj-gnu/./other/\1:' >> .depend-gnu
Index: trunk/minix/lib/other/Makefile
===================================================================
--- trunk/minix/lib/other/Makefile	(revision 9)
+++ 	(revision )
@@ -1,577 +1,0 @@
-#Generated from ./other/Makefile.in
-all: all-ack
-
-all-ack:
-all-gnu:
-
-makefiles: Makefile
-Makedepend-ack Makedepend-gnu: 
-	sh ../generate.sh ./other ../obj-ack/ ../obj-gnu
-
-Makefile: Makefile.in Makedepend-ack Makedepend-gnu
-	sh ../generate.sh ./other ../obj-ack/ ../obj-gnu
-	@echo
-	@echo *Attention*
-	@echo Makefile is regenerated... rerun command to see changes
-	@echo *Attention*
-	@echo
-
-depend: depend-ack
-all-ack: ../obj-ack//libc.a
-
-../obj-ack//libc.a: ../obj-ack//libc.a(_allocmem.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(_brk.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(_devctl.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(__pm_findproc.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(_freemem.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(_getnpid.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(_getsigset.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(_getnprocnr.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(_getpprocnr.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(_getprocnr.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(_getsysinfo.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(_reboot.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(_seekdir.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(_svrctl.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(asynchio.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(basename.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(bcmp.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(bcopy.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(bzero.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(configfile.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(crypt.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(ctermid.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(cuserid.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(environ.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(errno.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(fdopen.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(ffs.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(flock.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(fslib.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(fts.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(fsversion.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(getgrent.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(getlogin.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(getpagesize.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(getpass.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(getpwent.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(getttyent.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(getw.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(hypot.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(index.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(itoa.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(loadname.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(lock.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(lrand.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(lsearch.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(memccpy.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(mstats.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(mtab.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(nlist.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(paramvalue.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(peekpoke.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(popen.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(putenv.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(putw.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(random.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(rindex.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(setenv.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(setgroups.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(settimeofday.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(stderr.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(strdup.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(strtok_r.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(swab.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(sys_eniop.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(syscall.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(sysconf.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(syslog.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(taskcall.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(telldir.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(termcap.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(ttyname.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(ttyslot.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(v8regerror.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(v8regexp.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(v8regsub.o)
-../obj-ack//libc.a: ../obj-ack//libc.a(writev.o)
-
-../obj-ack//libc.a:
-	ar cr ../obj-ack//libc.a ../obj-ack//./other/*.o
-	rm ../obj-ack//./other/*.o
-
-../obj-ack//libc.a(_allocmem.o): _allocmem.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_allocmem.o _allocmem.c
-../obj-ack//libc.a(_brk.o): _brk.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_brk.o _brk.c
-../obj-ack//libc.a(_devctl.o): _devctl.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_devctl.o _devctl.c
-../obj-ack//libc.a(__pm_findproc.o): __pm_findproc.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/__pm_findproc.o __pm_findproc.c
-../obj-ack//libc.a(_freemem.o): _freemem.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_freemem.o _freemem.c
-../obj-ack//libc.a(_getnpid.o): _getnpid.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_getnpid.o _getnpid.c
-../obj-ack//libc.a(_getsigset.o): _getsigset.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_getsigset.o _getsigset.c
-../obj-ack//libc.a(_getnprocnr.o): _getnprocnr.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_getnprocnr.o _getnprocnr.c
-../obj-ack//libc.a(_getpprocnr.o): _getpprocnr.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_getpprocnr.o _getpprocnr.c
-../obj-ack//libc.a(_getprocnr.o): _getprocnr.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_getprocnr.o _getprocnr.c
-../obj-ack//libc.a(_getsysinfo.o): _getsysinfo.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_getsysinfo.o _getsysinfo.c
-../obj-ack//libc.a(_reboot.o): _reboot.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_reboot.o _reboot.c
-../obj-ack//libc.a(_seekdir.o): _seekdir.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_seekdir.o _seekdir.c
-../obj-ack//libc.a(_svrctl.o): _svrctl.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/_svrctl.o _svrctl.c
-../obj-ack//libc.a(asynchio.o): asynchio.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/asynchio.o asynchio.c
-../obj-ack//libc.a(basename.o): basename.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/basename.o basename.c
-../obj-ack//libc.a(bcmp.o): bcmp.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/bcmp.o bcmp.c
-../obj-ack//libc.a(bcopy.o): bcopy.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/bcopy.o bcopy.c
-../obj-ack//libc.a(bzero.o): bzero.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/bzero.o bzero.c
-../obj-ack//libc.a(configfile.o): configfile.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/configfile.o configfile.c
-../obj-ack//libc.a(crypt.o): crypt.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/crypt.o crypt.c
-../obj-ack//libc.a(ctermid.o): ctermid.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/ctermid.o ctermid.c
-../obj-ack//libc.a(cuserid.o): cuserid.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/cuserid.o cuserid.c
-../obj-ack//libc.a(environ.o): environ.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/environ.o environ.c
-../obj-ack//libc.a(errno.o): errno.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/errno.o errno.c
-../obj-ack//libc.a(fdopen.o): fdopen.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/fdopen.o fdopen.c
-../obj-ack//libc.a(ffs.o): ffs.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/ffs.o ffs.c
-../obj-ack//libc.a(flock.o): flock.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/flock.o flock.c
-../obj-ack//libc.a(fslib.o): fslib.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/fslib.o fslib.c
-../obj-ack//libc.a(fts.o): fts.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/fts.o fts.c
-../obj-ack//libc.a(fsversion.o): fsversion.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/fsversion.o fsversion.c
-../obj-ack//libc.a(getgrent.o): getgrent.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/getgrent.o getgrent.c
-../obj-ack//libc.a(getlogin.o): getlogin.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/getlogin.o getlogin.c
-../obj-ack//libc.a(getpagesize.o): getpagesize.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/getpagesize.o getpagesize.c
-../obj-ack//libc.a(getpass.o): getpass.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/getpass.o getpass.c
-../obj-ack//libc.a(getpwent.o): getpwent.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/getpwent.o getpwent.c
-../obj-ack//libc.a(getttyent.o): getttyent.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/getttyent.o getttyent.c
-../obj-ack//libc.a(getw.o): getw.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/getw.o getw.c
-../obj-ack//libc.a(hypot.o): hypot.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/hypot.o hypot.c
-../obj-ack//libc.a(index.o): index.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/index.o index.c
-../obj-ack//libc.a(itoa.o): itoa.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/itoa.o itoa.c
-../obj-ack//libc.a(loadname.o): loadname.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/loadname.o loadname.c
-../obj-ack//libc.a(lock.o): lock.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/lock.o lock.c
-../obj-ack//libc.a(lrand.o): lrand.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/lrand.o lrand.c
-../obj-ack//libc.a(lsearch.o): lsearch.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/lsearch.o lsearch.c
-../obj-ack//libc.a(memccpy.o): memccpy.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/memccpy.o memccpy.c
-../obj-ack//libc.a(mstats.o): mstats.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/mstats.o mstats.c
-../obj-ack//libc.a(mtab.o): mtab.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/mtab.o mtab.c
-../obj-ack//libc.a(nlist.o): nlist.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/nlist.o nlist.c
-../obj-ack//libc.a(paramvalue.o): paramvalue.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/paramvalue.o paramvalue.c
-../obj-ack//libc.a(peekpoke.o): peekpoke.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/peekpoke.o peekpoke.c
-../obj-ack//libc.a(popen.o): popen.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/popen.o popen.c
-../obj-ack//libc.a(putenv.o): putenv.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/putenv.o putenv.c
-../obj-ack//libc.a(putw.o): putw.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/putw.o putw.c
-../obj-ack//libc.a(random.o): random.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/random.o random.c
-../obj-ack//libc.a(rindex.o): rindex.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/rindex.o rindex.c
-../obj-ack//libc.a(setenv.o): setenv.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/setenv.o setenv.c
-../obj-ack//libc.a(setgroups.o): setgroups.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/setgroups.o setgroups.c
-../obj-ack//libc.a(settimeofday.o): settimeofday.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/settimeofday.o settimeofday.c
-../obj-ack//libc.a(stderr.o): stderr.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/stderr.o stderr.c
-../obj-ack//libc.a(strdup.o): strdup.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/strdup.o strdup.c
-../obj-ack//libc.a(strtok_r.o): strtok_r.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/strtok_r.o strtok_r.c
-../obj-ack//libc.a(swab.o): swab.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/swab.o swab.c
-../obj-ack//libc.a(sys_eniop.o): sys_eniop.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/sys_eniop.o sys_eniop.c
-../obj-ack//libc.a(syscall.o): syscall.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/syscall.o syscall.c
-../obj-ack//libc.a(sysconf.o): sysconf.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/sysconf.o sysconf.c
-../obj-ack//libc.a(syslog.o): syslog.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/syslog.o syslog.c
-../obj-ack//libc.a(taskcall.o): taskcall.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/taskcall.o taskcall.c
-../obj-ack//libc.a(telldir.o): telldir.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/telldir.o telldir.c
-../obj-ack//libc.a(termcap.o): termcap.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/termcap.o termcap.c
-../obj-ack//libc.a(ttyname.o): ttyname.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/ttyname.o ttyname.c
-../obj-ack//libc.a(ttyslot.o): ttyslot.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/ttyslot.o ttyslot.c
-../obj-ack//libc.a(v8regerror.o): v8regerror.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/v8regerror.o v8regerror.c
-../obj-ack//libc.a(v8regexp.o): v8regexp.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/v8regexp.o v8regexp.c
-../obj-ack//libc.a(v8regsub.o): v8regsub.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/v8regsub.o v8regsub.c
-../obj-ack//libc.a(writev.o): writev.c
-	cc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-ack//./other/writev.o writev.c
-
-all-gnu: ../obj-gnu/libc.a
-
-../obj-gnu/libc.a: ../obj-gnu/./other/_allocmem.o
-../obj-gnu/libc.a: ../obj-gnu/./other/_brk.o
-../obj-gnu/libc.a: ../obj-gnu/./other/_devctl.o
-../obj-gnu/libc.a: ../obj-gnu/./other/__pm_findproc.o
-../obj-gnu/libc.a: ../obj-gnu/./other/_freemem.o
-../obj-gnu/libc.a: ../obj-gnu/./other/_getnpid.o
-../obj-gnu/libc.a: ../obj-gnu/./other/_getsigset.o
-../obj-gnu/libc.a: ../obj-gnu/./other/_getnprocnr.o
-../obj-gnu/libc.a: ../obj-gnu/./other/_getpprocnr.o
-../obj-gnu/libc.a: ../obj-gnu/./other/_getprocnr.o
-../obj-gnu/libc.a: ../obj-gnu/./other/_getsysinfo.o
-../obj-gnu/libc.a: ../obj-gnu/./other/_reboot.o
-../obj-gnu/libc.a: ../obj-gnu/./other/_seekdir.o
-../obj-gnu/libc.a: ../obj-gnu/./other/_svrctl.o
-../obj-gnu/libc.a: ../obj-gnu/./other/asynchio.o
-../obj-gnu/libc.a: ../obj-gnu/./other/basename.o
-../obj-gnu/libc.a: ../obj-gnu/./other/bcmp.o
-../obj-gnu/libc.a: ../obj-gnu/./other/bcopy.o
-../obj-gnu/libc.a: ../obj-gnu/./other/bzero.o
-../obj-gnu/libc.a: ../obj-gnu/./other/configfile.o
-../obj-gnu/libc.a: ../obj-gnu/./other/crypt.o
-../obj-gnu/libc.a: ../obj-gnu/./other/ctermid.o
-../obj-gnu/libc.a: ../obj-gnu/./other/cuserid.o
-../obj-gnu/libc.a: ../obj-gnu/./other/environ.o
-../obj-gnu/libc.a: ../obj-gnu/./other/errno.o
-../obj-gnu/libc.a: ../obj-gnu/./other/fdopen.o
-../obj-gnu/libc.a: ../obj-gnu/./other/ffs.o
-../obj-gnu/libc.a: ../obj-gnu/./other/flock.o
-../obj-gnu/libc.a: ../obj-gnu/./other/fslib.o
-../obj-gnu/libc.a: ../obj-gnu/./other/fts.o
-../obj-gnu/libc.a: ../obj-gnu/./other/fsversion.o
-../obj-gnu/libc.a: ../obj-gnu/./other/getgrent.o
-../obj-gnu/libc.a: ../obj-gnu/./other/getlogin.o
-../obj-gnu/libc.a: ../obj-gnu/./other/getpagesize.o
-../obj-gnu/libc.a: ../obj-gnu/./other/getpass.o
-../obj-gnu/libc.a: ../obj-gnu/./other/getpwent.o
-../obj-gnu/libc.a: ../obj-gnu/./other/getttyent.o
-../obj-gnu/libc.a: ../obj-gnu/./other/getw.o
-../obj-gnu/libc.a: ../obj-gnu/./other/hypot.o
-../obj-gnu/libc.a: ../obj-gnu/./other/index.o
-../obj-gnu/libc.a: ../obj-gnu/./other/itoa.o
-../obj-gnu/libc.a: ../obj-gnu/./other/loadname.o
-../obj-gnu/libc.a: ../obj-gnu/./other/lock.o
-../obj-gnu/libc.a: ../obj-gnu/./other/lrand.o
-../obj-gnu/libc.a: ../obj-gnu/./other/lsearch.o
-../obj-gnu/libc.a: ../obj-gnu/./other/memccpy.o
-../obj-gnu/libc.a: ../obj-gnu/./other/mstats.o
-../obj-gnu/libc.a: ../obj-gnu/./other/mtab.o
-../obj-gnu/libc.a: ../obj-gnu/./other/nlist.o
-../obj-gnu/libc.a: ../obj-gnu/./other/paramvalue.o
-../obj-gnu/libc.a: ../obj-gnu/./other/peekpoke.o
-../obj-gnu/libc.a: ../obj-gnu/./other/popen.o
-../obj-gnu/libc.a: ../obj-gnu/./other/putenv.o
-../obj-gnu/libc.a: ../obj-gnu/./other/putw.o
-../obj-gnu/libc.a: ../obj-gnu/./other/random.o
-../obj-gnu/libc.a: ../obj-gnu/./other/rindex.o
-../obj-gnu/libc.a: ../obj-gnu/./other/setenv.o
-../obj-gnu/libc.a: ../obj-gnu/./other/setgroups.o
-../obj-gnu/libc.a: ../obj-gnu/./other/settimeofday.o
-../obj-gnu/libc.a: ../obj-gnu/./other/stderr.o
-../obj-gnu/libc.a: ../obj-gnu/./other/strdup.o
-../obj-gnu/libc.a: ../obj-gnu/./other/strtok_r.o
-../obj-gnu/libc.a: ../obj-gnu/./other/swab.o
-../obj-gnu/libc.a: ../obj-gnu/./other/sys_eniop.o
-../obj-gnu/libc.a: ../obj-gnu/./other/syscall.o
-../obj-gnu/libc.a: ../obj-gnu/./other/sysconf.o
-../obj-gnu/libc.a: ../obj-gnu/./other/syslog.o
-../obj-gnu/libc.a: ../obj-gnu/./other/taskcall.o
-../obj-gnu/libc.a: ../obj-gnu/./other/telldir.o
-../obj-gnu/libc.a: ../obj-gnu/./other/termcap.o
-../obj-gnu/libc.a: ../obj-gnu/./other/ttyname.o
-../obj-gnu/libc.a: ../obj-gnu/./other/ttyslot.o
-../obj-gnu/libc.a: ../obj-gnu/./other/v8regerror.o
-../obj-gnu/libc.a: ../obj-gnu/./other/v8regexp.o
-../obj-gnu/libc.a: ../obj-gnu/./other/v8regsub.o
-../obj-gnu/libc.a: ../obj-gnu/./other/writev.o
-
-../obj-gnu/libc.a:
-	gar cr ../obj-gnu/libc.a $?
-
-../obj-gnu/./other/_allocmem.o: _allocmem.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_allocmem.o _allocmem.c
-
-../obj-gnu/./other/_brk.o: _brk.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_brk.o _brk.c
-
-../obj-gnu/./other/_devctl.o: _devctl.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_devctl.o _devctl.c
-
-../obj-gnu/./other/__pm_findproc.o: __pm_findproc.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/__pm_findproc.o __pm_findproc.c
-
-../obj-gnu/./other/_freemem.o: _freemem.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_freemem.o _freemem.c
-
-../obj-gnu/./other/_getnpid.o: _getnpid.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_getnpid.o _getnpid.c
-
-../obj-gnu/./other/_getsigset.o: _getsigset.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_getsigset.o _getsigset.c
-
-../obj-gnu/./other/_getnprocnr.o: _getnprocnr.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_getnprocnr.o _getnprocnr.c
-
-../obj-gnu/./other/_getpprocnr.o: _getpprocnr.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_getpprocnr.o _getpprocnr.c
-
-../obj-gnu/./other/_getprocnr.o: _getprocnr.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_getprocnr.o _getprocnr.c
-
-../obj-gnu/./other/_getsysinfo.o: _getsysinfo.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_getsysinfo.o _getsysinfo.c
-
-../obj-gnu/./other/_reboot.o: _reboot.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_reboot.o _reboot.c
-
-../obj-gnu/./other/_seekdir.o: _seekdir.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_seekdir.o _seekdir.c
-
-../obj-gnu/./other/_svrctl.o: _svrctl.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/_svrctl.o _svrctl.c
-
-../obj-gnu/./other/asynchio.o: asynchio.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/asynchio.o asynchio.c
-
-../obj-gnu/./other/basename.o: basename.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/basename.o basename.c
-
-../obj-gnu/./other/bcmp.o: bcmp.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/bcmp.o bcmp.c
-
-../obj-gnu/./other/bcopy.o: bcopy.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/bcopy.o bcopy.c
-
-../obj-gnu/./other/bzero.o: bzero.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/bzero.o bzero.c
-
-../obj-gnu/./other/configfile.o: configfile.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/configfile.o configfile.c
-
-../obj-gnu/./other/crypt.o: crypt.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/crypt.o crypt.c
-
-../obj-gnu/./other/ctermid.o: ctermid.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/ctermid.o ctermid.c
-
-../obj-gnu/./other/cuserid.o: cuserid.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/cuserid.o cuserid.c
-
-../obj-gnu/./other/environ.o: environ.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/environ.o environ.c
-
-../obj-gnu/./other/errno.o: errno.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/errno.o errno.c
-
-../obj-gnu/./other/fdopen.o: fdopen.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/fdopen.o fdopen.c
-
-../obj-gnu/./other/ffs.o: ffs.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/ffs.o ffs.c
-
-../obj-gnu/./other/flock.o: flock.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/flock.o flock.c
-
-../obj-gnu/./other/fslib.o: fslib.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/fslib.o fslib.c
-
-../obj-gnu/./other/fts.o: fts.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/fts.o fts.c
-
-../obj-gnu/./other/fsversion.o: fsversion.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/fsversion.o fsversion.c
-
-../obj-gnu/./other/getgrent.o: getgrent.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/getgrent.o getgrent.c
-
-../obj-gnu/./other/getlogin.o: getlogin.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/getlogin.o getlogin.c
-
-../obj-gnu/./other/getpagesize.o: getpagesize.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/getpagesize.o getpagesize.c
-
-../obj-gnu/./other/getpass.o: getpass.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/getpass.o getpass.c
-
-../obj-gnu/./other/getpwent.o: getpwent.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/getpwent.o getpwent.c
-
-../obj-gnu/./other/getttyent.o: getttyent.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/getttyent.o getttyent.c
-
-../obj-gnu/./other/getw.o: getw.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/getw.o getw.c
-
-../obj-gnu/./other/hypot.o: hypot.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/hypot.o hypot.c
-
-../obj-gnu/./other/index.o: index.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/index.o index.c
-
-../obj-gnu/./other/itoa.o: itoa.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/itoa.o itoa.c
-
-../obj-gnu/./other/loadname.o: loadname.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/loadname.o loadname.c
-
-../obj-gnu/./other/lock.o: lock.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/lock.o lock.c
-
-../obj-gnu/./other/lrand.o: lrand.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/lrand.o lrand.c
-
-../obj-gnu/./other/lsearch.o: lsearch.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/lsearch.o lsearch.c
-
-../obj-gnu/./other/memccpy.o: memccpy.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/memccpy.o memccpy.c
-
-../obj-gnu/./other/mstats.o: mstats.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/mstats.o mstats.c
-
-../obj-gnu/./other/mtab.o: mtab.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/mtab.o mtab.c
-
-../obj-gnu/./other/nlist.o: nlist.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/nlist.o nlist.c
-
-../obj-gnu/./other/paramvalue.o: paramvalue.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/paramvalue.o paramvalue.c
-
-../obj-gnu/./other/peekpoke.o: peekpoke.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/peekpoke.o peekpoke.c
-
-../obj-gnu/./other/popen.o: popen.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/popen.o popen.c
-
-../obj-gnu/./other/putenv.o: putenv.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/putenv.o putenv.c
-
-../obj-gnu/./other/putw.o: putw.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/putw.o putw.c
-
-../obj-gnu/./other/random.o: random.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/random.o random.c
-
-../obj-gnu/./other/rindex.o: rindex.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/rindex.o rindex.c
-
-../obj-gnu/./other/setenv.o: setenv.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/setenv.o setenv.c
-
-../obj-gnu/./other/setgroups.o: setgroups.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/setgroups.o setgroups.c
-
-../obj-gnu/./other/settimeofday.o: settimeofday.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/settimeofday.o settimeofday.c
-
-../obj-gnu/./other/stderr.o: stderr.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/stderr.o stderr.c
-
-../obj-gnu/./other/strdup.o: strdup.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/strdup.o strdup.c
-
-../obj-gnu/./other/strtok_r.o: strtok_r.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/strtok_r.o strtok_r.c
-
-../obj-gnu/./other/swab.o: swab.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/swab.o swab.c
-
-../obj-gnu/./other/sys_eniop.o: sys_eniop.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/sys_eniop.o sys_eniop.c
-
-../obj-gnu/./other/syscall.o: syscall.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/syscall.o syscall.c
-
-../obj-gnu/./other/sysconf.o: sysconf.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/sysconf.o sysconf.c
-
-../obj-gnu/./other/syslog.o: syslog.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/syslog.o syslog.c
-
-../obj-gnu/./other/taskcall.o: taskcall.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/taskcall.o taskcall.c
-
-../obj-gnu/./other/telldir.o: telldir.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/telldir.o telldir.c
-
-../obj-gnu/./other/termcap.o: termcap.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/termcap.o termcap.c
-
-../obj-gnu/./other/ttyname.o: ttyname.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/ttyname.o ttyname.c
-
-../obj-gnu/./other/ttyslot.o: ttyslot.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/ttyslot.o ttyslot.c
-
-../obj-gnu/./other/v8regerror.o: v8regerror.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/v8regerror.o v8regerror.c
-
-../obj-gnu/./other/v8regexp.o: v8regexp.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/v8regexp.o v8regexp.c
-
-../obj-gnu/./other/v8regsub.o: v8regsub.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/v8regsub.o v8regsub.c
-
-../obj-gnu/./other/writev.o: writev.c
-	gcc -O -D_MINIX -D_POSIX_SOURCE -I../../servers -c -o ../obj-gnu/./other/writev.o writev.c
-
-
-
-
-clean::
-	rm -f ../obj-ack//./other/*
-	rm -f ../obj-gnu/./other/*
-
-include Makedepend-ack
-include .depend-ack
-
-include Makedepend-gnu
-include .depend-gnu
Index: trunk/minix/lib/other/Makefile.in
===================================================================
--- trunk/minix/lib/other/Makefile.in	(revision 9)
+++ 	(revision )
@@ -1,85 +1,0 @@
-# Makefile for lib/other.
-
-CFLAGS="-O -D_MINIX -D_POSIX_SOURCE -I../../servers"
-
-LIBRARIES=libc
-
-libc_FILES=" \
-	_allocmem.c \
-	_brk.c \
-	_devctl.c \
-	__pm_findproc.c \
-	_freemem.c \
-	_getnpid.c \
-	_getsigset.c \
-	_getnprocnr.c \
-	_getpprocnr.c \
-	_getprocnr.c \
-	_getsysinfo.c \
-	_reboot.c \
-	_seekdir.c \
-	_svrctl.c \
-	asynchio.c \
-	basename.c \
-	bcmp.c \
-	bcopy.c \
-	bzero.c \
-	configfile.c \
-	crypt.c \
-	ctermid.c \
-	cuserid.c \
-	environ.c \
-	errno.c \
-	fdopen.c \
-	ffs.c \
-	flock.c \
-	fslib.c \
-	fts.c \
-	fsversion.c \
-	getgrent.c \
-	getlogin.c \
-	getpagesize.c \
-	getpass.c \
-	getpwent.c \
-	getttyent.c \
-	getw.c \
-	hypot.c \
-	index.c \
-	itoa.c \
-	loadname.c \
-	lock.c \
-	lrand.c \
-	lsearch.c \
-	memccpy.c \
-	mstats.c \
-	mtab.c \
-	nlist.c \
-	paramvalue.c \
-	peekpoke.c \
-	popen.c \
-	putenv.c \
-	putw.c \
-	random.c \
-	rindex.c \
-	setenv.c \
-	setgroups.c \
-	settimeofday.c \
-	stderr.c \
-	strdup.c \
-	strtok_r.c \
-	swab.c \
-	sys_eniop.c \
-	syscall.c \
-	sysconf.c \
-	syslog.c \
-	taskcall.c \
-	telldir.c \
-	termcap.c \
-	ttyname.c \
-	ttyslot.c \
-	v8regerror.c \
-	v8regexp.c \
-	v8regsub.c \
-	writev.c"
-
-TYPE=both
Index: trunk/minix/lib/other/__pm_findproc.c
===================================================================
--- trunk/minix/lib/other/__pm_findproc.c	(revision 9)
+++ 	(revision )
@@ -1,19 +1,0 @@
-#include <lib.h>
-#define _pm_findproc	__pm_findproc
-#include <unistd.h>
-#include <string.h>
-
-PUBLIC int _pm_findproc(proc_name, proc_nr)
-char *proc_name;		/* name of process to search for */
-int *proc_nr;			/* return process number here */
-{
-  message m;
-
-  m.m1_p1 = proc_name;
-  m.m1_i1 = -1;			/* search by name */
-  m.m1_i2 = strlen(proc_name) + 1;
-  if (_syscall(MM, GETPROCNR, &m) < 0) return(-1);
-  *proc_nr = m.m1_i1;
-  return(0);
-}
-
Index: trunk/minix/lib/other/_allocmem.c
===================================================================
--- trunk/minix/lib/other/_allocmem.c	(revision 9)
+++ 	(revision )
@@ -1,16 +1,0 @@
-#include <lib.h>
-#define allocmem	_allocmem
-#include <unistd.h>
-
-
-PUBLIC int allocmem(size, base)
-phys_bytes size;			/* size of mem chunk requested */
-phys_bytes *base;			/* return base address */
-{
-  message m;
-  m.m4_l1 = size;		
-  if (_syscall(MM, ALLOCMEM, &m) < 0) return(-1);
-  *base = m.m4_l2;
-  return(0);
-}
-
Index: trunk/minix/lib/other/_brk.c
===================================================================
--- trunk/minix/lib/other/_brk.c	(revision 9)
+++ 	(revision )
@@ -1,44 +1,0 @@
-#include <lib.h>
-#define brk	_brk
-#define sbrk	_sbrk
-#include <unistd.h>
-
-extern char *_brksize;
-
-/* Both OSF/1 and SYSVR4 man pages specify that brk(2) returns int.
- * However, BSD4.3 specifies that brk() returns char*.  POSIX omits
- * brk() on the grounds that it imposes a memory model on an architecture.
- * For this reason, brk() and sbrk() are not in the lib/posix directory.
- * On the other hand, they are so crucial to correct operation of so many
- * parts of the system, that we have chosen to hide the name brk using _brk,
- * as with system calls.  In this way, if a user inadvertently defines a
- * procedure brk, MINIX may continue to work because the true call is _brk.
- */
-PUBLIC int brk(addr)
-char *addr;
-{
-  message m;
-
-  if (addr != _brksize) {
-	m.m1_p1 = addr;
-	if (_syscall(MM, BRK, &m) < 0) return(-1);
-	_brksize = m.m2_p1;
-  }
-  return(0);
-}
-
-
-PUBLIC char *sbrk(incr)
-int incr;
-{
-  char *newsize, *oldsize;
-
-  oldsize = _brksize;
-  newsize = _brksize + incr;
-  if ((incr > 0 && newsize < oldsize) || (incr < 0 && newsize > oldsize))
-	return( (char *) -1);
-  if (brk(newsize) == 0)
-	return(oldsize);
-  else
-	return( (char *) -1);
-}
Index: trunk/minix/lib/other/_devctl.c
===================================================================
--- trunk/minix/lib/other/_devctl.c	(revision 9)
+++ 	(revision )
@@ -1,16 +1,0 @@
-#include <lib.h>
-#define devctl	_devctl
-#include <unistd.h>
-
-
-PUBLIC int devctl(int ctl_req, int proc_nr, int dev_nr, int dev_style)
-{
-  message m;
-  m.m4_l1 = ctl_req;
-  m.m4_l2 = proc_nr;
-  m.m4_l3 = dev_nr;
-  m.m4_l4 = dev_style;
-  if (_syscall(FS, DEVCTL, &m) < 0) return(-1);
-  return(0);
-}
-
Index: trunk/minix/lib/other/_freemem.c
===================================================================
--- trunk/minix/lib/other/_freemem.c	(revision 9)
+++ 	(revision )
@@ -1,16 +1,0 @@
-#include <lib.h>
-#define freemem	_freemem
-#include <unistd.h>
-
-
-PUBLIC int freemem(size, base)
-phys_bytes size;			/* size of mem chunk requested */
-phys_bytes base;			/* base address of mem chunk */
-{
-  message m;
-  m.m4_l1 = size;		
-  m.m4_l2 = base;		
-  if (_syscall(MM, FREEMEM, &m) < 0) return(-1);
-  return(0);
-}
-
Index: trunk/minix/lib/other/_getnpid.c
===================================================================
--- trunk/minix/lib/other/_getnpid.c	(revision 9)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#include <lib.h>
-#define getnpid	_getnpid
-#include <unistd.h>
-
-PUBLIC pid_t getnpid(int proc_nr)
-{
-  message m;
-  m.m1_i1 = proc_nr;		/* search pid for this process */
-  if (_syscall(MM, GETPID, &m) < 0) return ( (pid_t) -1);
-  return( (pid_t) m.m2_i2);	/* return search result */
-}
Index: trunk/minix/lib/other/_getnprocnr.c
===================================================================
--- trunk/minix/lib/other/_getnprocnr.c	(revision 9)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#include <lib.h>
-#define getnprocnr	_getnprocnr
-#include <unistd.h>
-
-
-PUBLIC int getnprocnr(pid_t pid)
-{
-  message m;
-  m.m1_i1 = pid;		/* pass pid >=0 to search for */
-  m.m1_i2 = 0;			/* don't pass name to search for */
-  if (_syscall(PM_PROC_NR, GETPROCNR, &m) < 0) return(-1);
-  return(m.m1_i1);		/* return search result */
-}
-
Index: trunk/minix/lib/other/_getpprocnr.c
===================================================================
--- trunk/minix/lib/other/_getpprocnr.c	(revision 9)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#include <lib.h>
-#define getpprocnr	_getpprocnr
-#include <unistd.h>
-
-
-PUBLIC int getpprocnr()
-{
-  message m;
-  m.m1_i1 = -1;			/* don't pass pid to search for */
-  m.m1_i2 = 0;			/* don't pass name to search for */
-  if (_syscall(PM_PROC_NR, GETPROCNR, &m) < 0) return(-1);
-  return(m.m1_i2);		/* return parent process number */
-}
-
Index: trunk/minix/lib/other/_getprocnr.c
===================================================================
--- trunk/minix/lib/other/_getprocnr.c	(revision 9)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#include <lib.h>
-#define getprocnr	_getprocnr
-#include <unistd.h>
-
-
-PUBLIC int getprocnr()
-{
-  message m;
-  m.m1_i1 = -1;			/* don't pass pid to search for */
-  m.m1_i2 = 0;			/* don't pass name to search for */
-  if (_syscall(PM_PROC_NR, GETPROCNR, &m) < 0) return(-1);
-  return(m.m1_i1);		/* return own process number */
-}
-
Index: trunk/minix/lib/other/_getsigset.c
===================================================================
--- trunk/minix/lib/other/_getsigset.c	(revision 9)
+++ 	(revision )
@@ -1,15 +1,0 @@
-#include <lib.h>
-#define getsigset	_getsigset
-#include <unistd.h>
-
-
-PUBLIC int getsigset(sp)
-sigset_t *sp;				/* where to put it */
-{
-  message m;
-  m.m2_i1 = SELF;			/* request own signal set */
-  if (_syscall(PM_PROC_NR, PROCSTAT, &m) < 0) return(-1);
-  *sp = m.m2_l1;
-  return(0);
-}
-
Index: trunk/minix/lib/other/_getsysinfo.c
===================================================================
--- trunk/minix/lib/other/_getsysinfo.c	(revision 9)
+++ 	(revision )
@@ -1,17 +1,0 @@
-#include <lib.h>
-#define getsysinfo	_getsysinfo
-#include <unistd.h>
-
-
-PUBLIC int getsysinfo(who, what, where)
-int who;			/* from whom to request info */
-int what;			/* what information is requested */
-void *where;			/* where to put it */
-{
-  message m;
-  m.m1_i1 = what;
-  m.m1_p1 = where;
-  if (_syscall(who, GETSYSINFO, &m) < 0) return(-1);
-  return(0);
-}
-
Index: trunk/minix/lib/other/_reboot.c
===================================================================
--- trunk/minix/lib/other/_reboot.c	(revision 9)
+++ 	(revision )
@@ -1,24 +1,0 @@
-/* reboot.c - Systemcall interface to mm/signal.c::do_reboot()
-
-   author: Edvard Tuinder  v892231@si.hhs.NL
- */
-
-#include <lib.h>
-#define reboot	_reboot
-#include <unistd.h>
-#include <stdarg.h>
-
-int reboot(int how, ...)
-{
-  message m;
-  va_list ap;
-
-  va_start(ap, how);
-  if ((m.m1_i1 = how) == RBT_MONITOR) {
-	m.m1_p1 = va_arg(ap, char *);
-	m.m1_i2 = va_arg(ap, size_t);
-  }
-  va_end(ap);
-
-  return _syscall(MM, REBOOT, &m);
-}
Index: trunk/minix/lib/other/_seekdir.c
===================================================================
--- trunk/minix/lib/other/_seekdir.c	(revision 9)
+++ 	(revision )
@@ -1,32 +1,0 @@
-/*	seekdir()					Author: Kees J. Bot
- *								24 Apr 1989
- */
-#define nil 0
-#include <lib.h>
-#define lseek	_lseek
-#define readdir	_readdir
-#define seekdir	_seekdir
-#include <sys/types.h>
-#include <dirent.h>
-#include <unistd.h>
-#include <errno.h>
-
-int seekdir(DIR *dp, off_t pos)
-/* Seek to position pos in a directory. */
-{
-	int off;
-
-	if (dp == nil) { errno= EBADF; return -1; }
-
-	dp->_count= 0;
-	dp->_ptr= dp->_buf;
-
-	off= pos & (sizeof(dp->_buf) - 1);
-	dp->_pos= pos - off;
-
-	if (lseek(dp->_fd, dp->_pos, SEEK_SET) == -1) return -1;
-
-	while (dp->_pos < pos && readdir(dp) != nil) {}
-
-	return 0;
-}
Index: trunk/minix/lib/other/_svrctl.c
===================================================================
--- trunk/minix/lib/other/_svrctl.c	(revision 9)
+++ 	(revision )
@@ -1,29 +1,0 @@
-/*	svrctl() - special server control functions.	Author: Kees J. Bot
- *								24 Apr 1994
- */
-#include <lib.h>
-#include <stdio.h>
-#define svrctl _svrctl
-#include <sys/svrctl.h>
-
-int svrctl(int request, void *argp)
-{
-	message m;
-
-	m.m2_i1 = request;
-	m.m2_p1 = argp;
-
-	switch ((request >> 8) & 0xFF) {
-	case 'M':
-	case 'S':
-		/* MM handles calls for itself and the kernel. */
-		return _syscall(MM, SVRCTL, &m);
-	case 'F':
-	case 'I':
-		/* FS handles calls for itself and inet. */
-		return _syscall(FS, SVRCTL, &m);
-	default:
-		errno = EINVAL;
-		return -1;
-	}
-}
Index: trunk/minix/lib/other/asynchio.c
===================================================================
--- trunk/minix/lib/other/asynchio.c	(revision 9)
+++ 	(revision )
@@ -1,154 +1,0 @@
-/*	asyn_init(), asyn_read(), asyn_write(), asyn_ioctl(),
- *	asyn_wait(), asyn_synch(), asyn_close()
- *							Author: Kees J. Bot
- *								26 Jan 1995
- * Thise are just stub routines that are call compatible with
- * the asynchio(3) library of Minix-vmd.  See asynchio.h.
- */
-#define nil 0
-#define alarm	_alarm
-#define ioctl	_ioctl
-#define read	_read
-#define sigaction _sigaction
-#define sigfillset _sigfillset
-#define time	_time
-#define write	_write
-#include <lib.h>
-#include <time.h>
-#include <sys/ioctl.h>
-#include <sys/asynchio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <signal.h>
-
-#define IO_IDLE		0
-#define IO_INPROGRESS	1
-#define IO_RESULT	2
-
-#define OP_NOOP		0
-#define OP_READ		1
-#define OP_WRITE	2
-#define OP_IOCTL	3
-
-static asynchio_t *asyn_current;
-
-void asyn_init(asynchio_t *asyn)
-{
-	asyn->state= IO_IDLE;
-	asyn->op= OP_NOOP;
-}
-
-static ssize_t operation(int op, asynchio_t *asyn, int fd, int req,
-						void *data, ssize_t count)
-{
-	switch (asyn->state) {
-	case IO_INPROGRESS:
-		if (asyn_current != asyn && asyn->op != op) abort();
-		/*FALL THROUGH*/
-	case IO_IDLE:
-		asyn_current= asyn;
-		asyn->op= op;
-		asyn->fd= fd;
-		asyn->req= req;
-		asyn->data= data;
-		asyn->count= count;
-		asyn->state= IO_INPROGRESS;
-		errno= EINPROGRESS;
-		return -1;
-	case IO_RESULT:
-		if (asyn_current != asyn && asyn->op != op) abort();
-		errno= asyn->errno;
-		return asyn->count;
-	}
-}
-
-ssize_t asyn_read(asynchio_t *asyn, int fd, void *buf, size_t len)
-{
-	return operation(OP_READ, asyn, fd, 0, buf, len);
-}
-
-ssize_t asyn_write(asynchio_t *asyn, int fd, const void *buf, size_t len)
-{
-	return operation(OP_WRITE, asyn, fd, 0, (void *) buf, len);
-}
-
-int asyn_ioctl(asynchio_t *asyn, int fd, unsigned long request, void *data)
-{
-	return operation(OP_IOCTL, asyn, fd, request, data, 0);
-}
-
-static void time_out(int sig)
-{
-	alarm(1);
-}
-
-int asyn_wait(asynchio_t *asyn, int flags, struct timeval *to)
-{
-	time_t now;
-	unsigned old_timer, new_timer;
-	struct sigaction old_sa, new_sa;
-
-	if (asyn_current != asyn) abort();
-	if (flags & ASYN_NONBLOCK) abort();
-
-	if (asyn->state == IO_RESULT) {
-		asyn->state= IO_IDLE;
-		asyn->op= OP_NOOP;
-		return 0;
-	}
-
-	if (to != nil) {
-		now= time(nil);
-		if (to->tv_sec <= now) { errno= EINTR; return -1; }
-		old_timer= alarm(0);
-		new_sa.sa_handler= time_out;
-		sigfillset(&new_sa.sa_mask);
-		new_sa.sa_flags= 0;
-		sigaction(SIGALRM, &new_sa, &old_sa);
-		new_timer= to->tv_sec - now;
-		if (new_timer < old_timer) {
-			new_timer= old_timer;
-		}
-		alarm(new_timer);
-	}
-	switch (asyn->op) {
-	case OP_NOOP:
-		asyn->count= pause();
-		asyn->errno= errno;
-	case OP_READ:
-		asyn->count= read(asyn->fd, asyn->data, asyn->count);
-		asyn->errno= errno;
-		break;
-	case OP_WRITE:
-		asyn->count= write(asyn->fd, asyn->data, asyn->count);
-		asyn->errno= errno;
-		break;
-	case OP_IOCTL:
-		asyn->count= ioctl(asyn->fd, asyn->req, asyn->data);
-		asyn->errno= errno;
-		break;
-	}
-	if (to != nil) {
-		alarm(0);
-		sigaction(SIGALRM, &old_sa, (struct sigaction *)0);
-		alarm(old_timer);
-	}
-
-	if (asyn->count == -1 && asyn->errno == EINTR) {
-		errno= EINTR;
-		return -1;
-	} else {
-		asyn->state= IO_RESULT;
-		return 0;
-	}
-}
-
-int asyn_synch(asynchio_t *asyn, int fd)
-{
-}
-
-int asyn_close(asynchio_t *asyn, int fd)
-{
-	asyn_init(asyn);
-}
Index: trunk/minix/lib/other/basename.c
===================================================================
--- trunk/minix/lib/other/basename.c	(revision 9)
+++ 	(revision )
@@ -1,30 +1,0 @@
-/*
-basename.c
-*/
-
-#include <libgen.h>
-#include <string.h>
-
-char *basename(path)
-char *path;
-{
-	size_t len;
-	char *cp;
-
-	if (path == NULL)
-		return ".";
-	len= strlen(path);
-	if (len == 0)
-		return ".";
-	while (path[len-1] == '/')
-	{
-		if (len == 1)
-			return path;	/* just "/" */
-		len--;
-		path[len]= '\0';
-	}
-	cp= strrchr(path, '/');
-	if (cp != NULL)
-		return cp+1;
-	return path;
-}
Index: trunk/minix/lib/other/bcmp.c
===================================================================
--- trunk/minix/lib/other/bcmp.c	(revision 9)
+++ 	(revision )
@@ -1,12 +1,0 @@
-#include <lib.h>
-/* bcmp - Berklix equivalent of memcmp  */
-
-#include <string.h>
-
-int bcmp(s1, s2, length)	/* == 0 or != 0 for equality and inequality */ 
-_CONST void *s1;
-_CONST void *s2;
-size_t length;
-{
-  return(memcmp(s1, s2, length));
-}
Index: trunk/minix/lib/other/bcopy.c
===================================================================
--- trunk/minix/lib/other/bcopy.c	(revision 9)
+++ 	(revision )
@@ -1,12 +1,0 @@
-#include <lib.h>
-/* bcopy - Berklix equivalent of memcpy  */
-
-#include <string.h>
-
-void bcopy(src, dst, length)
-_CONST void *src;
-void *dst;
-size_t length;
-{
-  (void) memcpy(dst, src, length);
-}
Index: trunk/minix/lib/other/bzero.c
===================================================================
--- trunk/minix/lib/other/bzero.c	(revision 9)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#include <lib.h>
-/* bzero - Berklix subset of memset  */
-
-#include <string.h>
-
-void bzero(dst, length)
-void *dst;
-size_t length;
-{
-  (void) memset(dst, 0, length);
-}
Index: trunk/minix/lib/other/configfile.c
===================================================================
--- trunk/minix/lib/other/configfile.c	(revision 9)
+++ 	(revision )
@@ -1,574 +1,0 @@
-/*	config_read(), _delete(), _length() - Generic config file routines.
- *							Author: Kees J. Bot
- *								5 Jun 1999
- */
-#define nil ((void*)0)
-#if __minix_vmd
-#include <minix/stubs.h>
-#else
-#define fstat _fstat
-#define stat _stat
-#endif
-#include <sys/types.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-#include <time.h>
-#include <sys/stat.h>
-#if __minix_vmd
-#include <minix/asciictype.h>
-#else
-#include <ctype.h>
-#endif
-#define _c /* not const */
-#include <configfile.h>
-
-typedef struct configfile {	/* List of (included) configuration files. */
-	struct configfile *next;	/* A list indeed. */
-	time_t		ctime;		/* Last changed time, -1 if no file. */
-	char		name[1];	/* File name. */
-} configfile_t;
-
-/* Size of a configfile_t given a file name of length 'len'. */
-#define configfilesize(len)	(offsetof(configfile_t, name) + 1 + (len))
-
-typedef struct firstconfig {	/* First file and first word share a slot. */
-	configfile_t	*filelist;
-	char		new;		/* Set when created. */
-	config_t	config1;
-} firstconfig_t;
-
-/* Size of a config_t given a word of lenght 'len'.  Same for firstconfig_t. */
-#define config0size()		(offsetof(config_t, word))
-#define configsize(len)		(config0size() + 1 + (len))
-#define firstconfigsize(len)	\
-			(offsetof(firstconfig_t, config1) + configsize(len))
-
-/* Translate address of first config word to enclosing firstconfig_t and vv. */
-#define cfg2fcfg(p)	\
-    ((firstconfig_t *) ((char *) (p) - offsetof(firstconfig_t, config1)))
-#define fcfg2cfg(p)	(&(p)->config1)
-
-/* Variables used while building data. */
-static configfile_t *c_files;		/* List of (included) config files. */
-static int c_flags;			/* Flags argument of config_read(). */
-static FILE *c_fp;			/* Current open file. */
-static char *c_file;			/* Current open file name. */
-static unsigned c_line;			/* Current line number. */
-static int c;				/* Next character. */
-
-static void *allocate(void *mem, size_t size)
-/* Like realloc(), but checked. */
-{
-    if ((mem= realloc(mem, size)) == nil) {
-	fprintf(stderr, "\"%s\", line %u: Out of memory\n", c_file, c_line);
-	exit(1);
-    }
-    return mem;
-}
-
-#define deallocate(mem)	free(mem)
-
-static void delete_filelist(configfile_t *cfgf)
-/* Delete configuration file list. */
-{
-    void *junk;
-
-    while (cfgf != nil) {
-	junk= cfgf;
-	cfgf= cfgf->next;
-	deallocate(junk);
-    }
-}
-
-static void delete_config(config_t *cfg)
-/* Delete configuration file data. */
-{
-    config_t *next, *list, *junk;
-
-    next= cfg;
-    list= nil;
-    for (;;) {
-	if (next != nil) {
-	    /* Push the 'next' chain in reverse on the 'list' chain, putting
-	     * a leaf cell (next == nil) on top of 'list'.
-	     */
-	    junk= next;
-	    next= next->next;
-	    junk->next= list;
-	    list= junk;
-	} else
-	if (list != nil) {
-	    /* Delete the leaf cell.  If it has a sublist then that becomes
-	     * the 'next' chain.
-	     */
-	    junk= list;
-	    next= list->list;
-	    list= list->next;
-	    deallocate(junk);
-	} else {
-	    /* Both chains are gone. */
-	    break;
-	}
-    }
-}
-
-void config_delete(config_t *cfg1)
-/* Delete configuration file data, being careful with the odd first one. */
-{
-    firstconfig_t *fcfg= cfg2fcfg(cfg1);
-
-    delete_filelist(fcfg->filelist);
-    delete_config(fcfg->config1.next);
-    delete_config(fcfg->config1.list);
-    deallocate(fcfg);
-}
-
-static void nextc(void)
-/* Read the next character of the current file into 'c'. */
-{
-    if (c == '\n') c_line++;
-    c= getc(c_fp);
-    if (c == EOF && ferror(c_fp)) {
-	fprintf(stderr, "\"%s\", line %u: %s\n",
-	    c_file, c_line, strerror(errno));
-	exit(1);
-    }
-}
-
-static void skipwhite(void)
-/* Skip whitespace and comments. */
-{
-    while (isspace(c)) {
-	nextc();
-	if (c == '#') {
-	    do nextc(); while (c != EOF && c != '\n');
-	}
-    }
-}
-
-static void parse_err(void)
-/* Tell user that you can't parse past the current character. */
-{
-    char sc[2];
-
-    sc[0]= c;
-    sc[1]= 0;
-    fprintf(stderr, "\"%s\", line %u: parse error at '%s'\n",
-	c_file, c_line, c == EOF ? "EOF" : sc);
-    exit(1);
-}
-
-static config_t *read_word(void)
-/* Read a word or string. */
-{
-    config_t *w;
-    size_t i, len;
-    int q;
-    static char SPECIAL[] = "!#$%&*+-./:<=>?[\\]^_|~";
-
-    i= 0;
-    len= 32;
-    w= allocate(nil, configsize(32));
-    w->next= nil;
-    w->list= nil;
-    w->file= c_file;
-    w->line= c_line;
-    w->flags= 0;
-
-    /* Is it a quoted string? */
-    if (c == '\'' || c == '"') {
-	q= c;	/* yes */
-	nextc();
-    } else {
-	q= -1;	/* no */
-    }
-
-    for (;;) {
-	if (i == len) {
-	    len+= 32;
-	    w= allocate(w, configsize(len));
-	}
-
-	if (q == -1) {
-	    /* A word consists of letters, numbers and a few special chars. */
-	    if (!isalnum(c) && c < 0x80 && strchr(SPECIAL, c) == nil) break;
-	} else {
-	    /* Strings are made up of anything except newlines. */
-	    if (c == EOF || c == '\n') {
-		fprintf(stderr,
-		    "\"%s\", line %u: string at line %u not closed\n",
-		    c_file, c_line, w->line);
-		exit(1);
-		break;
-	    }
-	    if (c == q) {	/* Closing quote? */
-		nextc();
-		break;
-	    }
-	}
-
-	if (c != '\\') {	/* Simply add non-escapes. */
-	    w->word[i++]= c;
-	    nextc();
-	} else {		/* Interpret an escape. */
-	    nextc();
-	    if (isspace(c)) {
-		skipwhite();
-		continue;
-	    }
-
-	    if (c_flags & CFG_ESCAPED) {
-		w->word[i++]= '\\';	/* Keep the \ for the caller. */
-		if (i == len) {
-		    len+= 32;
-		    w= allocate(w, configsize(len));
-		}
-		w->flags |= CFG_ESCAPED;
-	    }
-
-	    if (isdigit(c)) {		/* Octal escape */
-		int n= 3;
-		int d= 0;
-
-		do {
-		    d= d * 010 + (c - '0');
-		    nextc();
-		} while (--n > 0 && isdigit(c));
-		w->word[i++]= d;
-	    } else
-	    if (c == 'x' || c == 'X') {	/* Hex escape */
-		int n= 2;
-		int d= 0;
-
-		nextc();
-		if (!isxdigit(c)) {
-		    fprintf(stderr, "\"%s\", line %u: bad hex escape\n",
-			c_file, c_line);
-		    exit(1);
-		}
-		do {
-		    d= d * 0x10 + (islower(c) ? (c - 'a' + 0xa) :
-				    isupper(c) ? (c - 'A' + 0xA) :
-				    (c - '0'));
-		    nextc();
-		} while (--n > 0 && isxdigit(c));
-		w->word[i++]= d;
-	    } else {
-		switch (c) {
-		case 'a':	c= '\a';	break;
-		case 'b':	c= '\b';	break;
-		case 'e':	c= '\033';	break;
-		case 'f':	c= '\f';	break;
-		case 'n':	c= '\n';	break;
-		case 'r':	c= '\r';	break;
-		case 's':	c= ' ';		break;
-		case 't':	c= '\t';	break;
-		case 'v':	c= '\v';	break;
-		default:	/* Anything else is kept as-is. */;
-		}
-		w->word[i++]= c;
-		nextc();
-	    }
-	}
-    }
-    w->word[i]= 0;
-    if (q != -1) {
-	w->flags |= CFG_STRING;
-    } else {
-	int f;
-	char *end;
-	static char base[]= { 0, 010, 10, 0x10 };
-
-	if (i == 0) parse_err();
-
-	/* Can the word be used as a number? */
-	for (f= 0; f < 4; f++) {
-	    (void) strtol(w->word, &end, base[f]);
-	    if (*end == 0) w->flags |= 1 << (f + 0);
-	    (void) strtoul(w->word, &end, base[f]);
-	    if (*end == 0) w->flags |= 1 << (f + 4);
-	}
-    }
-    return allocate(w, configsize(i));
-}
-
-static config_t *read_file(const char *file);
-static config_t *read_list(void);
-
-static config_t *read_line(void)
-/* Read and return one line of the config file. */
-{
-    config_t *cline, **pcline, *clist;
-
-    cline= nil;
-    pcline= &cline;
-
-    for (;;) {
-	skipwhite();
-
-	if (c == EOF || c == '}') {
-if(0)	    if (cline != nil) parse_err();
-	    break;
-	} else
-	if (c == ';') {
-	    nextc();
-	    if (cline != nil) break;
-	} else
-	if (cline != nil && c == '{') {
-	    /* A sublist. */
-	    nextc();
-	    clist= allocate(nil, config0size());
-	    clist->next= nil;
-	    clist->file= c_file;
-	    clist->line= c_line;
-	    clist->list= read_list();
-	    clist->flags= CFG_SUBLIST;
-	    *pcline= clist;
-	    pcline= &clist->next;
-	    if (c != '}') parse_err();
-	    nextc();
-	} else {
-	    *pcline= read_word();
-	    pcline= &(*pcline)->next;
-	}
-    }
-    return cline;
-}
-
-static config_t *read_list(void)
-/* Read and return a list of config file commands. */
-{
-    config_t *clist, **pclist, *cline;
-
-    clist= nil;
-    pclist= &clist;
-
-    while ((cline= read_line()) != nil) {
-	if (strcmp(cline->word, "include") == 0) {
-	    config_t *file= cline->next;
-	    if (file == nil || file->next != nil || !config_isatom(file)) {
-		fprintf(stderr,
-		    "\"%s\", line %u: 'include' command requires an argument\n",
-		    c_file, cline->line);
-		exit(1);
-	    }
-	    if (file->flags & CFG_ESCAPED) {
-		char *p, *q;
-		p= q= file->word;
-		for (;;) {
-		    if ((*q = *p) == '\\') *q = *++p;
-		    if (*q == 0) break;
-		    p++;
-		    q++;
-		}
-	    }
-	    file= read_file(file->word);
-	    delete_config(cline);
-	    *pclist= file;
-	    while (*pclist != nil) pclist= &(*pclist)->next;
-	} else {
-	    config_t *cfg= allocate(nil, config0size());
-	    cfg->next= nil;
-	    cfg->list= cline;
-	    cfg->file= cline->file;
-	    cfg->line= cline->line;
-	    cfg->flags= CFG_SUBLIST;
-	    *pclist= cfg;
-	    pclist= &cfg->next;
-	}
-    }
-    return clist;
-}
-
-static config_t *read_file(const char *file)
-/* Read and return a configuration file. */
-{
-    configfile_t *cfgf;
-    config_t *cfg;
-    struct stat st;
-    FILE *old_fp;	/* old_* variables store current file context. */
-    char *old_file;
-    unsigned old_line;
-    int old_c;
-    size_t n;
-    char *slash;
-
-    old_fp= c_fp;
-    old_file= c_file;
-    old_line= c_line;
-    old_c= c;
-
-    n= 0;
-    if (file[0] != '/' && old_file != nil
-			&& (slash= strrchr(old_file, '/')) != nil) {
-	n= slash - old_file + 1;
-    }
-    cfgf= allocate(nil, configfilesize(n + strlen(file)));
-    memcpy(cfgf->name, old_file, n);
-    strcpy(cfgf->name + n, file);
-    cfgf->next= c_files;
-    c_files= cfgf;
-
-    c_file= cfgf->name;
-    c_line= 0;
-
-    if ((c_fp= fopen(file, "r")) == nil || fstat(fileno(c_fp), &st) < 0) {
-	if (errno != ENOENT) {
-	    fprintf(stderr, "\"%s\", line 1: %s\n", file, strerror(errno));
-	    exit(1);
-	}
-	cfgf->ctime= -1;
-	c= EOF;
-    } else {
-	cfgf->ctime= st.st_ctime;
-	c= '\n';
-    }
-
-    cfg= read_list();
-    if (c != EOF) parse_err();
-
-    if (c_fp != nil) fclose(c_fp);
-    c_fp= old_fp;
-    c_file= old_file;
-    c_line= old_line;
-    c= old_c;
-    return cfg;
-}
-
-config_t *config_read(const char *file, int flags, config_t *cfg)
-/* Read and parse a configuration file. */
-{
-    if (cfg != nil) {
-	/* First check if any of the involved files has changed. */
-	firstconfig_t *fcfg;
-	configfile_t *cfgf;
-	struct stat st;
-
-	fcfg= cfg2fcfg(cfg);
-	for (cfgf= fcfg->filelist; cfgf != nil; cfgf= cfgf->next) {
-	    if (stat(cfgf->name, &st) < 0) {
-		if (errno != ENOENT) break;
-		st.st_ctime= -1;
-	    }
-	    if (st.st_ctime != cfgf->ctime) break;
-	}
-
-	if (cfgf == nil) return cfg;	/* Everything as it was. */
-	config_delete(cfg);		/* Otherwise delete and reread. */
-    }
-
-    errno= 0;
-    c_files= nil;
-    c_flags= flags;
-    cfg= read_file(file);
-
-    if (cfg != nil) {
-	/* Change first word to have a hidden pointer to a file list. */
-	size_t len= strlen(cfg->word);
-	firstconfig_t *fcfg;
-
-	fcfg= allocate(cfg, firstconfigsize(len));
-	memmove(&fcfg->config1, fcfg, configsize(len));
-	fcfg->filelist= c_files;
-	fcfg->new= 1;
-	return fcfg2cfg(fcfg);
-    }
-    /* Couldn't read (errno != 0) of nothing read (errno == 0). */
-    delete_filelist(c_files);
-    delete_config(cfg);
-    return nil;
-}
-
-int config_renewed(config_t *cfg)
-{
-    int new;
-
-    if (cfg == nil) {
-	new= 1;
-    } else {
-	new= cfg2fcfg(cfg)->new;
-	cfg2fcfg(cfg)->new= 0;
-    }
-    return new;
-}
-
-size_t config_length(config_t *cfg)
-/* Count the number of items on a list. */
-{
-    size_t n= 0;
-
-    while (cfg != nil) {
-	n++;
-	cfg= cfg->next;
-    }
-    return n;
-}
-
-#if TEST
-#include <unistd.h>
-
-static void print_list(int indent, config_t *cfg);
-
-static void print_words(int indent, config_t *cfg)
-{
-    while (cfg != nil) {
-	if (config_isatom(cfg)) {
-	    if (config_isstring(cfg)) fputc('"', stdout);
-	    printf("%s", cfg->word);
-	    if (config_isstring(cfg)) fputc('"', stdout);
-	} else {
-	    printf("{\n");
-	    print_list(indent+4, cfg->list);
-	    printf("%*s}", indent, "");
-	}
-	cfg= cfg->next;
-	if (cfg != nil) fputc(' ', stdout);
-    }
-    printf(";\n");
-}
-
-static void print_list(int indent, config_t *cfg)
-{
-    while (cfg != nil) {
-	if (!config_issub(cfg)) {
-	    fprintf(stderr, "Cell at \"%s\", line %u is not a sublist\n");
-	    break;
-	}
-	printf("%*s", indent, "");
-	print_words(indent, cfg->list);
-	cfg= cfg->next;
-    }
-}
-
-static void print_config(config_t *cfg)
-{
-    if (!config_renewed(cfg)) {
-	printf("# Config didn't change\n");
-    } else {
-	print_list(0, cfg);
-    }
-}
-
-int main(int argc, char **argv)
-{
-    config_t *cfg;
-    int c;
-
-    if (argc != 2) {
-	fprintf(stderr, "One config file name please\n");
-	exit(1);
-    }
-
-    cfg= nil;
-    do {
-	cfg= config_read(argv[1], CFG_ESCAPED, cfg);
-	print_config(cfg);
-	if (!isatty(0)) break;
-	while ((c= getchar()) != EOF && c != '\n') {}
-    } while (c != EOF);
-    return 0;
-}
-#endif /* TEST */
Index: trunk/minix/lib/other/crypt.c
===================================================================
--- trunk/minix/lib/other/crypt.c	(revision 9)
+++ 	(revision )
@@ -1,115 +1,0 @@
-/*	crypt() - one-way password encryption function	Author: Kees J. Bot
- *								7 Feb 1994
- * This routine does not encrypt anything, it uses the pwdauth
- * program to do the hard work.
- */
-#define nil ((void*)0)
-#define pipe _pipe
-#define fork _fork
-#define close _close
-#define dup2 _dup2
-#define execl _execl
-#define read _read
-#define _exit __exit
-#define write _write
-#define waitpid _waitpid
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <sys/wait.h>
-
-/* Set-uid root program to read /etc/shadow or encrypt passwords. */
-static char PWDAUTH[] = "/usr/lib/pwdauth";
-#define LEN	1024
-
-static void tell(const char *s0, ...)
-{
-	va_list ap;
-	const char *s;
-
-	va_start(ap, s0);
-	s= s0;
-	while (s != nil) {
-		(void) write(2, s, strlen(s));
-		s= va_arg(ap, const char *);
-	}
-	va_end(ap);
-}
-
-char *crypt(const char *key, const char *salt)
-{
-	pid_t pid;
-	int status;
-	int pfd[2];
-	static char pwdata[LEN];
-	char *p= pwdata;
-	const char *k= key;
-	const char *s= salt;
-	int n;
-
-	/* Fill pwdata[] with the key and salt. */
-	while ((*p++ = *k++) != 0) if (p == pwdata+LEN-1) goto fail;
-	while ((*p++ = *s++) != 0) if (p == pwdata+LEN-0) goto fail;
-
-	if (pipe(pfd) < 0) goto fail;
-
-	/* Prefill the pipe. */
-	(void) write(pfd[1], pwdata, p - pwdata);
-
-	switch ((pid= fork())) {
-	case -1:
-		close(pfd[0]);
-		close(pfd[1]);
-		goto fail;
-	case 0:
-		/* Connect both input and output to the pipe. */
-		if (pfd[0] != 0) {
-			dup2(pfd[0], 0);
-			close(pfd[0]);
-		}
-		if (pfd[1] != 1) {
-			dup2(pfd[1], 1);
-			close(pfd[1]);
-		}
-
-		execl(PWDAUTH, PWDAUTH, (char *) nil);
-
-		tell("crypt(): ", PWDAUTH, ": ", strerror(errno), "\r\n",
-								(char *) nil);
-		/* No pwdauth?  Fail! */
-		(void) read(0, pwdata, LEN);
-		_exit(1);
-	}
-	close(pfd[1]);
-
-	status= -1;
-	while (waitpid(pid, &status, 0) == -1 && errno == EINTR) {}
-	if (status != 0) {
-		close(pfd[0]);
-		goto fail;
-	}
-
-	/* Read and return the result.  Check if it contains exactly one
-	 * string.
-	 */
-	n= read(pfd[0], pwdata, LEN);
-	close(pfd[0]);
-	if (n < 0) goto fail;
-	p = pwdata + n;
-	n = 0;
-	while (p > pwdata) if (*--p == 0) n++;
-	if (n != 1) goto fail;
-	return pwdata;
-
-fail:
-	pwdata[0] = salt[0] ^ 1;		/* make result != salt */
-	pwdata[1] = 0;
-	return pwdata;
-}
-
-/*
- * $PchId: crypt.c,v 1.5 1996/04/11 07:46:11 philip Exp $
- */
Index: trunk/minix/lib/other/ctermid.c
===================================================================
--- trunk/minix/lib/other/ctermid.c	(revision 9)
+++ 	(revision )
@@ -1,32 +1,0 @@
-/*  ctermid(3)
- *
- *  Author: Terrence Holm          Aug. 1988
- *
- *
- *  Ctermid(3) returns a pointer to a string naming the controlling
- *  terminal. If <name_space> is NULL then local PRIVATE storage
- *  is used, otherwise <name_space> must point to storage of at
- *  least L_ctermid characters.
- *
- *  Returns a pointer to "/dev/tty".
- */
-
-#include <lib.h>
-#include <string.h>
-#include <stdio.h>
-
-_PROTOTYPE( char *ctermid, (char *name_space));
-
-#ifndef L_ctermid
-#define L_ctermid  9
-#endif
-
-char *ctermid(name_space)
-char *name_space;
-{
-  PRIVATE char termid[L_ctermid];
-
-  if (name_space == (char *)NULL) name_space = termid;
-  strcpy(name_space, "/dev/tty");
-  return(name_space);
-}
Index: trunk/minix/lib/other/cuserid.c
===================================================================
--- trunk/minix/lib/other/cuserid.c	(revision 9)
+++ 	(revision )
@@ -1,33 +1,0 @@
-/*  cuserid(3)
- *
- *  Author: Terrence W. Holm          Sept. 1987
- */
-
-#include <lib.h>
-#include <pwd.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdio.h>
-
-#ifndef  L_cuserid
-#define  L_cuserid   9
-#endif
-
-char *cuserid(user_name)
-char *user_name;
-{
-  PRIVATE char userid[L_cuserid];
-  struct passwd *pw_entry;
-
-  if (user_name == (char *)NULL) user_name = userid;
-
-  pw_entry = getpwuid(geteuid());
-
-  if (pw_entry == (struct passwd *)NULL) {
-	*user_name = '\0';
-	return((char *)NULL);
-  }
-  strcpy(user_name, pw_entry->pw_name);
-
-  return(user_name);
-}
Index: trunk/minix/lib/other/environ.c
===================================================================
--- trunk/minix/lib/other/environ.c	(revision 9)
+++ 	(revision )
@@ -1,20 +1,0 @@
-/*
- * environ.c - define the variable environ
- */
-/* $Header: /cvsup/minix/src/lib/other/environ.c,v 1.1.1.1 2005/04/21 14:56:26 beng Exp $ */
-/*
- * This file defines the variable environ and initializes it with a magic
- * value.  The C run-time start-off routine tests whether the variable
- * environ is initialized with this value.  If it is not, it is assumed
- * that it is defined by the user.  Only two bytes are tested, since we
- * don't know the endian-ness and alignment restrictions of the machine.
- * This means that the low-order two-bytes should be equal to the
- * high-order two-bytes on machines with four-byte pointers.  In fact, all
- * the bytes in the pointer are the same, just in case.
- */
-
-#if _EM_PSIZE==2
-char **environ = (char **) 0x5353;
-#else
-char **environ = (char **) 0x53535353;
-#endif
Index: trunk/minix/lib/other/errno.c
===================================================================
--- trunk/minix/lib/other/errno.c	(revision 9)
+++ 	(revision )
@@ -1,4 +1,0 @@
-#include <lib.h>
-/* errno.c - declare variable errno             Author: F. Meulenbroeks */
-
-int errno = 0;
Index: trunk/minix/lib/other/fdopen.c
===================================================================
--- trunk/minix/lib/other/fdopen.c	(revision 9)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/*
- * fdopen - convert a (UNIX) file descriptor into a FILE pointer
- */
-/* $Header: /cvsup/minix/src/lib/other/fdopen.c,v 1.2 2005/09/06 10:15:57 beng Exp $ */
-
-#include	<stdlib.h>
-#include	"../stdio/loc_incl.h"
-#include	<stdio.h>
-#include	<sys/stat.h>
-
-FILE *
-fdopen(fd, mode)
-int fd;
-_CONST char *mode;
-{
-	register int i;
-	struct stat st;
-	FILE *stream;
-	int flags = 0;
-
-	if (fd < 0) return (FILE *)NULL;
-	for (i = 0; __iotab[i] != 0 ; i++) 
-		if (i >= FOPEN_MAX-1)
-			return (FILE *)NULL;
-
-	switch(*mode++) {
-	case 'r':
-		flags |= _IOREAD | _IOREADING;
-		break;
-	case 'a':
-		flags |= _IOAPPEND;
-	case 'w':
-		flags |= _IOWRITE | _IOWRITING;
-		break;
-	default:
-		return (FILE *)NULL;
-	}
-	while(*mode) {
-		switch(*mode++) {
-		case 'b':
-			continue;
-		case '+':
-			flags |= _IOREAD | _IOWRITE;
-			continue;
-		/* The sequence may be followed by aditional characters */
-		default:
-			break;
-		}
-		break;
-	}
-
-	if ( fstat( fd, &st ) < 0 ) {
-		return (FILE *)NULL;
-	}
-	
-	if ( st.st_mode & S_IFIFO ) {
-		flags |= _IOFIFO;
-	}
-	
-	if ((stream = (FILE *) malloc(sizeof(FILE))) == NULL) {
-		return (FILE *)NULL;
-	}
-
-	if ((flags & _IOREAD) && (flags & _IOWRITE))
-		flags &= ~(_IOREADING | _IOWRITING);
-
-	stream->_count = 0;
-	stream->_fd = fd;
-	stream->_flags = flags;
-	stream->_buf = NULL;
-	__iotab[i] = stream;
-	return stream;
-}
Index: trunk/minix/lib/other/ffs.c
===================================================================
--- trunk/minix/lib/other/ffs.c	(revision 9)
+++ 	(revision )
@@ -1,17 +1,0 @@
-#include <lib.h>
-/*  ffs(3)
- *
- *  Author: Terrence W. Holm          Sep. 1988
- */
-_PROTOTYPE( int ffs, (int word));
-
-int ffs(word)
-int word;
-{
-  int i;
-
-  if (word == 0) return(0);
-
-  for (i = 1;; ++i, word >>= 1)
-	if (word & 1) return(i);
-}
Index: trunk/minix/lib/other/flock.c
===================================================================
--- trunk/minix/lib/other/flock.c	(revision 9)
+++ 	(revision )
@@ -1,32 +1,0 @@
-
-/* Library routines
- *
- * Porting to Minix 2.0.0
- * Author:	Giovanni Falzoni <gfalzoni@pointest.com>
- *
- * $Id: flock.c,v 1.1 2005/10/31 14:31:05 beng Exp $
- */
-#include <sys/types.h>
-#include <fcntl.h>
-#include <string.h>
-#include <errno.h>
-#include <unistd.h>
-
-/*
- *	Name:		int flock(int fd, int mode);
- *	Function:	Implements the flock function in Minix.
- */
-int flock(int fd, int mode)
-{
-  struct flock lck;
-  register int retcode;
-
-  memset((void *) &lck, 0, sizeof(struct flock));
-  lck.l_type = mode & ~LOCK_NB;
-  lck.l_pid = getpid();
-  if ((retcode = fcntl(fd, mode & LOCK_NB ? F_SETLK : F_SETLKW, &lck)) < 0 && errno == EAGAIN)
-	errno = EWOULDBLOCK;
-  return retcode;
-}
-
-/** flock.c **/
Index: trunk/minix/lib/other/fslib.c
===================================================================
--- trunk/minix/lib/other/fslib.c	(revision 9)
+++ 	(revision )
@@ -1,191 +1,0 @@
-/* fslib.c - routines needed by fs and fs utilities */
-
-#include <minix/config.h>	/* for unused stuff in <minix/type.h> :-( */
-#include <ansi.h>
-#include <limits.h>
-#include <dirent.h>
-#include <sys/types.h>
-#include <minix/const.h>
-#include <minix/type.h>		/* for unshort :-( */
-#include "fs/const.h"		/* depends of -I flag in Makefile */
-#include "fs/type.h"		/* ditto */
-#include "fs/inode.h"		/* ditto */
-#include "fs/super.h"
-#include <minix/fslib.h>
-
-/* The next routine is copied from fsck.c and mkfs.c...  (Re)define some
- * things for consistency.  Some things should be done better.
- */
-
-/* Convert from bit count to a block count. The usual expression
- *
- *	(nr_bits + (1 << BITMAPSHIFT) - 1) >> BITMAPSHIFT
- *
- * doesn't work because of overflow.
- *
- * Other overflow bugs, such as the expression for N_ILIST overflowing when
- * s_inodes is just over V*_INODES_PER_BLOCK less than the maximum+1, are not
- * fixed yet, because that number of inodes is silly.
- */
-/* The above comment doesn't all apply now bit_t is long.  Overflow is now
- * unlikely, but negative bit counts are now possible (though unlikely)
- * and give silly results.
- */ 
-PUBLIC int bitmapsize(nr_bits, block_size)
-bit_t nr_bits;
-int block_size;
-{
-  int nr_blocks;
-
-  nr_blocks = (int) (nr_bits / FS_BITS_PER_BLOCK(block_size));
-  if (((bit_t) nr_blocks * FS_BITS_PER_BLOCK(block_size)) < nr_bits) ++nr_blocks;
-  return(nr_blocks);
-}
-
-
-/*===========================================================================*
- *				conv2					     *
- *===========================================================================*/
-PUBLIC unsigned conv2(norm, w)
-int norm;			/* TRUE if no swap, FALSE for byte swap */
-int w;				/* promotion of 16-bit word to be swapped */
-{
-/* Possibly swap a 16-bit word between 8086 and 68000 byte order. */
-
-  if (norm) return( (unsigned) w & 0xFFFF);
-  return( ((w&BYTE) << 8) | ( (w>>8) & BYTE));
-}
-
-
-/*===========================================================================*
- *				conv4					     *
- *===========================================================================*/
-PUBLIC long conv4(norm, x)
-int norm;			/* TRUE if no swap, FALSE for byte swap */
-long x;				/* 32-bit long to be byte swapped */
-{
-/* Possibly swap a 32-bit long between 8086 and 68000 byte order. */
-
-  unsigned lo, hi;
-  long l;
-  
-  if (norm) return(x);			/* byte order was already ok */
-  lo = conv2(FALSE, (int) x & 0xFFFF);	/* low-order half, byte swapped */
-  hi = conv2(FALSE, (int) (x>>16) & 0xFFFF);	/* high-order half, swapped */
-  l = ( (long) lo <<16) | hi;
-  return(l);
-}
-
-
-/*===========================================================================*
- *				conv_inode				     *
- *===========================================================================*/
-PUBLIC void conv_inode(rip, dip, dip2, rw_flag, magic)
-register struct inode *rip;	/* pointer to the in-core inode struct */
-register d1_inode *dip;		/* pointer to the V1 on-disk inode struct */
-register d2_inode *dip2;	/* pointer to the V2 on-disk inode struct */
-int rw_flag;			/* READING or WRITING */
-int magic;			/* magic number of file system */
-{ 
-/* Copy the inode from the disk block to the in-core table or vice versa.
- * If the fourth parameter below is FALSE, the bytes are swapped.
- */
-  switch (magic) {
-	case SUPER_MAGIC:	old_icopy(rip, dip,  rw_flag, TRUE);	break;
-	case SUPER_REV:		old_icopy(rip, dip,  rw_flag, FALSE);	break;
-	case SUPER_V3:
-	case SUPER_V2:		new_icopy(rip, dip2, rw_flag, TRUE);	break;
-	case SUPER_V2_REV:	new_icopy(rip, dip2, rw_flag, FALSE);	break;
-  } 
-}
-
-
-/*===========================================================================*
- *				old_icopy				     *
- *===========================================================================*/
-PUBLIC void old_icopy(rip, dip, direction, norm)
-register struct inode *rip;	/* pointer to the in-core inode struct */
-register d1_inode *dip;		/* pointer to the d1_inode inode struct */
-int direction;			/* READING (from disk) or WRITING (to disk) */
-int norm;			/* TRUE = do not swap bytes; FALSE = swap */
-
-{
-/* 4 different on-disk inode layouts are supported, one for each combination
- * of V1.x/V2.x * bytes-swapped/not-swapped.  When an inode is read or written
- * this routine handles the conversions so that the information in the inode
- * table is independent of the disk structure from which the inode came.
- * The old_icopy routine copies to and from V1 disks.
- */
-
-  int i;
-
-  if (direction == READING) {
-	/* Copy V1.x inode to the in-core table, swapping bytes if need be. */
-	rip->i_mode    = conv2(norm, dip->d1_mode);
-	rip->i_uid     = conv2(norm,dip->d1_uid );
-	rip->i_size    = conv4(norm,dip->d1_size);
-	rip->i_mtime   = conv4(norm,dip->d1_mtime);
-	rip->i_atime   = 0;
-	rip->i_ctime   = 0;
-	rip->i_nlinks  = (nlink_t) dip->d1_nlinks;	/* 1 char */
-	rip->i_gid     = (gid_t) dip->d1_gid;		/* 1 char */
-	rip->i_ndzones = V1_NR_DZONES;
-	rip->i_nindirs = V1_INDIRECTS;
-	for (i = 0; i < V1_NR_TZONES; i++)
-		rip->i_zone[i] = conv2(norm, (int) dip->d1_zone[i]);
-  } else {
-	/* Copying V1.x inode to disk from the in-core table. */
-	dip->d1_mode   = conv2(norm,rip->i_mode);
-	dip->d1_uid    = conv2(norm,rip->i_uid );
-	dip->d1_size   = conv4(norm,rip->i_size);
-	dip->d1_mtime  = conv4(norm,rip->i_mtime);
-	dip->d1_nlinks = (nlink_t) rip->i_nlinks;	/* 1 char */
-	dip->d1_gid    = (gid_t) rip->i_gid;		/* 1 char */
-	for (i = 0; i < V1_NR_TZONES; i++)
-		dip->d1_zone[i] = conv2(norm, (int) rip->i_zone[i]);
-  }
-}
-
-
-/*===========================================================================*
- *				new_icopy				     *
- *===========================================================================*/
-PUBLIC void new_icopy(rip, dip, direction, norm)
-register struct inode *rip;	/* pointer to the in-core inode struct */
-register d2_inode *dip;	/* pointer to the d2_inode struct */
-int direction;			/* READING (from disk) or WRITING (to disk) */
-int norm;			/* TRUE = do not swap bytes; FALSE = swap */
-
-{
-/* Same as old_icopy, but to/from V2 disk layout. */
-
-  int i;
-
-  if (direction == READING) {
-	/* Copy V2.x inode to the in-core table, swapping bytes if need be. */
-	rip->i_mode    = conv2(norm,dip->d2_mode);
-	rip->i_uid     = conv2(norm,dip->d2_uid );
-	rip->i_nlinks  = conv2(norm,(int) dip->d2_nlinks);
-	rip->i_gid     = conv2(norm,(int) dip->d2_gid );
-	rip->i_size    = conv4(norm,dip->d2_size);
-	rip->i_atime   = conv4(norm,dip->d2_atime);
-	rip->i_ctime   = conv4(norm,dip->d2_ctime);
-	rip->i_mtime   = conv4(norm,dip->d2_mtime);
-	rip->i_ndzones = V2_NR_DZONES;
-	rip->i_nindirs = V2_INDIRECTS(rip->i_sp->s_block_size);
-	for (i = 0; i < V2_NR_TZONES; i++)
-		rip->i_zone[i] = conv4(norm, (long) dip->d2_zone[i]);
-  } else {
-	/* Copying V2.x inode to disk from the in-core table. */
-	dip->d2_mode   = conv2(norm,rip->i_mode);
-	dip->d2_uid    = conv2(norm,rip->i_uid );
-	dip->d2_nlinks = conv2(norm,rip->i_nlinks);
-	dip->d2_gid    = conv2(norm,rip->i_gid );
-	dip->d2_size   = conv4(norm,rip->i_size);
-	dip->d2_atime  = conv4(norm,rip->i_atime);
-	dip->d2_ctime  = conv4(norm,rip->i_ctime);
-	dip->d2_mtime  = conv4(norm,rip->i_mtime);
-	for (i = 0; i < V2_NR_TZONES; i++)
-		dip->d2_zone[i] = conv4(norm, (long) rip->i_zone[i]);
-  }
-}
Index: trunk/minix/lib/other/fsversion.c
===================================================================
--- trunk/minix/lib/other/fsversion.c	(revision 9)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/* This procedure examines a file system and figures out whether it is
- * version 1 or version 2.  It returns the result as an int.  If the
- * file system is neither, it returns -1.  A typical call is:
- *
- *	n = fsversion("/dev/hd1", "df");
- *
- * The first argument is the special file for the file system. 
- * The second is the program name, which is used in error messages.
- */
-
-#include <sys/types.h>
-#include <minix/config.h>
-#include <minix/const.h>
-#include <minix/minlib.h>
-#include <minix/type.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-
-#include "fs/const.h"
-#include "fs/type.h"
-#include "fs/super.h"
-
-static struct super_block super, *sp;
-
-int fsversion(dev, prog)
-char *dev, *prog;
-{
-  int fd;
-
-  if ((fd = open(dev, O_RDONLY)) < 0) {
-	std_err(prog);
-	std_err(" cannot open ");
-	perror(dev);
-	return(-1);
-  }
-
-  lseek(fd, (off_t) SUPER_BLOCK_BYTES, SEEK_SET);	/* skip boot block */
-  if (read(fd, (char *) &super, (unsigned) SUPER_SIZE) != SUPER_SIZE) {
-	std_err(prog);
-	std_err(" cannot read super block on ");
-	perror(dev);
-	close(fd);
-	return(-1);
-  }
-  close(fd);
-  sp = &super;
-  if (sp->s_magic == SUPER_MAGIC) return(1);
-  if (sp->s_magic == SUPER_V2) return(2);
-  if (sp->s_magic == SUPER_V3) return(3);
-  return(-1);
-}
Index: trunk/minix/lib/other/fts.c
===================================================================
--- trunk/minix/lib/other/fts.c	(revision 9)
+++ 	(revision )
@@ -1,1217 +1,0 @@
-/*-
- * Copyright (c) 1990, 1993, 1994
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $OpenBSD: fts.c,v 1.22 1999/10/03 19:22:22 millert Exp $
- */
-
-#if 0
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)fts.c	8.6 (Berkeley) 8/14/94";
-#endif /* LIBC_SCCS and not lint */
-#endif
-
-#define MAX(a, b)   ((a) > (b) ? (a) : (b))
-#define MIN(a, b)   ((a) < (b) ? (a) : (b))
-
-
-#define _POSIX_SOURCE 1
-#define _MINIX 1
-
-#include "namespace.h"
-#include <sys/param.h>
-#include <sys/stat.h>
-
-#include <dirent.h>
-#include <limits.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <fts.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include "un-namespace.h"
-
-static FTSENT	*fts_alloc(FTS *, char *, int);
-static FTSENT	*fts_build(FTS *, int);
-static void	 fts_lfree(FTSENT *);
-static void	 fts_load(FTS *, FTSENT *);
-static size_t	 fts_maxarglen(char * const *);
-static void	 fts_padjust(FTS *, FTSENT *);
-static int	 fts_palloc(FTS *, size_t);
-static FTSENT	*fts_sort(FTS *, FTSENT *, int);
-static u_short	 fts_stat(FTS *, FTSENT *, int);
-static int	 fts_safe_changedir(FTS *, FTSENT *, int, char *);
-static int	 fts_ufslinks(FTS *, const FTSENT *);
-
-#define	ISDOT(a)	(a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
-
-#define	CLR(opt)	(sp->fts_options &= ~(opt))
-#define	ISSET(opt)	(sp->fts_options & (opt))
-#define	SET(opt)	(sp->fts_options |= (opt))
-
-#define	FCHDIR(sp, fd)	(!ISSET(FTS_NOCHDIR) && fchdir(fd))
-
-/* fts_build flags */
-#define	BCHILD		1		/* fts_children */
-#define	BNAMES		2		/* fts_children, names only */
-#define	BREAD		3		/* fts_read */
-
-/*
- * Internal representation of an FTS, including extra implementation
- * details.  The FTS returned from fts_open points to this structure's
- * ftsp_fts member (and can be cast to an _fts_private as required)
- */
-struct _fts_private {
-	FTS		ftsp_fts;
-	dev_t		ftsp_dev;
-	int		ftsp_linksreliable;
-};
-
-/*
- * The "FTS_NOSTAT" option can avoid a lot of calls to stat(2) if it
- * knows that a directory could not possibly have subdirectories.  This
- * is decided by looking at the link count: a subdirectory would
- * increment its parent's link count by virtue of its own ".." entry.
- * This assumption only holds for UFS-like filesystems that implement
- * links and directories this way, so we must punt for others.
- */
-
-static const char *ufslike_filesystems[] = {
-	"ufs",
-	"nfs",
-	"nfs4",
-	"ext2fs",
-	0
-};
-
-static void *reallocf(void *ptr, size_t size)
-{
-	void *p;
-	if((p = realloc(ptr, size))) return p;
-	if(ptr) free(ptr);
-	return NULL;
-}
-
-FTS *
-fts_open(argv, options, compar)
-	char * const *argv;
-	int options;
-	int (*compar)(const FTSENT * const *, const FTSENT * const *);
-{
-	struct _fts_private *priv;
-	FTS *sp;
-	FTSENT *p, *root;
-	int nitems;
-	FTSENT *parent, *tmp;
-	int len;
-
-	/* Options check. */
-	if (options & ~FTS_OPTIONMASK) {
-		errno = EINVAL;
-		return (NULL);
-	}
-
-	/* Allocate/initialize the stream. */
-	if ((priv = malloc(sizeof(*priv))) == NULL)
-		return (NULL);
-	memset(priv, 0, sizeof(*priv));
-	sp = &priv->ftsp_fts;
-	sp->fts_compar = compar;
-	sp->fts_options = options;
-
-	/* Shush, GCC. */
-	tmp = NULL;
-
-	/* Logical walks turn on NOCHDIR; symbolic links are too hard. */
-	if (ISSET(FTS_LOGICAL))
-		SET(FTS_NOCHDIR);
-
-	/*
-	 * Start out with 1K of path space, and enough, in any case,
-	 * to hold the user's paths.
-	 */
-	if (fts_palloc(sp, MAX(fts_maxarglen(argv), PATH_MAX)))
-		goto mem1;
-
-	/* Allocate/initialize root's parent. */
-	if ((parent = fts_alloc(sp, "", 0)) == NULL)
-		goto mem2;
-	parent->fts_level = FTS_ROOTPARENTLEVEL;
-
-	/* Allocate/initialize root(s). */
-	for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
-		/* Don't allow zero-length paths. */
-		if ((len = strlen(*argv)) == 0) {
-			errno = ENOENT;
-			goto mem3;
-		}
-
-		p = fts_alloc(sp, *argv, len);
-		p->fts_level = FTS_ROOTLEVEL;
-		p->fts_parent = parent;
-		p->fts_accpath = p->fts_name;
-		p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW));
-
-		/* Command-line "." and ".." are real directories. */
-		if (p->fts_info == FTS_DOT)
-			p->fts_info = FTS_D;
-
-		/*
-		 * If comparison routine supplied, traverse in sorted
-		 * order; otherwise traverse in the order specified.
-		 */
-		if (compar) {
-			p->fts_link = root;
-			root = p;
-		} else {
-			p->fts_link = NULL;
-			if (root == NULL)
-				tmp = root = p;
-			else {
-				tmp->fts_link = p;
-				tmp = p;
-			}
-		}
-	}
-	if (compar && nitems > 1)
-		root = fts_sort(sp, root, nitems);
-
-	/*
-	 * Allocate a dummy pointer and make fts_read think that we've just
-	 * finished the node before the root(s); set p->fts_info to FTS_INIT
-	 * so that everything about the "current" node is ignored.
-	 */
-	if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
-		goto mem3;
-	sp->fts_cur->fts_link = root;
-	sp->fts_cur->fts_info = FTS_INIT;
-
-	/*
-	 * If using chdir(2), grab a file descriptor pointing to dot to ensure
-	 * that we can get back here; this could be avoided for some paths,
-	 * but almost certainly not worth the effort.  Slashes, symbolic links,
-	 * and ".." are all fairly nasty problems.  Note, if we can't get the
-	 * descriptor we run anyway, just more slowly.
-	 */
-	if (!ISSET(FTS_NOCHDIR) && (sp->fts_rfd = _open(".", O_RDONLY, 0)) < 0)
-		SET(FTS_NOCHDIR);
-
-	return (sp);
-
-mem3:	fts_lfree(root);
-	free(parent);
-mem2:	free(sp->fts_path);
-mem1:	free(sp);
-	return (NULL);
-}
-
-static void
-fts_load(sp, p)
-	FTS *sp;
-	FTSENT *p;
-{
-	int len;
-	char *cp;
-
-	/*
-	 * Load the stream structure for the next traversal.  Since we don't
-	 * actually enter the directory until after the preorder visit, set
-	 * the fts_accpath field specially so the chdir gets done to the right
-	 * place and the user can access the first node.  From fts_open it's
-	 * known that the path will fit.
-	 */
-	len = p->fts_pathlen = p->fts_namelen;
-	memmove(sp->fts_path, p->fts_name, len + 1);
-	if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
-		len = strlen(++cp);
-		memmove(p->fts_name, cp, len + 1);
-		p->fts_namelen = len;
-	}
-	p->fts_accpath = p->fts_path = sp->fts_path;
-	sp->fts_dev = p->fts_dev;
-}
-
-int
-fts_close(sp)
-	FTS *sp;
-{
-	FTSENT *freep, *p;
-	int saved_errno;
-
-	/*
-	 * This still works if we haven't read anything -- the dummy structure
-	 * points to the root list, so we step through to the end of the root
-	 * list which has a valid parent pointer.
-	 */
-	if (sp->fts_cur) {
-		for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
-			freep = p;
-			p = p->fts_link != NULL ? p->fts_link : p->fts_parent;
-			free(freep);
-		}
-		free(p);
-	}
-
-	/* Free up child linked list, sort array, path buffer. */
-	if (sp->fts_child)
-		fts_lfree(sp->fts_child);
-	if (sp->fts_array)
-		free(sp->fts_array);
-	free(sp->fts_path);
-
-	/* Return to original directory, save errno if necessary. */
-	if (!ISSET(FTS_NOCHDIR)) {
-		saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
-		(void)_close(sp->fts_rfd);
-
-		/* Set errno and return. */
-		if (saved_errno != 0) {
-			/* Free up the stream pointer. */
-			free(sp);
-			errno = saved_errno;
-			return (-1);
-		}
-	}
-
-	/* Free up the stream pointer. */
-	free(sp);
-	return (0);
-}
-
-/*
- * Special case of "/" at the end of the path so that slashes aren't
- * appended which would cause paths to be written as "....//foo".
- */
-#define	NAPPEND(p)							\
-	(p->fts_path[p->fts_pathlen - 1] == '/'				\
-	    ? p->fts_pathlen - 1 : p->fts_pathlen)
-
-FTSENT *
-fts_read(sp)
-	FTS *sp;
-{
-	FTSENT *p, *tmp;
-	int instr;
-	char *t;
-	int saved_errno;
-
-	/* If finished or unrecoverable error, return NULL. */
-	if (sp->fts_cur == NULL || ISSET(FTS_STOP))
-		return (NULL);
-
-	/* Set current node pointer. */
-	p = sp->fts_cur;
-
-	/* Save and zero out user instructions. */
-	instr = p->fts_instr;
-	p->fts_instr = FTS_NOINSTR;
-
-	/* Any type of file may be re-visited; re-stat and re-turn. */
-	if (instr == FTS_AGAIN) {
-		p->fts_info = fts_stat(sp, p, 0);
-		return (p);
-	}
-
-	/*
-	 * Following a symlink -- SLNONE test allows application to see
-	 * SLNONE and recover.  If indirecting through a symlink, have
-	 * keep a pointer to current location.  If unable to get that
-	 * pointer, follow fails.
-	 */
-	if (instr == FTS_FOLLOW &&
-	    (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
-		p->fts_info = fts_stat(sp, p, 1);
-		if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
-			if ((p->fts_symfd = _open(".", O_RDONLY, 0)) < 0) {
-				p->fts_errno = errno;
-				p->fts_info = FTS_ERR;
-			} else
-				p->fts_flags |= FTS_SYMFOLLOW;
-		}
-		return (p);
-	}
-
-	/* Directory in pre-order. */
-	if (p->fts_info == FTS_D) {
-		/* If skipped or crossed mount point, do post-order visit. */
-		if (instr == FTS_SKIP ||
-		    (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) {
-			if (p->fts_flags & FTS_SYMFOLLOW)
-				(void)_close(p->fts_symfd);
-			if (sp->fts_child) {
-				fts_lfree(sp->fts_child);
-				sp->fts_child = NULL;
-			}
-			p->fts_info = FTS_DP;
-			return (p);
-		}
-
-		/* Rebuild if only read the names and now traversing. */
-		if (sp->fts_child != NULL && ISSET(FTS_NAMEONLY)) {
-			CLR(FTS_NAMEONLY);
-			fts_lfree(sp->fts_child);
-			sp->fts_child = NULL;
-		}
-
-		/*
-		 * Cd to the subdirectory.
-		 *
-		 * If have already read and now fail to chdir, whack the list
-		 * to make the names come out right, and set the parent errno
-		 * so the application will eventually get an error condition.
-		 * Set the FTS_DONTCHDIR flag so that when we logically change
-		 * directories back to the parent we don't do a chdir.
-		 *
-		 * If haven't read do so.  If the read fails, fts_build sets
-		 * FTS_STOP or the fts_info field of the node.
-		 */
-		if (sp->fts_child != NULL) {
-			if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) {
-				p->fts_errno = errno;
-				p->fts_flags |= FTS_DONTCHDIR;
-				for (p = sp->fts_child; p != NULL;
-				    p = p->fts_link)
-					p->fts_accpath =
-					    p->fts_parent->fts_accpath;
-			}
-		} else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
-			if (ISSET(FTS_STOP))
-				return (NULL);
-			return (p);
-		}
-		p = sp->fts_child;
-		sp->fts_child = NULL;
-		goto name;
-	}
-
-	/* Move to the next node on this level. */
-next:	tmp = p;
-	if ((p = p->fts_link) != NULL) {
-		free(tmp);
-
-		/*
-		 * If reached the top, return to the original directory (or
-		 * the root of the tree), and load the paths for the next root.
-		 */
-		if (p->fts_level == FTS_ROOTLEVEL) {
-			if (FCHDIR(sp, sp->fts_rfd)) {
-				SET(FTS_STOP);
-				return (NULL);
-			}
-			fts_load(sp, p);
-			return (sp->fts_cur = p);
-		}
-
-		/*
-		 * User may have called fts_set on the node.  If skipped,
-		 * ignore.  If followed, get a file descriptor so we can
-		 * get back if necessary.
-		 */
-		if (p->fts_instr == FTS_SKIP)
-			goto next;
-		if (p->fts_instr == FTS_FOLLOW) {
-			p->fts_info = fts_stat(sp, p, 1);
-			if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
-				if ((p->fts_symfd =
-				    _open(".", O_RDONLY, 0)) < 0) {
-					p->fts_errno = errno;
-					p->fts_info = FTS_ERR;
-				} else
-					p->fts_flags |= FTS_SYMFOLLOW;
-			}
-			p->fts_instr = FTS_NOINSTR;
-		}
-
-name:		t = sp->fts_path + NAPPEND(p->fts_parent);
-		*t++ = '/';
-		memmove(t, p->fts_name, p->fts_namelen + 1);
-		return (sp->fts_cur = p);
-	}
-
-	/* Move up to the parent node. */
-	p = tmp->fts_parent;
-	free(tmp);
-
-	if (p->fts_level == FTS_ROOTPARENTLEVEL) {
-		/*
-		 * Done; free everything up and set errno to 0 so the user
-		 * can distinguish between error and EOF.
-		 */
-		free(p);
-		errno = 0;
-		return (sp->fts_cur = NULL);
-	}
-
-	/* NUL terminate the pathname. */
-	sp->fts_path[p->fts_pathlen] = '\0';
-
-	/*
-	 * Return to the parent directory.  If at a root node or came through
-	 * a symlink, go back through the file descriptor.  Otherwise, cd up
-	 * one directory.
-	 */
-	if (p->fts_level == FTS_ROOTLEVEL) {
-		if (FCHDIR(sp, sp->fts_rfd)) {
-			SET(FTS_STOP);
-			return (NULL);
-		}
-	} else if (p->fts_flags & FTS_SYMFOLLOW) {
-		if (FCHDIR(sp, p->fts_symfd)) {
-			saved_errno = errno;
-			(void)_close(p->fts_symfd);
-			errno = saved_errno;
-			SET(FTS_STOP);
-			return (NULL);
-		}
-		(void)_close(p->fts_symfd);
-	} else if (!(p->fts_flags & FTS_DONTCHDIR) &&
-	    fts_safe_changedir(sp, p->fts_parent, -1, "..")) {
-		SET(FTS_STOP);
-		return (NULL);
-	}
-	p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
-	return (sp->fts_cur = p);
-}
-
-/*
- * Fts_set takes the stream as an argument although it's not used in this
- * implementation; it would be necessary if anyone wanted to add global
- * semantics to fts using fts_set.  An error return is allowed for similar
- * reasons.
- */
-/* ARGSUSED */
-int
-fts_set(sp, p, instr)
-	FTS *sp;
-	FTSENT *p;
-	int instr;
-{
-	if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
-	    instr != FTS_NOINSTR && instr != FTS_SKIP) {
-		errno = EINVAL;
-		return (1);
-	}
-	p->fts_instr = instr;
-	return (0);
-}
-
-FTSENT *
-fts_children(sp, instr)
-	FTS *sp;
-	int instr;
-{
-	FTSENT *p;
-	int fd;
-
-	if (instr != 0 && instr != FTS_NAMEONLY) {
-		errno = EINVAL;
-		return (NULL);
-	}
-
-	/* Set current node pointer. */
-	p = sp->fts_cur;
-
-	/*
-	 * Errno set to 0 so user can distinguish empty directory from
-	 * an error.
-	 */
-	errno = 0;
-
-	/* Fatal errors stop here. */
-	if (ISSET(FTS_STOP))
-		return (NULL);
-
-	/* Return logical hierarchy of user's arguments. */
-	if (p->fts_info == FTS_INIT)
-		return (p->fts_link);
-
-	/*
-	 * If not a directory being visited in pre-order, stop here.  Could
-	 * allow FTS_DNR, assuming the user has fixed the problem, but the
-	 * same effect is available with FTS_AGAIN.
-	 */
-	if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */)
-		return (NULL);
-
-	/* Free up any previous child list. */
-	if (sp->fts_child != NULL)
-		fts_lfree(sp->fts_child);
-
-	if (instr == FTS_NAMEONLY) {
-		SET(FTS_NAMEONLY);
-		instr = BNAMES;
-	} else
-		instr = BCHILD;
-
-	/*
-	 * If using chdir on a relative path and called BEFORE fts_read does
-	 * its chdir to the root of a traversal, we can lose -- we need to
-	 * chdir into the subdirectory, and we don't know where the current
-	 * directory is, so we can't get back so that the upcoming chdir by
-	 * fts_read will work.
-	 */
-	if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
-	    ISSET(FTS_NOCHDIR))
-		return (sp->fts_child = fts_build(sp, instr));
-
-	if ((fd = _open(".", O_RDONLY, 0)) < 0)
-		return (NULL);
-	sp->fts_child = fts_build(sp, instr);
-	if (fchdir(fd))
-		return (NULL);
-	(void)_close(fd);
-	return (sp->fts_child);
-}
-
-#ifndef fts_get_clientptr
-#error "fts_get_clientptr not defined"
-#endif
-
-void *
-(fts_get_clientptr)(FTS *sp)
-{
-
-	return (fts_get_clientptr(sp));
-}
-
-#ifndef fts_get_stream
-#error "fts_get_stream not defined"
-#endif
-
-FTS *
-(fts_get_stream)(FTSENT *p)
-{
-	return (fts_get_stream(p));
-}
-
-void
-fts_set_clientptr(FTS *sp, void *clientptr)
-{
-
-	sp->fts_clientptr = clientptr;
-}
-
-/*
- * This is the tricky part -- do not casually change *anything* in here.  The
- * idea is to build the linked list of entries that are used by fts_children
- * and fts_read.  There are lots of special cases.
- *
- * The real slowdown in walking the tree is the stat calls.  If FTS_NOSTAT is
- * set and it's a physical walk (so that symbolic links can't be directories),
- * we can do things quickly.  First, if it's a 4.4BSD file system, the type
- * of the file is in the directory entry.  Otherwise, we assume that the number
- * of subdirectories in a node is equal to the number of links to the parent.
- * The former skips all stat calls.  The latter skips stat calls in any leaf
- * directories and for any files after the subdirectories in the directory have
- * been found, cutting the stat calls by about 2/3.
- */
-static FTSENT *
-fts_build(sp, type)
-	FTS *sp;
-	int type;
-{
-	struct dirent *dp;
-	FTSENT *p, *head;
-	int nitems;
-	FTSENT *cur, *tail;
-	DIR *dirp;
-	void *oldaddr;
-	size_t dnamlen;
-	int cderrno, descend, len, level, maxlen, nlinks, oflag, saved_errno,
-	    nostat, doadjust;
-	char *cp;
-
-	/* Set current node pointer. */
-	cur = sp->fts_cur;
-
-	/*
-	 * Open the directory for reading.  If this fails, we're done.
-	 * If being called from fts_read, set the fts_info field.
-	 */
-#ifdef FTS_WHITEOUT
-	if (ISSET(FTS_WHITEOUT))
-		oflag = DTF_NODUP | DTF_REWIND;
-	else
-		oflag = DTF_HIDEW | DTF_NODUP | DTF_REWIND;
-#else
-#define __opendir2(path, flag) opendir(path)
-#endif
-	if ((dirp = __opendir2(cur->fts_accpath, oflag)) == NULL) {
-		if (type == BREAD) {
-			cur->fts_info = FTS_DNR;
-			cur->fts_errno = errno;
-		}
-		return (NULL);
-	}
-
-	/*
-	 * Nlinks is the number of possible entries of type directory in the
-	 * directory if we're cheating on stat calls, 0 if we're not doing
-	 * any stat calls at all, -1 if we're doing stats on everything.
-	 */
-	if (type == BNAMES) {
-		nlinks = 0;
-		/* Be quiet about nostat, GCC. */
-		nostat = 0;
-	} else if (ISSET(FTS_NOSTAT) && ISSET(FTS_PHYSICAL)) {
-		if (fts_ufslinks(sp, cur))
-			nlinks = cur->fts_nlink - (ISSET(FTS_SEEDOT) ? 0 : 2);
-		else
-			nlinks = -1;
-		nostat = 1;
-	} else {
-		nlinks = -1;
-		nostat = 0;
-	}
-
-#ifdef notdef
-	(void)printf("nlinks == %d (cur: %d)\n", nlinks, cur->fts_nlink);
-	(void)printf("NOSTAT %d PHYSICAL %d SEEDOT %d\n",
-	    ISSET(FTS_NOSTAT), ISSET(FTS_PHYSICAL), ISSET(FTS_SEEDOT));
-#endif
-	/*
-	 * If we're going to need to stat anything or we want to descend
-	 * and stay in the directory, chdir.  If this fails we keep going,
-	 * but set a flag so we don't chdir after the post-order visit.
-	 * We won't be able to stat anything, but we can still return the
-	 * names themselves.  Note, that since fts_read won't be able to
-	 * chdir into the directory, it will have to return different path
-	 * names than before, i.e. "a/b" instead of "b".  Since the node
-	 * has already been visited in pre-order, have to wait until the
-	 * post-order visit to return the error.  There is a special case
-	 * here, if there was nothing to stat then it's not an error to
-	 * not be able to stat.  This is all fairly nasty.  If a program
-	 * needed sorted entries or stat information, they had better be
-	 * checking FTS_NS on the returned nodes.
-	 */
-	cderrno = 0;
-	if (nlinks || type == BREAD) {
-		if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) {
-			if (nlinks && type == BREAD)
-				cur->fts_errno = errno;
-			cur->fts_flags |= FTS_DONTCHDIR;
-			descend = 0;
-			cderrno = errno;
-		} else
-			descend = 1;
-	} else
-		descend = 0;
-
-	/*
-	 * Figure out the max file name length that can be stored in the
-	 * current path -- the inner loop allocates more path as necessary.
-	 * We really wouldn't have to do the maxlen calculations here, we
-	 * could do them in fts_read before returning the path, but it's a
-	 * lot easier here since the length is part of the dirent structure.
-	 *
-	 * If not changing directories set a pointer so that can just append
-	 * each new name into the path.
-	 */
-	len = NAPPEND(cur);
-	if (ISSET(FTS_NOCHDIR)) {
-		cp = sp->fts_path + len;
-		*cp++ = '/';
-	} else {
-		/* GCC, you're too verbose. */
-		cp = NULL;
-	}
-	len++;
-	maxlen = sp->fts_pathlen - len;
-
-	level = cur->fts_level + 1;
-
-	/* Read the directory, attaching each entry to the `link' pointer. */
-	doadjust = 0;
-	for (head = tail = NULL, nitems = 0; dirp && (dp = readdir(dirp));) {
-		dnamlen = strlen(dp->d_name);
-		if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
-			continue;
-
-		if ((p = fts_alloc(sp, dp->d_name, (int)dnamlen)) == NULL)
-			goto mem1;
-		if (dnamlen >= maxlen) {	/* include space for NUL */
-			oldaddr = sp->fts_path;
-			if (fts_palloc(sp, dnamlen + len + 1)) {
-				/*
-				 * No more memory for path or structures.  Save
-				 * errno, free up the current structure and the
-				 * structures already allocated.
-				 */
-mem1:				saved_errno = errno;
-				if (p)
-					free(p);
-				fts_lfree(head);
-				(void)closedir(dirp);
-				cur->fts_info = FTS_ERR;
-				SET(FTS_STOP);
-				errno = saved_errno;
-				return (NULL);
-			}
-			/* Did realloc() change the pointer? */
-			if (oldaddr != sp->fts_path) {
-				doadjust = 1;
-				if (ISSET(FTS_NOCHDIR))
-					cp = sp->fts_path + len;
-			}
-			maxlen = sp->fts_pathlen - len;
-		}
-
-		if (len + dnamlen >= USHRT_MAX) {
-			/*
-			 * In an FTSENT, fts_pathlen is a u_short so it is
-			 * possible to wraparound here.  If we do, free up
-			 * the current structure and the structures already
-			 * allocated, then error out with ENAMETOOLONG.
-			 */
-			free(p);
-			fts_lfree(head);
-			(void)closedir(dirp);
-			cur->fts_info = FTS_ERR;
-			SET(FTS_STOP);
-			errno = ENAMETOOLONG;
-			return (NULL);
-		}
-		p->fts_level = level;
-		p->fts_parent = sp->fts_cur;
-		p->fts_pathlen = len + dnamlen;
-
-#ifdef FTS_WHITEOUT
-		if (dp->d_type == DT_WHT)
-			p->fts_flags |= FTS_ISW;
-#endif
-
-		if (cderrno) {
-			if (nlinks) {
-				p->fts_info = FTS_NS;
-				p->fts_errno = cderrno;
-			} else
-				p->fts_info = FTS_NSOK;
-			p->fts_accpath = cur->fts_accpath;
-		} else if (nlinks == 0
-#ifdef DT_DIR
-		    || (nostat &&
-		    dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN)
-#endif
-		    ) {
-			p->fts_accpath =
-			    ISSET(FTS_NOCHDIR) ? p->fts_path : p->fts_name;
-			p->fts_info = FTS_NSOK;
-		} else {
-			/* Build a file name for fts_stat to stat. */
-			if (ISSET(FTS_NOCHDIR)) {
-				p->fts_accpath = p->fts_path;
-				memmove(cp, p->fts_name, p->fts_namelen + 1);
-			} else
-				p->fts_accpath = p->fts_name;
-			/* Stat it. */
-			p->fts_info = fts_stat(sp, p, 0);
-
-			/* Decrement link count if applicable. */
-			if (nlinks > 0 && (p->fts_info == FTS_D ||
-			    p->fts_info == FTS_DC || p->fts_info == FTS_DOT))
-				--nlinks;
-		}
-
-		/* We walk in directory order so "ls -f" doesn't get upset. */
-		p->fts_link = NULL;
-		if (head == NULL)
-			head = tail = p;
-		else {
-			tail->fts_link = p;
-			tail = p;
-		}
-		++nitems;
-	}
-	if (dirp)
-		(void)closedir(dirp);
-
-	/*
-	 * If realloc() changed the address of the path, adjust the
-	 * addresses for the rest of the tree and the dir list.
-	 */
-	if (doadjust)
-		fts_padjust(sp, head);
-
-	/*
-	 * If not changing directories, reset the path back to original
-	 * state.
-	 */
-	if (ISSET(FTS_NOCHDIR)) {
-		if (len == sp->fts_pathlen || nitems == 0)
-			--cp;
-		*cp = '\0';
-	}
-
-	/*
-	 * If descended after called from fts_children or after called from
-	 * fts_read and nothing found, get back.  At the root level we use
-	 * the saved fd; if one of fts_open()'s arguments is a relative path
-	 * to an empty directory, we wind up here with no other way back.  If
-	 * can't get back, we're done.
-	 */
-	if (descend && (type == BCHILD || !nitems) &&
-	    (cur->fts_level == FTS_ROOTLEVEL ?
-	    FCHDIR(sp, sp->fts_rfd) :
-	    fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
-		cur->fts_info = FTS_ERR;
-		SET(FTS_STOP);
-		return (NULL);
-	}
-
-	/* If didn't find anything, return NULL. */
-	if (!nitems) {
-		if (type == BREAD)
-			cur->fts_info = FTS_DP;
-		return (NULL);
-	}
-
-	/* Sort the entries. */
-	if (sp->fts_compar && nitems > 1)
-		head = fts_sort(sp, head, nitems);
-	return (head);
-}
-
-static u_short
-fts_stat(sp, p, follow)
-	FTS *sp;
-	FTSENT *p;
-	int follow;
-{
-	FTSENT *t;
-	dev_t dev;
-	ino_t ino;
-	struct stat *sbp, sb;
-	int saved_errno;
-
-	/* If user needs stat info, stat buffer already allocated. */
-	sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
-
-#ifdef FTS_WHITEOUT
-	/* Check for whiteout. */
-	if (p->fts_flags & FTS_ISW) {
-		if (sbp != &sb) {
-			memset(sbp, '\0', sizeof(*sbp));
-			sbp->st_mode = S_IFWHT;
-		}
-		return (FTS_W);
-	}
-#endif
-
-	/*
-	 * If doing a logical walk, or application requested FTS_FOLLOW, do
-	 * a stat(2).  If that fails, check for a non-existent symlink.  If
-	 * fail, set the errno from the stat call.
-	 */
-	if (ISSET(FTS_LOGICAL) || follow) {
-		if (stat(p->fts_accpath, sbp)) {
-			saved_errno = errno;
-			if (!lstat(p->fts_accpath, sbp)) {
-				errno = 0;
-				return (FTS_SLNONE);
-			}
-			p->fts_errno = saved_errno;
-			goto err;
-		}
-	} else if (lstat(p->fts_accpath, sbp)) {
-		p->fts_errno = errno;
-err:		memset(sbp, 0, sizeof(struct stat));
-		return (FTS_NS);
-	}
-
-	if (S_ISDIR(sbp->st_mode)) {
-		/*
-		 * Set the device/inode.  Used to find cycles and check for
-		 * crossing mount points.  Also remember the link count, used
-		 * in fts_build to limit the number of stat calls.  It is
-		 * understood that these fields are only referenced if fts_info
-		 * is set to FTS_D.
-		 */
-		dev = p->fts_dev = sbp->st_dev;
-		ino = p->fts_ino = sbp->st_ino;
-		p->fts_nlink = sbp->st_nlink;
-
-		if (ISDOT(p->fts_name))
-			return (FTS_DOT);
-
-		/*
-		 * Cycle detection is done by brute force when the directory
-		 * is first encountered.  If the tree gets deep enough or the
-		 * number of symbolic links to directories is high enough,
-		 * something faster might be worthwhile.
-		 */
-		for (t = p->fts_parent;
-		    t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
-			if (ino == t->fts_ino && dev == t->fts_dev) {
-				p->fts_cycle = t;
-				return (FTS_DC);
-			}
-		return (FTS_D);
-	}
-	if (S_ISLNK(sbp->st_mode))
-		return (FTS_SL);
-	if (S_ISREG(sbp->st_mode))
-		return (FTS_F);
-	return (FTS_DEFAULT);
-}
-
-/*
- * The comparison function takes pointers to pointers to FTSENT structures.
- * Qsort wants a comparison function that takes pointers to void.
- * (Both with appropriate levels of const-poisoning, of course!)
- * Use a trampoline function to deal with the difference.
- */
-static int
-fts_compar(const void *a, const void *b)
-{
-	FTS *parent;
-
-	parent = (*(const FTSENT * const *)a)->fts_fts;
-	return (*parent->fts_compar)(a, b);
-}
-
-static FTSENT *
-fts_sort(sp, head, nitems)
-	FTS *sp;
-	FTSENT *head;
-	int nitems;
-{
-	FTSENT **ap, *p;
-
-	/*
-	 * Construct an array of pointers to the structures and call qsort(3).
-	 * Reassemble the array in the order returned by qsort.  If unable to
-	 * sort for memory reasons, return the directory entries in their
-	 * current order.  Allocate enough space for the current needs plus
-	 * 40 so don't realloc one entry at a time.
-	 */
-	if (nitems > sp->fts_nitems) {
-		sp->fts_nitems = nitems + 40;
-		if ((sp->fts_array = reallocf(sp->fts_array,
-		    sp->fts_nitems * sizeof(FTSENT *))) == NULL) {
-			sp->fts_nitems = 0;
-			return (head);
-		}
-	}
-	for (ap = sp->fts_array, p = head; p; p = p->fts_link)
-		*ap++ = p;
-	qsort(sp->fts_array, nitems, sizeof(FTSENT *), fts_compar);
-	for (head = *(ap = sp->fts_array); --nitems; ++ap)
-		ap[0]->fts_link = ap[1];
-	ap[0]->fts_link = NULL;
-	return (head);
-}
-
-static FTSENT *
-fts_alloc(sp, name, namelen)
-	FTS *sp;
-	char *name;
-	int namelen;
-{
-	FTSENT *p;
-	size_t len;
-
-	struct ftsent_withstat {
-		FTSENT	ent;
-		struct	stat statbuf;
-	};
-
-	/*
-	 * The file name is a variable length array and no stat structure is
-	 * necessary if the user has set the nostat bit.  Allocate the FTSENT
-	 * structure, the file name and the stat structure in one chunk, but
-	 * be careful that the stat structure is reasonably aligned.
-	 */
-	if (ISSET(FTS_NOSTAT))
-		len = sizeof(FTSENT) + namelen + 1;
-	else
-		len = sizeof(struct ftsent_withstat) + namelen + 1;
-
-	if ((p = malloc(len)) == NULL)
-		return (NULL);
-
-	if (ISSET(FTS_NOSTAT)) {
-		p->fts_name = (char *)(p + 1);
-		p->fts_statp = NULL;
-	} else {
-		p->fts_name = (char *)((struct ftsent_withstat *)p + 1);
-		p->fts_statp = &((struct ftsent_withstat *)p)->statbuf;
-	}
-
-	/* Copy the name and guarantee NUL termination. */
-	memcpy(p->fts_name, name, namelen);
-	p->fts_name[namelen] = '\0';
-	p->fts_namelen = namelen;
-	p->fts_path = sp->fts_path;
-	p->fts_errno = 0;
-	p->fts_flags = 0;
-	p->fts_instr = FTS_NOINSTR;
-	p->fts_number = 0;
-	p->fts_pointer = NULL;
-	p->fts_fts = sp;
-	return (p);
-}
-
-static void
-fts_lfree(head)
-	FTSENT *head;
-{
-	FTSENT *p;
-
-	/* Free a linked list of structures. */
-	while ((p = head)) {
-		head = head->fts_link;
-		free(p);
-	}
-}
-
-/*
- * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
- * Most systems will allow creation of paths much longer than PATH_MAX, even
- * though the kernel won't resolve them.  Add the size (not just what's needed)
- * plus 256 bytes so don't realloc the path 2 bytes at a time.
- */
-static int
-fts_palloc(sp, more)
-	FTS *sp;
-	size_t more;
-{
-
-	sp->fts_pathlen += more + 256;
-	/*
-	 * Check for possible wraparound.  In an FTS, fts_pathlen is
-	 * a signed int but in an FTSENT it is an unsigned short.
-	 * We limit fts_pathlen to USHRT_MAX to be safe in both cases.
-	 */
-	if (sp->fts_pathlen < 0 || sp->fts_pathlen >= USHRT_MAX) {
-		if (sp->fts_path)
-			free(sp->fts_path);
-		sp->fts_path = NULL;
-		errno = ENAMETOOLONG;
-		return (1);
-	}
-	sp->fts_path = reallocf(sp->fts_path, sp->fts_pathlen);
-	return (sp->fts_path == NULL);
-}
-
-/*
- * When the path is realloc'd, have to fix all of the pointers in structures
- * already returned.
- */
-static void
-fts_padjust(sp, head)
-	FTS *sp;
-	FTSENT *head;
-{
-	FTSENT *p;
-	char *addr = sp->fts_path;
-
-#define	ADJUST(p) do {							\
-	if ((p)->fts_accpath != (p)->fts_name) {			\
-		(p)->fts_accpath =					\
-		    (char *)addr + ((p)->fts_accpath - (p)->fts_path);	\
-	}								\
-	(p)->fts_path = addr;						\
-} while (0)
-	/* Adjust the current set of children. */
-	for (p = sp->fts_child; p; p = p->fts_link)
-		ADJUST(p);
-
-	/* Adjust the rest of the tree, including the current level. */
-	for (p = head; p->fts_level >= FTS_ROOTLEVEL;) {
-		ADJUST(p);
-		p = p->fts_link ? p->fts_link : p->fts_parent;
-	}
-}
-
-static size_t
-fts_maxarglen(argv)
-	char * const *argv;
-{
-	size_t len, max;
-
-	for (max = 0; *argv; ++argv)
-		if ((len = strlen(*argv)) > max)
-			max = len;
-	return (max + 1);
-}
-
-/*
- * Change to dir specified by fd or p->fts_accpath without getting
- * tricked by someone changing the world out from underneath us.
- * Assumes p->fts_dev and p->fts_ino are filled in.
- */
-static int
-fts_safe_changedir(sp, p, fd, path)
-	FTS *sp;
-	FTSENT *p;
-	int fd;
-	char *path;
-{
-	int ret, oerrno, newfd;
-	struct stat sb;
-
-	newfd = fd;
-	if (ISSET(FTS_NOCHDIR))
-		return (0);
-	if (fd < 0 && (newfd = _open(path, O_RDONLY, 0)) < 0)
-		return (-1);
-	if (_fstat(newfd, &sb)) {
-		ret = -1;
-		goto bail;
-	}
-	if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) {
-		errno = ENOENT;		/* disinformation */
-		ret = -1;
-		goto bail;
-	}
-	ret = fchdir(newfd);
-bail:
-	oerrno = errno;
-	if (fd < 0)
-		(void)_close(newfd);
-	errno = oerrno;
-	return (ret);
-}
-
-/*
- * Check if the filesystem for "ent" has UFS-style links.
- */
-static int
-fts_ufslinks(FTS *sp, const FTSENT *ent)
-{
-	struct _fts_private *priv;
-	const char **cpp;
-
-	priv = (struct _fts_private *)sp;
-	priv->ftsp_linksreliable = 0;
-	return 0;
-}
Index: trunk/minix/lib/other/getgrent.c
===================================================================
--- trunk/minix/lib/other/getgrent.c	(revision 9)
+++ 	(revision )
@@ -1,150 +1,0 @@
-/*	getgrent(), getgrgid(), getgrnam() - group file routines
- *
- *							Author: Kees J. Bot
- *								31 Jan 1994
- */
-#define nil 0
-#define open _open
-#define fcntl _fcntl
-#define read _read
-#define close _close
-#include <sys/types.h>
-#include <grp.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#define arraysize(a)	(sizeof(a) / sizeof((a)[0]))
-#define arraylimit(a)	((a) + arraysize(a))
-
-static char GROUP[]= "/etc/group";	/* The group file. */
-static const char *grfile;		/* Current group file. */
-
-static char buf[1024];			/* Read buffer. */
-static char grline[512];		/* One line from the group file. */
-static struct group entry;		/* Entry to fill and return. */
-static char *members[64];		/* Group members with the entry. */
-static int grfd= -1;			/* Filedescriptor to the file. */
-static char *bufptr;			/* Place in buf. */
-static ssize_t buflen= 0;		/* Remaining characters in buf. */
-static char *lineptr;			/* Place in the line. */
-
-void endgrent(void)
-/* Close the group file. */
-{
-	if (grfd >= 0) {
-		(void) close(grfd);
-		grfd= -1;
-		buflen= 0;
-	}
-}
-
-int setgrent(void)
-/* Open the group file. */
-{
-	if (grfd >= 0) endgrent();
-
-	if (grfile == nil) grfile= GROUP;
-
-	if ((grfd= open(grfile, O_RDONLY)) < 0) return -1;
-	(void) fcntl(grfd, F_SETFD, fcntl(grfd, F_GETFD) | FD_CLOEXEC);
-	return 0;
-}
-
-void setgrfile(const char *file)
-/* Prepare for reading an alternate group file. */
-{
-	endgrent();
-	grfile= file;
-}
-
-static int getline(void)
-/* Get one line from the group file, return 0 if bad or EOF. */
-{
-	lineptr= grline;
-
-	do {
-		if (buflen == 0) {
-			if ((buflen= read(grfd, buf, sizeof(buf))) <= 0)
-				return 0;
-			bufptr= buf;
-		}
-
-		if (lineptr == arraylimit(grline)) return 0;
-		buflen--;
-	} while ((*lineptr++ = *bufptr++) != '\n');
-
-	lineptr= grline;
-	return 1;
-}
-
-static char *scan_punct(int punct)
-/* Scan for a field separator in a line, return the start of the field. */
-{
-	char *field= lineptr;
-	char *last;
-
-	for (;;) {
-		last= lineptr;
-		if (*lineptr == 0) return nil;
-		if (*lineptr == '\n') break;
-		if (*lineptr++ == punct) break;
-		if (lineptr[-1] == ':') return nil;	/* :::,,,:,,,? */
-	}
-	*last= 0;
-	return field;
-}
-
-struct group *getgrent(void)
-/* Read one entry from the group file. */
-{
-	char *p;
-	char **mem;
-
-	/* Open the file if not yet open. */
-	if (grfd < 0 && setgrent() < 0) return nil;
-
-	/* Until a good line is read. */
-	for (;;) {
-		if (!getline()) return nil;	/* EOF or corrupt. */
-
-		if ((entry.gr_name= scan_punct(':')) == nil) continue;
-		if ((entry.gr_passwd= scan_punct(':')) == nil) continue;
-		if ((p= scan_punct(':')) == nil) continue;
-		entry.gr_gid= strtol(p, nil, 0);
-
-		entry.gr_mem= mem= members;
-		if (*lineptr != '\n') {
-			do {
-				if ((*mem= scan_punct(',')) == nil) goto again;
-				if (mem < arraylimit(members) - 1) mem++;
-			} while (*lineptr != 0);
-		}
-		*mem= nil;
-		return &entry;
-	again:;
-	}
-}
-
-struct group *getgrgid(_mnx_Gid_t gid)
-/* Return the group file entry belonging to the user-id. */
-{
-	struct group *gr;
-
-	endgrent();
-	while ((gr= getgrent()) != nil && gr->gr_gid != gid) {}
-	endgrent();
-	return gr;
-}
-
-struct group *getgrnam(const char *name)
-/* Return the group file entry belonging to the user name. */
-{
-	struct group *gr;
-
-	endgrent();
-	while ((gr= getgrent()) != nil && strcmp(gr->gr_name, name) != 0) {}
-	endgrent();
-	return gr;
-}
Index: trunk/minix/lib/other/getlogin.c
===================================================================
--- trunk/minix/lib/other/getlogin.c	(revision 9)
+++ 	(revision )
@@ -1,28 +1,0 @@
-/*  getlogin(3)
- *
- *  Author: Terrence W. Holm          Aug. 1988
- */
-
-#include <lib.h>
-#include <pwd.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifndef  L_cuserid
-#define  L_cuserid   9
-#endif
-
-char *getlogin()
-{
-  PRIVATE char userid[L_cuserid];
-  struct passwd *pw_entry;
-
-  pw_entry = getpwuid(getuid());
-
-  if (pw_entry == (struct passwd *)NULL) return((char *)NULL);
-
-  strcpy(userid, pw_entry->pw_name);
-
-  return(userid);
-}
Index: trunk/minix/lib/other/getpagesize.c
===================================================================
--- trunk/minix/lib/other/getpagesize.c	(revision 9)
+++ 	(revision )
@@ -1,11 +1,0 @@
-/*
-getpagesize.c
-*/
-
-#include <unistd.h>
-
-int getpagesize(void)
-{
-	/* We don't have paging. Pretend that we do. */
-	return 4096;
-}
Index: trunk/minix/lib/other/getpass.c
===================================================================
--- trunk/minix/lib/other/getpass.c	(revision 9)
+++ 	(revision )
@@ -1,75 +1,0 @@
-/*	getpass() - read a password		Author: Kees J. Bot
- *							Feb 16 1993
- */
-#define open _open
-#define sigaction _sigaction
-#define sigemptyset _sigemptyset
-#define tcgetattr _tcgetattr
-#define tcsetattr _tcsetattr
-#define write _write
-#define read _read
-#define close _close
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <signal.h>
-#include <termios.h>
-#include <string.h>
-
-static int intr;
-
-static void catch(int sig)
-{
-	intr= 1;
-}
-
-char *getpass(const char *prompt)
-{
-	struct sigaction osa, sa;
-	struct termios cooked, raw;
-	static char password[32+1];
-	int fd, n= 0;
-
-	/* Try to open the controlling terminal. */
-	if ((fd= open("/dev/tty", O_RDONLY)) < 0) return NULL;
-
-	/* Trap interrupts unless ignored. */
-	intr= 0;
-	sigaction(SIGINT, NULL, &osa);
-	if (osa.sa_handler != SIG_IGN) {
-		sigemptyset(&sa.sa_mask);
-		sa.sa_flags= 0;
-		sa.sa_handler= catch;
-		sigaction(SIGINT, &sa, &osa);
-	}
-
-	/* Set the terminal to non-echo mode. */
-	tcgetattr(fd, &cooked);
-	raw= cooked;
-	raw.c_iflag|= ICRNL;
-	raw.c_lflag&= ~ECHO;
-	raw.c_lflag|= ECHONL;
-	raw.c_oflag|= OPOST | ONLCR;
-	tcsetattr(fd, TCSANOW, &raw);
-
-	/* Print the prompt.  (After setting non-echo!) */
-	write(2, prompt, strlen(prompt));
-
-	/* Read the password, 32 characters max. */
-	while (read(fd, password+n, 1) > 0) {
-		if (password[n] == '\n') break;
-		if (n < 32) n++;
-	}
-	password[n]= 0;
-
-	/* Terminal back to cooked mode. */
-	tcsetattr(fd, TCSANOW, &cooked);
-
-	close(fd);
-
-	/* Interrupt? */
-	sigaction(SIGINT, &osa, NULL);
-	if (intr) raise(SIGINT);
-
-	return password;
-}
Index: trunk/minix/lib/other/getpwent.c
===================================================================
--- trunk/minix/lib/other/getpwent.c	(revision 9)
+++ 	(revision )
@@ -1,143 +1,0 @@
-/*	getpwent(), getpwuid(), getpwnam() - password file routines
- *
- *							Author: Kees J. Bot
- *								31 Jan 1994
- */
-#define nil 0
-#define open _open
-#define fcntl _fcntl
-#define read _read
-#define close _close
-#include <sys/types.h>
-#include <pwd.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#define arraysize(a)	(sizeof(a) / sizeof((a)[0]))
-#define arraylimit(a)	((a) + arraysize(a))
-
-static char PASSWD[]= "/etc/passwd";	/* The password file. */
-static const char *pwfile;		/* Current password file. */
-
-static char buf[1024];			/* Read buffer. */
-static char pwline[256];		/* One line from the password file. */
-static struct passwd entry;		/* Entry to fill and return. */
-static int pwfd= -1;			/* Filedescriptor to the file. */
-static char *bufptr;			/* Place in buf. */
-static ssize_t buflen= 0;		/* Remaining characters in buf. */
-static char *lineptr;			/* Place in the line. */
-
-void endpwent(void)
-/* Close the password file. */
-{
-	if (pwfd >= 0) {
-		(void) close(pwfd);
-		pwfd= -1;
-		buflen= 0;
-	}
-}
-
-int setpwent(void)
-/* Open the password file. */
-{
-	if (pwfd >= 0) endpwent();
-
-	if (pwfile == nil) pwfile= PASSWD;
-
-	if ((pwfd= open(pwfile, O_RDONLY)) < 0) return -1;
-	(void) fcntl(pwfd, F_SETFD, fcntl(pwfd, F_GETFD) | FD_CLOEXEC);
-	return 0;
-}
-
-void setpwfile(const char *file)
-/* Prepare for reading an alternate password file. */
-{
-	endpwent();
-	pwfile= file;
-}
-
-static int getline(void)
-/* Get one line from the password file, return 0 if bad or EOF. */
-{
-	lineptr= pwline;
-
-	do {
-		if (buflen == 0) {
-			if ((buflen= read(pwfd, buf, sizeof(buf))) <= 0)
-				return 0;
-			bufptr= buf;
-		}
-
-		if (lineptr == arraylimit(pwline)) return 0;
-		buflen--;
-	} while ((*lineptr++ = *bufptr++) != '\n');
-
-	lineptr= pwline;
-	return 1;
-}
-
-static char *scan_colon(void)
-/* Scan for a field separator in a line, return the start of the field. */
-{
-	char *field= lineptr;
-	char *last;
-
-	for (;;) {
-		last= lineptr;
-		if (*lineptr == 0) return nil;
-		if (*lineptr == '\n') break;
-		if (*lineptr++ == ':') break;
-	}
-	*last= 0;
-	return field;
-}
-
-struct passwd *getpwent(void)
-/* Read one entry from the password file. */
-{
-	char *p;
-
-	/* Open the file if not yet open. */
-	if (pwfd < 0 && setpwent() < 0) return nil;
-
-	/* Until a good line is read. */
-	for (;;) {
-		if (!getline()) return nil;	/* EOF or corrupt. */
-
-		if ((entry.pw_name= scan_colon()) == nil) continue;
-		if ((entry.pw_passwd= scan_colon()) == nil) continue;
-		if ((p= scan_colon()) == nil) continue;
-		entry.pw_uid= strtol(p, nil, 0);
-		if ((p= scan_colon()) == nil) continue;
-		entry.pw_gid= strtol(p, nil, 0);
-		if ((entry.pw_gecos= scan_colon()) == nil) continue;
-		if ((entry.pw_dir= scan_colon()) == nil) continue;
-		if ((entry.pw_shell= scan_colon()) == nil) continue;
-
-		if (*lineptr == 0) return &entry;
-	}
-}
-
-struct passwd *getpwuid(_mnx_Uid_t uid)
-/* Return the password file entry belonging to the user-id. */
-{
-	struct passwd *pw;
-
-	endpwent();
-	while ((pw= getpwent()) != nil && pw->pw_uid != uid) {}
-	endpwent();
-	return pw;
-}
-
-struct passwd *getpwnam(const char *name)
-/* Return the password file entry belonging to the user name. */
-{
-	struct passwd *pw;
-
-	endpwent();
-	while ((pw= getpwent()) != nil && strcmp(pw->pw_name, name) != 0) {}
-	endpwent();
-	return pw;
-}
Index: trunk/minix/lib/other/getttyent.c
===================================================================
--- trunk/minix/lib/other/getttyent.c	(revision 9)
+++ 	(revision )
@@ -1,153 +1,0 @@
-/*	getttyent(3) - get a ttytab entry		Author: Kees J. Bot
- *								28 Oct 1995
- */
-#define nil 0
-#define open _open
-#define close _close
-#define fcntl _fcntl
-#define read _read
-#include <string.h>
-#include <sys/types.h>
-#include <ttyent.h>
-#include <unistd.h>
-#include <fcntl.h>
-
-#define arraysize(a)	(sizeof(a) / sizeof((a)[0]))
-#define arraylimit(a)	((a) + arraysize(a))
-
-static char TTYTAB[]= "/etc/ttytab";	/* The table of terminal devices. */
-
-static char buf[512];			/* Read buffer. */
-static char ttline[256];		/* One line from the ttytab file. */
-static char *ttargv[32];		/* Compound arguments. */
-static struct ttyent entry;		/* Entry to fill and return. */
-static int ttfd= -1;			/* Filedescriptor to the file. */
-static char *bufptr;			/* Place in buf. */
-static ssize_t buflen= 0;		/* Remaining characters in buf. */
-static char *lineptr;			/* Place in the line. */
-static char **argvptr;			/* Place in word lists. */
-
-void endttyent(void)
-/* Close the ttytab file. */
-{
-	if (ttfd >= 0) {
-		(void) close(ttfd);
-		ttfd= -1;
-		buflen= 0;
-	}
-}
-
-int setttyent(void)
-/* Open the ttytab file. */
-{
-	if (ttfd >= 0) endttyent();
-
-	if ((ttfd= open(TTYTAB, O_RDONLY)) < 0) return -1;
-	(void) fcntl(ttfd, F_SETFD, fcntl(ttfd, F_GETFD) | FD_CLOEXEC);
-	return 0;
-}
-
-static int getline(void)
-/* Get one line from the ttytab file, return 0 if bad or EOF. */
-{
-	lineptr= ttline;
-	argvptr= ttargv;
-
-	do {
-		if (buflen == 0) {
-			if ((buflen= read(ttfd, buf, sizeof(buf))) <= 0)
-				return 0;
-			bufptr= buf;
-		}
-
-		if (lineptr == arraylimit(ttline)) return 0;
-		buflen--;
-	} while ((*lineptr++ = *bufptr++) != '\n');
-
-	lineptr= ttline;
-	return 1;
-}
-
-static int white(int c)
-/* Whitespace? */
-{
-	return c == ' ' || c == '\t';
-}
-
-static char *scan_white(int quoted)
-/* Scan for a field separator in a line, return the start of the field.
- * "quoted" is set if we have to watch out for double quotes.
- */
-{
-	char *field, *last;
-
-	while (white(*lineptr)) lineptr++;
-	if (!quoted && *lineptr == '#') return nil;
-
-	field= lineptr;
-	for (;;) {
-		last= lineptr;
-		if (*lineptr == 0) return nil;
-		if (*lineptr == '\n') break;
-		if (quoted && *lineptr == '"') return field;
-		if (white(*lineptr++)) break;
-	}
-	*last= 0;
-	return *field == 0 ? nil : field;
-}
-
-static char **scan_quoted(void)
-/* Read a field that may be a quoted list of words. */
-{
-	char *p, **field= argvptr;
-
-	while (white(*lineptr)) lineptr++;
-
-	if (*lineptr == '"') {
-		/* Quoted list of words. */
-		lineptr++;
-		while ((p= scan_white(1)) != nil && *p != '"') {
-			if (argvptr == arraylimit(ttargv)) return nil;
-			*argvptr++= p;
-		}
-		if (*lineptr == '"') *lineptr++= 0;
-	} else {
-		/* Just one word. */
-		if ((p= scan_white(0)) == nil) return nil;
-		if (argvptr == arraylimit(ttargv)) return nil;
-		*argvptr++= p;
-	}
-	if (argvptr == arraylimit(ttargv)) return nil;
-	*argvptr++= nil;
-	return field;
-}
-
-struct ttyent *getttyent(void)
-/* Read one entry from the ttytab file. */
-{
-	/* Open the file if not yet open. */
-	if (ttfd < 0 && setttyent() < 0) return nil;
-
-	/* Look for a line with something on it. */
-	for (;;) {
-		if (!getline()) return nil;	/* EOF or corrupt. */
-
-		if ((entry.ty_name= scan_white(0)) == nil) continue;
-		entry.ty_type= scan_white(0);
-		entry.ty_getty= scan_quoted();
-		entry.ty_init= scan_quoted();
-
-		return &entry;
-	}
-}
-
-struct ttyent *getttynam(const char *name)
-/* Return the ttytab file entry for a given tty. */
-{
-	struct ttyent *tty;
-
-	endttyent();
-	while ((tty= getttyent()) != nil && strcmp(tty->ty_name, name) != 0) {}
-	endttyent();
-	return tty;
-}
Index: trunk/minix/lib/other/getw.c
===================================================================
--- trunk/minix/lib/other/getw.c	(revision 9)
+++ 	(revision )
@@ -1,22 +1,0 @@
-/*
- * getw - read a word from a stream
- */
-/* $Header: /cvsup/minix/src/lib/other/getw.c,v 1.1.1.1 2005/04/21 14:56:27 beng Exp $ */
-
-#include	<stdio.h>
-
-_PROTOTYPE(int getw, (FILE *stream ));
-
-int getw(stream)
-register FILE *stream;
-{
-	register int cnt = sizeof(int);
-	int w;
-	register char *p = (char *) &w;
-
-	while (cnt--) {
-		*p++ = getc(stream);
-	}
-	if (feof(stream) || ferror(stream)) return EOF;
-	return w;
-}
Index: trunk/minix/lib/other/hypot.c
===================================================================
--- trunk/minix/lib/other/hypot.c	(revision 9)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/*
- * (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- *
- * Author: Ceriel J.H. Jacobs
- */
-
-#include <math.h>
-
-struct complex {
-	double r,i;
-};
-
-_PROTOTYPE(double hypot, (double x, double y ));
-_PROTOTYPE(double cabs, (struct complex p_compl ));
-
-/* $Header: /cvsup/minix/src/lib/other/hypot.c,v 1.1.1.1 2005/04/21 14:56:27 beng Exp $ */
-
-double
-hypot(x, y)
-double x, y;
-{
-	/*	Computes sqrt(x*x+y*y), avoiding overflow */
-
-	if (x < 0) x = -x;
-	if (y < 0) y = -y;
-	if (x > y) {
-		double t = y;
-		y = x;
-		x = t;
-	}
-	/* sqrt(x*x+y*y) = sqrt(y*y*(x*x/(y*y)+1.0)) = y*sqrt(x*x/(y*y)+1.0) */
-	if (y == 0.0) return 0.0;
-	x /= y;
-	return y*sqrt(x*x+1.0);
-}
-
-double
-cabs(p_compl)
-struct complex p_compl;
-{
-	return hypot(p_compl.r, p_compl.i);
-}
Index: trunk/minix/lib/other/index.c
===================================================================
--- trunk/minix/lib/other/index.c	(revision 9)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#include <lib.h>
-/* index - find first occurrence of a character in a string */
-
-#include <string.h>
-
-char *index(s, charwanted)	/* found char, or NULL if none */
-_CONST char *s;
-char charwanted;
-{
-  return(strchr(s, charwanted));
-}
Index: trunk/minix/lib/other/itoa.c
===================================================================
--- trunk/minix/lib/other/itoa.c	(revision 9)
+++ 	(revision )
@@ -1,36 +1,0 @@
-#include <lib.h>
-/* Integer to ASCII for signed decimal integers. */
-
-PRIVATE int next;
-PRIVATE char qbuf[8];
-
-_PROTOTYPE( char *itoa, (int n));
-
-char *itoa(n)
-int n;
-{
-  register int r, k;
-  int flag = 0;
-
-  next = 0;
-  if (n < 0) {
-	qbuf[next++] = '-';
-	n = -n;
-  }
-  if (n == 0) {
-	qbuf[next++] = '0';
-  } else {
-	k = 10000;
-	while (k > 0) {
-		r = n / k;
-		if (flag || r > 0) {
-			qbuf[next++] = '0' + r;
-			flag = 1;
-		}
-		n -= r * k;
-		k = k / 10;
-	}
-  }
-  qbuf[next] = 0;
-  return(qbuf);
-}
Index: trunk/minix/lib/other/loadname.c
===================================================================
--- trunk/minix/lib/other/loadname.c	(revision 9)
+++ 	(revision )
@@ -1,19 +1,0 @@
-#include <lib.h>
-#include <string.h>
-
-PUBLIC void _loadname(name, msgptr)
-_CONST char *name;
-message *msgptr;
-{
-/* This function is used to load a string into a type m3 message. If the
- * string fits in the message, it is copied there.  If not, a pointer to
- * it is passed.
- */
-
-  register size_t k;
-
-  k = strlen(name) + 1;
-  msgptr->m3_i1 = k;
-  msgptr->m3_p1 = (char *) name;
-  if (k <= sizeof msgptr->m3_ca1) strcpy(msgptr->m3_ca1, name);
-}
Index: trunk/minix/lib/other/lock.c
===================================================================
--- trunk/minix/lib/other/lock.c	(revision 9)
+++ 	(revision )
@@ -1,62 +1,0 @@
-#include <lib.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <stdio.h>
-#if _ANSI
-#include <stdlib.h>
-#endif
-
-typedef enum {
-  False, True
-} BOOLEAN;
-
-#define LOCKDIR "/tmp/"		/* or /usr/tmp/ as the case may be */
-#define MAXTRIES 3
-#define NAPTIME (unsigned int)5
-
-PRIVATE _PROTOTYPE( char *lockpath, (char *name));
-_PROTOTYPE( void syserr, (char *errstring));
-_PROTOTYPE( BOOLEAN lock, (char *name));
-_PROTOTYPE( void unlock, (char *name));
-
-void
-syserr(errstring)
-char *errstring;
-{
-	fprintf(stderr,"couldn't %s\n", errstring);
-	exit(1);
-}
-
-BOOLEAN lock(name)		/* acquire lock */
-char *name;
-{
-  char *path;
-  int fd, tries;
-
-  path = lockpath(name);
-  tries = 0;
-  while ((fd = creat(path, 0)) == -1 && errno == EACCES) {
-	if (++tries >= MAXTRIES) return(False);
-	sleep(NAPTIME);
-  }
-  if (fd == -1 || close(fd) == -1) syserr("lock");
-  return(True);
-}
-
-void unlock(name)		/* free lock */
-char *name;
-{
-  if (unlink(lockpath(name)) == -1) syserr("unlock");
-}
-
-PRIVATE char *lockpath(name)	/* generate lock file path */
-char *name;
-{
-  PRIVATE char path[20];
-
-  strcpy(path, LOCKDIR);
-  return(strcat(path, name));
-}
Index: trunk/minix/lib/other/lrand.c
===================================================================
--- trunk/minix/lib/other/lrand.c	(revision 9)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/*  lrand(3)
- *
- *  Author: Terrence W. Holm          Nov. 1988
- *
- *
- *  A prime modulus multiplicative linear congruential
- *  generator (PMMLCG), or "Lehmer generator".
- *  Implementation directly derived from the article:
- *
- *	S. K. Park and K. W. Miller
- *	Random Number Generators: Good Ones are Hard to Find
- *	CACM vol 31, #10. Oct. 1988. pp 1192-1201.
- *
- *
- *  Using the following multiplier and modulus, we obtain a
- *  generator which:
- *
- *	1)  Has a full period: 1 to 2^31 - 2.
- *	2)  Is testably "random" (see the article).
- *	3)  Has a known implementation by E. L. Schrage.
- */
-
-#include <lib.h>
-
-_PROTOTYPE( long seed, (long lseed));
-_PROTOTYPE( long lrand, (void));
-
-#define  A	  16807L	/* A "good" multiplier	  */
-#define  M   2147483647L	/* Modulus: 2^31 - 1	  */
-#define  Q       127773L	/* M / A		  */
-#define  R         2836L	/* M % A		  */
-
-PRIVATE long _lseed = 1L;
-
-long seed(lseed)
-long lseed;
-{
-  long previous_seed = _lseed;
-
-  _lseed = lseed;
-
-  return(previous_seed);
-}
-
-
-long lrand()
-{
-  _lseed = A * (_lseed % Q) - R * (_lseed / Q);
-
-  if (_lseed < 0) _lseed += M;
-
-  return(_lseed);
-}
Index: trunk/minix/lib/other/lsearch.c
===================================================================
--- trunk/minix/lib/other/lsearch.c	(revision 9)
+++ 	(revision )
@@ -1,50 +1,0 @@
-#include <lib.h>
-#include <string.h>
-/*  lsearch(3)  and  lfind(3)
- *
- *  Author: Terrence W. Holm          Sep. 1988
- */
-
-#include <stddef.h>
-
-_PROTOTYPE( char *lsearch, (char *key, char *base,
-			    unsigned *count, unsigned width,
-			    int (*keycmp)(const void *, const void *)));
-_PROTOTYPE( char *lfind, (char *key, char *base,
-			    unsigned *count, unsigned width,
-			    int (*keycmp)(const void *, const void *)));
-
-char *lsearch(key, base, count, width, keycmp)
-char *key;
-char *base;
-unsigned *count;
-unsigned width;
-_PROTOTYPE( int (*keycmp), (const void *, const void *));
-{
-  char *entry;
-  char *last = base + *count * width;
-
-  for (entry = base; entry < last; entry += width)
-	if (keycmp(key, entry) == 0) return(entry);
-
-  bcopy(key, last, width);
-  *count += 1;
-  return(last);
-}
-
-
-char *lfind(key, base, count, width, keycmp)
-char *key;
-char *base;
-unsigned *count;
-unsigned width;
-_PROTOTYPE( int (*keycmp), (const void *, const void *));
-{
-  char *entry;
-  char *last = base + *count * width;
-
-  for (entry = base; entry < last; entry += width)
-	if (keycmp(key, entry) == 0) return(entry);
-
-  return((char *)NULL);
-}
Index: trunk/minix/lib/other/memccpy.c
===================================================================
--- trunk/minix/lib/other/memccpy.c	(revision 9)
+++ 	(revision )
@@ -1,39 +1,0 @@
-#include <lib.h>
-/* memccpy - copy bytes up to a certain char
- *
- * CHARBITS should be defined only if the compiler lacks "unsigned char".
- * It should be a mask, e.g. 0377 for an 8-bit machine.
- */
-
-#include <ansi.h>
-#include <stddef.h>
-
-_PROTOTYPE( void *memccpy, (void *dst, const void *src,
-			    int ucharstop, size_t size));
-#ifndef CHARBITS
-#	define	UNSCHAR(c)	((unsigned char)(c))
-#else
-#	define	UNSCHAR(c)	((c)&CHARBITS)
-#endif
-
-void *memccpy(dst, src, ucharstop, size)
-void * dst;
-_CONST void * src;
-int ucharstop;
-_SIZET size;
-{
-  register char *d;
-  register _CONST char *s;
-  register _SIZET n;
-  register int uc;
-
-  if (size <= 0) return( (void *) NULL);
-
-  s = (char *) src;
-  d = (char *) dst;
-  uc = UNSCHAR(ucharstop);
-  for (n = size; n > 0; n--)
-	if (UNSCHAR(*d++ = *s++) == (char) uc) return( (void *) d);
-
-  return( (void *) NULL);
-}
Index: trunk/minix/lib/other/mstats.c
===================================================================
--- trunk/minix/lib/other/mstats.c	(revision 9)
+++ 	(revision )
@@ -1,23 +1,0 @@
-#include <minix/config.h>
-
-#if ENABLE_MESSAGE_STATS
-
-#include <lib.h>
-#include <unistd.h>
-
-PUBLIC int mstats(struct message_statentry *ms, int entries, int reset)
-{
-	message m;
-
-	m.m1_i1 = entries;
-	m.m1_i2 = reset;
-	m.m1_p1 = (void *) ms;
-
-	if(_syscall(MM, MSTATS, &m) < 0) {
-		return -1;
-	}
-
-	return m.m_type;
-}
-
-#endif
Index: trunk/minix/lib/other/mtab.c
===================================================================
--- trunk/minix/lib/other/mtab.c	(revision 9)
+++ 	(revision )
@@ -1,205 +1,0 @@
-/* This package consists of 4 routines for handling the /etc/mtab file.
- * The /etc/mtab file contains information about the root and mounted file
- * systems as a series of lines, each one with exactly four fields separated 
- * by one space as follows:
- *
- *	special mounted_on version rw_flag
- *
- * where 
- *	special is the name of the block special file
- *	mounted_on is the directory on which it is mounted
- *	version is either 1 or 2 for MINIX V1 and V2 file systems
- *	rw_flag is rw or ro for read/write or read only
- *
- * An example /etc/mtab:
- *
- *	/dev/ram / 2 rw
- *	/dev/hd1 /usr 2 rw
- *	/dev/fd0 /user 1 ro
- *
- *
- * The four routines for handling /etc/mtab are as follows.  They use two
- * (hidden) internal buffers, mtab_in for input and mtab_out for output.
- *
- *	load_mtab(&prog_name)		   - read /etc/mtab into mtab_in
- *	get_mtab_entry(&s1, &s2, &s3, &s4) - arrays that are filled in
- *	put_mtab_entry(&s1, &s2, &s3, &s4) - append a line to mtab_out
- *	rewrite_mtab(&prog_name)	   - write mtab_out to /etc/mtab
- *
- * If load_mtab and rewrite_mtab work, they return 0.  If they fail, they
- * print their own error messages on stderr and return -1.  When get_mtab_entry
- * runs out of entries to return, it sets the first pointer to NULL and returns
- * -1 instead of 0.  Also, rewrite_mtab returns -1 if it fails.
- */
- 
-#include <sys/types.h>
-#include <minix/minlib.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdio.h>
-
-#define BUF_SIZE   512		  /* size of the /etc/mtab buffer */
-
-char *etc_mtab = "/etc/mtab";	  /* name of the /etc/mtab file */
-static char mtab_in[BUF_SIZE+1];  /* holds /etc/mtab when it is read in */
-static char mtab_out[BUF_SIZE+1]; /* buf to build /etc/mtab for output later */
-static char *iptr = mtab_in;	  /* pointer to next line to feed out. */
-static char *optr = mtab_out;	  /* pointer to place where next line goes */
-
-_PROTOTYPE(int load_mtab, (char *prog_name ));
-_PROTOTYPE(int rewrite_mtab, (char *prog_name ));
-_PROTOTYPE(int get_mtab_entry, (char *special, char *mounted_on, 
-					char *version, char *rw_flag));
-_PROTOTYPE(int put_mtab_entry, (char *special, char *mounted_on, 
-					char *version, char *rw_flag));
-_PROTOTYPE(void err, (char *prog_name, char *str ));
-
-
-int load_mtab(prog_name)
-char *prog_name;
-{
-/* Read in /etc/mtab and store it in /etc/mtab. */
-
-  int fd, n;
-  char *ptr;
-
-  /* Open the file. */
-  fd = open(etc_mtab, O_RDONLY);
-  if (fd < 0) {
-	err(prog_name, ": cannot open ");
-	return(-1);
-  }
-
-  /* File opened.  Read it in. */
-  n = read(fd, mtab_in, BUF_SIZE);
-  if (n <= 0) {
-	/* Read failed. */
-	err(prog_name, ": cannot read ");
-	return(-1);
-  }
-  if (n == BUF_SIZE) {
-	/* Some nut has mounted 50 file systems or something like that. */
-	std_err(prog_name);
-	std_err(": file too large: ");
-	std_err(etc_mtab);
-	return(-1);
-  }
-
-  close(fd);
-
-  /* Replace all the whitespace by '\0'. */
-  ptr = mtab_in;
-  while (*ptr != '\0') {
-	if (isspace(*ptr)) *ptr = '\0';
-	ptr++;
-  }
-  return(0);
-}
-
-
-int rewrite_mtab(prog_name)
-char *prog_name;
-{
-/* Write mtab_out to /etc/mtab. */
-
-  int fd, n;
-
-  /* Do a creat to truncate the file. */
-  fd = creat(etc_mtab, 0777);
-  if (fd < 0) {
-	err(prog_name, ": cannot overwrite ");
-	return(-1);
-  }
-
-  /* File created.  Write it. */
-  n = write(fd, mtab_out, (unsigned int)(optr - mtab_out));
-  if (n <= 0) {
-	/* Write failed. */
-	err(prog_name, " could not write ");
-	return(-1);
-  }
-
-  close(fd);
-  return(0);
-}
-
-
-int get_mtab_entry(special, mounted_on, version, rw_flag)
-char *special;
-char *mounted_on;
-char *version;
-char *rw_flag;
-{
-/* Return the next entry from mtab_in. */
-
-  if (iptr >= &mtab_in[BUF_SIZE]) {
-	special[0] = '\0';
-	return(-1);
-  }
-
-  strcpy(special, iptr);
-  while (isprint(*iptr)) iptr++;
-  while (*iptr == '\0'&& iptr < &mtab_in[BUF_SIZE]) iptr++;
-
-  strcpy(mounted_on, iptr);
-  while (isprint(*iptr)) iptr++;
-  while (*iptr == '\0'&& iptr < &mtab_in[BUF_SIZE]) iptr++;
-
-  strcpy(version, iptr);
-  while (isprint(*iptr)) iptr++;
-  while (*iptr == '\0'&& iptr < &mtab_in[BUF_SIZE]) iptr++;
-
-  strcpy(rw_flag, iptr);
-  while (isprint(*iptr)) iptr++;
-  while (*iptr == '\0'&& iptr < &mtab_in[BUF_SIZE]) iptr++;
-  return(0);
-}
-
-
-int put_mtab_entry(special, mounted_on, version, rw_flag)
-char *special;
-char *mounted_on;
-char *version;
-char *rw_flag;
-{
-/* Append an entry to the mtab_out buffer. */
-
-  int n1, n2, n3, n4;
-
-  n1 = strlen(special);
-  n2 = strlen(mounted_on);
-  n3 = strlen(version);
-  n4 = strlen(rw_flag);
-
-  if (optr + n1 + n2 + n3 + n4 + 5 >= &mtab_out[BUF_SIZE]) return(-1);
-  strcpy(optr, special);
-  optr += n1;
-  *optr++ = ' ';
-
-  strcpy(optr, mounted_on);
-  optr += n2;
-  *optr++ = ' ';
-
-  strcpy(optr, version);
-  optr += n3;
-  *optr++ = ' ';
-
-  strcpy(optr, rw_flag);
-  optr += n4;
-  *optr++ = '\n';
-  return(0);
-}
-
-
-void
-err(prog_name, str)
-char *prog_name, *str;
-{
-  std_err(prog_name); 
-  std_err(str);
-  std_err(etc_mtab);
-  perror(" ");
-}
Index: trunk/minix/lib/other/namespace.h
===================================================================
--- trunk/minix/lib/other/namespace.h	(revision 9)
+++ 	(revision )
@@ -1,163 +1,0 @@
-/*
- * Copyright (c) 2001 Daniel Eischen <deischen@FreeBSD.org>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/include/namespace.h,v 1.16 2003/05/01 19:03:13 nectar Exp $
- */
-
-#ifndef _NAMESPACE_H_
-#define _NAMESPACE_H_
-
-/*
- * Adjust names so that headers declare "hidden" names.
- *
- * README: When modifying this file don't forget to make the appropriate
- *         changes in un-namespace.h!!!
- */
-
-/*
- * ISO C (C90) section.  Most names in libc aren't in ISO C, so they
- * should be here.  Most aren't here...
- */
-#define		err				_err
-#define		warn				_warn
-#define		nsdispatch			_nsdispatch
-
-/*
- * Prototypes for syscalls/functions that need to be overridden
- * in libc_r/libpthread.
- */
-#define		accept				_accept
-#define		__acl_aclcheck_fd		___acl_aclcheck_fd
-#define		__acl_delete_fd			___acl_delete_fd
-#define		__acl_get_fd			___acl_get_fd
-#define		__acl_set_fd			___acl_set_fd
-#define		bind				_bind
-#define		__cap_get_fd			___cap_get_fd
-#define		__cap_set_fd			___cap_set_fd
-#define		close				_close
-#define		connect				_connect
-#define		dup				_dup
-#define		dup2				_dup2
-#define		execve				_execve
-#define		fcntl				_fcntl
-/*#define		flock				_flock */
-#define		flockfile			_flockfile
-#define		fpathconf			_fpathconf
-#define		fstat				_fstat
-#define		fstatfs				_fstatfs
-#define		fsync				_fsync
-#define		funlockfile			_funlockfile
-#define		getdirentries			_getdirentries
-#define		getlogin			_getlogin
-#define		getpeername			_getpeername
-#define		getprogname			_getprogname
-#define		getsockname			_getsockname
-#define		getsockopt			_getsockopt
-#define		ioctl				_ioctl
-/* #define		kevent				_kevent */
-#define		listen				_listen
-#define		nanosleep			_nanosleep
-#define		open				_open
-#define		poll				_poll
-#define		pthread_cond_broadcast		_pthread_cond_broadcast
-#define		pthread_cond_destroy		_pthread_cond_destroy
-#define		pthread_cond_init		_pthread_cond_init
-#define		pthread_cond_signal		_pthread_cond_signal
-#define		pthread_cond_timedwait		_pthread_cond_timedwait
-#define		pthread_cond_wait		_pthread_cond_wait
-#define		pthread_exit			_pthread_exit
-#define		pthread_getspecific		_pthread_getspecific
-#define		pthread_key_create		_pthread_key_create
-#define		pthread_key_delete		_pthread_key_delete
-#define		pthread_main_np			_pthread_main_np
-#define		pthread_mutex_destroy		_pthread_mutex_destroy
-#define		pthread_mutex_init		_pthread_mutex_init
-#define		pthread_mutex_lock		_pthread_mutex_lock
-#define		pthread_mutex_trylock		_pthread_mutex_trylock
-#define		pthread_mutex_unlock		_pthread_mutex_unlock
-#define		pthread_mutexattr_destroy	_pthread_mutexattr_destroy
-#define		pthread_mutexattr_init		_pthread_mutexattr_init
-#define		pthread_mutexattr_settype	_pthread_mutexattr_settype
-#define		pthread_once			_pthread_once
-#define		pthread_rwlock_destroy		_pthread_rwlock_destroy
-#define		pthread_rwlock_init		_pthread_rwlock_init
-#define		pthread_rwlock_rdlock		_pthread_rwlock_rdlock
-#define		pthread_rwlock_wrlock		_pthread_rwlock_wrlock
-#define		pthread_rwlock_tryrdlock	_pthread_rwlock_tryrdlock
-#define		pthread_rwlock_trywrlock	_pthread_rwlock_trywrlock
-#define		pthread_rwlock_unlock		_pthread_rwlock_unlock
-#define		pthread_self			_pthread_self
-#define		pthread_setspecific		_pthread_setspecific
-#define		pthread_sigmask			_pthread_sigmask
-#define		read				_read
-#define		readv				_readv
-#define		recvfrom			_recvfrom
-#define		recvmsg				_recvmsg
-#define		select				_select
-#define		sendmsg				_sendmsg
-#define		sendto				_sendto
-#define		setsockopt			_setsockopt
-/*#define		sigaction			_sigaction*/
-#define		sigprocmask			_sigprocmask
-#define		sigsuspend			_sigsuspend
-#define		socket				_socket
-#define		socketpair			_socketpair
-#define		wait4				_wait4
-#define		waitpid				_waitpid
-#define		write				_write
-#define		writev				_writev
-
-
-/*
- * Other hidden syscalls/functions that libc_r needs to override
- * but are not used internally by libc.
- *
- * XXX - When modifying libc to use one of the following, remove
- * the prototype from below and place it in the list above.
- */
-#if 0
-#define		creat				_creat
-#define		fchflags			_fchflags
-#define		fchmod				_fchmod
-#define		ftrylockfile			_ftrylockfile
-#define		msync				_msync
-#define		nfssvc				_nfssvc
-#define		pause				_pause
-#define		pthread_rwlockattr_init		_pthread_rwlockattr_init
-#define		pthread_rwlockattr_destroy	_pthread_rwlockattr_destroy
-#define		sched_yield			_sched_yield
-#define		sendfile			_sendfile
-#define		shutdown			_shutdown
-#define		sigaltstack			_sigaltstack
-#define		sigpending			_sigpending
-#define		sigreturn			_sigreturn
-#define		sigsetmask			_sigsetmask
-#define		sleep				_sleep
-#define		system				_system
-#define		tcdrain				_tcdrain
-#define		wait				_wait
-#endif
-
-#endif /* _NAMESPACE_H_ */
Index: trunk/minix/lib/other/nlist.c
===================================================================
--- trunk/minix/lib/other/nlist.c	(revision 9)
+++ 	(revision )
@@ -1,71 +1,0 @@
-/*
- * "nlist.c", Peter Valkenburg, january 1989.
- */
- 
-#include <lib.h>
-#include <string.h>
-#include <a.out.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-
-#define fail(fp)	(fclose(fp), -1)	/* ret. exp. when nlist fails */
-
-_PROTOTYPE( int nlist, (char *file, struct nlist nl[]));
-
-/*
- * Nlist fills fields n_sclass and n_value of array nl with values found in
- * non-stripped executable file.  Entries that are not found have their
- * n_value/n_sclass fields set to 0.  Nl ends with a 0 or nul string n_name.
- * The return value is -1 on failure, else the number of entries not found.
- */
-int nlist(file, nl)
-char *file;
-struct nlist nl[];
-{
-	int nents, nsrch, nfound, i;
-	struct nlist nlent;
-	FILE *fp;
-	struct exec hd;
-
-	/* open executable with namelist */
-	if ((fp = fopen(file, "r")) == NULL)
-		return -1;
-		
-	/* get header and seek to start of namelist */	
-	if (fread((char *) &hd, sizeof(struct exec), 1, fp) != 1 ||
-	    BADMAG(hd) || fseek(fp, A_SYMPOS(hd), SEEK_SET) != 0)
-		return fail(fp);
-	
-	/* determine number of entries searched for & reset fields */
-	nsrch = 0;
-	while (nl[nsrch].n_name != NULL && *(nl[nsrch].n_name) != '\0') {
-		nl[nsrch].n_sclass = 0;
-		nl[nsrch].n_value = 0;
-		nl[nsrch].n_type = 0;		/* for compatability */
-		nsrch++;
-	}
-
-	/* loop through namelist & fill in user array */
-	nfound = 0;
-	for (nents = (hd.a_syms & 0xFFFF) / sizeof(struct nlist);
-	     nents > 0; nents--) {
-		if (nsrch == nfound)
-			break;			/* no need to look further */
-		if (fread((char *) &nlent, sizeof(struct nlist), 1, fp) != 1)
-			return fail(fp);	  
-		for (i = 0; i < nsrch; i++)
-			if (nl[i].n_sclass == 0 &&
-			    strncmp(nl[i].n_name, nlent.n_name,
-			    	    sizeof(nlent.n_name)) == 0) {
-				nl[i] = nlent;
-				nfound++;
-				break;
-			}
-	}
-
-	(void) fclose(fp);
-	
-	return nsrch - nfound;
-}
Index: trunk/minix/lib/other/paramvalue.c
===================================================================
--- trunk/minix/lib/other/paramvalue.c	(revision 9)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*	paramvalue() - decode kernel parameter values	Author: Kees J. Bot
- *								7 May 1994
- * The kernel returns the results of parameter queries
- * by the XXQUERYPARAM svrctl calls as an array of hex digits, like this:
- * "75020000,080C0000".  These are the values of two four-byte variables.
- * Paramvalue() decodes such a string.
- */
-#define nil 0
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <minix/queryparam.h>
-
-size_t paramvalue(char **value, void *address, size_t size)
-/* Decode the string *value storing the result in the object at address with
- * the given size.  *value is left at the next parameter, *address is padded
- * with zeros if needed, and the actual size of the value is returned.
- */
-{
-	unsigned char *addr= address;
-	char *v= *value;
-	int nibble;
-	size_t n;
-
-	n= 0;
-
-	while (*v != 0 && *v != ',') {
-		nibble= *v++ - '0';
-		if (nibble > 0x9) nibble= nibble + '0' - 'A' + 0xA;
-		if (nibble > 0xF) nibble= nibble + 'A' - 'a';
-		if (size > 0) {
-			if (n % 2 == 0) {
-				*addr= nibble << 4;
-			} else {
-				*addr++|= nibble;
-				size--;
-			}
-			n++;
-		}
-	}
-	while (size > 0) { *addr++= 0; size--; }
-	while (*v != 0 && *v++ != ',') {}
-	*value= v;
-	return n / 2;
-}
-
-
-/*
- * $PchId: paramvalue.c,v 1.3 1996/02/22 09:15:56 philip Exp $
- */
Index: trunk/minix/lib/other/peekpoke.c
===================================================================
--- trunk/minix/lib/other/peekpoke.c	(revision 9)
+++ 	(revision )
@@ -1,49 +1,0 @@
-/* Peek and poke using /dev/mem.
- *
- * Callers now ought to check the return values.
- *
- * Calling peek() requires read permission on /dev/mem, and consumes
- * a file descriptor.  Calling poke() requires write permission, and
- * consumes another file descriptor.
- */
-
-#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-_PROTOTYPE( int peek, (unsigned segment, unsigned offset));
-_PROTOTYPE( int poke, (unsigned segment, unsigned offset, unsigned value));
-
-#define SEGSIZE 0x10
-
-int peek(segment, offset)
-unsigned segment;
-unsigned offset;
-{
-  unsigned char chvalue;
-  static int infd = -1;
-
-  if (infd < 0) infd = open("/dev/mem", O_RDONLY);
-  if (infd < 0 ||
-      lseek(infd, (unsigned long) segment * SEGSIZE + offset, SEEK_SET) < 0 ||
-      read(infd, (char *) &chvalue, (unsigned) 1) != 1)
-	return(-1);
-  return(chvalue);
-}
-
-int poke(segment, offset, value)
-unsigned segment;
-unsigned offset;
-unsigned value;
-{
-  unsigned char chvalue;
-  static int outfd = -1;
-
-  chvalue = value;
-  if (outfd < 0) outfd = open("/dev/mem", O_WRONLY);
-  if (outfd < 0 ||
-      lseek(outfd, (unsigned long) segment * SEGSIZE + offset, SEEK_SET) < 0 ||
-      write(outfd, (char *) &chvalue, (unsigned) 1) != 1)
-	return(-1);
-  return(chvalue);
-}
Index: trunk/minix/lib/other/popen.c
===================================================================
--- trunk/minix/lib/other/popen.c	(revision 9)
+++ 	(revision )
@@ -1,122 +1,0 @@
-/*
- * popen - open a pipe
- */
-/* $Header: /cvsup/minix/src/lib/other/popen.c,v 1.1.1.1 2005/04/21 14:56:27 beng Exp $ */
-
-#include	<sys/types.h>
-#include	<limits.h>
-#include	<errno.h>
-#include	<signal.h>
-#include	<stdio.h>
-
-#if	defined(__BSD4_2)
-union wait {
-	int	w_status;
-};
-typedef union wait wait_arg;
-#else
-typedef int wait_arg;
-#endif	/* __BSD4_2 */
-
-#include	"../stdio/loc_incl.h"
-
-#ifdef _ANSI
-int _close(int d);
-int _dup2(int oldd, int newd);		/* not present in System 5 */
-int _execl(const char *name, const char *_arg, ... );
-pid_t _fork(void);
-int _pipe(int fildes[2]);
-pid_t _wait(wait_arg *status);
-void _exit(int status);
-#endif
-
-static int pids[OPEN_MAX];
-
-FILE *
-popen(command, type)
-_CONST char *command;
-_CONST char *type;
-{
-	int piped[2];
-	int Xtype = *type == 'r' ? 0 : *type == 'w' ? 1 : 2;
-	int pid;
-
-	if (Xtype == 2 ||
-	    _pipe(piped) < 0 ||
-	    (pid = _fork()) < 0) return 0;
-	
-	if (pid == 0) {
-		/* child */
-		register int *p;
-
-		for (p = pids; p < &pids[OPEN_MAX]; p++) {
-			if (*p) _close((int)(p - pids));
-		}
-		_close(piped[Xtype]);
-		_dup2(piped[!Xtype], !Xtype);
-		_close(piped[!Xtype]);
-		_execl("/bin/sh", "sh", "-c", command, (char *) 0);
-		_exit(127);	/* like system() ??? */
-	}
-
-	pids[piped[Xtype]] = pid;
-	_close(piped[!Xtype]);
-	return fdopen(piped[Xtype], type);
-}
-
-#if	defined(__BSD4_2)
-#define	ret_val	status.w_status
-#else
-#define	ret_val	status
-#endif
-
-int
-pclose(stream)
-FILE *stream;
-{
-	int fd = fileno(stream);
-	wait_arg status;
-	int wret;
-
-#ifdef _ANSI
-	void (*intsave)(int) = signal(SIGINT, SIG_IGN);
-	void (*quitsave)(int) = signal(SIGQUIT, SIG_IGN);
-#else
-	void (*intsave)() = signal(SIGINT, SIG_IGN);
-	void (*quitsave)() = signal(SIGQUIT, SIG_IGN);
-#endif
-	fclose(stream);
-	while ((wret = _wait(&status)) != -1) {
-		if (wret == pids[fd]) break;
-	}
-	if (wret == -1) ret_val = -1;
-	signal(SIGINT, intsave);
-	signal(SIGQUIT, quitsave);
-	pids[fd] = 0;
-	return ret_val;
-}
-
-#if	defined(__USG)
-int _dup(int fildes);
-
-static int
-_dup2(oldd, newd)
-int oldd, newd;
-{
-	int i = 0, fd, tmp;
-	int fdbuf[_NFILES];
-
-	/* ignore the error on the close() */
-	tmp = errno; (void) _close(newd); errno = tmp;
-	while ((fd = _dup(oldd)) != newd) {
-		if (fd == -1) break;
-		fdbuf[i++] = fd;
-	}
-	tmp = errno;
-	while (--i >= 0) {
-		_close(fdbuf[i]);
-	}
-	errno = tmp;
-	return -(fd == -1);
-}
-#endif	/* __USG */
Index: trunk/minix/lib/other/putenv.c
===================================================================
--- trunk/minix/lib/other/putenv.c	(revision 9)
+++ 	(revision )
@@ -1,79 +1,0 @@
-/*
- * (c) copyright 1989 by the Vrije Universiteit, Amsterdam, The Netherlands.
- * See the copyright notice in the ACK home directory, in the file "Copyright".
- */
-/* $Header: /cvsup/minix/src/lib/other/putenv.c,v 1.1.1.1.8.1 2006/05/03 21:13:45 beng Exp $ */
-
-#include	<stdlib.h>
-#include	<string.h>
-
-#define	ENTRY_INC	10
-#define	rounded(x)	(((x / ENTRY_INC) + 1) * ENTRY_INC)
-
-extern _CONST char ***_penviron;
-
-int
-putenv(name)
-char *name;
-{
-	register _CONST char **v = *_penviron;
-	register char *r;
-	static int size = 0;
-	/* When size != 0, it contains the number of entries in the
-	 * table (including the final NULL pointer). This means that the
-	 * last non-null entry  is environ[size - 2].
-	 */
-
-	if (!name) return 0;
-	if (*_penviron == NULL) return 1;
-	if (r = strchr(name, '=')) {
-		register _CONST char *p, *q;
-
-		*r = '\0';
-
-		if (v != NULL) {
-			while ((p = *v) != NULL) {
-				q = name;
-				while (*q && (*q++ == *p++))
-					/* EMPTY */ ;
-				if (*q || (*p != '=')) {
-					v++;
-				} else {
-					/* The name was already in the
-					 * environment.
-					 */
-					*r = '=';
-					*v = name;
-					return 0;
-				}
-			}
-		}
-		*r = '=';
-		v = *_penviron;
-	}
-
-	if (!size) {
-		register _CONST char **p;
-		register int i = 0;
-
-		if (v)
-			do {
-				i++;
-			} while (*v++);
-		if (!(v = malloc(rounded(i) * sizeof(char **))))
-			return 1;
-		size = i;
-		p = *_penviron;
-		*_penviron = v;
-		while (*v++ = *p++);		/* copy the environment */
-		v = *_penviron;
-	} else if (!(size % ENTRY_INC)) {
-		if (!(v = realloc(*_penviron, rounded(size) * sizeof(char **))))
-			return 1;
-		*_penviron = v;
-	}
-	v[size - 1] = name;
-	v[size] = NULL;
-	size++;
-	return 0;
-}
Index: trunk/minix/lib/other/putw.c
===================================================================
--- trunk/minix/lib/other/putw.c	(revision 9)
+++ 	(revision )
@@ -1,23 +1,0 @@
-/* 
- * putw - write an word on a stream
- */
-/* $Header: /cvsup/minix/src/lib/other/putw.c,v 1.1.1.1 2005/04/21 14:56:27 beng Exp $ */
-
-#include	<stdio.h>
-
-_PROTOTYPE(int putw, (int w, FILE *stream ));
-
-int
-putw(w, stream)
-int w;
-register FILE *stream;
-{
-	register int cnt = sizeof(int);
-	register char *p = (char *) &w;
-
-	while (cnt--) {
-		putc(*p++, stream);
-	}
-	if (ferror(stream)) return EOF;
-	return w;
-}
Index: trunk/minix/lib/other/random.c
===================================================================
--- trunk/minix/lib/other/random.c	(revision 9)
+++ 	(revision )
@@ -1,363 +1,0 @@
-/*
- * Copyright (c) 1983, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)random.c	8.1 (Berkeley) 6/4/93";
-#endif /* LIBC_SCCS and not lint */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-/*
- * random.c:
- *
- * An improved random number generation package.  In addition to the standard
- * rand()/srand() like interface, this package also has a special state info
- * interface.  The initstate() routine is called with a seed, an array of
- * bytes, and a count of how many bytes are being passed in; this array is
- * then initialized to contain information for random number generation with
- * that much state information.  Good sizes for the amount of state
- * information are 32, 64, 128, and 256 bytes.  The state can be switched by
- * calling the setstate() routine with the same array as was initiallized
- * with initstate().  By default, the package runs with 128 bytes of state
- * information and generates far better random numbers than a linear
- * congruential generator.  If the amount of state information is less than
- * 32 bytes, a simple linear congruential R.N.G. is used.
- *
- * Internally, the state information is treated as an array of longs; the
- * zeroeth element of the array is the type of R.N.G. being used (small
- * integer); the remainder of the array is the state information for the
- * R.N.G.  Thus, 32 bytes of state information will give 7 longs worth of
- * state information, which will allow a degree seven polynomial.  (Note:
- * the zeroeth word of state information also has some other information
- * stored in it -- see setstate() for details).
- * 
- * The random number generation technique is a linear feedback shift register
- * approach, employing trinomials (since there are fewer terms to sum up that
- * way).  In this approach, the least significant bit of all the numbers in
- * the state table will act as a linear feedback shift register, and will
- * have period 2^deg - 1 (where deg is the degree of the polynomial being
- * used, assuming that the polynomial is irreducible and primitive).  The
- * higher order bits will have longer periods, since their values are also
- * influenced by pseudo-random carries out of the lower bits.  The total
- * period of the generator is approximately deg*(2**deg - 1); thus doubling
- * the amount of state information has a vast influence on the period of the
- * generator.  Note: the deg*(2**deg - 1) is an approximation only good for
- * large deg, when the period of the shift register is the dominant factor.
- * With deg equal to seven, the period is actually much longer than the
- * 7*(2**7 - 1) predicted by this formula.
- */
-
-/*
- * For each of the currently supported random number generators, we have a
- * break value on the amount of state information (you need at least this
- * many bytes of state info to support this random number generator), a degree
- * for the polynomial (actually a trinomial) that the R.N.G. is based on, and
- * the separation between the two lower order coefficients of the trinomial.
- */
-#define	TYPE_0		0		/* linear congruential */
-#define	BREAK_0		8
-#define	DEG_0		0
-#define	SEP_0		0
-
-#define	TYPE_1		1		/* x**7 + x**3 + 1 */
-#define	BREAK_1		32
-#define	DEG_1		7
-#define	SEP_1		3
-
-#define	TYPE_2		2		/* x**15 + x + 1 */
-#define	BREAK_2		64
-#define	DEG_2		15
-#define	SEP_2		1
-
-#define	TYPE_3		3		/* x**31 + x**3 + 1 */
-#define	BREAK_3		128
-#define	DEG_3		31
-#define	SEP_3		3
-
-#define	TYPE_4		4		/* x**63 + x + 1 */
-#define	BREAK_4		256
-#define	DEG_4		63
-#define	SEP_4		1
-
-/*
- * Array versions of the above information to make code run faster --
- * relies on fact that TYPE_i == i.
- */
-#define	MAX_TYPES	5		/* max number of types above */
-
-static int degrees[MAX_TYPES] =	{ DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 };
-static int seps [MAX_TYPES] =	{ SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 };
-
-/*
- * Initially, everything is set up as if from:
- *
- *	initstate(1, &randtbl, 128);
- *
- * Note that this initialization takes advantage of the fact that srandom()
- * advances the front and rear pointers 10*rand_deg times, and hence the
- * rear pointer which starts at 0 will also end up at zero; thus the zeroeth
- * element of the state information, which contains info about the current
- * position of the rear pointer is just
- *
- *	MAX_TYPES * (rptr - state) + TYPE_3 == TYPE_3.
- */
-
-static long randtbl[DEG_3 + 1] = {
-	TYPE_3,
-	0x9a319039, 0x32d9c024, 0x9b663182, 0x5da1f342, 0xde3b81e0, 0xdf0a6fb5,
-	0xf103bc02, 0x48f340fb, 0x7449e56b, 0xbeb1dbb0, 0xab5c5918, 0x946554fd,
-	0x8c2e680f, 0xeb3d799f, 0xb11ee0b7, 0x2d436b86, 0xda672e2a, 0x1588ca88,
-	0xe369735d, 0x904f35f7, 0xd7158fd6, 0x6fa6f051, 0x616e6b96, 0xac94efdc,
-	0x36413f93, 0xc622c298, 0xf5a42ab8, 0x8a88d77b, 0xf5ad9d0e, 0x8999220b,
-	0x27fb47b9,
-};
-
-/*
- * fptr and rptr are two pointers into the state info, a front and a rear
- * pointer.  These two pointers are always rand_sep places aparts, as they
- * cycle cyclically through the state information.  (Yes, this does mean we
- * could get away with just one pointer, but the code for random() is more
- * efficient this way).  The pointers are left positioned as they would be
- * from the call
- *
- *	initstate(1, randtbl, 128);
- *
- * (The position of the rear pointer, rptr, is really 0 (as explained above
- * in the initialization of randtbl) because the state table pointer is set
- * to point to randtbl[1] (as explained below).
- */
-static long *fptr = &randtbl[SEP_3 + 1];
-static long *rptr = &randtbl[1];
-
-/*
- * The following things are the pointer to the state information table, the
- * type of the current generator, the degree of the current polynomial being
- * used, and the separation between the two pointers.  Note that for efficiency
- * of random(), we remember the first location of the state information, not
- * the zeroeth.  Hence it is valid to access state[-1], which is used to
- * store the type of the R.N.G.  Also, we remember the last location, since
- * this is more efficient than indexing every time to find the address of
- * the last element to see if the front and rear pointers have wrapped.
- */
-static long *state = &randtbl[1];
-static int rand_type = TYPE_3;
-static int rand_deg = DEG_3;
-static int rand_sep = SEP_3;
-static long *end_ptr = &randtbl[DEG_3 + 1];
-
-/*
- * srandom:
- *
- * Initialize the random number generator based on the given seed.  If the
- * type is the trivial no-state-information type, just remember the seed.
- * Otherwise, initializes state[] based on the given "seed" via a linear
- * congruential generator.  Then, the pointers are set to known locations
- * that are exactly rand_sep places apart.  Lastly, it cycles the state
- * information a given number of times to get rid of any initial dependencies
- * introduced by the L.C.R.N.G.  Note that the initialization of randtbl[]
- * for default usage relies on values produced by this routine.
- */
-void
-srandom(x)
-	u_int x;
-{
-	register int i, j;
-
-	if (rand_type == TYPE_0)
-		state[0] = x;
-	else {
-		j = 1;
-		state[0] = x;
-		for (i = 1; i < rand_deg; i++)
-			state[i] = 1103515245 * state[i - 1] + 12345;
-		fptr = &state[rand_sep];
-		rptr = &state[0];
-		for (i = 0; i < 10 * rand_deg; i++)
-			(void)random();
-	}
-}
-
-/*
- * initstate:
- *
- * Initialize the state information in the given array of n bytes for future
- * random number generation.  Based on the number of bytes we are given, and
- * the break values for the different R.N.G.'s, we choose the best (largest)
- * one we can and set things up for it.  srandom() is then called to
- * initialize the state information.
- * 
- * Note that on return from srandom(), we set state[-1] to be the type
- * multiplexed with the current value of the rear pointer; this is so
- * successive calls to initstate() won't lose this information and will be
- * able to restart with setstate().
- * 
- * Note: the first thing we do is save the current state, if any, just like
- * setstate() so that it doesn't matter when initstate is called.
- *
- * Returns a pointer to the old state.
- */
-char *
-initstate(seed, arg_state, n)
-	u_int seed;			/* seed for R.N.G. */
-	char *arg_state;		/* pointer to state array */
-	size_t n;			/* # bytes of state info */
-{
-	register char *ostate = (char *)(&state[-1]);
-
-	if (rand_type == TYPE_0)
-		state[-1] = rand_type;
-	else
-		state[-1] = MAX_TYPES * (rptr - state) + rand_type;
-	if (n < BREAK_0) {
-		(void)fprintf(stderr,
-		    "random: not enough state (%d bytes); ignored.\n", n);
-		return(0);
-	}
-	if (n < BREAK_1) {
-		rand_type = TYPE_0;
-		rand_deg = DEG_0;
-		rand_sep = SEP_0;
-	} else if (n < BREAK_2) {
-		rand_type = TYPE_1;
-		rand_deg = DEG_1;
-		rand_sep = SEP_1;
-	} else if (n < BREAK_3) {
-		rand_type = TYPE_2;
-		rand_deg = DEG_2;
-		rand_sep = SEP_2;
-	} else if (n < BREAK_4) {
-		rand_type = TYPE_3;
-		rand_deg = DEG_3;
-		rand_sep = SEP_3;
-	} else {
-		rand_type = TYPE_4;
-		rand_deg = DEG_4;
-		rand_sep = SEP_4;
-	}
-	state = &(((long *)arg_state)[1]);	/* first location */
-	end_ptr = &state[rand_deg];	/* must set end_ptr before srandom */
-	srandom(seed);
-	if (rand_type == TYPE_0)
-		state[-1] = rand_type;
-	else
-		state[-1] = MAX_TYPES*(rptr - state) + rand_type;
-	return(ostate);
-}
-
-/*
- * setstate:
- *
- * Restore the state from the given state array.
- *
- * Note: it is important that we also remember the locations of the pointers
- * in the current state information, and restore the locations of the pointers
- * from the old state information.  This is done by multiplexing the pointer
- * location into the zeroeth word of the state information.
- *
- * Note that due to the order in which things are done, it is OK to call
- * setstate() with the same state as the current state.
- *
- * Returns a pointer to the old state information.
- */
-char *
-setstate(arg_state)
-	const char *arg_state;
-{
-	register long *new_state = (long *)arg_state;
-	register int type = new_state[0] % MAX_TYPES;
-	register int rear = new_state[0] / MAX_TYPES;
-	char *ostate = (char *)(&state[-1]);
-
-	if (rand_type == TYPE_0)
-		state[-1] = rand_type;
-	else
-		state[-1] = MAX_TYPES * (rptr - state) + rand_type;
-	switch(type) {
-	case TYPE_0:
-	case TYPE_1:
-	case TYPE_2:
-	case TYPE_3:
-	case TYPE_4:
-		rand_type = type;
-		rand_deg = degrees[type];
-		rand_sep = seps[type];
-		break;
-	default:
-		(void)fprintf(stderr,
-		    "random: state info corrupted; not changed.\n");
-	}
-	state = &new_state[1];
-	if (rand_type != TYPE_0) {
-		rptr = &state[rear];
-		fptr = &state[(rear + rand_sep) % rand_deg];
-	}
-	end_ptr = &state[rand_deg];		/* set end_ptr too */
-	return(ostate);
-}
-
-/*
- * random:
- *
- * If we are using the trivial TYPE_0 R.N.G., just do the old linear
- * congruential bit.  Otherwise, we do our fancy trinomial stuff, which is
- * the same in all the other cases due to all the global variables that have
- * been set up.  The basic operation is to add the number at the rear pointer
- * into the one at the front pointer.  Then both pointers are advanced to
- * the next location cyclically in the table.  The value returned is the sum
- * generated, reduced to 31 bits by throwing away the "least random" low bit.
- *
- * Note: the code takes advantage of the fact that both the front and
- * rear pointers can't wrap on the same call by not testing the rear
- * pointer if the front one has wrapped.
- *
- * Returns a 31-bit random number.
- */
-long
-random()
-{
-	long i;
-
-	if (rand_type == TYPE_0)
-		i = state[0] = (state[0] * 1103515245 + 12345) & 0x7fffffff;
-	else {
-		*fptr += *rptr;
-		i = (*fptr >> 1) & 0x7fffffff;	/* chucking least random bit */
-		if (++fptr >= end_ptr) {
-			fptr = state;
-			++rptr;
-		} else if (++rptr >= end_ptr)
-			rptr = state;
-	}
-	return(i);
-}
Index: trunk/minix/lib/other/rindex.c
===================================================================
--- trunk/minix/lib/other/rindex.c	(revision 9)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#include <lib.h>
-/* rindex - find last occurrence of a character in a string  */
-
-#include <string.h>
-
-char *rindex(s, charwanted)	/* found char, or NULL if none */
-_CONST char *s;
-char charwanted;
-{
-  return(strrchr(s, charwanted));
-}
Index: trunk/minix/lib/other/setenv.c
===================================================================
--- trunk/minix/lib/other/setenv.c	(revision 9)
+++ 	(revision )
@@ -1,25 +1,0 @@
-
-#include	<stdlib.h>
-#include	<string.h>
-
-int
-setenv(const char *name, const char *val, int overwrite)
-{
-	char *bf;
-	int r;
-
-	if(!overwrite && getenv(name))
-		return 0;
-
-	if(!(bf=malloc(strlen(name)+strlen(val)+2)))
-		return -1;
-
-	strcpy(bf, name);
-	strcat(bf, "=");
-	strcat(bf, val);
-
-	r = putenv(bf);
-
-	return r == 0 ? 0 : -1;
-}
-
Index: trunk/minix/lib/other/setgroups.c
===================================================================
--- trunk/minix/lib/other/setgroups.c	(revision 9)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/*
-setgroups.c
-*/
-
-#include <errno.h>
-#include <unistd.h>
-#include <string.h>
-#include <grp.h>
-
-int setgroups(int ngroups, const gid_t *gidset)
-{
-	if(ngroups > 1) {
-		/* Supplementary groups not implemented */
-		errno= EINVAL;
-		return -1;
-	}
-
-	if(ngroups == 1)
-		return setgid(gidset[0]);
-
-	return 0;
-}
-
-int initgroups(const char *name, gid_t basegid)
-{
-	struct group *gr;
-	int r, found = 0;
-	if((r = setgid(basegid)) < 0)
-		return r;
-
-	setgrent();
-	while (!found && (gr = getgrent()) != NULL) {
-		char **mem;
-		for(mem = gr->gr_mem; mem && *mem; mem++) {
-			if(!strcmp(name, *mem)) {
-				found = 1;
-				break;
-			}
-		}
-	}
-	endgrent();
-
-	/* Because supplemental groups aren't implemented, this call
-	 * should fail if the user is in any supplemental groups.
-	 */
-	if(found) {
-		errno = EINVAL;
-		return -1;
-	}
-
-	return 0;
-}
-
Index: trunk/minix/lib/other/settimeofday.c
===================================================================
--- trunk/minix/lib/other/settimeofday.c	(revision 9)
+++ 	(revision )
@@ -1,14 +1,0 @@
-/*
-settimeofday.c
-*/
-
-#define stime _stime
-
-#include <sys/time.h>
-#include <time.h>
-
-int settimeofday(const struct timeval *tp, const void *tzp)
-{
-	/* Ignore time zones */
-	return stime(&tp->tv_sec);
-}
Index: trunk/minix/lib/other/stderr.c
===================================================================
--- trunk/minix/lib/other/stderr.c	(revision 9)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#include <lib.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-_PROTOTYPE( void std_err, (char *s));
-
-void std_err(s)
-char *s;
-{
-  register char *p = s;
-
-  while (*p != 0) p++;
-  write(2, s, (int) (p - s));
-}
Index: trunk/minix/lib/other/strdup.c
===================================================================
--- trunk/minix/lib/other/strdup.c	(revision 9)
+++ 	(revision )
@@ -1,23 +1,0 @@
-/*
-lib/other/strdup.c
-*/
-
-#include <stdlib.h>
-#include <string.h>
-
-char *strdup(s1)
-const char *s1;
-{
-	size_t len;
-	char *s2;
-
-	len= strlen(s1)+1;
-
-	s2= malloc(len);
-	if (s2 == NULL)
-		return NULL;
-	strcpy(s2, s1);
-
-	return s2;
-}
-
Index: trunk/minix/lib/other/strtok_r.c
===================================================================
--- trunk/minix/lib/other/strtok_r.c	(revision 9)
+++ 	(revision )
@@ -1,169 +1,0 @@
-/*
- * Copyright (c) 1998 Softweyr LLC.  All rights reserved.
- *
- * strtok_r, from Berkeley strtok
- * Oct 13, 1998 by Wes Peters <wes@softweyr.com>
- *
- * Copyright (c) 1988, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notices, this list of conditions and the following disclaimer.
- * 
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notices, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *
- *	This product includes software developed by Softweyr LLC, the
- *      University of California, Berkeley, and its contributors.
- *
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY SOFTWEYR LLC, THE REGENTS AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- * PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL SOFTWEYR LLC, THE
- * REGENTS, OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef lint
-static const char rcsid[] =
-  "$FreeBSD: src/lib/libc/string/strtok.c,v 1.2.6.1 2001/07/09 23:30:07 obrien Exp $";
-#endif
-
-#include <stddef.h>
-#include <string.h>
-
-char *
-strtok_r(char *s, const char *delim, char **last)
-{
-    char *spanp;
-    int c, sc;
-    char *tok;
-
-    if (s == NULL && (s = *last) == NULL)
-    {
-	return NULL;
-    }
-
-    /*
-     * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
-     */
-cont:
-    c = *s++;
-    for (spanp = (char *)delim; (sc = *spanp++) != 0; )
-    {
-	if (c == sc)
-	{
-	    goto cont;
-	}
-    }
-
-    if (c == 0)		/* no non-delimiter characters */
-    {
-	*last = NULL;
-	return NULL;
-    }
-    tok = s - 1;
-
-    /*
-     * Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
-     * Note that delim must have one NUL; we stop if we see that, too.
-     */
-    for (;;)
-    {
-	c = *s++;
-	spanp = (char *)delim;
-	do
-	{
-	    if ((sc = *spanp++) == c)
-	    {
-		if (c == 0)
-		{
-		    s = NULL;
-		}
-		else
-		{
-		    char *w = s - 1;
-		    *w = '\0';
-		}
-		*last = s;
-		return tok;
-	    }
-	}
-	while (sc != 0);
-    }
-    /* NOTREACHED */
-}
-
-
-#if 0
-char *
-strtok(char *s, const char *delim)
-{
-    static char *last;
-
-    return strtok_r(s, delim, &last);
-}
-#endif
-
-#if defined(DEBUG_STRTOK)
-
-/*
- * Test the tokenizer.
- */
-int
-main()
-{
-    char test[80], blah[80];
-    char *sep = "\\/:;=-";
-    char *word, *phrase, *brkt, *brkb;
-
-    printf("String tokenizer test:\n");
-
-    strcpy(test, "This;is.a:test:of=the/string\\tokenizer-function.");
-
-    for (word = strtok(test, sep);
-	 word;
-	 word = strtok(NULL, sep))
-    {
-	printf("Next word is \"%s\".\n", word);
-    }
-
-    phrase = "foo";
-
-    strcpy(test, "This;is.a:test:of=the/string\\tokenizer-function.");
-
-    for (word = strtok_r(test, sep, &brkt);
-	 word;
-	 word = strtok_r(NULL, sep, &brkt))
-    {
-	strcpy(blah, "blah:blat:blab:blag");
-
-	for (phrase = strtok_r(blah, sep, &brkb);
-	     phrase;
-	     phrase = strtok_r(NULL, sep, &brkb))
-	{
-	    printf("So far we're at %s:%s\n", word, phrase);
-	}
-    }
-
-    return 0;
-}
-
-#endif /* DEBUG_STRTOK */
Index: trunk/minix/lib/other/swab.c
===================================================================
--- trunk/minix/lib/other/swab.c	(revision 9)
+++ 	(revision )
@@ -1,22 +1,0 @@
-#include <lib.h>
-/*  swab(3)
- *
- *  Author: Terrence W. Holm          Sep. 1988
- */
-_PROTOTYPE( void swab, (char *from, char *to, int count));
-
-void swab(from, to, count)
-char *from;
-char *to;
-int count;
-{
-  register char temp;
-
-  count >>= 1;
-
-  while (--count >= 0) {
-	temp = *from++;
-	*to++ = *from++;
-	*to++ = temp;
-  }
-}
Index: trunk/minix/lib/other/sys_eniop.c
===================================================================
--- trunk/minix/lib/other/sys_eniop.c	(revision 9)
+++ 	(revision )
@@ -1,14 +1,0 @@
-#include "../syslib/syslib.h"
-
-/*===========================================================================*
- *                               sys_enable_iop				     *    
- *===========================================================================*/
-PUBLIC int sys_enable_iop(proc_nr)
-int proc_nr;			/* number of process to allow I/O */
-{
-    message m_iop;
-    m_iop.IO_ENDPT = proc_nr;
-    return _taskcall(SYSTASK, SYS_IOPENABLE, &m_iop);
-}
-
-
Index: trunk/minix/lib/other/syscall.c
===================================================================
--- trunk/minix/lib/other/syscall.c	(revision 9)
+++ 	(revision )
@@ -1,22 +1,0 @@
-#include <lib.h>
-
-PUBLIC int _syscall(who, syscallnr, msgptr)
-int who;
-int syscallnr;
-register message *msgptr;
-{
-  int status;
-
-  msgptr->m_type = syscallnr;
-  status = _sendrec(who, msgptr);
-  if (status != 0) {
-	/* 'sendrec' itself failed. */
-	/* XXX - strerror doesn't know all the codes */
-	msgptr->m_type = status;
-  }
-  if (msgptr->m_type < 0) {
-	errno = -msgptr->m_type;
-	return(-1);
-  }
-  return(msgptr->m_type);
-}
Index: trunk/minix/lib/other/sysconf.c
===================================================================
--- trunk/minix/lib/other/sysconf.c	(revision 9)
+++ 	(revision )
@@ -1,55 +1,0 @@
-/* sysconf.c						POSIX 4.8.1
- *	long int sysconf(int name);
- *
- *	POSIX allows some of the values in <limits.h> to be increased at
- *	run time.  The sysconf() function allows such values to be checked
- *	at run time.  MINIX does not use this facility - the run time
- *	limits are those given in <limits.h>.
- */
-
-#include <lib.h>
-#include <unistd.h>
-#include <time.h>
-
-PUBLIC long int sysconf(name)
-int name;			/* property being inspected */
-{
-  switch(name) {
-	case _SC_ARG_MAX:
-		return (long) ARG_MAX;
-
-	case _SC_CHILD_MAX:
-		return (long) CHILD_MAX;
-
-	case _SC_CLK_TCK:
-		return (long) CLOCKS_PER_SEC;
-
-	case _SC_NGROUPS_MAX:
-		return (long) NGROUPS_MAX;
-
-	case _SC_OPEN_MAX:
-		return (long) OPEN_MAX;
-
-	case _SC_JOB_CONTROL:
-		return -1L;			/* no job control */
-
-	case _SC_SAVED_IDS:
-		return -1L;			/* no saved uid/gid */
-
-	case _SC_VERSION:
-		return (long) _POSIX_VERSION;
-
-	case _SC_STREAM_MAX:
-		return (long) STREAM_MAX;
-
-	case _SC_TZNAME_MAX:
-		return (long) TZNAME_MAX;
-
-	case _SC_PAGESIZE:
-		return getpagesize();
-
-	default:
-		errno = EINVAL;
-		return -1L;
-  }
-}
Index: trunk/minix/lib/other/syslog.c
===================================================================
--- trunk/minix/lib/other/syslog.c	(revision 9)
+++ 	(revision )
@@ -1,167 +1,0 @@
-/* Copyright (c) 1983, 1988, 1993
- * The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by the University of
- *      California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * #if defined(LIBC_SCCS) && !defined(lint)
- * static char sccsid[] = "@(#)syslog.c    8.4 (Berkeley) 3/18/94";
- * #endif
- *
- * Author: Eric Allman
- * Modified to use UNIX domain IPC by Ralph Campbell
- * Patched March 12, 1996 by A. Ian Vogelesang <vogelesang@hdshq.com>
- * Rewritten by Martin Mares <mj@atrey.karlin.mff.cuni.cz> on May 14, 1997
- * Rewritten by G. Falzoni <gfalzoni@inwind.it> for porting to Minix
- *
- * $Id: syslog.c,v 1.2 2006/04/03 15:03:07 beng Exp $
- */
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdarg.h>
-#include <time.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <syslog.h>
-#include <sys/ioctl.h>
-#include <net/netlib.h>
-#include <net/hton.h>
-#include <net/gen/in.h>
-#include <net/gen/udp.h>
-#include <net/gen/udp_io.h>
-#include <net/gen/netdb.h>
-#include <errno.h>
-#include <net/gen/inet.h>
-
-static int LogPid = (-1);
-static int nfd = (-1);
-static int LogFacility = LOG_USER;
-static int LogFlags = 0;
-static char TagBuffer[40] = "syslog";
-
-/*
-** OPENLOG -- open system log
-** 	- establishes a channel to syslogd using UDP device
-**	  (port 514 is used _ syslog/udp)
-**	- stores program tag (if not NULL) and other options
-**	  for use by syslog
-*/
-void openlog(const char *ident, int option, int facility)
-{
-  struct nwio_udpopt udpopt;
-
-  /* Stores logging flags */
-  LogFlags = option & (LOG_PID | LOG_PERROR | LOG_CONS);
-  /* Stores process id. if LOG_PID was specified */
-  if (option & LOG_PID) LogPid = getpid();
-  /* Stores the requested facility */
-  LogFacility = facility;
-  /* Stores log tag if supplied */
-  if (ident != NULL && *ident != '0' && ident != TagBuffer) {
-	strncpy(TagBuffer, ident, sizeof(TagBuffer));
-	TagBuffer[sizeof(TagBuffer) - 1] = '0';
-  }
-
-  /* Opens channel to syslog daemon via UDP device */
-  /* Static values used to minimize code */
-  if (option & LOG_NDELAY) {
-	/* Opens UDP device */
-	if ((nfd = open(UDP_DEVICE, O_RDWR)) < 0) {
-		 /* Report error */ ;
-	}
-	/* Sets options for UDP device */
-	udpopt.nwuo_flags = NWUO_SHARED | NWUO_LP_SET | NWUO_DI_LOC |
-		NWUO_DI_BROAD | NWUO_RP_SET | NWUO_RA_SET |
-		NWUO_RWDATONLY | NWUO_DI_IPOPT;
-	udpopt.nwuo_locaddr = udpopt.nwuo_remaddr = htonl(0x7F000001L);
-	udpopt.nwuo_locport = udpopt.nwuo_remport = htons(514);
-	if (ioctl(nfd, NWIOSUDPOPT, &udpopt) < 0 ||
-	    ioctl(nfd, NWIOGUDPOPT, &udpopt) < 0) {
-		 /* Report error */ ;
-	}
-  }
-  return;
-}
-
-/*
-**  SYSLOG -- print message on log file
-**
-**  This routine looks a lot like printf, except that it outputs to the
-**  log file instead of the standard output.  Also:
-**	- adds a timestamp,
-**	- prints the module name in front of the message,
-**	- has some other formatting types (or will sometime),
-**	- adds a newline on the end of the message.
-**
-** The output of this routine is intended to be read by syslogd(8).
-*/
-void syslog(int lprty, const char *msg,...)
-{
-  time_t now;
-  char buff[512];
-  int len, rc;
-  va_list ap;
-
-  /* First log message open chnnel to syslog */
-  if (nfd < 0) openlog(TagBuffer, LogFlags | LOG_NDELAY, LogFacility);
-  time(&now);
-  len = sprintf(buff, "<%d>%.15s %s: ",
-		LogFacility | lprty, ctime(&now) + 4, TagBuffer);
-  if (LogFlags & LOG_PID) {
-	len -= 2;
-	len += sprintf(buff + len, "[%d]: ", LogPid);
-  }
-  va_start(ap, msg);
-  len += vsprintf(buff + len, msg, ap);
-  va_end(ap);
-  rc = write(nfd, buff, len);
-  if ((rc != len && LogFlags & LOG_CONS) || LogFlags & LOG_PERROR) {
-	write(STDERR_FILENO, buff, len);
-	write(STDERR_FILENO, "\n", 1);
-  }
-  return;
-}
-
-/*
-**  CLOSELOG -- close access to syslogd
-**	- closes UDP channel
-**	- restores default values
-*/
-void closelog(void)
-{
-
-  close(nfd);
-  LogPid = nfd = -1;
-  LogFacility = LOG_USER;
-  LogFlags = 0;
-  return;
-}
-
-/** syslog.c **/
Index: trunk/minix/lib/other/taskcall.c
===================================================================
--- trunk/minix/lib/other/taskcall.c	(revision 9)
+++ 	(revision )
@@ -1,20 +1,0 @@
-/* _taskcall() is the same as _syscall() except it returns negative error
- * codes directly and not in errno.  This is a better interface for MM and
- * FS.
- */
-
-#include <lib.h>
-#include <minix/syslib.h>
-
-PUBLIC int _taskcall(who, syscallnr, msgptr)
-int who;
-int syscallnr;
-register message *msgptr;
-{
-  int status;
-
-  msgptr->m_type = syscallnr;
-  status = _sendrec(who, msgptr);
-  if (status != 0) return(status);
-  return(msgptr->m_type);
-}
Index: trunk/minix/lib/other/telldir.c
===================================================================
--- trunk/minix/lib/other/telldir.c	(revision 9)
+++ 	(revision )
@@ -1,16 +1,0 @@
-/*	telldir()					Author: Kees J. Bot
- *								24 Apr 1989
- */
-#define nil 0
-#include <lib.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <errno.h>
-
-off_t telldir(DIR *dp)
-/* Return the current read position in a directory. */
-{
-	if (dp == nil) { errno= EBADF; return -1; }
-
-	return dp->_pos;
-}
Index: trunk/minix/lib/other/termcap.c
===================================================================
--- trunk/minix/lib/other/termcap.c	(revision 9)
+++ 	(revision )
@@ -1,325 +1,0 @@
-/*
- *	termcap.c	V1.1	20/7/87		agc	Joypace Ltd
- *
- *	Copyright Joypace Ltd, London, UK, 1987. All rights reserved.
- *	This file may be freely distributed provided that this notice
- *	remains attached.
- *
- *	A public domain implementation of the termcap(3) routines.
- *
- *
- *
- *	 Klamer Schutte	      V1.2    Nov. 1988
- *
- *   - Can match multiple terminal names		 [tgetent]
- *   - Removal of **area assignments			 [tgetstr]
- *
- *	 Terrence W. Holm     V1.3    May, Sep, Oct.  1988
- *
- *   - Correct when TERM != name and TERMCAP is defined	 [tgetent]
- *   - Correct the comparison for the terminal name 	 [tgetent]
- *   - Correct the value of ^x escapes              	 [tgetstr]
- *   - Added %r to reverse row/column			 [tgoto]
- *   - Fixed end of definition test			 [tgetnum/flag/str]
- *
- *	 Terrence W. Holm     V1.4    Jan. 1989
- *
- *   - Incorporated Klamer's V1.2 fixes into V1.3
- *   - Added %d, (old %d is now %2)			 [tgoto]
- *   - Allow '#' comments in definition file		 [tgetent]
- */
-
-#include <lib.h>
-#include <termcap.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-char *capab = (char *)NULL;		/* the capability itself */
-
-#if 0
-/*  The following are not yet used.  */
-extern short ospeed;		/* output speed */
-extern char PC;			/* padding character */
-extern char *BC;		/* back cursor movement */
-extern char *UP;		/* up cursor movement */
-#endif
-
-/*
- *	tgetent - get the termcap entry for terminal name, and put it
- *	in bp (which must be an array of 1024 chars). Returns 1 if
- *	termcap entry found, 0 if not found, and -1 if file not found.
- */
-
-int tgetent(bp, name)
-char *bp;
-char *name;
-{
-  FILE *fp;
-  char *file;
-  char *term;
-  short len = strlen(name);
-
-  capab = bp;
-
-  /* If TERMCAP begins with a '/' then use TERMCAP as the path	 */
-  /* Name of the termcap definitions file. If TERMCAP is a	 */
-  /* Definition and TERM equals "name" then use TERMCAP as the	 */
-  /* Definition. Otherwise use "/etc/termcap" as the path name.	 */
-
-  if ((file = getenv("TERMCAP")) == (char *)NULL)
-	file = "/etc/termcap";
-  else if (*file != '/')
-	if ((term = getenv("TERM")) != (char *)NULL && strcmp(term, name) == 0) {
-		*bp = '\0';
-		strncat(bp, file, 1023);
-		return(1);
-	} else
-		file = "/etc/termcap";
-
-  if ((fp = fopen(file, "r")) == (FILE *) NULL) {
-	capab = (char *)NULL;		/* no valid termcap  */
-	return(-1);
-  }
-  for (;;) {
-	/* Read in each definition */
-	int def_len = 0;
-	char *cp = bp;
-
-	do {
-		if (fgets(&bp[def_len], (unsigned int)(1024 - def_len), fp) == (char *)NULL) {
-			fclose(fp);
-			capab = (char *)NULL;	/* no valid termcap */
-			return(0);
-		}
-		def_len = strlen(bp) - 2;
-	} while (bp[def_len] == '\\');
-
-	while (isspace(*cp)) cp++;
-
-	/* Comment lines start with a '#'  */
-	if (*cp == '#') continue;
-
-	/* See if any of the terminal names in this definition */
-	/* Match "name".						 */
-
-	do {
-		if (strncmp(name, cp, len) == 0 &&
-		    (cp[len] == '|' || cp[len] == ':')) {
-			fclose(fp);
-			return(1);
-		}
-		while ((*cp) && (*cp != '|') && (*cp != ':')) cp++;
-	} while (*cp++ == '|');
-  }
-}
-
-
-/*
- *	tgetnum - get the numeric terminal capability corresponding
- *	to id. Returns the value, -1 if invalid.
- */
-
-int tgetnum(id)
-char *id;
-{
-  register char *cp = capab;
-
-  if (cp == (char *)NULL || id == (char *)NULL) return(-1);
-
-  for (;;) {
-	while (*cp++ != ':')
-		if (cp[-1] == '\0') return(-1);
-
-	while (isspace(*cp)) cp++;
-
-	if (strncmp(cp, id, 2) == 0 && cp[2] == '#') return(atoi(cp + 3));
-  }
-}
-
-
-/*
- *	tgetflag - get the boolean flag corresponding to id. Returns -1
- *	if invalid, 0 if the flag is not in termcap entry, or 1 if it is
- *	present.
- */
-
-int tgetflag(id)
-char *id;
-{
-  register char *cp = capab;
-
-  if (cp == (char *)NULL || id == (char *)NULL) return(-1);
-
-  for (;;) {
-	while (*cp++ != ':')
-		if (cp[-1] == '\0') return(0);
-
-	while (isspace(*cp)) cp++;
-
-	if (strncmp(cp, id, 2) == 0) return(1);
-  }
-}
-
-
-/*
- *	tgetstr - get the string capability corresponding to id and place
- *	it in area (advancing area at same time). Expand escape sequences
- *	etc. Returns the string, or NULL if it can't do it.
- */
-
-char *tgetstr(id, area)
-char *id;
-char **area;
-{
-  register char *cp = capab;
-  register char *wsp = *area;	/* workspace pointer  */
-
-  if (cp == (char *)NULL || id == (char *)NULL) return((char *)NULL);
-
-  for (;;) {
-	while (*cp++ != ':')
-		if (cp[-1] == '\0') return((char *)NULL);
-
-	while (isspace(*cp)) cp++;
-
-	if (strncmp(cp, id, 2) == 0 && cp[2] == '=') {
-		for (cp += 3; *cp && *cp != ':'; wsp++, cp++) switch (*cp) {
-			    case '^':
-				*wsp = *++cp - '@';
-				break;
-
-			    case '\\':
-				switch (*++cp) {
-				    case 'E':
-					*wsp = '\033';
-					break;
-				    case 'n':
-					*wsp = '\n';
-					break;
-				    case 'r':
-					*wsp = '\r';
-					break;
-				    case 't':
-					*wsp = '\t';
-					break;
-				    case 'b':
-					*wsp = '\b';
-					break;
-				    case 'f':
-					*wsp = '\f';
-					break;
-				    case '0':
-				    case '1':
-				    case '2':
-				    case '3':
-					{
-						int i;
-						int t = 0;
-						for (i = 0; i < 3 &&
-						     isdigit(*cp); ++i, ++cp)
-							t = t * 8 + *cp - '0';
-						*wsp = t;
-						cp--;
-						break;
-					}
-				    default:
-					*wsp = *cp;
-				}
-				break;
-
-			    default:	*wsp = *cp;
-  			}
-
-		*wsp++ = '\0';
-
-		{
-			char *ret = *area;
-			*area = wsp;
-			return(ret);
-		}
-	}
-  }				/* end for(;;) */
-}
-
-
-
-/*
- *	tgoto - given the cursor motion string cm, make up the string
- *	for the cursor to go to (destcol, destline), and return the string.
- *	Returns "OOPS" if something's gone wrong, or the string otherwise.
- */
-
-char *tgoto(cm, destcol, destline)
-char *cm;
-int destcol;
-int destline;
-{
-  PRIVATE char ret[24];
-  char *rp = ret;
-  int incr = 0;
-  int argno = 0;
-  int numval;
-
-  for (; *cm; cm++) {
-	if (*cm == '%') {
-		switch (*++cm) {
-		    case 'i':	incr = 1;	  			break;
-
-		    case 'r':	argno = 1;	  			break;
-
-		    case '+':
-			numval = (argno == 0 ? destline : destcol);
-			*rp++ = numval + incr + *++cm;
-			argno = 1 - argno;
-			break;
-
-		    case '2':
-			numval = (argno == 0 ? destline : destcol);
-			numval = (numval + incr) % 100;
-			*rp++ = '0' + (numval / 10);
-			*rp++ = '0' + (numval % 10);
-			argno = 1 - argno;
-			break;
-
-		    case 'd':
-			numval = (argno == 0 ? destline : destcol);
-			numval = (numval + incr) % 1000;
-			if (numval > 99) *rp++ = '0' + (numval / 100);
-			if (numval > 9) *rp++ = '0' + (numval / 10) % 10;
-			*rp++ = '0' + (numval % 10);
-			argno = 1 - argno;
-			break;
-
-		    case '%':	*rp++ = '%';	  			break;
-
-		    default:	return("OOPS");
-  		}
-
-	} else
-		*rp++ = *cm;
-  }
-
-  *rp = '\0';
-  return(ret);
-}
-
-
-
-/*
- *	tputs - put the string cp out onto the terminal, using the function
- *	outc. This should do padding for the terminal, but I can't find a
- *	terminal that needs padding at the moment...
- */
-
-int tputs(cp, affcnt, outc)
-register char *cp;
-int affcnt;
-_PROTOTYPE( void (*outc), (int ch));
-{
-  if (cp == (char *)NULL) return(1);
-  /* Do any padding interpretation - left null for MINIX just now */
-  while (*cp) (*outc) (*cp++);
-  return(1);
-}
Index: trunk/minix/lib/other/ttyname.c
===================================================================
--- trunk/minix/lib/other/ttyname.c	(revision 9)
+++ 	(revision )
@@ -1,53 +1,0 @@
-/* ttyname.c						POSIX 4.7.2
- *	char *ttyname(int fildes);
- *
- *	Determines name of a terminal device.
- */
-
-#include <lib.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <string.h>
-#include <unistd.h>
-
-PRIVATE char base[] = "/dev";
-PRIVATE char path[sizeof(base) + 1 + NAME_MAX];	/* extra 1 for '/' */
-
-PUBLIC char *ttyname(fildes)
-int fildes;
-{
-  DIR *devices;
-  struct dirent *entry;
-  struct stat tty_stat;
-  struct stat dev_stat;
-
-  /* Simple first test: file descriptor must be a character device */
-  if (fstat(fildes, &tty_stat) < 0 || !S_ISCHR(tty_stat.st_mode))
-	return (char *) NULL;
-
-  /* Open device directory for reading  */
-  if ((devices = opendir(base)) == (DIR *) NULL)
-	return (char *) NULL;
-
-  /* Scan the entries for one that matches perfectly */
-  while ((entry = readdir(devices)) != (struct dirent *) NULL) {
-	if (tty_stat.st_ino != entry->d_ino)
-		continue;
-	strcpy(path, base);
-	strcat(path, "/");
-	strcat(path, entry->d_name);
-	if (stat(path, &dev_stat) < 0 || !S_ISCHR(dev_stat.st_mode))
-		continue;
-	if (tty_stat.st_ino == dev_stat.st_ino &&
-	    tty_stat.st_dev == dev_stat.st_dev &&
-	    tty_stat.st_rdev == dev_stat.st_rdev) {
-		closedir(devices);
-		return path;
-	}
-  }
-
-  closedir(devices);
-  return (char *) NULL;
-}
Index: trunk/minix/lib/other/ttyslot.c
===================================================================
--- trunk/minix/lib/other/ttyslot.c	(revision 9)
+++ 	(revision )
@@ -1,62 +1,0 @@
-/*
-ttyslot.c
-
-Return the index in the utmp file for the current user's terminal. The 
-current user's terminal is the first file descriptor in the range 0..2
-for which ttyname() returns a name. The index is the line number in the
-/etc/ttytab file. 0 will be returned in case of an error.
-
-Created:	Oct 11, 1992 by Philip Homburg
-*/
-
-#define _MINIX_SOURCE
-
-#include <sys/types.h>
-#include <ttyent.h>
-#include <string.h>
-#include <unistd.h>
-
-int ttyslot()
-{
-	int slot;
-
-	slot= fttyslot(0);
-	if (slot == 0) slot= fttyslot(1);
-	if (slot == 0) slot= fttyslot(2);
-	return slot;
-}
-
-int fttyslot(fd)
-int fd;
-{
-	char *tname;
-	int lineno;
-	struct ttyent *ttyp;
-
-	tname= ttyname(fd);
-	if (tname == NULL) return 0;
-
-	/* Assume that tty devices are in /dev */
-	if (strncmp(tname, "/dev/", 5) != 0)
-		return 0;	/* Malformed tty name. */
-	tname += 5;
-
-	/* Scan /etc/ttytab. */
-	lineno= 1;
-	while ((ttyp= getttyent()) != NULL)
-	{
-		if (strcmp(tname, ttyp->ty_name) == 0)
-		{
-			endttyent();
-			return lineno;
-		}
-		lineno++;
-	}
-	/* No match */
-	endttyent();
-	return 0;
-}
-
-/*
- * $PchHeader: /mount/hd2/minix/lib/misc/RCS/ttyslot.c,v 1.3 1994/12/22 13:49:12 philip Exp $
- */
Index: trunk/minix/lib/other/un-namespace.h
===================================================================
--- trunk/minix/lib/other/un-namespace.h	(revision 9)
+++ 	(revision )
@@ -1,153 +1,0 @@
-/*
- * Copyright (c) 2001 Daniel Eischen <deischen@FreeBSD.org>.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libc/include/un-namespace.h,v 1.13 2003/05/01 19:03:13 nectar Exp $
- */
-
-#ifndef _UN_NAMESPACE_H_
-#define _UN_NAMESPACE_H_
-
-#undef		accept
-#undef		__acl_aclcheck_fd
-#undef		__acl_delete_fd
-#undef		__acl_get_fd
-#undef		__acl_set_fd
-#undef		bind
-#undef		__cap_get_fd
-#undef		__cap_set_fd
-#undef		close
-#undef		connect
-#undef		dup
-#undef		dup2
-#undef		execve
-#undef		fcntl
-#undef		flock
-#undef		flockfile
-#undef		fpathconf
-#undef		fstat
-#undef		fstatfs
-#undef		fsync
-#undef		funlockfile
-#undef		getdirentries
-#undef		getlogin
-#undef		getpeername
-#undef		getprogname
-#undef		getsockname
-#undef		getsockopt
-#undef		ioctl
-#undef		kevent
-#undef		listen
-#undef		nanosleep
-#undef		open
-#undef		poll
-#undef		pthread_cond_broadcast
-#undef		pthread_cond_destroy
-#undef		pthread_cond_init
-#undef		pthread_cond_signal
-#undef		pthread_cond_timedwait
-#undef		pthread_cond_wait
-#undef		pthread_exit
-#undef		pthread_getspecific
-#undef		pthread_key_create
-#undef		pthread_key_delete
-#undef		pthread_main_np
-#undef		pthread_mutex_destroy
-#undef		pthread_mutex_init
-#undef		pthread_mutex_lock
-#undef		pthread_mutex_trylock
-#undef		pthread_mutex_unlock
-#undef		pthread_mutexattr_init
-#undef		pthread_mutexattr_destroy
-#undef		pthread_mutexattr_settype
-#undef		pthread_once
-#undef		pthread_rwlock_destroy
-#undef		pthread_rwlock_init
-#undef		pthread_rwlock_rdlock
-#undef		pthread_rwlock_wrlock
-#undef		pthread_rwlock_tryrdlock
-#undef		pthread_rwlock_trywrlock
-#undef		pthread_rwlock_unlock
-#undef		pthread_self
-#undef		pthread_setspecific
-#undef		pthread_sigmask
-#undef		read
-#undef		readv
-#undef		recvfrom
-#undef		recvmsg
-#undef		select
-#undef		sendmsg
-#undef		sendto
-#undef		setsockopt
-#undef		sigaction
-#undef		sigprocmask
-#undef		sigsuspend
-#undef		socket
-#undef		socketpair
-#undef		wait4
-#undef		waitpid
-#undef		write
-#undef		writev
-
-#if 0
-#undef		creat
-#undef		fchflags
-#undef		fchmod
-#undef		ftrylockfile
-#undef		msync
-#undef		nfssvc
-#undef		pause
-#undef		pthread_rwlockattr_init
-#undef		pthread_rwlockattr_destroy
-#undef		sched_yield
-#undef		sendfile
-#undef		shutdown
-#undef		sigaltstack
-#undef		sigpending
-#undef		sigreturn
-#undef		sigsetmask
-#undef		sleep
-#undef		system
-#undef		tcdrain
-#undef		wait
-#endif	/* 0 */
-
-#ifdef _SIGNAL_H_
-int     	_sigaction(int, const struct sigaction *, struct sigaction *);
-#endif
-
-#ifdef _SYS_EVENT_H_
-int		_kevent(int, const struct kevent *, int, struct kevent *,
-		    int, const struct timespec *);
-#endif
-
-#ifdef _SYS_FCNTL_H_
-int		_flock(int, int);
-#endif
-
-#undef		err
-#undef		warn
-#undef		nsdispatch
-
-#endif	/* _UN_NAMESPACE_H_ */
Index: trunk/minix/lib/other/v8regerror.c
===================================================================
--- trunk/minix/lib/other/v8regerror.c	(revision 9)
+++ 	(revision )
@@ -1,15 +1,0 @@
-/*	regerror() - Default regexp error report	Author: Kees J. Bot
- *								12 Jun 1999
- *
- * A better version of this routine should be supplied by the user in
- * the program using regexps.
- */
-#include <stdio.h>
-#define const		/* avoid "const poisoning" */
-#include <regexp.h>
-#undef const
-
-void regerror(char *message)
-{
-	fprintf(stderr, "regexp error: %s\n", message);
-}
Index: trunk/minix/lib/other/v8regexp.c
===================================================================
--- trunk/minix/lib/other/v8regexp.c	(revision 9)
+++ 	(revision )
@@ -1,1075 +1,0 @@
-/* regcomp and regexec -- regsub and regerror are elsewhere
- *
- *	Copyright (c) 1986 by University of Toronto.
- *	Written by Henry Spencer.  Not derived from licensed software.
- *
- *	Permission is granted to anyone to use this software for any
- *	purpose on any computer system, and to redistribute it freely,
- *	subject to the following restrictions:
- *
- *	1. The author is not responsible for the consequences of use of
- *		this software, no matter how awful, even if they arise
- *		from defects in it.
- *
- *	2. The origin of this software must not be misrepresented, either
- *		by explicit claim or by omission.
- *
- *	3. Altered versions must be plainly marked as such, and must not
- *		be misrepresented as being the original software.
- *
- * Beware that some of this code is subtly aware of the way operator
- * precedence is structured in regular expressions.  Serious changes in
- * regular-expression syntax might require a total rethink.
- *
- *	The third parameter to regexec was added by Martin C. Atkins.
- *	Andy Tanenbaum also made some changes.
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#define const		/* avoid "const poisoning" */
-#include <regexp.h>
-#undef const
-
-/* The first byte of the regexp internal "program" is actually this magic
- * number; the start node begins in the second byte.
- */
-#define	MAGIC	0234
-
-/* The "internal use only" fields in regexp.h are present to pass info from
- * compile to execute that permits the execute phase to run lots faster on
- * simple cases.  They are:
- *
- * regstart	char that must begin a match; '\0' if none obvious
- * reganch	is the match anchored (at beginning-of-line only)?
- * regmust	string (pointer into program) that match must include, or NULL
- * regmlen	length of regmust string
- *
- * Regstart and reganch permit very fast decisions on suitable starting points
- * for a match, cutting down the work a lot.  Regmust permits fast rejection
- * of lines that cannot possibly match.  The regmust tests are costly enough
- * that regcomp() supplies a regmust only if the r.e. contains something
- * potentially expensive (at present, the only such thing detected is * or +
- * at the start of the r.e., which can involve a lot of backup).  Regmlen is
- * supplied because the test in regexec() needs it and regcomp() is computing
- * it anyway.
- */
-
-/* Structure for regexp "program".  This is essentially a linear encoding
- * of a nondeterministic finite-state machine (aka syntax charts or
- * "railroad normal form" in parsing technology).  Each node is an opcode
- * plus a "next" pointer, possibly plus an operand.  "Next" pointers of
- * all nodes except BRANCH implement concatenation; a "next" pointer with
- * a BRANCH on both ends of it is connecting two alternatives.  (Here we
- * have one of the subtle syntax dependencies:  an individual BRANCH (as
- * opposed to a collection of them) is never concatenated with anything
- * because of operator precedence.)  The operand of some types of node is
- * a literal string; for others, it is a node leading into a sub-FSM.  In
- * particular, the operand of a BRANCH node is the first node of the branch.
- * (NB this is *not* a tree structure:  the tail of the branch connects
- * to the thing following the set of BRANCHes.)  The opcodes are:
- */
-
-/* Definition	number	opnd?	meaning */
-#define	END	0		/* no	End of program. */
-#define	BOL	1		/* no	Match "" at beginning of line. */
-#define	EOL	2		/* no	Match "" at end of line. */
-#define	ANY	3		/* no	Match any one character. */
-#define	ANYOF	4		/* str	Match any character in this string. */
-#define	ANYBUT	5		/* str	Match any character not in this
-			 * string. */
-#define	BRANCH	6		/* node	Match this alternative, or the
-			 * next... */
-#define	BACK	7		/* no	Match "", "next" ptr points backward. */
-#define	EXACTLY	8		/* str	Match this string. */
-#define	NOTHING	9		/* no	Match empty string. */
-#define	STAR	10		/* node	Match this (simple) thing 0 or more
-			 * times. */
-#define	PLUS	11		/* node	Match this (simple) thing 1 or more
-			 * times. */
-#define	OPEN	20		/* no	Mark this point in input as start of
-			 * #n. */
- /* OPEN+1 is number 1, etc. */
-#define	CLOSE	30		/* no	Analogous to OPEN. */
-
-/* Opcode notes:
- *
- * BRANCH	The set of branches constituting a single choice are hooked
- *		together with their "next" pointers, since precedence prevents
- *		anything being concatenated to any individual branch.  The
- *		"next" pointer of the last BRANCH in a choice points to the
- *		thing following the whole choice.  This is also where the
- *		final "next" pointer of each individual branch points; each
- *		branch starts with the operand node of a BRANCH node.
- *
- * BACK		Normal "next" pointers all implicitly point forward; BACK
- *		exists to make loop structures possible.
- *
- * STAR,PLUS	'?', and complex '*' and '+', are implemented as circular
- *		BRANCH structures using BACK.  Simple cases (one character
- *		per match) are implemented with STAR and PLUS for speed
- *		and to minimize recursive plunges.
- *
- * OPEN,CLOSE	...are numbered at compile time.
- */
-
-/* A node is one char of opcode followed by two chars of "next" pointer.
- * "Next" pointers are stored as two 8-bit pieces, high order first.  The
- * value is a positive offset from the opcode of the node containing it.
- * An operand, if any, simply follows the node.  (Note that much of the
- * code generation knows about this implicit relationship.)
- *
- * Using two bytes for the "next" pointer is vast overkill for most things,
- * but allows patterns to get big without disasters.
- */
-#define	OP(p)	(*(p))
-#define	NEXT(p)	(((*((p)+1)&0377)<<8) + (*((p)+2)&0377))
-#define	OPERAND(p)	((p) + 3)
-
-/* Utility definitions.
- */
-#ifndef CHARBITS
-#define	UCHARAT(p)	((int)*(unsigned char *)(p))
-#else
-#define	UCHARAT(p)	((int)*(p)&CHARBITS)
-#endif
-
-#define	CFAIL(m)	{ regerror(m); return((char *)NULL); }
-#define	RFAIL(m)	{ regerror(m); return((regexp *)NULL); }
-#define	ISMULT(c)	((c) == '*' || (c) == '+' || (c) == '?')
-#define	META	"^$.[()|?+*\\"
-
-/* Flags to be passed up and down.
- */
-#define	HASWIDTH	01	/* Known never to match null string. */
-#define	SIMPLE		02	/* Simple enough to be STAR/PLUS operand. */
-#define	SPSTART		04	/* Starts with * or +. */
-#define	WORST		0	/* Worst case. */
-
-/* Global work variables for regcomp().
- */
-static char *regparse;		/* Input-scan pointer. */
-static int regnpar;		/* () count. */
-static char regdummy;
-static char *regcode;		/* Code-emit pointer; &regdummy = don't. */
-static long regsize;		/* Code size. */
-
-/* Forward declarations for regcomp()'s friends.
- */
-static char *reg(int paren, int *flagp);
-static char *regbranch(int *flagp);
-static char *regpiece(int *flagp);
-static char *regatom(int *flagp);
-static char *regnode(int op);
-static char *regnext(char *p);
-static void regc(int b);
-static void reginsert(int op, char *opnd);
-static void regtail(char *p, char *val);
-static void regoptail(char *p, char *val);
-
-/*
- - regcomp - compile a regular expression into internal code
- *
- * We can't allocate space until we know how big the compiled form will be,
- * but we can't compile it (and thus know how big it is) until we've got a
- * place to put the code.  So we cheat:  we compile it twice, once with code
- * generation turned off and size counting turned on, and once "for real".
- * This also means that we don't allocate space until we are sure that the
- * thing really will compile successfully, and we never have to move the
- * code and thus invalidate pointers into it.  (Note that it has to be in
- * one piece because free() must be able to free it all.)
- *
- * Beware that the optimization-preparation code in here knows about some
- * of the structure of the compiled regexp.
- */
-regexp *regcomp(exp)
-char *exp;
-{
-  register regexp *r;
-  register char *scan;
-  register char *longest;
-  register int len;
-  int flags;
-
-  if (exp == (char *)NULL) RFAIL("NULL argument");
-
-  /* First pass: determine size, legality. */
-  regparse = exp;
-  regnpar = 1;
-  regsize = 0L;
-  regcode = &regdummy;
-  regc(MAGIC);
-  if (reg(0, &flags) == (char *)NULL) return((regexp *)NULL);
-
-  /* Small enough for pointer-storage convention? */
-  if (regsize >= 32767L)	/* Probably could be 65535L. */
-	RFAIL("regexp too big");
-
-  /* Allocate space. */
-  r = (regexp *) malloc(sizeof(regexp) + (unsigned) regsize);
-  if (r == (regexp *)NULL) RFAIL("out of space");
-
-  /* Second pass: emit code. */
-  regparse = exp;
-  regnpar = 1;
-  regcode = r->program;
-  regc(MAGIC);
-  if (reg(0, &flags) == (char *)NULL) return((regexp *)NULL);
-
-  /* Dig out information for optimizations. */
-  r->regstart = '\0';		/* Worst-case defaults. */
-  r->reganch = 0;
-  r->regmust = (char *)NULL;
-  r->regmlen = 0;
-  scan = r->program + 1;	/* First BRANCH. */
-  if (OP(regnext(scan)) == END) {	/* Only one top-level choice. */
-	scan = OPERAND(scan);
-
-	/* Starting-point info. */
-	if (OP(scan) == EXACTLY)
-		r->regstart = *OPERAND(scan);
-	else if (OP(scan) == BOL)
-		r->reganch++;
-
-	/* If there's something expensive in the r.e., find the
-	 * longest literal string that must appear and make it the
-	 * regmust.  Resolve ties in favor of later strings, since
-	 * the regstart check works with the beginning of the r.e.
-	 * and avoiding duplication strengthens checking.  Not a
-	 * strong reason, but sufficient in the absence of others. */
-	if (flags & SPSTART) {
-		longest = (char *)NULL;
-		len = 0;
-		for (; scan != (char *)NULL; scan = regnext(scan))
-			if (OP(scan) == EXACTLY && strlen(OPERAND(scan)) >= len) {
-				longest = OPERAND(scan);
-				len = strlen(OPERAND(scan));
-			}
-		r->regmust = longest;
-		r->regmlen = len;
-	}
-  }
-  return(r);
-}
-
-/*
- - reg - regular expression, i.e. main body or parenthesized thing
- *
- * Caller must absorb opening parenthesis.
- *
- * Combining parenthesis handling with the base level of regular expression
- * is a trifle forced, but the need to tie the tails of the branches to what
- * follows makes it hard to avoid.
- */
-static char *reg(paren, flagp)
-int paren;			/* Parenthesized? */
-int *flagp;
-{
-  register char *ret;
-  register char *br;
-  register char *ender;
-  register int parno;
-  int flags;
-
-  *flagp = HASWIDTH;		/* Tentatively. */
-
-  /* Make an OPEN node, if parenthesized. */
-  if (paren) {
-	if (regnpar >= NSUBEXP) CFAIL("too many ()");
-	parno = regnpar;
-	regnpar++;
-	ret = regnode(OPEN + parno);
-  } else {
-	parno = 0;		/* not actually used, keep compiler quiet */
-	ret = (char *)NULL;
-  }
-
-  /* Pick up the branches, linking them together. */
-  br = regbranch(&flags);
-  if (br == (char *)NULL) return((char *)NULL);
-  if (ret != (char *)NULL)
-	regtail(ret, br);	/* OPEN -> first. */
-  else
-	ret = br;
-  if (!(flags & HASWIDTH)) *flagp &= ~HASWIDTH;
-  *flagp |= flags & SPSTART;
-  while (*regparse == '|') {
-	regparse++;
-	br = regbranch(&flags);
-	if (br == (char *)NULL) return((char *)NULL);
-	regtail(ret, br);	/* BRANCH -> BRANCH. */
-	if (!(flags & HASWIDTH)) *flagp &= ~HASWIDTH;
-	*flagp |= flags & SPSTART;
-  }
-
-  /* Make a closing node, and hook it on the end. */
-  ender = regnode((paren) ? CLOSE + parno : END);
-  regtail(ret, ender);
-
-  /* Hook the tails of the branches to the closing node. */
-  for (br = ret; br != (char *)NULL; br = regnext(br)) regoptail(br, ender);
-
-  /* Check for proper termination. */
-  if (paren && *regparse++ != ')') {
-	CFAIL("unmatched ()");
-  } else if (!paren && *regparse != '\0') {
-	if (*regparse == ')') {
-		CFAIL("unmatched ()");
-	} else
-		CFAIL("junk on end");	/* "Can't happen". */
-	/* NOTREACHED */
-  }
-  return(ret);
-}
-
-/*
- - regbranch - one alternative of an | operator
- *
- * Implements the concatenation operator.
- */
-static char *regbranch(flagp)
-int *flagp;
-{
-  register char *ret;
-  register char *chain;
-  register char *latest;
-  int flags;
-
-  *flagp = WORST;		/* Tentatively. */
-
-  ret = regnode(BRANCH);
-  chain = (char *)NULL;
-  while (*regparse != '\0' && *regparse != '|' && *regparse != ')') {
-	latest = regpiece(&flags);
-	if (latest == (char *)NULL) return((char *)NULL);
-	*flagp |= flags & HASWIDTH;
-	if (chain == (char *)NULL)	/* First piece. */
-		*flagp |= flags & SPSTART;
-	else
-		regtail(chain, latest);
-	chain = latest;
-  }
-  if (chain == (char *)NULL)		/* Loop ran zero times. */
-	regnode(NOTHING);
-
-  return(ret);
-}
-
-/*
- - regpiece - something followed by possible [*+?]
- *
- * Note that the branching code sequences used for ? and the general cases
- * of * and + are somewhat optimized:  they use the same NOTHING node as
- * both the endmarker for their branch list and the body of the last branch.
- * It might seem that this node could be dispensed with entirely, but the
- * endmarker role is not redundant.
- */
-static char *regpiece(flagp)
-int *flagp;
-{
-  register char *ret;
-  register char op;
-  register char *next;
-  int flags;
-
-  ret = regatom(&flags);
-  if (ret == (char *)NULL) return((char *)NULL);
-
-  op = *regparse;
-  if (!ISMULT(op)) {
-	*flagp = flags;
-	return(ret);
-  }
-  if (!(flags & HASWIDTH) && op != '?') CFAIL("*+ operand could be empty");
-  *flagp = (op != '+') ? (WORST | SPSTART) : (WORST | HASWIDTH);
-
-  if (op == '*' && (flags & SIMPLE))
-	reginsert(STAR, ret);
-  else if (op == '*') {
-	/* Emit x* as (x&|), where & means "self". */
-	reginsert(BRANCH, ret);	/* Either x */
-	regoptail(ret, regnode(BACK));	/* and loop */
-	regoptail(ret, ret);	/* back */
-	regtail(ret, regnode(BRANCH));	/* or */
-	regtail(ret, regnode(NOTHING));	/* null. */
-  } else if (op == '+' && (flags & SIMPLE))
-	reginsert(PLUS, ret);
-  else if (op == '+') {
-	/* Emit x+ as x(&|), where & means "self". */
-	next = regnode(BRANCH);	/* Either */
-	regtail(ret, next);
-	regtail(regnode(BACK), ret);	/* loop back */
-	regtail(next, regnode(BRANCH));	/* or */
-	regtail(ret, regnode(NOTHING));	/* null. */
-  } else if (op == '?') {
-	/* Emit x? as (x|) */
-	reginsert(BRANCH, ret);	/* Either x */
-	regtail(ret, regnode(BRANCH));	/* or */
-	next = regnode(NOTHING);/* null. */
-	regtail(ret, next);
-	regoptail(ret, next);
-  }
-  regparse++;
-  if (ISMULT(*regparse)) CFAIL("nested *?+");
-
-  return(ret);
-}
-
-/*
- - regatom - the lowest level
- *
- * Optimization:  gobbles an entire sequence of ordinary characters so that
- * it can turn them into a single node, which is smaller to store and
- * faster to run.  Backslashed characters are exceptions, each becoming a
- * separate node; the code is simpler that way and it's not worth fixing.
- */
-static char *regatom(flagp)
-int *flagp;
-{
-  register char *ret;
-  int flags;
-
-  *flagp = WORST;		/* Tentatively. */
-
-  switch (*regparse++) {
-      case '^':	ret = regnode(BOL);	  	break;
-      case '$':	ret = regnode(EOL);	  	break;
-      case '.':
-	ret = regnode(ANY);
-	*flagp |= HASWIDTH | SIMPLE;
-	break;
-      case '[':{
-		register int class;
-		register int classend;
-
-		if (*regparse == '^') {	/* Complement of range. */
-			ret = regnode(ANYBUT);
-			regparse++;
-		} else
-			ret = regnode(ANYOF);
-		if (*regparse == ']' || *regparse == '-') regc(*regparse++);
-		while (*regparse != '\0' && *regparse != ']') {
-			if (*regparse == '-') {
-				regparse++;
-				if (*regparse == ']' || *regparse == '\0')
-					regc('-');
-				else {
-					class = UCHARAT(regparse - 2) + 1;
-					classend = UCHARAT(regparse);
-					if (class > classend + 1)
-						CFAIL("invalid [] range");
-					for (; class <= classend; class++)
-						regc(class);
-					regparse++;
-				}
-			} else
-				regc(*regparse++);
-		}
-		regc('\0');
-		if (*regparse != ']') CFAIL("unmatched []");
-		regparse++;
-		*flagp |= HASWIDTH | SIMPLE;
-	}
-	break;
-      case '(':
-	ret = reg(1, &flags);
-	if (ret == (char *)NULL) return((char *)NULL);
-	*flagp |= flags & (HASWIDTH | SPSTART);
-	break;
-      case '\0':
-      case '|':
-      case ')':
-	CFAIL("internal urp");	/* Supposed to be caught earlier. */
-	break;
-      case '?':
-      case '+':
-      case '*':	CFAIL("?+* follows nothing");	  	break;
-      case '\\':
-	if (*regparse == '\0') CFAIL("trailing \\");
-	ret = regnode(EXACTLY);
-	regc(*regparse++);
-	regc('\0');
-	*flagp |= HASWIDTH | SIMPLE;
-	break;
-      default:{
-		register int len;
-		register char ender;
-
-		regparse--;
-		len = strcspn(regparse, META);
-		if (len <= 0) CFAIL("internal disaster");
-		ender = *(regparse + len);
-		if (len > 1 && ISMULT(ender))
-			len--;	/* Back off clear of ?+* operand. */
-		*flagp |= HASWIDTH;
-		if (len == 1) *flagp |= SIMPLE;
-		ret = regnode(EXACTLY);
-		while (len > 0) {
-			regc(*regparse++);
-			len--;
-		}
-		regc('\0');
-	}
-	break;
-  }
-
-  return(ret);
-}
-
-/*
- - regnode - emit a node
- */
-static char *regnode(op)
-char op;
-{
-  register char *ret;
-  register char *ptr;
-
-  ret = regcode;
-  if (ret == &regdummy) {
-	regsize += 3;
-	return(ret);
-  }
-  ptr = ret;
-  *ptr++ = op;
-  *ptr++ = '\0';		/* Null "next" pointer. */
-  *ptr++ = '\0';
-  regcode = ptr;
-
-  return(ret);
-}
-
-/*
- - regc - emit (if appropriate) a byte of code
- */
-static void regc(b)
-char b;
-{
-  if (regcode != &regdummy)
-	*regcode++ = b;
-  else
-	regsize++;
-}
-
-/*
- - reginsert - insert an operator in front of already-emitted operand
- *
- * Means relocating the operand.
- */
-static void reginsert(op, opnd)
-char op;
-char *opnd;
-{
-  register char *src;
-  register char *dst;
-  register char *place;
-
-  if (regcode == &regdummy) {
-	regsize += 3;
-	return;
-  }
-  src = regcode;
-  regcode += 3;
-  dst = regcode;
-  while (src > opnd) *--dst = *--src;
-
-  place = opnd;			/* Op node, where operand used to be. */
-  *place++ = op;
-  *place++ = '\0';
-  *place++ = '\0';
-}
-
-/*
- - regtail - set the next-pointer at the end of a node chain
- */
-static void regtail(p, val)
-char *p;
-char *val;
-{
-  register char *scan;
-  register char *temp;
-  register int offset;
-
-  if (p == &regdummy) return;
-
-  /* Find last node. */
-  scan = p;
-  for (;;) {
-	temp = (char *)regnext(scan);
-	if (temp == (char *)NULL) break;
-	scan = temp;
-  }
-
-  if (OP(scan) == BACK)
-	offset = scan - val;
-  else
-	offset = val - scan;
-  *(scan + 1) = (offset >> 8) & 0377;
-  *(scan + 2) = offset & 0377;
-}
-
-/*
- - regoptail - regtail on operand of first argument; nop if operandless
- */
-static void regoptail(p, val)
-char *p;
-char *val;
-{
-  /* "Operandless" and "op != BRANCH" are synonymous in practice. */
-  if (p == (char *)NULL || p == &regdummy || OP(p) != BRANCH) return;
-  regtail(OPERAND(p), val);
-}
-
-/* regexec and friends
- */
-
-/* Global work variables for regexec().
- */
-static char *reginput;		/* String-input pointer. */
-static char *regbol;		/* Beginning of input, for ^ check. */
-static char **regstartp;	/* Pointer to startp array. */
-static char **regendp;		/* Ditto for endp. */
-
-/* Forwards.
- */
-static int regtry(regexp *prog, char *string);
-static int regmatch(char *prog);
-static int regrepeat(char *p);
-
-#ifdef DEBUG
-int regnarrate = 0;
-void regdump();
-static char *regprop(char *op);
-#endif
-
-/*
- - regexec - match a regexp against a string
- */
-int regexec(prog, string, bolflag)
-register regexp *prog;
-register char *string;
-int bolflag;
-{
-  register char *s;
-
-  /* Be paranoid... */
-  if (prog == (regexp *)NULL || string == (char *)NULL) {
-	regerror("NULL parameter");
-	return(0);
-  }
-
-  /* Check validity of program. */
-  if (UCHARAT(prog->program) != MAGIC) {
-	regerror("corrupted program");
-	return(0);
-  }
-
-  /* If there is a "must appear" string, look for it. */
-  if (prog->regmust != (char *)NULL) {
-	s = string;
-	while ((s = strchr(s, prog->regmust[0])) != (char *)NULL) {
-		if (strncmp(s, prog->regmust, prog->regmlen) == 0)
-			break;	/* Found it. */
-		s++;
-	}
-	if (s == (char *)NULL)		/* Not present. */
-		return(0);
-  }
-
-  /* Mark beginning of line for ^ . */
-  if (bolflag)
-	regbol = string;
-  else
-	regbol = (char *)NULL;
-
-  /* Simplest case:  anchored match need be tried only once. */
-  if (prog->reganch) return(regtry(prog, string));
-
-  /* Messy cases:  unanchored match. */
-  s = string;
-  if (prog->regstart != '\0') 	/* We know what char it must start with. */
-	while ((s = strchr(s, prog->regstart)) != (char *)NULL) {
-		if (regtry(prog, s)) return(1);
-		s++;
-	}
-  else
-	/* We don't -- general case. */
-	do {
-		if (regtry(prog, s)) return(1);
-	} while (*s++ != '\0');
-
-  /* Failure. */
-  return(0);
-}
-
-/*
- - regtry - try match at specific point
- */
-static int regtry(prog, string)   /* 0 failure, 1 success */
-regexp *prog;
-char *string;
-{
-  register int i;
-  register char **sp;
-  register char **ep;
-
-  reginput = string;
-  regstartp = prog->startp;
-  regendp = prog->endp;
-
-  sp = prog->startp;
-  ep = prog->endp;
-  for (i = NSUBEXP; i > 0; i--) {
-	*sp++ = (char *)NULL;
-	*ep++ = (char *)NULL;
-  }
-  if (regmatch(prog->program + 1)) {
-	prog->startp[0] = string;
-	prog->endp[0] = reginput;
-	return(1);
-  } else
-	return(0);
-}
-
-/*
- - regmatch - main matching routine
- *
- * Conceptually the strategy is simple:  check to see whether the current
- * node matches, call self recursively to see whether the rest matches,
- * and then act accordingly.  In practice we make some effort to avoid
- * recursion, in particular by going through "ordinary" nodes (that don't
- * need to know whether the rest of the match failed) by a loop instead of
- * by recursion.
- */
-static int regmatch(prog)	/* 0 failure, 1 success */ 
-char *prog;
-{
-  register char *scan;		/* Current node. */
-  char *next;			/* Next node. */
-
-  scan = prog;
-#ifdef DEBUG
-  if (scan != (char *)NULL && regnarrate) fprintf(stderr, "%s(\n", regprop(scan));
-#endif
-  while (scan != (char *)NULL) {
-#ifdef DEBUG
-	if (regnarrate) fprintf(stderr, "%s...\n", regprop(scan));
-#endif
-	next = regnext(scan);
-
-	switch (OP(scan)) {
-	    case BOL:
-		if (reginput != regbol) return(0);
-		break;
-	    case EOL:
-		if (*reginput != '\0') return(0);
-		break;
-	    case ANY:
-		if (*reginput == '\0') return(0);
-		reginput++;
-		break;
-	    case EXACTLY:{
-			register int len;
-			register char *opnd;
-
-			opnd = OPERAND(scan);
-			/* Inline the first character, for speed. */
-			if (*opnd != *reginput) return(0);
-			len = strlen(opnd);
-			if (len > 1 && strncmp(opnd, reginput, len) != 0)
-				return(0);
-			reginput += len;
-		}
-		break;
-	    case ANYOF:
-		if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) == (char *)NULL)
-			return(0);
-		reginput++;
-		break;
-	    case ANYBUT:
-		if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) != (char *)NULL)
-			return(0);
-		reginput++;
-		break;
-	    case NOTHING:
-		break;
-	    case BACK:
-		break;
-	    case OPEN + 1:
-	    case OPEN + 2:
-	    case OPEN + 3:
-	    case OPEN + 4:
-	    case OPEN + 5:
-	    case OPEN + 6:
-	    case OPEN + 7:
-	    case OPEN + 8:
-	    case OPEN + 9:{
-			register int no;
-			register char *save;
-
-			no = OP(scan) - OPEN;
-			save = reginput;
-
-			if (regmatch(next)) {
-				/* Don't set startp if some later
-				 * invocation of the same parentheses
-				 * already has. */
-				if (regstartp[no] == (char *)NULL)
-					regstartp[no] = save;
-				return(1);
-			} else
-				return(0);
-		}
-		break;
-	    case CLOSE + 1:
-	    case CLOSE + 2:
-	    case CLOSE + 3:
-	    case CLOSE + 4:
-	    case CLOSE + 5:
-	    case CLOSE + 6:
-	    case CLOSE + 7:
-	    case CLOSE + 8:
-	    case CLOSE + 9:{
-			register int no;
-			register char *save;
-
-			no = OP(scan) - CLOSE;
-			save = reginput;
-
-			if (regmatch(next)) {
-				/* Don't set endp if some later
-				 * invocation of the same parentheses
-				 * already has. */
-				if (regendp[no] == (char *)NULL) regendp[no] = save;
-				return(1);
-			} else
-				return(0);
-		}
-		break;
-	    case BRANCH:{
-			register char *save;
-
-			if (OP(next) != BRANCH)	/* No choice. */
-				next = OPERAND(scan);	/* Avoid recursion. */
-			else {
-				do {
-					save = reginput;
-					if (regmatch(OPERAND(scan)))
-						return(1);
-					reginput = save;
-					scan = regnext(scan);
-				} while (scan != (char *)NULL && OP(scan) == BRANCH);
-				return(0);
-				/* NOTREACHED */
-			}
-		}
-		break;
-	    case STAR:
-	    case PLUS:{
-			register char nextch;
-			register int no;
-			register char *save;
-			register int min;
-
-			/* Lookahead to avoid useless match attempts
-			 * when we know what character comes next. */
-			nextch = '\0';
-			if (OP(next) == EXACTLY) nextch = *OPERAND(next);
-			min = (OP(scan) == STAR) ? 0 : 1;
-			save = reginput;
-			no = regrepeat(OPERAND(scan));
-			while (no >= min) {
-				/* If it could work, try it. */
-				if (nextch == '\0' || *reginput == nextch)
-					if (regmatch(next)) return(1);
-				/* Couldn't or didn't -- back up. */
-				no--;
-				reginput = save + no;
-			}
-			return(0);
-		}
-		break;
-	    case END:
-		return(1);	/* Success! */
-		break;
-	    default:
-		regerror("memory corruption");
-		return(0);
-		break;
-	}
-
-	scan = next;
-  }
-
-  /* We get here only if there's trouble -- normally "case END" is the
-   * terminating point. */
-  regerror("corrupted pointers");
-  return(0);
-}
-
-/*
- - regrepeat - repeatedly match something simple, report how many
- */
-static int regrepeat(p)
-char *p;
-{
-  register int count = 0;
-  register char *scan;
-  register char *opnd;
-
-  scan = reginput;
-  opnd = OPERAND(p);
-  switch (OP(p)) {
-      case ANY:
-	count = strlen(scan);
-	scan += count;
-	break;
-      case EXACTLY:
-	while (*opnd == *scan) {
-		count++;
-		scan++;
-	}
-	break;
-      case ANYOF:
-	while (*scan != '\0' && strchr(opnd, *scan) != (char *)NULL) {
-		count++;
-		scan++;
-	}
-	break;
-      case ANYBUT:
-	while (*scan != '\0' && strchr(opnd, *scan) == (char *)NULL) {
-		count++;
-		scan++;
-	}
-	break;
-      default:			/* Oh dear.  Called inappropriately. */
-	regerror("internal foulup");
-	count = 0;		/* Best compromise. */
-	break;
-  }
-  reginput = scan;
-
-  return(count);
-}
-
-/*
- - regnext - dig the "next" pointer out of a node
- */
-static char *regnext(p)
-register char *p;
-{
-  register int offset;
-
-  if (p == &regdummy) return((char *)NULL);
-
-  offset = NEXT(p);
-  if (offset == 0) return((char *)NULL);
-
-  if (OP(p) == BACK)
-	return(p - offset);
-  else
-	return(p + offset);
-}
-
-#ifdef DEBUG
-
-static char *regprop();
-
-/*
- - regdump - dump a regexp onto stdout in vaguely comprehensible form
- */
-void regdump(r)
-regexp *r;
-{
-  register char *s;
-  register char op = EXACTLY;	/* Arbitrary non-END op. */
-  register char *next;
-
-  s = r->program + 1;
-  while (op != END) {		/* While that wasn't END last time... */
-	op = OP(s);
-	printf("%2d%s", (int) (s - r->program), regprop(s));	/* Where, what. */
-	next = regnext(s);
-	if (next == (char *)NULL)	/* Next ptr. */
-		printf("(0)");
-	else
-		printf("(%d)", (int) (s - r->program) + (int) (next - s));
-	s += 3;
-	if (op == ANYOF || op == ANYBUT || op == EXACTLY) {
-		/* Literal string, where present. */
-		while (*s != '\0') {
-			putchar(*s);
-			s++;
-		}
-		s++;
-	}
-	putchar('\n');
-  }
-
-  /* Header fields of interest. */
-  if (r->regstart != '\0') printf("start `%c' ", r->regstart);
-  if (r->reganch) printf("anchored ");
-  if (r->regmust != (char *)NULL) printf("must have \"%s\"", r->regmust);
-  printf("\n");
-}
-
-/*
- - regprop - printable representation of opcode
- */
-static char *regprop(op)
-char *op;
-{
-  register char *p;
-  static char buf[50];
-
-  (void) strcpy(buf, ":");
-
-  switch (OP(op)) {
-      case BOL:	p = "BOL";	  	break;
-      case EOL:	p = "EOL";	  	break;
-      case ANY:	p = "ANY";	  	break;
-      case ANYOF:	p = "ANYOF";	  	break;
-      case ANYBUT:	p = "ANYBUT";	  	break;
-      case BRANCH:	p = "BRANCH";	  	break;
-      case EXACTLY:	p = "EXACTLY";	  	break;
-      case NOTHING:	p = "NOTHING";	  	break;
-      case BACK:	p = "BACK";	  	break;
-      case END:	p = "END";	  	break;
-      case OPEN + 1:
-      case OPEN + 2:
-      case OPEN + 3:
-      case OPEN + 4:
-      case OPEN + 5:
-      case OPEN + 6:
-      case OPEN + 7:
-      case OPEN + 8:
-      case OPEN + 9:
-	sprintf(buf + strlen(buf), "OPEN%d", OP(op) - OPEN);
-	p = (char *)NULL;
-	break;
-      case CLOSE + 1:
-      case CLOSE + 2:
-      case CLOSE + 3:
-      case CLOSE + 4:
-      case CLOSE + 5:
-      case CLOSE + 6:
-      case CLOSE + 7:
-      case CLOSE + 8:
-      case CLOSE + 9:
-	sprintf(buf + strlen(buf), "CLOSE%d", OP(op) - CLOSE);
-	p = (char *)NULL;
-	break;
-      case STAR:	p = "STAR";	  	break;
-      case PLUS:	p = "PLUS";	  	break;
-      default:	regerror("corrupted opcode"); p = (char *) NULL; break;
-  }
-  if (p != (char *)NULL) (void) strcat(buf, p);
-  return(buf);
-}
-
-#endif
-
-/*
- * $PchId: regexp.c,v 1.4 1996/02/22 09:03:07 philip Exp $
- */
Index: trunk/minix/lib/other/v8regsub.c
===================================================================
--- trunk/minix/lib/other/v8regsub.c	(revision 9)
+++ 	(revision )
@@ -1,90 +1,0 @@
-/* regsub
- *
- *	Copyright (c) 1986 by University of Toronto.
- *	Written by Henry Spencer.  Not derived from licensed software.
- *
- *	Permission is granted to anyone to use this software for any
- *	purpose on any computer system, and to redistribute it freely,
- *	subject to the following restrictions:
- *
- *	1. The author is not responsible for the consequences of use of
- *		this software, no matter how awful, even if they arise
- *		from defects in it.
- *
- *	2. The origin of this software must not be misrepresented, either
- *		by explicit claim or by omission.
- *
- *	3. Altered versions must be plainly marked as such, and must not
- *		be misrepresented as being the original software.
- */
-
-#include <string.h>
-#include <stdio.h>
-#define const		/* avoid "const poisoning" */
-#include <regexp.h>
-#undef const
-
-/* The first byte of the regexp internal "program" is actually this magic
- * number; the start node begins in the second byte.
- */
-#define	MAGIC	0234
-
-#define CHARBITS 0377
-#ifndef CHARBITS
-#define	UCHARAT(p)	((int)*(unsigned char *)(p))
-#else
-#define	UCHARAT(p)	((int)*(p)&CHARBITS)
-#endif
-
-/*
- - regsub - perform substitutions after a regexp match
- */
-void regsub(prog, source, dest)
-regexp *prog;
-char *source;
-char *dest;
-{
-  register char *src;
-  register char *dst;
-  register char c;
-  register int no;
-  register int len;
-
-  if (prog == (regexp *)NULL || source == (char *)NULL || dest == (char *)NULL) {
-	regerror("NULL parm to regsub");
-	return;
-  }
-  if (UCHARAT(prog->program) != MAGIC) {
-	regerror("damaged regexp fed to regsub");
-	return;
-  }
-  src = source;
-  dst = dest;
-  while ((c = *src++) != '\0') {
-	if (c == '&')
-		no = 0;
-	else if (c == '\\' && '0' <= *src && *src <= '9')
-		no = *src++ - '0';
-	else
-		no = -1;
-
-	if (no < 0) {		/* Ordinary character. */
-		if (c == '\\' && (*src == '\\' || *src == '&')) c = *src++;
-		*dst++ = c;
-	} else
-	if (prog->startp[no] != (char *)NULL && prog->endp[no] != (char *)NULL) {
-		len = (int) (prog->endp[no] - prog->startp[no]);
-		strncpy(dst, prog->startp[no], len);
-		dst += len;
-		if (len != 0 && *(dst - 1) == '\0') {	/* strncpy hit NUL. */
-			regerror("damaged match string");
-			return;
-		}
-	}
-  }
-  *dst++ = '\0';
-}
-
-/*
- * $PchId: regsub.c,v 1.3 1995/11/27 20:18:16 philip Exp $
- */
Index: trunk/minix/lib/other/writev.c
===================================================================
--- trunk/minix/lib/other/writev.c	(revision 9)
+++ 	(revision )
@@ -1,39 +1,0 @@
-#include <errno.h>
-#include <stdio.h>
-#include <sys/uio.h>
-
-ssize_t writev(int fildes, const struct iovec *iov, int iovcnt)
-{
-#if DEBUG
-	fprintf(stderr, "bind: not implemented for fd %d\n", socket);
-#endif
-	errno= ENOSYS;
-	return -1;
-
-#if 0
-	int i, r;
-	char *p;
-	ssize_t l, sum;
-
-	/* We should buffer */
-	sum= 0;
-	for (i= 0; i<iovcnt; i++)
-	{
-		p= iov[i].iov_base;
-		l= iov[i].iov_len;
-		while (l > 0)
-		{
-			r= write(fildes, p, l);
-			if (r <= 0)
-			{
-				assert(sum == 0);
-				return r;
-			}
-			p += r;
-			l -= r;
-			sum += r;
-		}
-	}
-	return sum;
-#endif
-}
