diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..5d91537 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,30 @@ +*.o +*.a + +choose +chpst +compile +direntry.h +hasflock.h +hasmkffo.h +hassgact.h +hassgprm.h +hasshsgr.h +haswaitp.h +iopause.h +load +makelib +reboot_system.h +runit +runit-init +runsv +runsvchdir +runsvdir +select.h +socket.lib +sv +svlogd +sysdeps +uint64.h +utmpset +uw_tmp.h diff --git a/src/Makefile b/src/Makefile index d9624de..2d1bf4a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -170,12 +170,6 @@ byte_diff.o: byte.h byte_diff.c compile byte_rchr.o: byte.h byte_rchr.c compile ./compile byte_rchr.c -chkshsgr: chkshsgr.o load - ./load chkshsgr - -chkshsgr.o: chkshsgr.c compile - ./compile chkshsgr.c - choose: choose.sh warn-auto.sh rm -f choose cat warn-auto.sh choose.sh \ @@ -185,7 +179,7 @@ choose: choose.sh warn-auto.sh coe.o: coe.c coe.h compile ./compile coe.c -compile: conf-cc print-cc.sh systype warn-auto.sh +compile: conf-cc print-cc.sh warn-auto.sh rm -f compile sh print-cc.sh > compile chmod 555 compile @@ -232,9 +226,7 @@ hassgact.h: choose compile hassgact.h1 hassgact.h2 load trysgact.c hassgprm.h: choose compile hassgprm.h1 hassgprm.h2 load trysgprm.c ./choose cl trysgprm hassgprm.h1 hassgprm.h2 > hassgprm.h -hasshsgr.h: chkshsgr choose compile hasshsgr.h1 hasshsgr.h2 load \ -tryshsgr.c warn-shsgr - ./chkshsgr || ( cat warn-shsgr; exit 1 ) +hasshsgr.h: choose compile hasshsgr.h1 hasshsgr.h2 load tryshsgr.c ./choose clr tryshsgr hasshsgr.h1 hasshsgr.h2 > hasshsgr.h haswaitp.h: choose compile haswaitp.h1 haswaitp.h2 load trywaitp.c @@ -246,7 +238,7 @@ iopause.h: choose compile iopause.h1 iopause.h2 load trypoll.c iopause.o: compile iopause.c iopause.h select.h tai.h taia.h uint64.h ./compile iopause.c -load: conf-ld print-ld.sh systype warn-auto.sh +load: conf-ld print-ld.sh warn-auto.sh rm -f load sh print-ld.sh > load chmod 555 load @@ -257,7 +249,7 @@ lock_ex.o: compile hasflock.h lock.h lock_ex.c lock_exnb.o: compile hasflock.h lock.h lock_exnb.c ./compile lock_exnb.c -makelib: print-ar.sh systype warn-auto.sh +makelib: print-ar.sh warn-auto.sh rm -f makelib sh print-ar.sh > makelib chmod 555 makelib @@ -372,10 +364,10 @@ subgetopt.o: compile subgetopt.c subgetopt.h ./compile subgetopt.c sysdeps: compile direntry.h hasflock.h hasmkffo.h hassgact.h \ -hassgprm.h hasshsgr.h haswaitp.h iopause.h load select.h systype \ +hassgprm.h hasshsgr.h haswaitp.h iopause.h load select.h \ uint64.h reboot_system.h uw_tmp.h socket.lib rm -f sysdeps - cat systype compile load socket.lib >>sysdeps + cat compile load socket.lib >>sysdeps grep sysdep direntry.h >>sysdeps grep sysdep haswaitp.h >>sysdeps grep sysdep hassgact.h >>sysdeps @@ -390,9 +382,6 @@ uint64.h reboot_system.h uw_tmp.h socket.lib grep sysdep uw_tmp.h >>sysdeps cat sysdeps -systype: find-systype.sh trycpp.c x86cpuid.c - sh find-systype.sh > systype - tai_now.o: compile tai.h tai_now.c uint64.h ./compile tai_now.c diff --git a/src/chkshsgr.c b/src/chkshsgr.c deleted file mode 100644 index 31eda67..0000000 --- a/src/chkshsgr.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Public domain. */ - -#include -#include - -int main() -{ - gid_t x[4]; - - x[0] = x[1] = 0; - if (getgroups(1,x) == 0) if (setgroups(1,x) == -1) _exit(1); - _exit(0); -} diff --git a/src/find-systype.sh b/src/find-systype.sh deleted file mode 100644 index 9f6e565..0000000 --- a/src/find-systype.sh +++ /dev/null @@ -1,143 +0,0 @@ -# oper-:arch-:syst-:chip-:kern- -# oper = operating system type; e.g., sunos-4.1.4 -# arch = machine language; e.g., sparc -# syst = which binaries can run; e.g., sun4 -# chip = chip model; e.g., micro-2-80 -# kern = kernel version; e.g., sun4m -# dependence: arch --- chip -# \ \ -# oper --- syst --- kern -# so, for example, syst is interpreted in light of oper, but chip is not. -# anyway, no slashes, no extra colons, no uppercase letters. -# the point of the extra -'s is to ease parsing: can add hierarchies later. -# e.g., *:i386-*:*:pentium-*:* would handle pentium-100 as well as pentium, -# and i386-486 (486s do have more instructions, you know) as well as i386. -# the idea here is to include ALL useful available information. - -exec 2>/dev/null - -sys="`uname -s | tr '/:[A-Z]' '..[a-z]'`" -if [ x"$sys" != x ] -then - unamer="`uname -r | tr /: ..`" - unamem="`uname -m | tr /: ..`" - unamev="`uname -v | tr /: ..`" - - case "$sys" in - bsd.os|freebsd|netbsd|openbsd) - # in bsd 4.4, uname -v does not have useful info. - # in bsd 4.4, uname -m is arch, not chip. - oper="$sys-$unamer" - arch="$unamem" - syst="" - chip="`sysctl -n hw.model`" # hopefully - kern="" - ;; - linux) - # as in bsd 4.4, uname -v does not have useful info. - oper="$sys-$unamer" - syst="" - chip="$unamem" - kern="" - case "$chip" in - i386|i486|i586|i686) - arch="i386" - ;; - alpha) - arch="alpha" - ;; - esac - ;; - aix) - # naturally IBM has to get uname -r and uname -v backwards. dorks. - oper="$sys-$unamev-$unamer" - arch="`arch | tr /: ..`" - syst="" - chip="$unamem" - kern="" - ;; - sunos) - oper="$sys-$unamer-$unamev" - arch="`(uname -p || mach) | tr /: ..`" - syst="`arch | tr /: ..`" - chip="$unamem" # this is wrong; is there any way to get the real info? - kern="`arch -k | tr /: ..`" - ;; - unix_sv) - oper="$sys-$unamer-$unamev" - arch="`uname -m`" - syst="" - chip="$unamem" - kern="" - ;; - *) - oper="$sys-$unamer-$unamev" - arch="`arch | tr /: ..`" - syst="" - chip="$unamem" - kern="" - ;; - esac -else - gcc -c trycpp.c - gcc -o trycpp trycpp.o - case `./trycpp` in - nextstep) - oper="nextstep-`hostinfo | sed -n 's/^[ ]*NeXT Mach \([^:]*\):.*$/\1/p'`" - arch="`hostinfo | sed -n 's/^Processor type: \(.*\) (.*)$/\1/p' | tr /: ..`" - syst="" - chip="`hostinfo | sed -n 's/^Processor type: .* (\(.*\))$/\1/p' | tr ' /:' '...'`" - kern="" - ;; - *) - oper="unknown" - arch="" - syst="" - chip="" - kern="" - ;; - esac - rm -f trycpp.o trycpp -fi - -case "$chip" in -80486) - # let's try to be consistent here. (BSD/OS) - chip=i486 - ;; -i486DX) - # respect the hyphen hierarchy. (FreeBSD) - chip=i486-dx - ;; -i486.DX2) - # respect the hyphen hierarchy. (FreeBSD) - chip=i486-dx2 - ;; -Intel.586) - # no, you nitwits, there is no such chip. (NeXTStep) - chip=pentium - ;; -i586) - # no, you nitwits, there is no such chip. (Linux) - chip=pentium - ;; -i686) - # STOP SAYING THAT! (Linux) - chip=ppro -esac - -if gcc -c x86cpuid.c -then - if gcc -o x86cpuid x86cpuid.o - then - x86cpuid="`./x86cpuid | tr /: ..`" - case "$x86cpuid" in - ?*) - chip="$x86cpuid" - ;; - esac - fi -fi -rm -f x86cpuid x86cpuid.o - -echo "$oper-:$arch-:$syst-:$chip-:$kern-" | tr ' [A-Z]' '.[a-z]' diff --git a/src/warn-shsgr b/src/warn-shsgr deleted file mode 100644 index 37c351e..0000000 --- a/src/warn-shsgr +++ /dev/null @@ -1,3 +0,0 @@ -Oops. Your getgroups() returned 0, and setgroups() failed; this means -that I can't reliably do my shsgr test. Please either ``make'' as root -or ``make'' while you're in one or more supplementary groups. diff --git a/src/x86cpuid.c b/src/x86cpuid.c deleted file mode 100644 index f81c593..0000000 --- a/src/x86cpuid.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Public domain. */ - -#include - -void nope() -{ - exit(1); -} - -int main() -{ - unsigned long x[4]; - unsigned long y[4]; - int i; - int j; - char c; - - signal(SIGILL,nope); - - x[0] = 0; - x[1] = 0; - x[2] = 0; - x[3] = 0; - - asm volatile(".byte 15;.byte 162" : "=a"(x[0]),"=b"(x[1]),"=c"(x[3]),"=d"(x[2]) : "0"(0) ); - if (!x[0]) return 0; - asm volatile(".byte 15;.byte 162" : "=a"(y[0]),"=b"(y[1]),"=c"(y[2]),"=d"(y[3]) : "0"(1) ); - - for (i = 1;i < 4;++i) - for (j = 0;j < 4;++j) { - c = x[i] >> (8 * j); - if (c < 32) c = 32; - if (c > 126) c = 126; - putchar(c); - } - - printf("-%08x-%08x\n",y[0],y[3]); - - return 0; -}