From f7a79572c5058e8eddec82149a33fbb11f2923b7 Mon Sep 17 00:00:00 2001 From: Nick Downing Date: Wed, 18 Jan 2017 11:50:55 +1100 Subject: [PATCH] Start again with a better approach to patching and a different order of transformations so we will be able to run cproto earlier, on more-or-less original code --- .gitignore | 1 + lib/libc4.3tahoe/.MAP | 11 + lib/libc4.3tahoe/Makefile | 106 ++ lib/libc4.3tahoe/compat-4.1/.MAP | 16 + lib/libc4.3tahoe/compat-4.1/Makefile | 76 + .../compat-4.1/compat-4.1.tahoe/.MAP | 3 + .../compat-4.1/compat-4.1.tahoe/Makefile | 57 + .../compat-4.1/compat-4.1.tahoe/profiled/.MAP | 0 .../compat-4.1/compat-4.1.tahoe/reset.c | 46 + .../compat-4.1/compat-4.1.vax/.MAP | 4 + .../compat-4.1/compat-4.1.vax/DEFS.h | 17 + .../compat-4.1/compat-4.1.vax/Makefile | 58 + .../compat-4.1/compat-4.1.vax/profiled/.MAP | 0 .../compat-4.1/compat-4.1.vax/reset.c | 50 + lib/libc4.3tahoe/compat-4.1/ftime.c | 38 + lib/libc4.3tahoe/compat-4.1/getpw.c | 49 + lib/libc4.3tahoe/compat-4.1/gtty.c | 22 + lib/libc4.3tahoe/compat-4.1/nice.c | 28 + lib/libc4.3tahoe/compat-4.1/pause.c | 19 + lib/libc4.3tahoe/compat-4.1/profiled/.MAP | 0 lib/libc4.3tahoe/compat-4.1/rand.c | 22 + lib/libc4.3tahoe/compat-4.1/stty.c | 22 + lib/libc4.3tahoe/compat-4.1/tell.c | 20 + lib/libc4.3tahoe/compat-4.1/times.c | 46 + lib/libc4.3tahoe/compat-4.1/utime.c | 25 + lib/libc4.3tahoe/compat-4.1/vlimit.c | 44 + lib/libc4.3tahoe/compat-4.1/vtimes.c | 73 + lib/libc4.3tahoe/compat-4.3/.MAP | 7 + lib/libc4.3tahoe/compat-4.3/Makefile | 62 + lib/libc4.3tahoe/compat-4.3/ecvt.c | 108 ++ lib/libc4.3tahoe/compat-4.3/gcvt.c | 66 + lib/libc4.3tahoe/compat-4.3/profiled/.MAP | 0 lib/libc4.3tahoe/compat-4.3/sibuf.c | 7 + lib/libc4.3tahoe/compat-4.3/sobuf.c | 7 + lib/libc4.3tahoe/compat-4.3/strout.c | 27 + lib/libc4.3tahoe/compat-sys5/.MAP | 20 + lib/libc4.3tahoe/compat-sys5/Makefile | 109 ++ .../compat-sys5/compat-sys5.tahoe/.MAP | 1 + .../compat-sys5/compat-sys5.tahoe/Makefile | 54 + .../compat-sys5/compat-sys5.vax/.MAP | 4 + .../compat-sys5/compat-sys5.vax/Makefile | 59 + .../compat-sys5/compat-sys5.vax/profiled/.MAP | 0 .../compat-sys5/compat-sys5.vax/strchr.s | 87 ++ .../compat-sys5/compat-sys5.vax/strrchr.s | 101 ++ lib/libc4.3tahoe/compat-sys5/getopt.c | 84 ++ lib/libc4.3tahoe/compat-sys5/memccpy.c | 31 + lib/libc4.3tahoe/compat-sys5/memchr.c | 31 + lib/libc4.3tahoe/compat-sys5/memcmp.c | 30 + lib/libc4.3tahoe/compat-sys5/memcpy.c | 33 + lib/libc4.3tahoe/compat-sys5/memset.c | 33 + lib/libc4.3tahoe/compat-sys5/profiled/.MAP | 0 lib/libc4.3tahoe/compat-sys5/strcatn.c | 34 + lib/libc4.3tahoe/compat-sys5/strchr.c | 39 + lib/libc4.3tahoe/compat-sys5/strcmpn.c | 24 + lib/libc4.3tahoe/compat-sys5/strcpyn.c | 31 + lib/libc4.3tahoe/compat-sys5/strcspn.c | 38 + lib/libc4.3tahoe/compat-sys5/strpbrk.c | 36 + lib/libc4.3tahoe/compat-sys5/strrchr.c | 41 + lib/libc4.3tahoe/compat-sys5/strspn.c | 38 + lib/libc4.3tahoe/compat-sys5/strtok.c | 57 + lib/libc4.3tahoe/compat-sys5/tmpnam.c | 91 ++ lib/libc4.3tahoe/gen/.MAP | 87 ++ lib/libc4.3tahoe/gen/:errfix | 4 + lib/libc4.3tahoe/gen/Makefile | 258 ++++ lib/libc4.3tahoe/gen/abort.c | 21 + lib/libc4.3tahoe/gen/alarm.c | 30 + lib/libc4.3tahoe/gen/atoi.c | 28 + lib/libc4.3tahoe/gen/atol.c | 29 + lib/libc4.3tahoe/gen/bcmp.c | 26 + lib/libc4.3tahoe/gen/bcopy.c | 45 + lib/libc4.3tahoe/gen/bzero.c | 24 + lib/libc4.3tahoe/gen/calloc.c | 27 + lib/libc4.3tahoe/gen/closedir.c | 36 + lib/libc4.3tahoe/gen/crypt.c | 385 +++++ lib/libc4.3tahoe/gen/ctime.c | 403 +++++ lib/libc4.3tahoe/gen/ctype_.c | 25 + lib/libc4.3tahoe/gen/disklabel.c | 393 +++++ lib/libc4.3tahoe/gen/errlst.c | 94 ++ lib/libc4.3tahoe/gen/execvp.c | 87 ++ lib/libc4.3tahoe/gen/fakcu.c | 11 + lib/libc4.3tahoe/gen/ffs.c | 35 + lib/libc4.3tahoe/gen/fstab.c | 152 ++ lib/libc4.3tahoe/gen/gen.tahoe/.MAP | 28 + lib/libc4.3tahoe/gen/gen.tahoe/Makefile | 105 ++ lib/libc4.3tahoe/gen/gen.tahoe/_setjmp.s | 76 + lib/libc4.3tahoe/gen/gen.tahoe/abort.s | 32 + lib/libc4.3tahoe/gen/gen.tahoe/abs.s | 34 + lib/libc4.3tahoe/gen/gen.tahoe/alloca.s | 37 + lib/libc4.3tahoe/gen/gen.tahoe/atof.s | 336 +++++ lib/libc4.3tahoe/gen/gen.tahoe/bcmp.s | 45 + lib/libc4.3tahoe/gen/gen.tahoe/bcopy.s | 63 + lib/libc4.3tahoe/gen/gen.tahoe/bzero.s | 35 + lib/libc4.3tahoe/gen/gen.tahoe/fabs.s | 33 + lib/libc4.3tahoe/gen/gen.tahoe/ffs.s | 35 + lib/libc4.3tahoe/gen/gen.tahoe/frexp.c | 41 + lib/libc4.3tahoe/gen/gen.tahoe/insque.s | 31 + lib/libc4.3tahoe/gen/gen.tahoe/ldexp.s | 87 ++ lib/libc4.3tahoe/gen/gen.tahoe/modf.s | 72 + lib/libc4.3tahoe/gen/gen.tahoe/nargs.s | 33 + lib/libc4.3tahoe/gen/gen.tahoe/profiled/.MAP | 0 lib/libc4.3tahoe/gen/gen.tahoe/remque.s | 31 + lib/libc4.3tahoe/gen/gen.tahoe/setjmp.s | 88 ++ lib/libc4.3tahoe/gen/gen.tahoe/strcat.s | 41 + lib/libc4.3tahoe/gen/gen.tahoe/strcmp.s | 45 + lib/libc4.3tahoe/gen/gen.tahoe/strcpy.s | 37 + lib/libc4.3tahoe/gen/gen.tahoe/strlen.s | 37 + lib/libc4.3tahoe/gen/gen.tahoe/strncat.s | 57 + lib/libc4.3tahoe/gen/gen.tahoe/strncmp.s | 51 + lib/libc4.3tahoe/gen/gen.tahoe/strncpy.s | 38 + lib/libc4.3tahoe/gen/gen.tahoe/udiv.s | 68 + lib/libc4.3tahoe/gen/gen.tahoe/urem.s | 66 + lib/libc4.3tahoe/gen/gen.vax/.MAP | 29 + lib/libc4.3tahoe/gen/gen.vax/Makefile | 118 ++ lib/libc4.3tahoe/gen/gen.vax/_setjmp.s | 85 ++ lib/libc4.3tahoe/gen/gen.vax/abs.s | 21 + lib/libc4.3tahoe/gen/gen.vax/alloca.s | 22 + lib/libc4.3tahoe/gen/gen.vax/atof.s | 336 +++++ lib/libc4.3tahoe/gen/gen.vax/bcmp.s | 41 + lib/libc4.3tahoe/gen/gen.vax/bcopy.s | 62 + lib/libc4.3tahoe/gen/gen.vax/bzero.s | 37 + lib/libc4.3tahoe/gen/gen.vax/fabs.s | 31 + lib/libc4.3tahoe/gen/gen.vax/ffs.s | 32 + lib/libc4.3tahoe/gen/gen.vax/frexp.s | 33 + lib/libc4.3tahoe/gen/gen.vax/index.s | 83 ++ lib/libc4.3tahoe/gen/gen.vax/insque.s | 28 + lib/libc4.3tahoe/gen/gen.vax/ldexp.s | 67 + lib/libc4.3tahoe/gen/gen.vax/modf.s | 39 + lib/libc4.3tahoe/gen/gen.vax/nargs.s | 17 + lib/libc4.3tahoe/gen/gen.vax/profiled/.MAP | 0 lib/libc4.3tahoe/gen/gen.vax/remque.s | 28 + lib/libc4.3tahoe/gen/gen.vax/rindex.s | 97 ++ lib/libc4.3tahoe/gen/gen.vax/setjmp.s | 75 + lib/libc4.3tahoe/gen/gen.vax/strcat.s | 50 + lib/libc4.3tahoe/gen/gen.vax/strcmp.s | 69 + lib/libc4.3tahoe/gen/gen.vax/strcpy.s | 46 + lib/libc4.3tahoe/gen/gen.vax/strlen.s | 36 + lib/libc4.3tahoe/gen/gen.vax/strncat.s | 67 + lib/libc4.3tahoe/gen/gen.vax/strncmp.s | 73 + lib/libc4.3tahoe/gen/gen.vax/strncpy.s | 68 + lib/libc4.3tahoe/gen/gen.vax/udiv.s | 77 + lib/libc4.3tahoe/gen/gen.vax/urem.s | 75 + lib/libc4.3tahoe/gen/getenv.c | 64 + lib/libc4.3tahoe/gen/getgrent.c | 71 + lib/libc4.3tahoe/gen/getgrgid.c | 18 + lib/libc4.3tahoe/gen/getgrnam.c | 18 + lib/libc4.3tahoe/gen/getlogin.c | 33 + lib/libc4.3tahoe/gen/getpass.c | 44 + lib/libc4.3tahoe/gen/getpwent.c | 96 ++ lib/libc4.3tahoe/gen/getpwnamuid.c | 121 ++ lib/libc4.3tahoe/gen/getttyent.c | 137 ++ lib/libc4.3tahoe/gen/getttynam.c | 26 + lib/libc4.3tahoe/gen/getusershell.c | 109 ++ lib/libc4.3tahoe/gen/getwd.c | 114 ++ lib/libc4.3tahoe/gen/index.c | 35 + lib/libc4.3tahoe/gen/initgroups.c | 50 + lib/libc4.3tahoe/gen/insque.c | 29 + lib/libc4.3tahoe/gen/isatty.c | 18 + lib/libc4.3tahoe/gen/malloc.c | 384 +++++ lib/libc4.3tahoe/gen/mktemp.c | 107 ++ lib/libc4.3tahoe/gen/ndbm.c | 528 +++++++ lib/libc4.3tahoe/gen/nlist.c | 99 ++ lib/libc4.3tahoe/gen/opendir.c | 44 + lib/libc4.3tahoe/gen/perror.c | 41 + lib/libc4.3tahoe/gen/popen.c | 80 + lib/libc4.3tahoe/gen/profiled/.MAP | 0 lib/libc4.3tahoe/gen/psignal.c | 36 + lib/libc4.3tahoe/gen/qsort.c | 218 +++ lib/libc4.3tahoe/gen/random.c | 366 +++++ lib/libc4.3tahoe/gen/readdir.c | 56 + lib/libc4.3tahoe/gen/regex.c | 401 +++++ lib/libc4.3tahoe/gen/regexp/.MAP | 11 + lib/libc4.3tahoe/gen/regexp/Makefile | 63 + lib/libc4.3tahoe/gen/regexp/README | 84 ++ lib/libc4.3tahoe/gen/regexp/regerror.c | 17 + lib/libc4.3tahoe/gen/regexp/regexp.3 | 179 +++ lib/libc4.3tahoe/gen/regexp/regexp.c | 1317 +++++++++++++++++ lib/libc4.3tahoe/gen/regexp/regexp.h | 21 + lib/libc4.3tahoe/gen/regexp/regmagic.h | 5 + lib/libc4.3tahoe/gen/regexp/regsub.c | 80 + lib/libc4.3tahoe/gen/regexp/tests | 121 ++ lib/libc4.3tahoe/gen/regexp/timer.c | 182 +++ lib/libc4.3tahoe/gen/regexp/try.c | 238 +++ lib/libc4.3tahoe/gen/remque.c | 27 + lib/libc4.3tahoe/gen/rindex.c | 37 + lib/libc4.3tahoe/gen/scandir.c | 102 ++ lib/libc4.3tahoe/gen/seekdir.c | 50 + lib/libc4.3tahoe/gen/setegid.c | 16 + lib/libc4.3tahoe/gen/setenv.c | 99 ++ lib/libc4.3tahoe/gen/seteuid.c | 16 + lib/libc4.3tahoe/gen/setgid.c | 19 + lib/libc4.3tahoe/gen/setjmperr.c | 33 + lib/libc4.3tahoe/gen/setrgid.c | 16 + lib/libc4.3tahoe/gen/setruid.c | 16 + lib/libc4.3tahoe/gen/setuid.c | 19 + lib/libc4.3tahoe/gen/siginterrupt.c | 30 + lib/libc4.3tahoe/gen/siglist.c | 46 + lib/libc4.3tahoe/gen/signal.c | 36 + lib/libc4.3tahoe/gen/sleep.c | 67 + lib/libc4.3tahoe/gen/strcasecmp.c | 89 ++ lib/libc4.3tahoe/gen/strcat.c | 23 + lib/libc4.3tahoe/gen/strcmp.c | 17 + lib/libc4.3tahoe/gen/strcpy.c | 20 + lib/libc4.3tahoe/gen/strlen.c | 19 + lib/libc4.3tahoe/gen/strncat.c | 28 + lib/libc4.3tahoe/gen/strncmp.c | 18 + lib/libc4.3tahoe/gen/strncpy.c | 25 + lib/libc4.3tahoe/gen/swab.c | 43 + lib/libc4.3tahoe/gen/syslog.c | 213 +++ lib/libc4.3tahoe/gen/system.c | 26 + lib/libc4.3tahoe/gen/telldir.c | 35 + lib/libc4.3tahoe/gen/time.c | 28 + lib/libc4.3tahoe/gen/timezone.c | 115 ++ lib/libc4.3tahoe/gen/ttyname.c | 51 + lib/libc4.3tahoe/gen/ttyslot.c | 48 + lib/libc4.3tahoe/gen/ualarm.c | 37 + lib/libc4.3tahoe/gen/usleep.c | 70 + lib/libc4.3tahoe/gen/valloc.c | 22 + lib/libc4.3tahoe/inet/.MAP | 8 + lib/libc4.3tahoe/inet/Makefile | 67 + lib/libc4.3tahoe/inet/inet_addr.c | 115 ++ lib/libc4.3tahoe/inet/inet_lnaof.c | 42 + lib/libc4.3tahoe/inet/inet_makeaddr.c | 43 + lib/libc4.3tahoe/inet/inet_netof.c | 41 + lib/libc4.3tahoe/inet/inet_network.c | 76 + lib/libc4.3tahoe/inet/inet_ntoa.c | 40 + lib/libc4.3tahoe/inet/profiled/.MAP | 0 lib/libc4.3tahoe/net/.MAP | 26 + lib/libc4.3tahoe/net/Make.resolv | 83 ++ lib/libc4.3tahoe/net/Makefile | 119 ++ lib/libc4.3tahoe/net/getnetbyaddr.c | 40 + lib/libc4.3tahoe/net/getnetbyname.c | 45 + lib/libc4.3tahoe/net/getnetent.c | 119 ++ lib/libc4.3tahoe/net/getproto.c | 39 + lib/libc4.3tahoe/net/getprotoent.c | 118 ++ lib/libc4.3tahoe/net/getprotoname.c | 45 + lib/libc4.3tahoe/net/getservbyname.c | 48 + lib/libc4.3tahoe/net/getservbyport.c | 43 + lib/libc4.3tahoe/net/getservent.c | 121 ++ lib/libc4.3tahoe/net/herror.c | 60 + lib/libc4.3tahoe/net/hosttable/.MAP | 4 + lib/libc4.3tahoe/net/hosttable/Makefile | 62 + lib/libc4.3tahoe/net/hosttable/gethostent.c | 143 ++ .../net/hosttable/gethostnamadr.c | 156 ++ lib/libc4.3tahoe/net/hosttable/profiled/.MAP | 0 lib/libc4.3tahoe/net/named/.MAP | 4 + lib/libc4.3tahoe/net/named/Makefile | 66 + lib/libc4.3tahoe/net/named/gethostnamadr.c | 406 +++++ lib/libc4.3tahoe/net/named/profiled/.MAP | 0 lib/libc4.3tahoe/net/named/sethostent.c | 45 + lib/libc4.3tahoe/net/net.tahoe/.MAP | 6 + lib/libc4.3tahoe/net/net.tahoe/Makefile | 61 + lib/libc4.3tahoe/net/net.tahoe/htonl.s | 28 + lib/libc4.3tahoe/net/net.tahoe/htons.s | 28 + lib/libc4.3tahoe/net/net.tahoe/ntohl.s | 28 + lib/libc4.3tahoe/net/net.tahoe/ntohs.s | 28 + lib/libc4.3tahoe/net/net.tahoe/profiled/.MAP | 0 lib/libc4.3tahoe/net/net.vax/.MAP | 6 + lib/libc4.3tahoe/net/net.vax/Makefile | 60 + lib/libc4.3tahoe/net/net.vax/htonl.s | 30 + lib/libc4.3tahoe/net/net.vax/htons.s | 30 + lib/libc4.3tahoe/net/net.vax/ntohl.s | 30 + lib/libc4.3tahoe/net/net.vax/ntohs.s | 30 + lib/libc4.3tahoe/net/net.vax/profiled/.MAP | 0 lib/libc4.3tahoe/net/profiled/.MAP | 0 lib/libc4.3tahoe/net/rcmd.c | 313 ++++ lib/libc4.3tahoe/net/res_comp.c | 314 ++++ lib/libc4.3tahoe/net/res_debug.c | 488 ++++++ lib/libc4.3tahoe/net/res_init.c | 143 ++ lib/libc4.3tahoe/net/res_mkquery.c | 200 +++ lib/libc4.3tahoe/net/res_query.c | 251 ++++ lib/libc4.3tahoe/net/res_send.c | 371 +++++ lib/libc4.3tahoe/net/rexec.c | 130 ++ lib/libc4.3tahoe/net/ruserpass.c | 819 ++++++++++ lib/libc4.3tahoe/ns/.MAP | 4 + lib/libc4.3tahoe/ns/Makefile | 58 + lib/libc4.3tahoe/ns/ns_addr.c | 194 +++ lib/libc4.3tahoe/ns/ns_ntoa.c | 73 + lib/libc4.3tahoe/ns/profiled/.MAP | 0 lib/libc4.3tahoe/stdio/.MAP | 41 + lib/libc4.3tahoe/stdio/Makefile | 145 ++ lib/libc4.3tahoe/stdio/clrerr.c | 12 + lib/libc4.3tahoe/stdio/doprnt.c | 665 +++++++++ lib/libc4.3tahoe/stdio/doscan.c | 293 ++++ lib/libc4.3tahoe/stdio/exit.c | 11 + lib/libc4.3tahoe/stdio/fdopen.c | 62 + lib/libc4.3tahoe/stdio/fgetc.c | 11 + lib/libc4.3tahoe/stdio/fgets.c | 25 + lib/libc4.3tahoe/stdio/filbuf.c | 70 + lib/libc4.3tahoe/stdio/findiop.c | 129 ++ lib/libc4.3tahoe/stdio/flsbuf.c | 121 ++ lib/libc4.3tahoe/stdio/fopen.c | 62 + lib/libc4.3tahoe/stdio/fprintf.c | 45 + lib/libc4.3tahoe/stdio/fputc.c | 11 + lib/libc4.3tahoe/stdio/fputs.c | 41 + lib/libc4.3tahoe/stdio/fread.4.2 | 23 + lib/libc4.3tahoe/stdio/fread.c | 46 + lib/libc4.3tahoe/stdio/freopen.c | 59 + lib/libc4.3tahoe/stdio/fseek.c | 64 + lib/libc4.3tahoe/stdio/ftell.c | 35 + lib/libc4.3tahoe/stdio/fwrite.4.2 | 20 + lib/libc4.3tahoe/stdio/fwrite.c | 49 + lib/libc4.3tahoe/stdio/getchar.c | 15 + lib/libc4.3tahoe/stdio/gets.c | 21 + lib/libc4.3tahoe/stdio/getw.c | 20 + lib/libc4.3tahoe/stdio/printf.c | 32 + lib/libc4.3tahoe/stdio/profiled/.MAP | 0 lib/libc4.3tahoe/stdio/putchar.c | 16 + lib/libc4.3tahoe/stdio/puts.c | 15 + lib/libc4.3tahoe/stdio/putw.c | 17 + lib/libc4.3tahoe/stdio/rew.c | 38 + lib/libc4.3tahoe/stdio/scanf.c | 33 + lib/libc4.3tahoe/stdio/setbuf.c | 28 + lib/libc4.3tahoe/stdio/setbuffer.c | 47 + lib/libc4.3tahoe/stdio/sprintf.c | 37 + lib/libc4.3tahoe/stdio/stdio.tahoe/.MAP | 1 + lib/libc4.3tahoe/stdio/stdio.tahoe/Makefile | 54 + lib/libc4.3tahoe/stdio/stdio.vax/.MAP | 6 + lib/libc4.3tahoe/stdio/stdio.vax/Makefile | 54 + lib/libc4.3tahoe/stdio/stdio.vax/fgets.s | 138 ++ lib/libc4.3tahoe/stdio/stdio.vax/fputs.s | 151 ++ lib/libc4.3tahoe/stdio/stdio.vax/gets.s | 120 ++ .../stdio/stdio.vax/profiled/.MAP | 0 lib/libc4.3tahoe/stdio/stdio.vax/puts.s | 148 ++ lib/libc4.3tahoe/stdio/ungetc.c | 24 + lib/libc4.3tahoe/stdio/vfprintf.c | 47 + lib/libc4.3tahoe/stdio/vprintf.c | 34 + lib/libc4.3tahoe/stdio/vsprintf.c | 39 + lib/libc4.3tahoe/tahoe/.MAP | 5 + lib/libc4.3tahoe/tahoe/DEFS.h | 42 + lib/libc4.3tahoe/tahoe/Makefile | 42 + lib/libc4.3tahoe/tahoe/csu/.MAP | 9 + lib/libc4.3tahoe/tahoe/csu/Makefile | 70 + lib/libc4.3tahoe/tahoe/csu/crt0.s | 39 + lib/libc4.3tahoe/tahoe/csu/gcrt0.h | 24 + lib/libc4.3tahoe/tahoe/csu/gmon.c | 285 ++++ lib/libc4.3tahoe/tahoe/csu/gmon.ex | 1 + lib/libc4.3tahoe/tahoe/csu/gmon.h | 72 + lib/libc4.3tahoe/tahoe/csu/mcrt0.s | 59 + lib/libc4.3tahoe/tahoe/csu/mon.c | 157 ++ lib/libc4.3tahoe/tahoe/csu/mon.ex | 7 + lib/libc4.3tahoe/tahoe/fpe/.MAP | 25 + lib/libc4.3tahoe/tahoe/fpe/Makefile | 81 + lib/libc4.3tahoe/tahoe/fpe/addd.s | 162 ++ lib/libc4.3tahoe/tahoe/fpe/addf.s | 135 ++ lib/libc4.3tahoe/tahoe/fpe/cmpd.s | 47 + lib/libc4.3tahoe/tahoe/fpe/cmpf.s | 34 + lib/libc4.3tahoe/tahoe/fpe/cvtdl.s | 64 + lib/libc4.3tahoe/tahoe/fpe/cvtfl.s | 63 + lib/libc4.3tahoe/tahoe/fpe/cvtld.s | 67 + lib/libc4.3tahoe/tahoe/fpe/cvtlf.s | 65 + lib/libc4.3tahoe/tahoe/fpe/cvtud.s | 52 + lib/libc4.3tahoe/tahoe/fpe/cvtuf.s | 51 + lib/libc4.3tahoe/tahoe/fpe/divd.s | 95 ++ lib/libc4.3tahoe/tahoe/fpe/divf.s | 78 + lib/libc4.3tahoe/tahoe/fpe/fnorm.s | 58 + lib/libc4.3tahoe/tahoe/fpe/fp_exp.s | 37 + lib/libc4.3tahoe/tahoe/fpe/modf.s | 136 ++ lib/libc4.3tahoe/tahoe/fpe/muld.s | 116 ++ lib/libc4.3tahoe/tahoe/fpe/mulf.s | 98 ++ lib/libc4.3tahoe/tahoe/fpe/negd.s | 25 + lib/libc4.3tahoe/tahoe/fpe/negf.s | 24 + lib/libc4.3tahoe/tahoe/fpe/profiled/.MAP | 0 lib/libc4.3tahoe/tahoe/fpe/sfnorm.s | 48 + lib/libc4.3tahoe/tahoe/fpe/sfp_exp.s | 37 + lib/libc4.3tahoe/tahoe/fpe/subd.s | 17 + lib/libc4.3tahoe/tahoe/fpe/subf.s | 17 + lib/libc4.3tahoe/tahoe/sys/.MAP | 121 ++ lib/libc4.3tahoe/tahoe/sys/Makefile | 207 +++ lib/libc4.3tahoe/tahoe/sys/Ovadvise.s | 27 + lib/libc4.3tahoe/tahoe/sys/Ovfork.s | 59 + lib/libc4.3tahoe/tahoe/sys/SYS.h | 32 + lib/libc4.3tahoe/tahoe/sys/_exit.s | 26 + lib/libc4.3tahoe/tahoe/sys/accept.s | 25 + lib/libc4.3tahoe/tahoe/sys/access.s | 25 + lib/libc4.3tahoe/tahoe/sys/acct.s | 25 + lib/libc4.3tahoe/tahoe/sys/adjtime.s | 25 + lib/libc4.3tahoe/tahoe/sys/bind.s | 25 + lib/libc4.3tahoe/tahoe/sys/brk.s | 40 + lib/libc4.3tahoe/tahoe/sys/cerror.s | 28 + lib/libc4.3tahoe/tahoe/sys/chdir.s | 25 + lib/libc4.3tahoe/tahoe/sys/chmod.s | 25 + lib/libc4.3tahoe/tahoe/sys/chown.s | 25 + lib/libc4.3tahoe/tahoe/sys/chroot.s | 25 + lib/libc4.3tahoe/tahoe/sys/close.s | 25 + lib/libc4.3tahoe/tahoe/sys/connect.s | 25 + lib/libc4.3tahoe/tahoe/sys/creat.s | 25 + lib/libc4.3tahoe/tahoe/sys/dup.s | 25 + lib/libc4.3tahoe/tahoe/sys/dup2.s | 25 + lib/libc4.3tahoe/tahoe/sys/execl.s | 28 + lib/libc4.3tahoe/tahoe/sys/execle.s | 32 + lib/libc4.3tahoe/tahoe/sys/exect.s | 28 + lib/libc4.3tahoe/tahoe/sys/execv.s | 30 + lib/libc4.3tahoe/tahoe/sys/execve.s | 25 + lib/libc4.3tahoe/tahoe/sys/fchmod.s | 25 + lib/libc4.3tahoe/tahoe/sys/fchown.s | 25 + lib/libc4.3tahoe/tahoe/sys/fcntl.s | 25 + lib/libc4.3tahoe/tahoe/sys/flock.s | 25 + lib/libc4.3tahoe/tahoe/sys/fork.s | 29 + lib/libc4.3tahoe/tahoe/sys/fstat.s | 25 + lib/libc4.3tahoe/tahoe/sys/fsync.s | 25 + lib/libc4.3tahoe/tahoe/sys/ftruncate.s | 25 + lib/libc4.3tahoe/tahoe/sys/getdtablesize.s | 25 + lib/libc4.3tahoe/tahoe/sys/getegid.s | 26 + lib/libc4.3tahoe/tahoe/sys/geteuid.s | 26 + lib/libc4.3tahoe/tahoe/sys/getgid.s | 25 + lib/libc4.3tahoe/tahoe/sys/getgroups.s | 25 + lib/libc4.3tahoe/tahoe/sys/gethostid.s | 25 + lib/libc4.3tahoe/tahoe/sys/gethostname.s | 25 + lib/libc4.3tahoe/tahoe/sys/getitimer.s | 25 + lib/libc4.3tahoe/tahoe/sys/getpagesize.s | 25 + lib/libc4.3tahoe/tahoe/sys/getpeername.s | 25 + lib/libc4.3tahoe/tahoe/sys/getpgrp.s | 25 + lib/libc4.3tahoe/tahoe/sys/getpid.s | 25 + lib/libc4.3tahoe/tahoe/sys/getppid.s | 26 + lib/libc4.3tahoe/tahoe/sys/getpriority.s | 25 + lib/libc4.3tahoe/tahoe/sys/getrlimit.s | 25 + lib/libc4.3tahoe/tahoe/sys/getrusage.s | 25 + lib/libc4.3tahoe/tahoe/sys/getsockname.s | 25 + lib/libc4.3tahoe/tahoe/sys/getsockopt.s | 25 + lib/libc4.3tahoe/tahoe/sys/gettimeofday.s | 25 + lib/libc4.3tahoe/tahoe/sys/getuid.s | 25 + lib/libc4.3tahoe/tahoe/sys/ioctl.s | 25 + lib/libc4.3tahoe/tahoe/sys/kill.s | 25 + lib/libc4.3tahoe/tahoe/sys/killpg.s | 25 + lib/libc4.3tahoe/tahoe/sys/link.s | 25 + lib/libc4.3tahoe/tahoe/sys/listen.s | 25 + lib/libc4.3tahoe/tahoe/sys/lseek.s | 25 + lib/libc4.3tahoe/tahoe/sys/lstat.s | 25 + lib/libc4.3tahoe/tahoe/sys/mkdir.s | 25 + lib/libc4.3tahoe/tahoe/sys/mknod.s | 25 + lib/libc4.3tahoe/tahoe/sys/mmap.s | 25 + lib/libc4.3tahoe/tahoe/sys/mount.s | 26 + lib/libc4.3tahoe/tahoe/sys/open.s | 25 + lib/libc4.3tahoe/tahoe/sys/pipe.s | 29 + lib/libc4.3tahoe/tahoe/sys/profil.s | 25 + lib/libc4.3tahoe/tahoe/sys/profiled/.MAP | 0 lib/libc4.3tahoe/tahoe/sys/ptrace.s | 30 + lib/libc4.3tahoe/tahoe/sys/quota.s | 25 + lib/libc4.3tahoe/tahoe/sys/read.s | 25 + lib/libc4.3tahoe/tahoe/sys/readlink.s | 25 + lib/libc4.3tahoe/tahoe/sys/readv.s | 25 + lib/libc4.3tahoe/tahoe/sys/reboot.s | 25 + lib/libc4.3tahoe/tahoe/sys/recv.s | 25 + lib/libc4.3tahoe/tahoe/sys/recvfrom.s | 25 + lib/libc4.3tahoe/tahoe/sys/recvmsg.s | 25 + lib/libc4.3tahoe/tahoe/sys/rename.s | 25 + lib/libc4.3tahoe/tahoe/sys/rmdir.s | 25 + lib/libc4.3tahoe/tahoe/sys/sbrk.s | 48 + lib/libc4.3tahoe/tahoe/sys/select.s | 25 + lib/libc4.3tahoe/tahoe/sys/send.s | 25 + lib/libc4.3tahoe/tahoe/sys/sendmsg.s | 25 + lib/libc4.3tahoe/tahoe/sys/sendto.s | 25 + lib/libc4.3tahoe/tahoe/sys/setgroups.s | 25 + lib/libc4.3tahoe/tahoe/sys/sethostid.s | 25 + lib/libc4.3tahoe/tahoe/sys/sethostname.s | 25 + lib/libc4.3tahoe/tahoe/sys/setitimer.s | 25 + lib/libc4.3tahoe/tahoe/sys/setpgrp.s | 25 + lib/libc4.3tahoe/tahoe/sys/setpriority.s | 25 + lib/libc4.3tahoe/tahoe/sys/setquota.s | 25 + lib/libc4.3tahoe/tahoe/sys/setregid.s | 25 + lib/libc4.3tahoe/tahoe/sys/setreuid.s | 25 + lib/libc4.3tahoe/tahoe/sys/setrlimit.s | 25 + lib/libc4.3tahoe/tahoe/sys/setsockopt.s | 25 + lib/libc4.3tahoe/tahoe/sys/settimeofday.s | 25 + lib/libc4.3tahoe/tahoe/sys/shutdown.s | 25 + lib/libc4.3tahoe/tahoe/sys/sigblock.s | 25 + lib/libc4.3tahoe/tahoe/sys/sigpause.s | 25 + lib/libc4.3tahoe/tahoe/sys/sigreturn.s | 38 + lib/libc4.3tahoe/tahoe/sys/sigsetmask.s | 25 + lib/libc4.3tahoe/tahoe/sys/sigstack.s | 25 + lib/libc4.3tahoe/tahoe/sys/sigvec.s | 25 + lib/libc4.3tahoe/tahoe/sys/socket.s | 25 + lib/libc4.3tahoe/tahoe/sys/socketpair.s | 25 + lib/libc4.3tahoe/tahoe/sys/stat.s | 25 + lib/libc4.3tahoe/tahoe/sys/swapon.s | 25 + lib/libc4.3tahoe/tahoe/sys/symlink.s | 25 + lib/libc4.3tahoe/tahoe/sys/sync.s | 25 + lib/libc4.3tahoe/tahoe/sys/syscall.s | 41 + lib/libc4.3tahoe/tahoe/sys/truncate.s | 25 + lib/libc4.3tahoe/tahoe/sys/umask.s | 25 + lib/libc4.3tahoe/tahoe/sys/umount.s | 25 + lib/libc4.3tahoe/tahoe/sys/unlink.s | 25 + lib/libc4.3tahoe/tahoe/sys/utimes.s | 25 + lib/libc4.3tahoe/tahoe/sys/vhangup.s | 27 + lib/libc4.3tahoe/tahoe/sys/wait.s | 29 + lib/libc4.3tahoe/tahoe/sys/wait3.s | 51 + lib/libc4.3tahoe/tahoe/sys/write.s | 25 + lib/libc4.3tahoe/tahoe/sys/writev.s | 25 + lib/libc4.3tahoe/vax/.MAP | 4 + lib/libc4.3tahoe/vax/DEFS.h | 34 + lib/libc4.3tahoe/vax/Makefile | 38 + lib/libc4.3tahoe/vax/csu/.MAP | 7 + lib/libc4.3tahoe/vax/csu/Makefile | 94 ++ lib/libc4.3tahoe/vax/csu/crt0.c | 115 ++ lib/libc4.3tahoe/vax/csu/gmon.c | 297 ++++ lib/libc4.3tahoe/vax/csu/gmon.ex | 18 + lib/libc4.3tahoe/vax/csu/gmon.h | 78 + lib/libc4.3tahoe/vax/csu/mon.c | 173 +++ lib/libc4.3tahoe/vax/csu/mon.ex | 15 + lib/libc4.3tahoe/vax/sys/.MAP | 121 ++ lib/libc4.3tahoe/vax/sys/Makefile | 206 +++ lib/libc4.3tahoe/vax/sys/Ovadvise.s | 27 + lib/libc4.3tahoe/vax/sys/Ovfork.s | 62 + lib/libc4.3tahoe/vax/sys/SYS.h | 32 + lib/libc4.3tahoe/vax/sys/_exit.s | 26 + lib/libc4.3tahoe/vax/sys/accept.s | 25 + lib/libc4.3tahoe/vax/sys/access.s | 25 + lib/libc4.3tahoe/vax/sys/acct.s | 25 + lib/libc4.3tahoe/vax/sys/adjtime.s | 25 + lib/libc4.3tahoe/vax/sys/bind.s | 25 + lib/libc4.3tahoe/vax/sys/brk.s | 42 + lib/libc4.3tahoe/vax/sys/cerror.s | 28 + lib/libc4.3tahoe/vax/sys/chdir.s | 25 + lib/libc4.3tahoe/vax/sys/chmod.s | 25 + lib/libc4.3tahoe/vax/sys/chown.s | 25 + lib/libc4.3tahoe/vax/sys/chroot.s | 25 + lib/libc4.3tahoe/vax/sys/close.s | 25 + lib/libc4.3tahoe/vax/sys/connect.s | 25 + lib/libc4.3tahoe/vax/sys/creat.s | 25 + lib/libc4.3tahoe/vax/sys/dup.s | 25 + lib/libc4.3tahoe/vax/sys/dup2.s | 25 + lib/libc4.3tahoe/vax/sys/execl.s | 28 + lib/libc4.3tahoe/vax/sys/execle.s | 30 + lib/libc4.3tahoe/vax/sys/exect.s | 28 + lib/libc4.3tahoe/vax/sys/execv.s | 30 + lib/libc4.3tahoe/vax/sys/execve.s | 25 + lib/libc4.3tahoe/vax/sys/fchmod.s | 25 + lib/libc4.3tahoe/vax/sys/fchown.s | 25 + lib/libc4.3tahoe/vax/sys/fcntl.s | 25 + lib/libc4.3tahoe/vax/sys/flock.s | 25 + lib/libc4.3tahoe/vax/sys/fork.s | 28 + lib/libc4.3tahoe/vax/sys/fstat.s | 25 + lib/libc4.3tahoe/vax/sys/fsync.s | 26 + lib/libc4.3tahoe/vax/sys/ftruncate.s | 25 + lib/libc4.3tahoe/vax/sys/getdtablesize.s | 25 + lib/libc4.3tahoe/vax/sys/getegid.s | 26 + lib/libc4.3tahoe/vax/sys/geteuid.s | 26 + lib/libc4.3tahoe/vax/sys/getgid.s | 25 + lib/libc4.3tahoe/vax/sys/getgroups.s | 25 + lib/libc4.3tahoe/vax/sys/gethostid.s | 25 + lib/libc4.3tahoe/vax/sys/gethostname.s | 25 + lib/libc4.3tahoe/vax/sys/getitimer.s | 25 + lib/libc4.3tahoe/vax/sys/getpagesize.s | 25 + lib/libc4.3tahoe/vax/sys/getpeername.s | 25 + lib/libc4.3tahoe/vax/sys/getpgrp.s | 25 + lib/libc4.3tahoe/vax/sys/getpid.s | 25 + lib/libc4.3tahoe/vax/sys/getppid.s | 26 + lib/libc4.3tahoe/vax/sys/getpriority.s | 25 + lib/libc4.3tahoe/vax/sys/getrlimit.s | 25 + lib/libc4.3tahoe/vax/sys/getrusage.s | 25 + lib/libc4.3tahoe/vax/sys/getsockname.s | 25 + lib/libc4.3tahoe/vax/sys/getsockopt.s | 25 + lib/libc4.3tahoe/vax/sys/gettimeofday.s | 25 + lib/libc4.3tahoe/vax/sys/getuid.s | 25 + lib/libc4.3tahoe/vax/sys/ioctl.s | 25 + lib/libc4.3tahoe/vax/sys/kill.s | 25 + lib/libc4.3tahoe/vax/sys/killpg.s | 25 + lib/libc4.3tahoe/vax/sys/link.s | 25 + lib/libc4.3tahoe/vax/sys/listen.s | 25 + lib/libc4.3tahoe/vax/sys/lseek.s | 25 + lib/libc4.3tahoe/vax/sys/lstat.s | 25 + lib/libc4.3tahoe/vax/sys/mkdir.s | 25 + lib/libc4.3tahoe/vax/sys/mknod.s | 25 + lib/libc4.3tahoe/vax/sys/mount.s | 26 + lib/libc4.3tahoe/vax/sys/open.s | 25 + lib/libc4.3tahoe/vax/sys/pipe.s | 29 + lib/libc4.3tahoe/vax/sys/profil.s | 25 + lib/libc4.3tahoe/vax/sys/profiled/.MAP | 0 lib/libc4.3tahoe/vax/sys/ptrace.s | 30 + lib/libc4.3tahoe/vax/sys/quota.s | 25 + lib/libc4.3tahoe/vax/sys/read.s | 25 + lib/libc4.3tahoe/vax/sys/readlink.s | 25 + lib/libc4.3tahoe/vax/sys/readv.s | 26 + lib/libc4.3tahoe/vax/sys/reboot.s | 25 + lib/libc4.3tahoe/vax/sys/recv.s | 25 + lib/libc4.3tahoe/vax/sys/recvfrom.s | 25 + lib/libc4.3tahoe/vax/sys/recvmsg.s | 25 + lib/libc4.3tahoe/vax/sys/rename.s | 25 + lib/libc4.3tahoe/vax/sys/rmdir.s | 25 + lib/libc4.3tahoe/vax/sys/sbrk.s | 46 + lib/libc4.3tahoe/vax/sys/select.s | 25 + lib/libc4.3tahoe/vax/sys/send.s | 25 + lib/libc4.3tahoe/vax/sys/sendmsg.s | 25 + lib/libc4.3tahoe/vax/sys/sendto.s | 25 + lib/libc4.3tahoe/vax/sys/setgroups.s | 25 + lib/libc4.3tahoe/vax/sys/sethostid.s | 25 + lib/libc4.3tahoe/vax/sys/sethostname.s | 25 + lib/libc4.3tahoe/vax/sys/setitimer.s | 25 + lib/libc4.3tahoe/vax/sys/setpgrp.s | 25 + lib/libc4.3tahoe/vax/sys/setpriority.s | 25 + lib/libc4.3tahoe/vax/sys/setquota.s | 25 + lib/libc4.3tahoe/vax/sys/setregid.s | 25 + lib/libc4.3tahoe/vax/sys/setreuid.s | 25 + lib/libc4.3tahoe/vax/sys/setrlimit.s | 25 + lib/libc4.3tahoe/vax/sys/setsockopt.s | 25 + lib/libc4.3tahoe/vax/sys/settimeofday.s | 25 + lib/libc4.3tahoe/vax/sys/shutdown.s | 25 + lib/libc4.3tahoe/vax/sys/sigblock.s | 25 + lib/libc4.3tahoe/vax/sys/signal.s | 39 + lib/libc4.3tahoe/vax/sys/sigpause.s | 25 + lib/libc4.3tahoe/vax/sys/sigreturn.s | 35 + lib/libc4.3tahoe/vax/sys/sigsetmask.s | 25 + lib/libc4.3tahoe/vax/sys/sigstack.s | 25 + lib/libc4.3tahoe/vax/sys/sigvec.s | 25 + lib/libc4.3tahoe/vax/sys/socket.s | 25 + lib/libc4.3tahoe/vax/sys/socketpair.s | 25 + lib/libc4.3tahoe/vax/sys/stat.s | 26 + lib/libc4.3tahoe/vax/sys/swapon.s | 25 + lib/libc4.3tahoe/vax/sys/symlink.s | 25 + lib/libc4.3tahoe/vax/sys/sync.s | 25 + lib/libc4.3tahoe/vax/sys/syscall.s | 31 + lib/libc4.3tahoe/vax/sys/truncate.s | 25 + lib/libc4.3tahoe/vax/sys/umask.s | 25 + lib/libc4.3tahoe/vax/sys/umount.s | 25 + lib/libc4.3tahoe/vax/sys/unlink.s | 25 + lib/libc4.3tahoe/vax/sys/utimes.s | 25 + lib/libc4.3tahoe/vax/sys/vhangup.s | 27 + lib/libc4.3tahoe/vax/sys/wait.s | 29 + lib/libc4.3tahoe/vax/sys/wait3.s | 53 + lib/libc4.3tahoe/vax/sys/write.s | 25 + lib/libc4.3tahoe/vax/sys/writev.s | 25 + lib/libstdc/a.out.h | 11 +- lib/libstdc/ar.h | 6 - lib/libstdc/arpa/ftp.h | 6 - lib/libstdc/arpa/inet.h | 14 +- lib/libstdc/arpa/nameser.h | 11 +- lib/libstdc/arpa/telnet.h | 6 - lib/libstdc/arpa/tftp.h | 6 - lib/libstdc/assert.h | 12 +- lib/libstdc/compat-4.1.h | 33 - lib/libstdc/compat-4.1/ftime.c | 14 +- lib/libstdc/compat-4.1/getpw.c | 11 +- lib/libstdc/compat-4.1/gtty.c | 9 +- lib/libstdc/compat-4.1/nice.c | 12 +- lib/libstdc/compat-4.1/pause.c | 8 +- lib/libstdc/compat-4.1/rand.c | 11 +- lib/libstdc/compat-4.1/stty.c | 9 +- lib/libstdc/compat-4.1/tell.c | 10 +- lib/libstdc/compat-4.1/times.c | 20 +- lib/libstdc/compat-4.1/utime.c | 11 +- lib/libstdc/compat-4.1/vlimit.c | 14 +- lib/libstdc/compat-4.1/vtimes.c | 27 +- lib/libstdc/compat-sys5.h | 21 - lib/libstdc/compat-sys5/getopt.c | 14 +- lib/libstdc/compat-sys5/memccpy.c | 8 +- lib/libstdc/compat-sys5/memchr.c | 8 +- lib/libstdc/compat-sys5/memcmp.c | 7 +- lib/libstdc/compat-sys5/memcpy.c | 8 +- lib/libstdc/compat-sys5/memset.c | 8 +- lib/libstdc/compat-sys5/strcatn.c | 10 +- lib/libstdc/compat-sys5/strchr.c | 9 +- lib/libstdc/compat-sys5/strcmpn.c | 9 +- lib/libstdc/compat-sys5/strcpyn.c | 9 +- lib/libstdc/compat-sys5/strcspn.c | 6 +- lib/libstdc/compat-sys5/strpbrk.c | 7 +- lib/libstdc/compat-sys5/strrchr.c | 9 +- lib/libstdc/compat-sys5/strspn.c | 6 +- lib/libstdc/compat-sys5/strtok.c | 8 +- lib/libstdc/compat-sys5/tmpnam.c | 10 +- lib/libstdc/csu.h | 31 - lib/libstdc/csu/crt0.c | 30 +- lib/libstdc/csu/gmon.c | 42 +- lib/libstdc/csu/mon.c | 25 +- lib/libstdc/ctype.h | 6 - lib/libstdc/disktab.h | 19 +- lib/libstdc/errno.h | 1 + lib/libstdc/fcntl.h | 40 + lib/libstdc/fstab.h | 34 +- lib/libstdc/gen.h | 148 +- lib/libstdc/gen/_setjmp.c | 4 +- lib/libstdc/gen/abort.c | 11 +- lib/libstdc/gen/abs.c | 2 - lib/libstdc/gen/alarm.c | 10 +- lib/libstdc/gen/atof.c | 2 - lib/libstdc/gen/atoi.c | 8 +- lib/libstdc/gen/atol.c | 9 +- lib/libstdc/gen/bcmp.c | 9 +- lib/libstdc/gen/bcopy.c | 9 +- lib/libstdc/gen/bzero.c | 9 +- lib/libstdc/gen/calloc.c | 15 +- lib/libstdc/gen/closedir.c | 15 +- lib/libstdc/gen/crypt.c | 18 +- lib/libstdc/gen/ctime.c | 63 +- lib/libstdc/gen/ctype_.c | 5 +- lib/libstdc/gen/disktab.c | 69 +- lib/libstdc/gen/ecvt.c | 26 +- lib/libstdc/gen/errlst.c | 4 +- lib/libstdc/gen/execvp.c | 27 +- lib/libstdc/gen/fakcu.c | 8 +- lib/libstdc/gen/ffs.c | 8 +- lib/libstdc/gen/frexp.c | 10 +- lib/libstdc/gen/fstab.c | 58 +- lib/libstdc/gen/gcvt.c | 12 +- lib/libstdc/gen/getenv.c | 18 +- lib/libstdc/gen/getgrent.c | 28 +- lib/libstdc/gen/getgrgid.c | 11 +- lib/libstdc/gen/getgrnam.c | 12 +- lib/libstdc/gen/getlogin.c | 11 +- lib/libstdc/gen/getpass.c | 17 +- lib/libstdc/gen/getpwent.c | 34 +- lib/libstdc/gen/getpwnamuid.c | 35 +- lib/libstdc/gen/getttyent.c | 35 +- lib/libstdc/gen/getttynam.c | 12 +- lib/libstdc/gen/getusershell.c | 36 +- lib/libstdc/gen/getwd.c | 28 +- lib/libstdc/gen/index.c | 9 +- lib/libstdc/gen/initgroups.c | 22 +- lib/libstdc/gen/insque.c | 17 +- lib/libstdc/gen/isatty.c | 8 +- lib/libstdc/gen/ldexp.c | 4 +- lib/libstdc/gen/malloc.c | 53 +- lib/libstdc/gen/mkstemp.c | 13 +- lib/libstdc/gen/mktemp.c | 11 +- lib/libstdc/gen/modf.c | 4 +- lib/libstdc/gen/ndbm.c | 140 +- lib/libstdc/gen/nlist.c | 20 +- lib/libstdc/gen/opendir.c | 15 +- lib/libstdc/gen/perror.c | 14 +- lib/libstdc/gen/psignal.c | 12 +- lib/libstdc/gen/qsort.c | 18 +- lib/libstdc/gen/random.c | 29 +- lib/libstdc/gen/readdir.c | 14 +- lib/libstdc/gen/regex.c | 32 +- lib/libstdc/gen/remque.c | 17 +- lib/libstdc/gen/rindex.c | 9 +- lib/libstdc/gen/scandir.c | 23 +- lib/libstdc/gen/seekdir.c | 15 +- lib/libstdc/gen/setegid.c | 8 +- lib/libstdc/gen/seteuid.c | 8 +- lib/libstdc/gen/setgid.c | 8 +- lib/libstdc/gen/setjmp.c | 4 +- lib/libstdc/gen/setjmperr.c | 8 +- lib/libstdc/gen/setrgid.c | 8 +- lib/libstdc/gen/setruid.c | 8 +- lib/libstdc/gen/setuid.c | 8 +- lib/libstdc/gen/siginterrupt.c | 9 +- lib/libstdc/gen/siglist.c | 5 +- lib/libstdc/gen/signal.c | 10 +- lib/libstdc/gen/sleep.c | 18 +- lib/libstdc/gen/strcat.c | 9 +- lib/libstdc/gen/strcmp.c | 8 +- lib/libstdc/gen/strcpy.c | 9 +- lib/libstdc/gen/strlen.c | 8 +- lib/libstdc/gen/strncat.c | 10 +- lib/libstdc/gen/strncmp.c | 9 +- lib/libstdc/gen/strncpy.c | 9 +- lib/libstdc/gen/swab.c | 9 +- lib/libstdc/gen/syslog.c | 47 +- lib/libstdc/gen/system.c | 13 +- lib/libstdc/gen/telldir.c | 14 +- lib/libstdc/gen/time.c | 14 +- lib/libstdc/gen/timezone.c | 9 +- lib/libstdc/gen/ttyname.c | 22 +- lib/libstdc/gen/ttyslot.c | 15 +- lib/libstdc/gen/ualarm.c | 12 +- lib/libstdc/gen/usleep.c | 18 +- lib/libstdc/gen/valloc.c | 12 +- lib/libstdc/grp.h | 30 +- lib/libstdc/include.patch | 63 - lib/libstdc/inet.h | 6 - lib/libstdc/inet/inet_addr.c | 17 +- lib/libstdc/inet/inet_lnaof.c | 13 +- lib/libstdc/inet/inet_makeaddr.c | 14 +- lib/libstdc/inet/inet_netof.c | 13 +- lib/libstdc/inet/inet_network.c | 15 +- lib/libstdc/inet/inet_ntoa.c | 14 +- lib/libstdc/lastlog.h | 7 - lib/libstdc/libstdc.patch | 1031 +++++++++++++ lib/libstdc/machine | 1 - lib/libstdc/math.h | 34 +- lib/libstdc/memory.h | 39 +- lib/libstdc/mp.h | 41 + lib/libstdc/mtab.h | 6 - lib/libstdc/n.sh | 131 +- lib/libstdc/ndbm.h | 40 +- lib/libstdc/net.h | 53 +- lib/libstdc/net/af.h | 7 - lib/libstdc/net/getnetbyaddr.c | 11 +- lib/libstdc/net/getnetbyname.c | 12 +- lib/libstdc/net/getnetent.c | 38 +- lib/libstdc/net/getproto.c | 11 +- lib/libstdc/net/getprotoent.c | 37 +- lib/libstdc/net/getprotoname.c | 12 +- lib/libstdc/net/getservbyname.c | 12 +- lib/libstdc/net/getservbyport.c | 13 +- lib/libstdc/net/getservent.c | 38 +- lib/libstdc/net/hosttable/gethostent.c | 46 +- lib/libstdc/net/hosttable/gethostnamadr.c | 40 +- lib/libstdc/net/htonl.c | 2 - lib/libstdc/net/htons.c | 4 +- lib/libstdc/net/if.h | 21 +- lib/libstdc/net/if_arp.h | 8 - lib/libstdc/net/named/gethostnamadr.c | 83 +- lib/libstdc/net/named/sethostent.c | 23 +- lib/libstdc/net/netisr.h | 7 - lib/libstdc/net/ntohl.c | 2 - lib/libstdc/net/ntohs.c | 4 +- lib/libstdc/net/raw_cb.h | 9 - lib/libstdc/net/rcmd.c | 74 +- lib/libstdc/net/res_comp.c | 52 +- lib/libstdc/net/res_debug.c | 58 +- lib/libstdc/net/res_init.c | 33 +- lib/libstdc/net/res_mkquery.c | 34 +- lib/libstdc/net/res_send.c | 76 +- lib/libstdc/net/rexec.c | 35 +- lib/libstdc/net/route.h | 8 - lib/libstdc/net/ruserpass.c | 143 +- lib/libstdc/netdb.h | 79 +- lib/libstdc/netimp/if_imp.h | 7 - lib/libstdc/netimp/if_imphost.h | 17 +- lib/libstdc/netinet/icmp_var.h | 7 - lib/libstdc/netinet/if_ether.h | 14 +- lib/libstdc/netinet/in.h | 44 +- lib/libstdc/netinet/in_pcb.h | 11 +- lib/libstdc/netinet/in_systm.h | 9 +- lib/libstdc/netinet/in_var.h | 11 +- lib/libstdc/netinet/ip.h | 9 - lib/libstdc/netinet/ip_icmp.h | 10 - lib/libstdc/netinet/ip_var.h | 11 +- lib/libstdc/netinet/tcp.h | 14 +- lib/libstdc/netinet/tcp_debug.h | 10 - lib/libstdc/netinet/tcp_fsm.h | 9 - lib/libstdc/netinet/tcp_seq.h | 7 - lib/libstdc/netinet/tcp_timer.h | 7 - lib/libstdc/netinet/tcp_var.h | 16 +- lib/libstdc/netinet/tcpip.h | 8 - lib/libstdc/netinet/udp.h | 7 - lib/libstdc/netinet/udp_var.h | 9 - lib/libstdc/netns/idp.h | 8 - lib/libstdc/netns/idp_var.h | 6 - lib/libstdc/netns/ns.h | 30 +- lib/libstdc/netns/ns_error.h | 8 - lib/libstdc/netns/ns_if.h | 11 +- lib/libstdc/netns/ns_pcb.h | 11 +- lib/libstdc/netns/sp.h | 7 - lib/libstdc/netns/spidp.h | 8 - lib/libstdc/netns/spp_debug.h | 9 - lib/libstdc/netns/spp_var.h | 11 - lib/libstdc/nlist.h | 17 - lib/libstdc/ns.h | 6 - lib/libstdc/ns/ns_addr.c | 35 +- lib/libstdc/ns/ns_ntoa.c | 22 +- lib/libstdc/o.sh | 157 +- lib/libstdc/p.sh | 129 -- lib/libstdc/pcc.h | 11 +- lib/libstdc/protocols/dumprestore.h | 8 - lib/libstdc/protocols/routed.h | 8 - lib/libstdc/protocols/rwhod.h | 6 - lib/libstdc/protocols/talkd.h | 12 +- lib/libstdc/protocols/timed.h | 9 - lib/libstdc/pwd.h | 26 +- lib/libstdc/ranlib.h | 7 - lib/libstdc/resolv.h | 48 +- lib/libstdc/setjmp.h | 25 - lib/libstdc/sgtty.h | 10 +- lib/libstdc/signal.h | 1 + lib/libstdc/stab.h | 6 - lib/libstdc/stdio.h | 164 +- lib/libstdc/stdio.h.orig | 65 - lib/libstdc/stdio/clrerr.c | 10 +- lib/libstdc/stdio/doprnt.c | 58 +- lib/libstdc/stdio/doscan.c | 49 +- lib/libstdc/stdio/exit.c | 11 +- lib/libstdc/stdio/fdopen.c | 17 +- lib/libstdc/stdio/fgetc.c | 10 +- lib/libstdc/stdio/fgets.c | 11 +- lib/libstdc/stdio/filbuf.c | 18 +- lib/libstdc/stdio/findiop.c | 29 +- lib/libstdc/stdio/flsbuf.c | 28 +- lib/libstdc/stdio/fopen.c | 19 +- lib/libstdc/stdio/fprintf.c | 26 +- lib/libstdc/stdio/fputc.c | 10 +- lib/libstdc/stdio/fputs.c | 10 +- lib/libstdc/stdio/fread.c | 12 +- lib/libstdc/stdio/freopen.c | 20 +- lib/libstdc/stdio/fseek.c | 13 +- lib/libstdc/stdio/ftell.c | 12 +- lib/libstdc/stdio/fwrite.c | 12 +- lib/libstdc/stdio/getchar.c | 9 +- lib/libstdc/stdio/gets.c | 10 +- lib/libstdc/stdio/getw.c | 10 +- lib/libstdc/{gen => stdio}/popen.c | 25 +- lib/libstdc/stdio/printf.c | 25 +- lib/libstdc/stdio/putchar.c | 10 +- lib/libstdc/stdio/puts.c | 9 +- lib/libstdc/stdio/putw.c | 10 +- lib/libstdc/stdio/rew.c | 10 +- lib/libstdc/stdio/scanf.c | 47 +- lib/libstdc/stdio/setbuf.c | 11 +- lib/libstdc/stdio/setbuffer.c | 16 +- lib/libstdc/stdio/sibuf.c | 6 +- lib/libstdc/stdio/sobuf.c | 6 +- lib/libstdc/stdio/sprintf.c | 25 +- lib/libstdc/stdio/strout.c | 12 +- lib/libstdc/stdio/ungetc.c | 10 +- lib/libstdc/stdio/vfprintf.c | 22 +- lib/libstdc/stdio/vprintf.c | 21 +- lib/libstdc/stdio/vsprintf.c | 21 +- lib/libstdc/string.h | 61 +- lib/libstdc/strings.h | 59 +- lib/libstdc/struct.h | 6 - lib/libstdc/sys.h | 60 - lib/libstdc/sys/_exit.c | 5 +- lib/libstdc/sys/accept.c | 4 +- lib/libstdc/sys/access.c | 5 +- lib/libstdc/sys/acct.c | 3 - lib/libstdc/sys/acct.h | 23 +- lib/libstdc/sys/adjtime.c | 4 +- lib/libstdc/sys/bind.c | 4 +- lib/libstdc/sys/bkmac.h | 8 - lib/libstdc/sys/brk.c | 3 - lib/libstdc/sys/buf.h | 32 +- lib/libstdc/sys/callout.h | 7 - lib/libstdc/sys/chdir.c | 3 - lib/libstdc/sys/chmod.c | 5 +- lib/libstdc/sys/chown.c | 5 +- lib/libstdc/sys/chroot.c | 3 - lib/libstdc/sys/clist.h | 7 - lib/libstdc/sys/close.c | 5 +- lib/libstdc/sys/cmap.h | 21 +- lib/libstdc/sys/conf.h | 19 +- lib/libstdc/sys/connect.c | 4 +- lib/libstdc/sys/creat.c | 5 +- lib/libstdc/sys/dir.h | 56 +- lib/libstdc/sys/dk.h | 6 - lib/libstdc/sys/dkbad.h | 7 - lib/libstdc/sys/dmap.h | 13 +- lib/libstdc/sys/domain.h | 6 - lib/libstdc/sys/dup.c | 5 +- lib/libstdc/sys/dup2.c | 5 +- lib/libstdc/sys/errno.h | 19 - lib/libstdc/sys/exec.h | 38 - lib/libstdc/sys/execl.c | 5 +- lib/libstdc/sys/execle.c | 5 +- lib/libstdc/sys/exect.c | 5 +- lib/libstdc/sys/execv.c | 5 +- lib/libstdc/sys/execve.c | 5 +- lib/libstdc/sys/fchmod.c | 5 +- lib/libstdc/sys/fchown.c | 5 +- lib/libstdc/sys/fcntl.c | 5 +- lib/libstdc/sys/file.h | 107 +- lib/libstdc/sys/flock.c | 5 +- lib/libstdc/sys/fork.c | 3 - lib/libstdc/sys/fs.h | 16 +- lib/libstdc/sys/fstat.c | 5 +- lib/libstdc/sys/fsync.c | 5 +- lib/libstdc/sys/ftruncate.c | 5 +- lib/libstdc/sys/getdtablesize.c | 3 - lib/libstdc/sys/getegid.c | 3 - lib/libstdc/sys/geteuid.c | 3 - lib/libstdc/sys/getgid.c | 3 - lib/libstdc/sys/getgroups.c | 5 +- lib/libstdc/sys/gethostid.c | 3 - lib/libstdc/sys/gethostname.c | 3 - lib/libstdc/sys/getitimer.c | 4 +- lib/libstdc/sys/getpagesize.c | 3 - lib/libstdc/sys/getpeername.c | 4 +- lib/libstdc/sys/getpgrp.c | 5 +- lib/libstdc/sys/getpid.c | 3 - lib/libstdc/sys/getppid.c | 3 - lib/libstdc/sys/getpriority.c | 5 +- lib/libstdc/sys/getrlimit.c | 4 +- lib/libstdc/sys/getrusage.c | 4 +- lib/libstdc/sys/getsockname.c | 5 +- lib/libstdc/sys/getsockopt.c | 5 +- lib/libstdc/sys/gettimeofday.c | 2 - lib/libstdc/sys/getuid.c | 3 - lib/libstdc/sys/gprof.h | 6 - lib/libstdc/sys/inode.h | 26 +- lib/libstdc/sys/ioctl.c | 5 +- lib/libstdc/sys/ioctl.h | 44 +- lib/libstdc/sys/kernel.h | 13 +- lib/libstdc/sys/kill.c | 5 +- lib/libstdc/sys/killpg.c | 5 +- lib/libstdc/sys/link.c | 5 +- lib/libstdc/sys/listen.c | 5 +- lib/libstdc/sys/lseek.c | 5 +- lib/libstdc/sys/lstat.c | 3 - lib/libstdc/sys/map.h | 9 +- lib/libstdc/sys/mbuf.h | 13 +- lib/libstdc/sys/mkdir.c | 5 +- lib/libstdc/sys/mknod.c | 5 +- lib/libstdc/sys/mman.h | 6 - lib/libstdc/sys/mount.c | 5 +- lib/libstdc/sys/mount.h | 27 +- lib/libstdc/sys/msgbuf.h | 6 - lib/libstdc/sys/mtio.h | 8 - lib/libstdc/sys/namei.h | 17 +- lib/libstdc/sys/open.c | 5 +- lib/libstdc/sys/param.h | 27 +- lib/libstdc/sys/pipe.c | 3 - lib/libstdc/sys/proc.h | 92 +- lib/libstdc/sys/profil.c | 5 +- lib/libstdc/sys/protosw.h | 8 +- lib/libstdc/sys/ptrace.c | 5 +- lib/libstdc/sys/ptrace.h | 23 +- lib/libstdc/sys/quota.c | 5 +- lib/libstdc/sys/quota.h | 28 +- lib/libstdc/sys/read.c | 5 +- lib/libstdc/sys/readlink.c | 5 +- lib/libstdc/sys/readv.c | 4 +- lib/libstdc/sys/reboot.c | 5 +- lib/libstdc/sys/reboot.h | 6 - lib/libstdc/sys/recv.c | 5 +- lib/libstdc/sys/recvfrom.c | 4 +- lib/libstdc/sys/recvmsg.c | 4 +- lib/libstdc/sys/rename.c | 5 +- lib/libstdc/sys/resource.h | 35 - lib/libstdc/sys/rmdir.c | 3 - lib/libstdc/sys/sbrk.c | 5 +- lib/libstdc/sys/seg.h | 7 - lib/libstdc/sys/select.c | 5 +- lib/libstdc/sys/select.h | 40 +- lib/libstdc/sys/send.c | 5 +- lib/libstdc/sys/sendmsg.c | 4 +- lib/libstdc/sys/sendto.c | 4 +- lib/libstdc/sys/setgroups.c | 5 +- lib/libstdc/sys/sethostid.c | 3 - lib/libstdc/sys/sethostname.c | 3 - lib/libstdc/sys/setitimer.c | 4 +- lib/libstdc/sys/setpgrp.c | 5 +- lib/libstdc/sys/setpriority.c | 5 +- lib/libstdc/sys/setquota.c | 5 +- lib/libstdc/sys/setregid.c | 5 +- lib/libstdc/sys/setreuid.c | 5 +- lib/libstdc/sys/setrlimit.c | 4 +- lib/libstdc/sys/setsockopt.c | 5 +- lib/libstdc/sys/settimeofday.c | 2 - lib/libstdc/sys/shutdown.c | 5 +- lib/libstdc/sys/sigblock.c | 5 +- lib/libstdc/sys/signal.h | 49 - lib/libstdc/sys/sigpause.c | 5 +- lib/libstdc/sys/sigreturn.c | 3 +- lib/libstdc/sys/sigsetmask.c | 5 +- lib/libstdc/sys/sigstack.c | 5 +- lib/libstdc/sys/sigvec.c | 5 +- lib/libstdc/sys/socket.c | 5 +- lib/libstdc/sys/socket.h | 65 - lib/libstdc/sys/socketpair.c | 5 +- lib/libstdc/sys/socketvar.h | 13 +- lib/libstdc/sys/stat.c | 3 - lib/libstdc/sys/stat.h | 29 +- lib/libstdc/sys/swapon.c | 3 - lib/libstdc/sys/symlink.c | 5 +- lib/libstdc/sys/sync.c | 5 +- lib/libstdc/sys/syslog.h | 22 - lib/libstdc/sys/systm.h | 22 +- lib/libstdc/sys/tablet.h | 13 +- lib/libstdc/sys/text.h | 10 +- lib/libstdc/sys/time.h | 55 +- lib/libstdc/sys/timeb.h | 23 +- lib/libstdc/sys/times.h | 20 - lib/libstdc/sys/trace.h | 6 - lib/libstdc/sys/truncate.c | 3 - lib/libstdc/sys/tty.h | 66 +- lib/libstdc/sys/ttychars.h | 10 +- lib/libstdc/sys/ttydev.h | 10 +- lib/libstdc/sys/types.h | 45 +- lib/libstdc/sys/uio.h | 27 +- lib/libstdc/sys/umask.c | 5 +- lib/libstdc/sys/umount.c | 3 - lib/libstdc/sys/un.h | 8 +- lib/libstdc/sys/unlink.c | 3 - lib/libstdc/sys/unpcb.h | 7 - lib/libstdc/sys/user.h | 38 +- lib/libstdc/sys/utimes.c | 2 - lib/libstdc/sys/vadvise.h | 6 - lib/libstdc/sys/vcmd.h | 11 +- lib/libstdc/sys/vhangup.c | 3 - lib/libstdc/sys/vlimit.h | 19 - lib/libstdc/sys/vm.h | 22 +- lib/libstdc/sys/vmmac.h | 18 +- lib/libstdc/sys/vmmeter.h | 12 +- lib/libstdc/sys/vmparam.h | 10 +- lib/libstdc/sys/vmsystm.h | 12 +- lib/libstdc/sys/vsio.h | 8 - lib/libstdc/sys/vtimes.h | 19 - lib/libstdc/sys/wait.c | 2 - lib/libstdc/sys/wait.h | 23 - lib/libstdc/sys/wait3.c | 4 +- lib/libstdc/sys/write.c | 5 +- lib/libstdc/sys/writev.c | 4 +- lib/libstdc/sys_h.patch | 112 -- lib/libstdc/sys_netinet.patch | 64 - lib/libstdc/sys_netns.patch | 38 - lib/libstdc/sys_vax.patch | 13 - lib/libstdc/syscall.h | 6 - lib/libstdc/sysexits.h | 6 - lib/libstdc/syslog.h | 1 + lib/libstdc/time.h | 26 +- lib/libstdc/ttyent.h | 26 +- lib/libstdc/unported.txt | 10 + lib/libstdc/utmp.h | 23 - lib/libstdc/varargs.h | 6 - lib/libstdc/vax/clock.h | 7 - lib/libstdc/vax/cons.h | 6 - lib/libstdc/vax/cpu.h | 9 +- lib/libstdc/vax/crl.h | 6 - lib/libstdc/vax/dkio.h | 7 - lib/libstdc/vax/flp.h | 6 - lib/libstdc/vax/frame.h | 7 - lib/libstdc/vax/inline/inline.h | 8 +- lib/libstdc/vax/ioa.h | 14 +- lib/libstdc/vax/ka630.h | 7 - lib/libstdc/vax/machparam.h | 11 +- lib/libstdc/vax/mem.h | 9 +- lib/libstdc/vax/mscp.h | 7 - lib/libstdc/vax/mtpr.h | 6 - lib/libstdc/vax/nexus.h | 9 +- lib/libstdc/vax/pcb.h | 10 +- lib/libstdc/vax/psl.h | 6 - lib/libstdc/vax/pte.h | 17 +- lib/libstdc/vax/reg.h | 6 - lib/libstdc/vax/rpb.h | 6 - lib/libstdc/vax/rsp.h | 8 - lib/libstdc/vax/scb.h | 6 - lib/libstdc/vax/tmscp.h | 7 - lib/libstdc/vax/trap.h | 6 - lib/libstdc/vax/vmparam.h | 10 +- lib/libstdc/vaxif/if_accreg.h | 7 - lib/libstdc/vaxif/if_cssreg.h | 7 - lib/libstdc/vaxif/if_ddnreg.h | 7 - lib/libstdc/vaxif/if_ddnvar.h | 6 - lib/libstdc/vaxif/if_dereg.h | 8 - lib/libstdc/vaxif/if_dmc.h | 6 - lib/libstdc/vaxif/if_ecreg.h | 6 - lib/libstdc/vaxif/if_en.h | 7 - lib/libstdc/vaxif/if_enreg.h | 6 - lib/libstdc/vaxif/if_exreg.h | 7 - lib/libstdc/vaxif/if_hdhreg.h | 7 - lib/libstdc/vaxif/if_hy.h | 9 - lib/libstdc/vaxif/if_hyreg.h | 7 - lib/libstdc/vaxif/if_il.h | 7 - lib/libstdc/vaxif/if_ilreg.h | 6 - lib/libstdc/vaxif/if_ix.h | 7 - lib/libstdc/vaxif/if_pclreg.h | 7 - lib/libstdc/vaxif/if_qereg.h | 7 - lib/libstdc/vaxif/if_uba.h | 10 +- lib/libstdc/vaxif/if_vv.h | 7 - lib/libstdc/vaxmba/hpreg.h | 9 +- lib/libstdc/vaxmba/htreg.h | 9 +- lib/libstdc/vaxmba/mbareg.h | 10 +- lib/libstdc/vaxmba/mbavar.h | 9 +- lib/libstdc/vaxmba/mtreg.h | 6 - lib/libstdc/vaxuba/adreg.h | 7 - lib/libstdc/vaxuba/dhreg.h | 7 - lib/libstdc/vaxuba/dhureg.h | 6 - lib/libstdc/vaxuba/dmfreg.h | 7 - lib/libstdc/vaxuba/dmreg.h | 6 - lib/libstdc/vaxuba/dmzreg.h | 7 - lib/libstdc/vaxuba/dzreg.h | 6 - lib/libstdc/vaxuba/idcreg.h | 9 +- lib/libstdc/vaxuba/ikreg.h | 8 - lib/libstdc/vaxuba/npreg.h | 8 - lib/libstdc/vaxuba/pdma.h | 6 - lib/libstdc/vaxuba/psreg.h | 7 - lib/libstdc/vaxuba/rkreg.h | 10 +- lib/libstdc/vaxuba/rlreg.h | 7 - lib/libstdc/vaxuba/rxreg.h | 11 +- lib/libstdc/vaxuba/tmreg.h | 9 +- lib/libstdc/vaxuba/tmscpreg.h | 6 - lib/libstdc/vaxuba/tsreg.h | 7 - lib/libstdc/vaxuba/ubareg.h | 13 +- lib/libstdc/vaxuba/ubavar.h | 20 +- lib/libstdc/vaxuba/udareg.h | 6 - lib/libstdc/vaxuba/upreg.h | 10 +- lib/libstdc/vaxuba/utreg.h | 8 - lib/libstdc/vaxuba/uureg.h | 6 - lib/libstdc/vaxuba/vpreg.h | 8 - lib/libstdc/vaxuba/vsreg.h | 7 - lib/libstdc/vfont.h | 6 - 1171 files changed, 38260 insertions(+), 6200 deletions(-) create mode 100644 lib/libc4.3tahoe/.MAP create mode 100644 lib/libc4.3tahoe/Makefile create mode 100644 lib/libc4.3tahoe/compat-4.1/.MAP create mode 100644 lib/libc4.3tahoe/compat-4.1/Makefile create mode 100644 lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/.MAP create mode 100644 lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/Makefile create mode 100644 lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/profiled/.MAP create mode 100644 lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/reset.c create mode 100644 lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/.MAP create mode 100644 lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/DEFS.h create mode 100644 lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/Makefile create mode 100644 lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/profiled/.MAP create mode 100644 lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/reset.c create mode 100644 lib/libc4.3tahoe/compat-4.1/ftime.c create mode 100644 lib/libc4.3tahoe/compat-4.1/getpw.c create mode 100644 lib/libc4.3tahoe/compat-4.1/gtty.c create mode 100644 lib/libc4.3tahoe/compat-4.1/nice.c create mode 100644 lib/libc4.3tahoe/compat-4.1/pause.c create mode 100644 lib/libc4.3tahoe/compat-4.1/profiled/.MAP create mode 100644 lib/libc4.3tahoe/compat-4.1/rand.c create mode 100644 lib/libc4.3tahoe/compat-4.1/stty.c create mode 100644 lib/libc4.3tahoe/compat-4.1/tell.c create mode 100644 lib/libc4.3tahoe/compat-4.1/times.c create mode 100644 lib/libc4.3tahoe/compat-4.1/utime.c create mode 100644 lib/libc4.3tahoe/compat-4.1/vlimit.c create mode 100644 lib/libc4.3tahoe/compat-4.1/vtimes.c create mode 100644 lib/libc4.3tahoe/compat-4.3/.MAP create mode 100644 lib/libc4.3tahoe/compat-4.3/Makefile create mode 100644 lib/libc4.3tahoe/compat-4.3/ecvt.c create mode 100644 lib/libc4.3tahoe/compat-4.3/gcvt.c create mode 100644 lib/libc4.3tahoe/compat-4.3/profiled/.MAP create mode 100644 lib/libc4.3tahoe/compat-4.3/sibuf.c create mode 100644 lib/libc4.3tahoe/compat-4.3/sobuf.c create mode 100644 lib/libc4.3tahoe/compat-4.3/strout.c create mode 100644 lib/libc4.3tahoe/compat-sys5/.MAP create mode 100644 lib/libc4.3tahoe/compat-sys5/Makefile create mode 100644 lib/libc4.3tahoe/compat-sys5/compat-sys5.tahoe/.MAP create mode 100644 lib/libc4.3tahoe/compat-sys5/compat-sys5.tahoe/Makefile create mode 100644 lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/.MAP create mode 100644 lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/Makefile create mode 100644 lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/profiled/.MAP create mode 100644 lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/strchr.s create mode 100644 lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/strrchr.s create mode 100644 lib/libc4.3tahoe/compat-sys5/getopt.c create mode 100644 lib/libc4.3tahoe/compat-sys5/memccpy.c create mode 100644 lib/libc4.3tahoe/compat-sys5/memchr.c create mode 100644 lib/libc4.3tahoe/compat-sys5/memcmp.c create mode 100644 lib/libc4.3tahoe/compat-sys5/memcpy.c create mode 100644 lib/libc4.3tahoe/compat-sys5/memset.c create mode 100644 lib/libc4.3tahoe/compat-sys5/profiled/.MAP create mode 100644 lib/libc4.3tahoe/compat-sys5/strcatn.c create mode 100644 lib/libc4.3tahoe/compat-sys5/strchr.c create mode 100644 lib/libc4.3tahoe/compat-sys5/strcmpn.c create mode 100644 lib/libc4.3tahoe/compat-sys5/strcpyn.c create mode 100644 lib/libc4.3tahoe/compat-sys5/strcspn.c create mode 100644 lib/libc4.3tahoe/compat-sys5/strpbrk.c create mode 100644 lib/libc4.3tahoe/compat-sys5/strrchr.c create mode 100644 lib/libc4.3tahoe/compat-sys5/strspn.c create mode 100644 lib/libc4.3tahoe/compat-sys5/strtok.c create mode 100644 lib/libc4.3tahoe/compat-sys5/tmpnam.c create mode 100644 lib/libc4.3tahoe/gen/.MAP create mode 100644 lib/libc4.3tahoe/gen/:errfix create mode 100644 lib/libc4.3tahoe/gen/Makefile create mode 100644 lib/libc4.3tahoe/gen/abort.c create mode 100644 lib/libc4.3tahoe/gen/alarm.c create mode 100644 lib/libc4.3tahoe/gen/atoi.c create mode 100644 lib/libc4.3tahoe/gen/atol.c create mode 100644 lib/libc4.3tahoe/gen/bcmp.c create mode 100644 lib/libc4.3tahoe/gen/bcopy.c create mode 100644 lib/libc4.3tahoe/gen/bzero.c create mode 100644 lib/libc4.3tahoe/gen/calloc.c create mode 100644 lib/libc4.3tahoe/gen/closedir.c create mode 100644 lib/libc4.3tahoe/gen/crypt.c create mode 100644 lib/libc4.3tahoe/gen/ctime.c create mode 100644 lib/libc4.3tahoe/gen/ctype_.c create mode 100644 lib/libc4.3tahoe/gen/disklabel.c create mode 100644 lib/libc4.3tahoe/gen/errlst.c create mode 100644 lib/libc4.3tahoe/gen/execvp.c create mode 100644 lib/libc4.3tahoe/gen/fakcu.c create mode 100644 lib/libc4.3tahoe/gen/ffs.c create mode 100644 lib/libc4.3tahoe/gen/fstab.c create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/.MAP create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/Makefile create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/_setjmp.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/abort.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/abs.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/alloca.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/atof.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/bcmp.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/bcopy.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/bzero.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/fabs.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/ffs.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/frexp.c create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/insque.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/ldexp.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/modf.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/nargs.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/profiled/.MAP create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/remque.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/setjmp.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/strcat.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/strcmp.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/strcpy.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/strlen.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/strncat.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/strncmp.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/strncpy.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/udiv.s create mode 100644 lib/libc4.3tahoe/gen/gen.tahoe/urem.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/.MAP create mode 100644 lib/libc4.3tahoe/gen/gen.vax/Makefile create mode 100644 lib/libc4.3tahoe/gen/gen.vax/_setjmp.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/abs.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/alloca.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/atof.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/bcmp.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/bcopy.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/bzero.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/fabs.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/ffs.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/frexp.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/index.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/insque.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/ldexp.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/modf.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/nargs.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/profiled/.MAP create mode 100644 lib/libc4.3tahoe/gen/gen.vax/remque.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/rindex.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/setjmp.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/strcat.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/strcmp.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/strcpy.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/strlen.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/strncat.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/strncmp.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/strncpy.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/udiv.s create mode 100644 lib/libc4.3tahoe/gen/gen.vax/urem.s create mode 100644 lib/libc4.3tahoe/gen/getenv.c create mode 100644 lib/libc4.3tahoe/gen/getgrent.c create mode 100644 lib/libc4.3tahoe/gen/getgrgid.c create mode 100644 lib/libc4.3tahoe/gen/getgrnam.c create mode 100644 lib/libc4.3tahoe/gen/getlogin.c create mode 100644 lib/libc4.3tahoe/gen/getpass.c create mode 100644 lib/libc4.3tahoe/gen/getpwent.c create mode 100644 lib/libc4.3tahoe/gen/getpwnamuid.c create mode 100644 lib/libc4.3tahoe/gen/getttyent.c create mode 100644 lib/libc4.3tahoe/gen/getttynam.c create mode 100644 lib/libc4.3tahoe/gen/getusershell.c create mode 100644 lib/libc4.3tahoe/gen/getwd.c create mode 100644 lib/libc4.3tahoe/gen/index.c create mode 100644 lib/libc4.3tahoe/gen/initgroups.c create mode 100644 lib/libc4.3tahoe/gen/insque.c create mode 100644 lib/libc4.3tahoe/gen/isatty.c create mode 100644 lib/libc4.3tahoe/gen/malloc.c create mode 100644 lib/libc4.3tahoe/gen/mktemp.c create mode 100644 lib/libc4.3tahoe/gen/ndbm.c create mode 100644 lib/libc4.3tahoe/gen/nlist.c create mode 100644 lib/libc4.3tahoe/gen/opendir.c create mode 100644 lib/libc4.3tahoe/gen/perror.c create mode 100644 lib/libc4.3tahoe/gen/popen.c create mode 100644 lib/libc4.3tahoe/gen/profiled/.MAP create mode 100644 lib/libc4.3tahoe/gen/psignal.c create mode 100644 lib/libc4.3tahoe/gen/qsort.c create mode 100644 lib/libc4.3tahoe/gen/random.c create mode 100644 lib/libc4.3tahoe/gen/readdir.c create mode 100644 lib/libc4.3tahoe/gen/regex.c create mode 100644 lib/libc4.3tahoe/gen/regexp/.MAP create mode 100644 lib/libc4.3tahoe/gen/regexp/Makefile create mode 100644 lib/libc4.3tahoe/gen/regexp/README create mode 100644 lib/libc4.3tahoe/gen/regexp/regerror.c create mode 100644 lib/libc4.3tahoe/gen/regexp/regexp.3 create mode 100644 lib/libc4.3tahoe/gen/regexp/regexp.c create mode 100644 lib/libc4.3tahoe/gen/regexp/regexp.h create mode 100644 lib/libc4.3tahoe/gen/regexp/regmagic.h create mode 100644 lib/libc4.3tahoe/gen/regexp/regsub.c create mode 100644 lib/libc4.3tahoe/gen/regexp/tests create mode 100644 lib/libc4.3tahoe/gen/regexp/timer.c create mode 100644 lib/libc4.3tahoe/gen/regexp/try.c create mode 100644 lib/libc4.3tahoe/gen/remque.c create mode 100644 lib/libc4.3tahoe/gen/rindex.c create mode 100644 lib/libc4.3tahoe/gen/scandir.c create mode 100644 lib/libc4.3tahoe/gen/seekdir.c create mode 100644 lib/libc4.3tahoe/gen/setegid.c create mode 100644 lib/libc4.3tahoe/gen/setenv.c create mode 100644 lib/libc4.3tahoe/gen/seteuid.c create mode 100644 lib/libc4.3tahoe/gen/setgid.c create mode 100644 lib/libc4.3tahoe/gen/setjmperr.c create mode 100644 lib/libc4.3tahoe/gen/setrgid.c create mode 100644 lib/libc4.3tahoe/gen/setruid.c create mode 100644 lib/libc4.3tahoe/gen/setuid.c create mode 100644 lib/libc4.3tahoe/gen/siginterrupt.c create mode 100644 lib/libc4.3tahoe/gen/siglist.c create mode 100644 lib/libc4.3tahoe/gen/signal.c create mode 100644 lib/libc4.3tahoe/gen/sleep.c create mode 100644 lib/libc4.3tahoe/gen/strcasecmp.c create mode 100644 lib/libc4.3tahoe/gen/strcat.c create mode 100644 lib/libc4.3tahoe/gen/strcmp.c create mode 100644 lib/libc4.3tahoe/gen/strcpy.c create mode 100644 lib/libc4.3tahoe/gen/strlen.c create mode 100644 lib/libc4.3tahoe/gen/strncat.c create mode 100644 lib/libc4.3tahoe/gen/strncmp.c create mode 100644 lib/libc4.3tahoe/gen/strncpy.c create mode 100644 lib/libc4.3tahoe/gen/swab.c create mode 100644 lib/libc4.3tahoe/gen/syslog.c create mode 100644 lib/libc4.3tahoe/gen/system.c create mode 100644 lib/libc4.3tahoe/gen/telldir.c create mode 100644 lib/libc4.3tahoe/gen/time.c create mode 100644 lib/libc4.3tahoe/gen/timezone.c create mode 100644 lib/libc4.3tahoe/gen/ttyname.c create mode 100644 lib/libc4.3tahoe/gen/ttyslot.c create mode 100644 lib/libc4.3tahoe/gen/ualarm.c create mode 100644 lib/libc4.3tahoe/gen/usleep.c create mode 100644 lib/libc4.3tahoe/gen/valloc.c create mode 100644 lib/libc4.3tahoe/inet/.MAP create mode 100644 lib/libc4.3tahoe/inet/Makefile create mode 100644 lib/libc4.3tahoe/inet/inet_addr.c create mode 100644 lib/libc4.3tahoe/inet/inet_lnaof.c create mode 100644 lib/libc4.3tahoe/inet/inet_makeaddr.c create mode 100644 lib/libc4.3tahoe/inet/inet_netof.c create mode 100644 lib/libc4.3tahoe/inet/inet_network.c create mode 100644 lib/libc4.3tahoe/inet/inet_ntoa.c create mode 100644 lib/libc4.3tahoe/inet/profiled/.MAP create mode 100644 lib/libc4.3tahoe/net/.MAP create mode 100644 lib/libc4.3tahoe/net/Make.resolv create mode 100644 lib/libc4.3tahoe/net/Makefile create mode 100644 lib/libc4.3tahoe/net/getnetbyaddr.c create mode 100644 lib/libc4.3tahoe/net/getnetbyname.c create mode 100644 lib/libc4.3tahoe/net/getnetent.c create mode 100644 lib/libc4.3tahoe/net/getproto.c create mode 100644 lib/libc4.3tahoe/net/getprotoent.c create mode 100644 lib/libc4.3tahoe/net/getprotoname.c create mode 100644 lib/libc4.3tahoe/net/getservbyname.c create mode 100644 lib/libc4.3tahoe/net/getservbyport.c create mode 100644 lib/libc4.3tahoe/net/getservent.c create mode 100644 lib/libc4.3tahoe/net/herror.c create mode 100644 lib/libc4.3tahoe/net/hosttable/.MAP create mode 100644 lib/libc4.3tahoe/net/hosttable/Makefile create mode 100644 lib/libc4.3tahoe/net/hosttable/gethostent.c create mode 100644 lib/libc4.3tahoe/net/hosttable/gethostnamadr.c create mode 100644 lib/libc4.3tahoe/net/hosttable/profiled/.MAP create mode 100644 lib/libc4.3tahoe/net/named/.MAP create mode 100644 lib/libc4.3tahoe/net/named/Makefile create mode 100644 lib/libc4.3tahoe/net/named/gethostnamadr.c create mode 100644 lib/libc4.3tahoe/net/named/profiled/.MAP create mode 100644 lib/libc4.3tahoe/net/named/sethostent.c create mode 100644 lib/libc4.3tahoe/net/net.tahoe/.MAP create mode 100644 lib/libc4.3tahoe/net/net.tahoe/Makefile create mode 100644 lib/libc4.3tahoe/net/net.tahoe/htonl.s create mode 100644 lib/libc4.3tahoe/net/net.tahoe/htons.s create mode 100644 lib/libc4.3tahoe/net/net.tahoe/ntohl.s create mode 100644 lib/libc4.3tahoe/net/net.tahoe/ntohs.s create mode 100644 lib/libc4.3tahoe/net/net.tahoe/profiled/.MAP create mode 100644 lib/libc4.3tahoe/net/net.vax/.MAP create mode 100644 lib/libc4.3tahoe/net/net.vax/Makefile create mode 100644 lib/libc4.3tahoe/net/net.vax/htonl.s create mode 100644 lib/libc4.3tahoe/net/net.vax/htons.s create mode 100644 lib/libc4.3tahoe/net/net.vax/ntohl.s create mode 100644 lib/libc4.3tahoe/net/net.vax/ntohs.s create mode 100644 lib/libc4.3tahoe/net/net.vax/profiled/.MAP create mode 100644 lib/libc4.3tahoe/net/profiled/.MAP create mode 100644 lib/libc4.3tahoe/net/rcmd.c create mode 100644 lib/libc4.3tahoe/net/res_comp.c create mode 100644 lib/libc4.3tahoe/net/res_debug.c create mode 100644 lib/libc4.3tahoe/net/res_init.c create mode 100644 lib/libc4.3tahoe/net/res_mkquery.c create mode 100644 lib/libc4.3tahoe/net/res_query.c create mode 100644 lib/libc4.3tahoe/net/res_send.c create mode 100644 lib/libc4.3tahoe/net/rexec.c create mode 100644 lib/libc4.3tahoe/net/ruserpass.c create mode 100644 lib/libc4.3tahoe/ns/.MAP create mode 100644 lib/libc4.3tahoe/ns/Makefile create mode 100644 lib/libc4.3tahoe/ns/ns_addr.c create mode 100644 lib/libc4.3tahoe/ns/ns_ntoa.c create mode 100644 lib/libc4.3tahoe/ns/profiled/.MAP create mode 100644 lib/libc4.3tahoe/stdio/.MAP create mode 100644 lib/libc4.3tahoe/stdio/Makefile create mode 100644 lib/libc4.3tahoe/stdio/clrerr.c create mode 100644 lib/libc4.3tahoe/stdio/doprnt.c create mode 100644 lib/libc4.3tahoe/stdio/doscan.c create mode 100644 lib/libc4.3tahoe/stdio/exit.c create mode 100644 lib/libc4.3tahoe/stdio/fdopen.c create mode 100644 lib/libc4.3tahoe/stdio/fgetc.c create mode 100644 lib/libc4.3tahoe/stdio/fgets.c create mode 100644 lib/libc4.3tahoe/stdio/filbuf.c create mode 100644 lib/libc4.3tahoe/stdio/findiop.c create mode 100644 lib/libc4.3tahoe/stdio/flsbuf.c create mode 100644 lib/libc4.3tahoe/stdio/fopen.c create mode 100644 lib/libc4.3tahoe/stdio/fprintf.c create mode 100644 lib/libc4.3tahoe/stdio/fputc.c create mode 100644 lib/libc4.3tahoe/stdio/fputs.c create mode 100644 lib/libc4.3tahoe/stdio/fread.4.2 create mode 100644 lib/libc4.3tahoe/stdio/fread.c create mode 100644 lib/libc4.3tahoe/stdio/freopen.c create mode 100644 lib/libc4.3tahoe/stdio/fseek.c create mode 100644 lib/libc4.3tahoe/stdio/ftell.c create mode 100644 lib/libc4.3tahoe/stdio/fwrite.4.2 create mode 100644 lib/libc4.3tahoe/stdio/fwrite.c create mode 100644 lib/libc4.3tahoe/stdio/getchar.c create mode 100644 lib/libc4.3tahoe/stdio/gets.c create mode 100644 lib/libc4.3tahoe/stdio/getw.c create mode 100644 lib/libc4.3tahoe/stdio/printf.c create mode 100644 lib/libc4.3tahoe/stdio/profiled/.MAP create mode 100644 lib/libc4.3tahoe/stdio/putchar.c create mode 100644 lib/libc4.3tahoe/stdio/puts.c create mode 100644 lib/libc4.3tahoe/stdio/putw.c create mode 100644 lib/libc4.3tahoe/stdio/rew.c create mode 100644 lib/libc4.3tahoe/stdio/scanf.c create mode 100644 lib/libc4.3tahoe/stdio/setbuf.c create mode 100644 lib/libc4.3tahoe/stdio/setbuffer.c create mode 100644 lib/libc4.3tahoe/stdio/sprintf.c create mode 100644 lib/libc4.3tahoe/stdio/stdio.tahoe/.MAP create mode 100644 lib/libc4.3tahoe/stdio/stdio.tahoe/Makefile create mode 100644 lib/libc4.3tahoe/stdio/stdio.vax/.MAP create mode 100644 lib/libc4.3tahoe/stdio/stdio.vax/Makefile create mode 100644 lib/libc4.3tahoe/stdio/stdio.vax/fgets.s create mode 100644 lib/libc4.3tahoe/stdio/stdio.vax/fputs.s create mode 100644 lib/libc4.3tahoe/stdio/stdio.vax/gets.s create mode 100644 lib/libc4.3tahoe/stdio/stdio.vax/profiled/.MAP create mode 100644 lib/libc4.3tahoe/stdio/stdio.vax/puts.s create mode 100644 lib/libc4.3tahoe/stdio/ungetc.c create mode 100644 lib/libc4.3tahoe/stdio/vfprintf.c create mode 100644 lib/libc4.3tahoe/stdio/vprintf.c create mode 100644 lib/libc4.3tahoe/stdio/vsprintf.c create mode 100644 lib/libc4.3tahoe/tahoe/.MAP create mode 100644 lib/libc4.3tahoe/tahoe/DEFS.h create mode 100644 lib/libc4.3tahoe/tahoe/Makefile create mode 100644 lib/libc4.3tahoe/tahoe/csu/.MAP create mode 100644 lib/libc4.3tahoe/tahoe/csu/Makefile create mode 100644 lib/libc4.3tahoe/tahoe/csu/crt0.s create mode 100644 lib/libc4.3tahoe/tahoe/csu/gcrt0.h create mode 100644 lib/libc4.3tahoe/tahoe/csu/gmon.c create mode 120000 lib/libc4.3tahoe/tahoe/csu/gmon.ex create mode 100644 lib/libc4.3tahoe/tahoe/csu/gmon.h create mode 100644 lib/libc4.3tahoe/tahoe/csu/mcrt0.s create mode 100644 lib/libc4.3tahoe/tahoe/csu/mon.c create mode 100644 lib/libc4.3tahoe/tahoe/csu/mon.ex create mode 100644 lib/libc4.3tahoe/tahoe/fpe/.MAP create mode 100644 lib/libc4.3tahoe/tahoe/fpe/Makefile create mode 100644 lib/libc4.3tahoe/tahoe/fpe/addd.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/addf.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/cmpd.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/cmpf.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/cvtdl.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/cvtfl.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/cvtld.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/cvtlf.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/cvtud.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/cvtuf.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/divd.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/divf.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/fnorm.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/fp_exp.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/modf.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/muld.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/mulf.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/negd.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/negf.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/profiled/.MAP create mode 100644 lib/libc4.3tahoe/tahoe/fpe/sfnorm.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/sfp_exp.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/subd.s create mode 100644 lib/libc4.3tahoe/tahoe/fpe/subf.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/.MAP create mode 100644 lib/libc4.3tahoe/tahoe/sys/Makefile create mode 100644 lib/libc4.3tahoe/tahoe/sys/Ovadvise.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/Ovfork.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/SYS.h create mode 100644 lib/libc4.3tahoe/tahoe/sys/_exit.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/accept.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/access.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/acct.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/adjtime.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/bind.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/brk.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/cerror.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/chdir.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/chmod.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/chown.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/chroot.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/close.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/connect.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/creat.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/dup.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/dup2.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/execl.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/execle.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/exect.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/execv.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/execve.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/fchmod.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/fchown.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/fcntl.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/flock.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/fork.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/fstat.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/fsync.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/ftruncate.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getdtablesize.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getegid.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/geteuid.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getgid.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getgroups.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/gethostid.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/gethostname.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getitimer.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getpagesize.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getpeername.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getpgrp.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getpid.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getppid.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getpriority.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getrlimit.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getrusage.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getsockname.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getsockopt.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/gettimeofday.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/getuid.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/ioctl.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/kill.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/killpg.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/link.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/listen.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/lseek.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/lstat.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/mkdir.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/mknod.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/mmap.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/mount.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/open.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/pipe.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/profil.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/profiled/.MAP create mode 100644 lib/libc4.3tahoe/tahoe/sys/ptrace.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/quota.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/read.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/readlink.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/readv.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/reboot.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/recv.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/recvfrom.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/recvmsg.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/rename.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/rmdir.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/sbrk.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/select.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/send.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/sendmsg.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/sendto.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/setgroups.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/sethostid.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/sethostname.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/setitimer.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/setpgrp.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/setpriority.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/setquota.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/setregid.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/setreuid.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/setrlimit.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/setsockopt.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/settimeofday.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/shutdown.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/sigblock.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/sigpause.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/sigreturn.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/sigsetmask.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/sigstack.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/sigvec.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/socket.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/socketpair.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/stat.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/swapon.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/symlink.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/sync.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/syscall.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/truncate.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/umask.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/umount.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/unlink.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/utimes.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/vhangup.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/wait.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/wait3.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/write.s create mode 100644 lib/libc4.3tahoe/tahoe/sys/writev.s create mode 100644 lib/libc4.3tahoe/vax/.MAP create mode 100644 lib/libc4.3tahoe/vax/DEFS.h create mode 100644 lib/libc4.3tahoe/vax/Makefile create mode 100644 lib/libc4.3tahoe/vax/csu/.MAP create mode 100644 lib/libc4.3tahoe/vax/csu/Makefile create mode 100644 lib/libc4.3tahoe/vax/csu/crt0.c create mode 100644 lib/libc4.3tahoe/vax/csu/gmon.c create mode 100644 lib/libc4.3tahoe/vax/csu/gmon.ex create mode 100644 lib/libc4.3tahoe/vax/csu/gmon.h create mode 100644 lib/libc4.3tahoe/vax/csu/mon.c create mode 100644 lib/libc4.3tahoe/vax/csu/mon.ex create mode 100644 lib/libc4.3tahoe/vax/sys/.MAP create mode 100644 lib/libc4.3tahoe/vax/sys/Makefile create mode 100644 lib/libc4.3tahoe/vax/sys/Ovadvise.s create mode 100644 lib/libc4.3tahoe/vax/sys/Ovfork.s create mode 100644 lib/libc4.3tahoe/vax/sys/SYS.h create mode 100644 lib/libc4.3tahoe/vax/sys/_exit.s create mode 100644 lib/libc4.3tahoe/vax/sys/accept.s create mode 100644 lib/libc4.3tahoe/vax/sys/access.s create mode 100644 lib/libc4.3tahoe/vax/sys/acct.s create mode 100644 lib/libc4.3tahoe/vax/sys/adjtime.s create mode 100644 lib/libc4.3tahoe/vax/sys/bind.s create mode 100644 lib/libc4.3tahoe/vax/sys/brk.s create mode 100644 lib/libc4.3tahoe/vax/sys/cerror.s create mode 100644 lib/libc4.3tahoe/vax/sys/chdir.s create mode 100644 lib/libc4.3tahoe/vax/sys/chmod.s create mode 100644 lib/libc4.3tahoe/vax/sys/chown.s create mode 100644 lib/libc4.3tahoe/vax/sys/chroot.s create mode 100644 lib/libc4.3tahoe/vax/sys/close.s create mode 100644 lib/libc4.3tahoe/vax/sys/connect.s create mode 100644 lib/libc4.3tahoe/vax/sys/creat.s create mode 100644 lib/libc4.3tahoe/vax/sys/dup.s create mode 100644 lib/libc4.3tahoe/vax/sys/dup2.s create mode 100644 lib/libc4.3tahoe/vax/sys/execl.s create mode 100644 lib/libc4.3tahoe/vax/sys/execle.s create mode 100644 lib/libc4.3tahoe/vax/sys/exect.s create mode 100644 lib/libc4.3tahoe/vax/sys/execv.s create mode 100644 lib/libc4.3tahoe/vax/sys/execve.s create mode 100644 lib/libc4.3tahoe/vax/sys/fchmod.s create mode 100644 lib/libc4.3tahoe/vax/sys/fchown.s create mode 100644 lib/libc4.3tahoe/vax/sys/fcntl.s create mode 100644 lib/libc4.3tahoe/vax/sys/flock.s create mode 100644 lib/libc4.3tahoe/vax/sys/fork.s create mode 100644 lib/libc4.3tahoe/vax/sys/fstat.s create mode 100644 lib/libc4.3tahoe/vax/sys/fsync.s create mode 100644 lib/libc4.3tahoe/vax/sys/ftruncate.s create mode 100644 lib/libc4.3tahoe/vax/sys/getdtablesize.s create mode 100644 lib/libc4.3tahoe/vax/sys/getegid.s create mode 100644 lib/libc4.3tahoe/vax/sys/geteuid.s create mode 100644 lib/libc4.3tahoe/vax/sys/getgid.s create mode 100644 lib/libc4.3tahoe/vax/sys/getgroups.s create mode 100644 lib/libc4.3tahoe/vax/sys/gethostid.s create mode 100644 lib/libc4.3tahoe/vax/sys/gethostname.s create mode 100644 lib/libc4.3tahoe/vax/sys/getitimer.s create mode 100644 lib/libc4.3tahoe/vax/sys/getpagesize.s create mode 100644 lib/libc4.3tahoe/vax/sys/getpeername.s create mode 100644 lib/libc4.3tahoe/vax/sys/getpgrp.s create mode 100644 lib/libc4.3tahoe/vax/sys/getpid.s create mode 100644 lib/libc4.3tahoe/vax/sys/getppid.s create mode 100644 lib/libc4.3tahoe/vax/sys/getpriority.s create mode 100644 lib/libc4.3tahoe/vax/sys/getrlimit.s create mode 100644 lib/libc4.3tahoe/vax/sys/getrusage.s create mode 100644 lib/libc4.3tahoe/vax/sys/getsockname.s create mode 100644 lib/libc4.3tahoe/vax/sys/getsockopt.s create mode 100644 lib/libc4.3tahoe/vax/sys/gettimeofday.s create mode 100644 lib/libc4.3tahoe/vax/sys/getuid.s create mode 100644 lib/libc4.3tahoe/vax/sys/ioctl.s create mode 100644 lib/libc4.3tahoe/vax/sys/kill.s create mode 100644 lib/libc4.3tahoe/vax/sys/killpg.s create mode 100644 lib/libc4.3tahoe/vax/sys/link.s create mode 100644 lib/libc4.3tahoe/vax/sys/listen.s create mode 100644 lib/libc4.3tahoe/vax/sys/lseek.s create mode 100644 lib/libc4.3tahoe/vax/sys/lstat.s create mode 100644 lib/libc4.3tahoe/vax/sys/mkdir.s create mode 100644 lib/libc4.3tahoe/vax/sys/mknod.s create mode 100644 lib/libc4.3tahoe/vax/sys/mount.s create mode 100644 lib/libc4.3tahoe/vax/sys/open.s create mode 100644 lib/libc4.3tahoe/vax/sys/pipe.s create mode 100644 lib/libc4.3tahoe/vax/sys/profil.s create mode 100644 lib/libc4.3tahoe/vax/sys/profiled/.MAP create mode 100644 lib/libc4.3tahoe/vax/sys/ptrace.s create mode 100644 lib/libc4.3tahoe/vax/sys/quota.s create mode 100644 lib/libc4.3tahoe/vax/sys/read.s create mode 100644 lib/libc4.3tahoe/vax/sys/readlink.s create mode 100644 lib/libc4.3tahoe/vax/sys/readv.s create mode 100644 lib/libc4.3tahoe/vax/sys/reboot.s create mode 100644 lib/libc4.3tahoe/vax/sys/recv.s create mode 100644 lib/libc4.3tahoe/vax/sys/recvfrom.s create mode 100644 lib/libc4.3tahoe/vax/sys/recvmsg.s create mode 100644 lib/libc4.3tahoe/vax/sys/rename.s create mode 100644 lib/libc4.3tahoe/vax/sys/rmdir.s create mode 100644 lib/libc4.3tahoe/vax/sys/sbrk.s create mode 100644 lib/libc4.3tahoe/vax/sys/select.s create mode 100644 lib/libc4.3tahoe/vax/sys/send.s create mode 100644 lib/libc4.3tahoe/vax/sys/sendmsg.s create mode 100644 lib/libc4.3tahoe/vax/sys/sendto.s create mode 100644 lib/libc4.3tahoe/vax/sys/setgroups.s create mode 100644 lib/libc4.3tahoe/vax/sys/sethostid.s create mode 100644 lib/libc4.3tahoe/vax/sys/sethostname.s create mode 100644 lib/libc4.3tahoe/vax/sys/setitimer.s create mode 100644 lib/libc4.3tahoe/vax/sys/setpgrp.s create mode 100644 lib/libc4.3tahoe/vax/sys/setpriority.s create mode 100644 lib/libc4.3tahoe/vax/sys/setquota.s create mode 100644 lib/libc4.3tahoe/vax/sys/setregid.s create mode 100644 lib/libc4.3tahoe/vax/sys/setreuid.s create mode 100644 lib/libc4.3tahoe/vax/sys/setrlimit.s create mode 100644 lib/libc4.3tahoe/vax/sys/setsockopt.s create mode 100644 lib/libc4.3tahoe/vax/sys/settimeofday.s create mode 100644 lib/libc4.3tahoe/vax/sys/shutdown.s create mode 100644 lib/libc4.3tahoe/vax/sys/sigblock.s create mode 100644 lib/libc4.3tahoe/vax/sys/signal.s create mode 100644 lib/libc4.3tahoe/vax/sys/sigpause.s create mode 100644 lib/libc4.3tahoe/vax/sys/sigreturn.s create mode 100644 lib/libc4.3tahoe/vax/sys/sigsetmask.s create mode 100644 lib/libc4.3tahoe/vax/sys/sigstack.s create mode 100644 lib/libc4.3tahoe/vax/sys/sigvec.s create mode 100644 lib/libc4.3tahoe/vax/sys/socket.s create mode 100644 lib/libc4.3tahoe/vax/sys/socketpair.s create mode 100644 lib/libc4.3tahoe/vax/sys/stat.s create mode 100644 lib/libc4.3tahoe/vax/sys/swapon.s create mode 100644 lib/libc4.3tahoe/vax/sys/symlink.s create mode 100644 lib/libc4.3tahoe/vax/sys/sync.s create mode 100644 lib/libc4.3tahoe/vax/sys/syscall.s create mode 100644 lib/libc4.3tahoe/vax/sys/truncate.s create mode 100644 lib/libc4.3tahoe/vax/sys/umask.s create mode 100644 lib/libc4.3tahoe/vax/sys/umount.s create mode 100644 lib/libc4.3tahoe/vax/sys/unlink.s create mode 100644 lib/libc4.3tahoe/vax/sys/utimes.s create mode 100644 lib/libc4.3tahoe/vax/sys/vhangup.s create mode 100644 lib/libc4.3tahoe/vax/sys/wait.s create mode 100644 lib/libc4.3tahoe/vax/sys/wait3.s create mode 100644 lib/libc4.3tahoe/vax/sys/write.s create mode 100644 lib/libc4.3tahoe/vax/sys/writev.s delete mode 100644 lib/libstdc/compat-4.1.h delete mode 100644 lib/libstdc/compat-sys5.h delete mode 100644 lib/libstdc/csu.h create mode 120000 lib/libstdc/errno.h create mode 100644 lib/libstdc/fcntl.h delete mode 100644 lib/libstdc/include.patch delete mode 100644 lib/libstdc/inet.h create mode 100644 lib/libstdc/libstdc.patch delete mode 120000 lib/libstdc/machine create mode 100644 lib/libstdc/mp.h delete mode 100644 lib/libstdc/ns.h delete mode 100755 lib/libstdc/p.sh create mode 120000 lib/libstdc/signal.h delete mode 100644 lib/libstdc/stdio.h.orig rename lib/libstdc/{gen => stdio}/popen.c (85%) delete mode 100644 lib/libstdc/sys.h delete mode 100644 lib/libstdc/sys_h.patch delete mode 100644 lib/libstdc/sys_netinet.patch delete mode 100644 lib/libstdc/sys_netns.patch delete mode 100644 lib/libstdc/sys_vax.patch create mode 120000 lib/libstdc/syslog.h create mode 100644 lib/libstdc/unported.txt diff --git a/.gitignore b/.gitignore index 23eb1d7..7016c8d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ cproto-4.6/stamp-h cproto-4.6/y.tab.c lib/libstdc/*.temp lib/libstdc/xx* +lib/libstdc.orig xify/newline xify/nocomment xify/nostring diff --git a/lib/libc4.3tahoe/.MAP b/lib/libc4.3tahoe/.MAP new file mode 100644 index 0000000..71f4684 --- /dev/null +++ b/lib/libc4.3tahoe/.MAP @@ -0,0 +1,11 @@ +D COMPAT-4.1 compat-4.1 +D COMPAT-4.3 compat-4.3 +D COMPAT-S compat-sys5 +D GEN gen +D INET inet +F MAKEFILE.;1 Makefile +D NET net +D NS ns +D STDIO stdio +D TAHOE tahoe +D VAX vax diff --git a/lib/libc4.3tahoe/Makefile b/lib/libc4.3tahoe/Makefile new file mode 100644 index 0000000..05630d1 --- /dev/null +++ b/lib/libc4.3tahoe/Makefile @@ -0,0 +1,106 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 4.34 (Berkeley) 7/9/88 +# +# Compatibility routines are kept in directories with a prefixing +# ``compat'' (so they all sort together). +# +# The C run-time startup code is always machine dependent and expected +# to be located in ${MACHINE}/csu +# +# There are two possible methods of doing host name look up. They are +# to use the name server or /etc/hosts. HOSTLOOKUP defines which method +# is to be compiled into libc : +# +# defining HOSTLOOKUP to be "named", compiles the +# host lookup routines that use the BIND name server. +# +# defining HOSTLOOKUP to be "hosttable", compiles +# the host lookup routines that use /etc/hosts. +# +#HOSTLOOKUP= hosttable +HOSTLOOKUP= named +# +# The system has two monitoring schemes, utilizing either ``prof'' +# or ``gprof''. DFLMON determines the default profiler; mon.o +# specifies that ``prof'' is the default, gmon.o specifies that +# ``gprof'' is the default. +#DFLMON= gmon.o +DFLMON= mon.o +# +# All library object contain sccsid strings by default; they may be +# excluded as a space-saving measure. To produce a library that does +# not contain these strings, remove -DLIBC_SCCS and -DSYSLIBC_SCCS +# from DEFS below. To remove these strings from just the system call +# stubs, remove -DSYSLIBC_SCCS from DEFS below. +#DEFS= +DEFS="-DLIBC_SCCS -DSYSLIBC_SCCS" + +SUBDIR= ${ALL} net/hosttable net/named +ONE= compat-4.1 compat-4.3 compat-sys5 gen inet net ns stdio +TWO= compat-4.1/compat-4.1.${MACHINE} gen/gen.${MACHINE} \ + net/net.${MACHINE} net/${HOSTLOOKUP} stdio/stdio.${MACHINE} \ + compat-sys5/compat-sys5.${MACHINE} ${MACHINE}/csu ${MACHINE}/sys +ALL= ${ONE} ${TWO} +TAGSFILE=tags + +libc.a libc_p.a: mkdir ${ALL} tags + ls library/*.o | sort -t/ +1 > t1 + ar cr libc.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON} + ar ma findiop.o libc.a exit.o + ar ma exit.o libc.a fakcu.o + ls profiled/*.o | sort -t/ +1 > t1 + ar cr libc_p.a `lorder \`cat t1\` | tsort` ${MACHINE}/csu/${DFLMON} + ar ma findiop.o libc_p.a exit.o + ar ma exit.o libc_p.a fakcu.o + rm -rf t1 library profiled + +mkdir: FRC + rm -rf library profiled + mkdir library profiled + +${ALL}: FRC + cd $@; make ${MFLAGS} DEFS=${DEFS} link + +install: + install -o bin -g bin -m 644 libc.a ${DESTDIR}/lib/libc.a + ranlib ${DESTDIR}/lib/libc.a + install -o bin -g bin -m 644 libc_p.a ${DESTDIR}/usr/lib/libc_p.a + ranlib ${DESTDIR}/usr/lib/libc_p.a + cd ${MACHINE}/csu; make DESTDIR=${DESTDIR} install + install -o bin -g bin -m 444 ${TAGSFILE} ${DESTDIR}/usr/lib/${TAGSFILE} + +tags: + for i in ${ONE}; do \ + (cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \ + done + for i in ${TWO}; do \ + (cd $$i; make ${MFLAGS} TAGSFILE=../../${TAGSFILE} tags); \ + done + sort -o ${TAGSFILE} ${TAGSFILE} + +clean: + for i in ${SUBDIR}; \ + do (cd $$i; make ${MFLAGS} clean); done + rm -rf libc.a libc_p.a library profiled + +depend: + for i in ${SUBDIR}; \ + do (cd $$i; make ${MFLAGS} DEFS=${DEFS} depend); done + +FRC: + diff --git a/lib/libc4.3tahoe/compat-4.1/.MAP b/lib/libc4.3tahoe/compat-4.1/.MAP new file mode 100644 index 0000000..1ae36da --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/.MAP @@ -0,0 +1,16 @@ +D COMPAT-4.000 compat-4.1.vax +D COMPAT-4.1 compat-4.1.tahoe +F FTIME.C;1 ftime.c +F GETPW.C;1 getpw.c +F GTTY.C;1 gtty.c +F MAKEFILE.;1 Makefile +F NICE.C;1 nice.c +F PAUSE.C;1 pause.c +D PROFILED profiled +F RAND.C;1 rand.c +F STTY.C;1 stty.c +F TELL.C;1 tell.c +F TIMES.C;1 times.c +F UTIME.C;1 utime.c +F VLIMIT.C;1 vlimit.c +F VTIMES.C;1 vtimes.c diff --git a/lib/libc4.3tahoe/compat-4.1/Makefile b/lib/libc4.3tahoe/compat-4.1/Makefile new file mode 100644 index 0000000..4e53dda --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/Makefile @@ -0,0 +1,76 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that this notice is preserved and that due credit is given +# to the University of California at Berkeley. The name of the University +# may not be used to endorse or promote products derived from this +# software without specific prior written permission. This software +# is provided ``as is'' without express or implied warranty. +# +# @(#)Makefile 5.8 (Berkeley) 5/20/88 +# +DEFS= -DLIBC_SCCS +CFLAGS= -O ${DEFS} +STDSRCS=ftime.c gtty.c nice.c pause.c rand.c stty.c tell.c \ + times.c utime.c vlimit.c vtimes.c +STD= ftime.o gtty.o nice.o pause.o rand.o stty.o tell.o \ + times.o utime.o vlimit.o vtimes.o +# these should just be pitched, but in the interest of compatibility... +TRASHSRC=getpw.c +TRASH= getpw.o +SRCS= ${STDSRCS} ${TRASHSRCS} +OBJS= ${STD} ${TRASH} +TAGSFILE=tags + +.c.o: + @${CC} -p ${CFLAGS} -c $*.c + @-ld -X -o profiled/$*.o -r $*.o + ${CC} ${CFLAGS} -c $*.c + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../library; rm -f ${OBJS}) + (cd ../profiled; rm -f ${OBJS}) + ln ${OBJS} ../library + (cd profiled; ln ${OBJS} ../../profiled) + +tags: + cwd=`pwd`; \ + for i in ${SRCS}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +ftime.o: ftime.c /usr/include/sys/types.h /usr/include/sys/time.h +ftime.o: /usr/include/time.h +gtty.o: gtty.c /usr/include/sgtty.h /usr/include/sys/ioctl.h +gtty.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h +nice.o: nice.c /usr/include/sys/time.h /usr/include/time.h +nice.o: /usr/include/sys/resource.h +pause.o: pause.c +rand.o: rand.c +stty.o: stty.c /usr/include/sgtty.h /usr/include/sys/ioctl.h +stty.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h +tell.o: tell.c +times.o: times.c /usr/include/sys/time.h /usr/include/time.h +times.o: /usr/include/sys/resource.h +utime.o: utime.c /usr/include/sys/time.h /usr/include/time.h +vlimit.o: vlimit.c /usr/include/sys/time.h /usr/include/time.h +vlimit.o: /usr/include/sys/resource.h /usr/include/errno.h +vtimes.o: vtimes.c /usr/include/sys/time.h /usr/include/time.h +vtimes.o: /usr/include/sys/resource.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/.MAP b/lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/.MAP new file mode 100644 index 0000000..46d53f0 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/.MAP @@ -0,0 +1,3 @@ +F MAKEFILE.;1 Makefile +D PROFILED profiled +F RESET.C;1 reset.c diff --git a/lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/Makefile b/lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/Makefile new file mode 100644 index 0000000..f714f05 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/Makefile @@ -0,0 +1,57 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.8 (Berkeley) 7/9/88 +# +DEFS= -DLIBC_SCCS +CFLAGS= -I../../tahoe ${DEFS} +SRCS= reset.c +OBJS= reset.o +TAGSFILE=tags + +.c.o: + @/lib/cpp -E ${CFLAGS} -DPROF $*.c | ${AS} -o $*.o + @-ld -X -o profiled/$*.o -r $*.o + /lib/cpp -E ${CFLAGS} $*.c | ${AS} -o $*.o + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + (P=`pwd`; \ + egrep -o "^ENTRY(.*)|^SYSCALL(.*)" ${SRCS} | /bin/sed \ +"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ + >> ${TAGSFILE}) + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +reset.o: reset.c ../../tahoe/DEFS.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/profiled/.MAP b/lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/reset.c b/lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/reset.c new file mode 100644 index 0000000..660d72d --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/compat-4.1.tahoe/reset.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ +#ifdef LIBC_SCCS +_sccsid:.asciz "@(#)reset.c 1.2 (Berkeley/CCI) 8/1/86" +#endif LIBC_SCCS + +/* + * C library -- reset, setexit + * + * reset(x) + * will generate a "return" from + * the last call to + * setexit() + * by restoring r2 - r12, fp + * and doing a return. + * The returned value is x; on the original + * call the returned value is 0. + * + * useful for going back to the main loop + * after a horrible error in a lowlevel + * routine. + */ +#include "DEFS.h" + +ENTRY(setexit, 0) + movab setsav,r0 + storer $0x1ffc, (r0) + movl (fp),44(r0) # fp + moval 4(fp),48(r0) # sp + movl -8(fp),52(r0) # pc + clrl r0 + ret + +ENTRY(reset, 0) + movl 4(fp),r0 # returned value + movab setsav,r1 + loadr $0x1ffc,(r1) + movl 44(r1),fp + movl 48(r1),sp + jmp *52(r1) + + .data +setsav: .space 14*4 diff --git a/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/.MAP b/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/.MAP new file mode 100644 index 0000000..978435d --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/.MAP @@ -0,0 +1,4 @@ +F DEFS.H;1 DEFS.h +F MAKEFILE.;1 Makefile +D PROFILED profiled +F RESET.C;1 reset.c diff --git a/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/DEFS.h b/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/DEFS.h new file mode 100644 index 0000000..8ba6d7e --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/DEFS.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)DEFS.h 5.1 (Berkeley) 5/30/85 + */ + +#ifdef PROF +#define ENTRY(x) .globl _/**/x; .align 2; _/**/x: .word 0; \ + .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount +#define ASENTRY(x) .globl x; .align 2; x: .word 0; \ + .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount +#else +#define ENTRY(x) .globl _/**/x; .align 2; _/**/x: .word 0 +#define ASENTRY(x) .globl x; .align 2; x: .word 0 +#endif diff --git a/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/Makefile b/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/Makefile new file mode 100644 index 0000000..5a30f17 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.10 (Berkeley) 7/9/88 +# +DEFS= -DLIBC_SCCS +CFLAGS= ${DEFS} +SRCS= reset.c +OBJS= reset.o +TAGSFILE=tags + +.c.o: + @/lib/cpp -E ${CFLAGS} -DPROF $*.c | ${AS} -o $*.o + @-ld -X -o profiled/$*.o -r $*.o + /lib/cpp -E ${CFLAGS} $*.c | ${AS} -o $*.o + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + (P=`pwd`; \ + egrep -o "^ENTRY(.*)|^SYSCALL(.*)" ${SRCS} | /bin/sed \ +"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ + >> ${TAGSFILE}) + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +reset.o: reset.c +reset.o:DEFS.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/profiled/.MAP b/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/reset.c b/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/reset.c new file mode 100644 index 0000000..0fc9bda --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/compat-4.1.vax/reset.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ +#ifdef LIBC_SCCS +_sccsid:.asciz "@(#)reset.c 5.4 (Berkeley) 3/9/86" +#endif LIBC_SCCS + +/* + * C library -- reset, setexit + * + * reset(x) + * will generate a "return" from + * the last call to + * setexit() + * by restoring r6 - r12, ap, fp + * and doing a return. + * The returned value is x; on the original + * call the returned value is 0. + * + * useful for going back to the main loop + * after a horrible error in a lowlevel + * routine. + */ +#include "DEFS.h" + +ENTRY(setexit) + movab setsav,r0 + movq r6,(r0)+ + movq r8,(r0)+ + movq r10,(r0)+ + movq 8(fp),(r0)+ # ap, fp + movab 4(ap),(r0)+ # sp + movl 16(fp),(r0) # pc + clrl r0 + ret + +ENTRY(reset) + movl 4(ap),r0 # returned value + movab setsav,r1 + movq (r1)+,r6 + movq (r1)+,r8 + movq (r1)+,r10 + movq (r1)+,r12 + movl (r1)+,sp + jmp *(r1) + + .data +setsav: .space 10*4 diff --git a/lib/libc4.3tahoe/compat-4.1/ftime.c b/lib/libc4.3tahoe/compat-4.1/ftime.c new file mode 100644 index 0000000..243902d --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/ftime.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ftime.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include + +/* + * Backwards compatible ftime. + */ + +/* from old timeb.h */ +struct timeb { + time_t time; + u_short millitm; + short timezone; + short dstflag; +}; + +ftime(tp) + register struct timeb *tp; +{ + struct timeval t; + struct timezone tz; + + if (gettimeofday(&t, &tz) < 0) + return (-1); + tp->time = t.tv_sec; + tp->millitm = t.tv_usec / 1000; + tp->timezone = tz.tz_minuteswest; + tp->dstflag = tz.tz_dsttime; +} diff --git a/lib/libc4.3tahoe/compat-4.1/getpw.c b/lib/libc4.3tahoe/compat-4.1/getpw.c new file mode 100644 index 0000000..67a9bd3 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/getpw.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getpw.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +getpw(uid, buf) +int uid; +char buf[]; +{ + static FILE *pwf; + register n, c; + register char *bp; + + if(pwf == 0) + pwf = fopen("/etc/passwd", "r"); + if(pwf == NULL) + return(1); + rewind(pwf); + + for (;;) { + bp = buf; + while((c=getc(pwf)) != '\n') { + if(c == EOF) + return(1); + *bp++ = c; + } + *bp++ = '\0'; + bp = buf; + n = 3; + while(--n) + while((c = *bp++) != ':') + if(c == '\n') + return(1); + while((c = *bp++) != ':') { + if(c<'0' || c>'9') + continue; + n = n*10+c-'0'; + } + if(n == uid) + return(0); + } +} diff --git a/lib/libc4.3tahoe/compat-4.1/gtty.c b/lib/libc4.3tahoe/compat-4.1/gtty.c new file mode 100644 index 0000000..9e589ae --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/gtty.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)gtty.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Writearound to old gtty system call. + */ + +#include + +gtty(fd, ap) + struct sgtty *ap; +{ + + return(ioctl(fd, TIOCGETP, ap)); +} diff --git a/lib/libc4.3tahoe/compat-4.1/nice.c b/lib/libc4.3tahoe/compat-4.1/nice.c new file mode 100644 index 0000000..9a2fa22 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/nice.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)nice.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include + +/* + * Backwards compatible nice. + */ +nice(incr) + int incr; +{ + int prio; + extern int errno; + + errno = 0; + prio = getpriority(PRIO_PROCESS, 0); + if (prio == -1 && errno) + return (-1); + return (setpriority(PRIO_PROCESS, 0, prio + incr)); +} diff --git a/lib/libc4.3tahoe/compat-4.1/pause.c b/lib/libc4.3tahoe/compat-4.1/pause.c new file mode 100644 index 0000000..b58a851 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/pause.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)pause.c 5.4 (Berkeley) 2/27/88"; +#endif LIBC_SCCS and not lint + +/* + * Backwards compatible pause. + */ +pause() +{ + long sigblock(); + + sigpause(sigblock(0L)); +} diff --git a/lib/libc4.3tahoe/compat-4.1/profiled/.MAP b/lib/libc4.3tahoe/compat-4.1/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/compat-4.1/rand.c b/lib/libc4.3tahoe/compat-4.1/rand.c new file mode 100644 index 0000000..009914c --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/rand.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rand.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +static long randx = 1; + +srand(x) +unsigned x; +{ + randx = x; +} + +rand() +{ + return((randx = randx * 1103515245 + 12345) & 0x7fffffff); +} diff --git a/lib/libc4.3tahoe/compat-4.1/stty.c b/lib/libc4.3tahoe/compat-4.1/stty.c new file mode 100644 index 0000000..6253baf --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/stty.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)stty.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Writearound to old stty system call. + */ + +#include + +stty(fd, ap) + struct sgtty *ap; +{ + + return(ioctl(fd, TIOCSETP, ap)); +} diff --git a/lib/libc4.3tahoe/compat-4.1/tell.c b/lib/libc4.3tahoe/compat-4.1/tell.c new file mode 100644 index 0000000..68a4ba1 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/tell.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)tell.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * return offset in file. + */ + +long lseek(); + +long tell(f) +{ + return(lseek(f, 0L, 1)); +} diff --git a/lib/libc4.3tahoe/compat-4.1/times.c b/lib/libc4.3tahoe/compat-4.1/times.c new file mode 100644 index 0000000..7843072 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/times.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)times.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include + +/* + * Backwards compatible times. + */ +struct tms { + int tms_utime; /* user time */ + int tms_stime; /* system time */ + int tms_cutime; /* user time, children */ + int tms_cstime; /* system time, children */ +}; + +times(tmsp) + register struct tms *tmsp; +{ + struct rusage ru; + + if (getrusage(RUSAGE_SELF, &ru) < 0) + return (-1); + tmsp->tms_utime = scale60(&ru.ru_utime); + tmsp->tms_stime = scale60(&ru.ru_stime); + if (getrusage(RUSAGE_CHILDREN, &ru) < 0) + return (-1); + tmsp->tms_cutime = scale60(&ru.ru_utime); + tmsp->tms_cstime = scale60(&ru.ru_stime); + return (0); +} + +static +scale60(tvp) + register struct timeval *tvp; +{ + + return (tvp->tv_sec * 60 + tvp->tv_usec / 16667); +} diff --git a/lib/libc4.3tahoe/compat-4.1/utime.c b/lib/libc4.3tahoe/compat-4.1/utime.c new file mode 100644 index 0000000..3e0b150 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/utime.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)utime.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +/* + * Backwards compatible utime. + */ + +utime(name, otv) + char *name; + int otv[]; +{ + struct timeval tv[2]; + + tv[0].tv_sec = otv[0]; tv[0].tv_usec = 0; + tv[1].tv_sec = otv[1]; tv[1].tv_usec = 0; + return (utimes(name, tv)); +} diff --git a/lib/libc4.3tahoe/compat-4.1/vlimit.c b/lib/libc4.3tahoe/compat-4.1/vlimit.c new file mode 100644 index 0000000..df8d0ff --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/vlimit.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vlimit.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * (Almost) backwards compatible vlimit. + */ +#include +#include +#include + +/* LIM_NORAISE is not emulated */ +#define LIM_NORAISE 0 /* if <> 0, can't raise limits */ +#define LIM_CPU 1 /* max secs cpu time */ +#define LIM_FSIZE 2 /* max size of file created */ +#define LIM_DATA 3 /* max growth of data space */ +#define LIM_STACK 4 /* max growth of stack */ +#define LIM_CORE 5 /* max size of ``core'' file */ +#define LIM_MAXRSS 6 /* max desired data+stack core usage */ + +#define NLIMITS 6 + +vlimit(limit, value) + int limit, value; +{ + struct rlimit rlim; + + if (limit <= 0 || limit > NLIMITS) + return (EINVAL); + if (value == -1) { + if (getrlimit(limit - 1, &rlim) < 0) + return (-1); + return (rlim.rlim_cur); + } + rlim.rlim_cur = value; + rlim.rlim_max = RLIM_INFINITY; + return (setrlimit(limit - 1, &rlim)); +} diff --git a/lib/libc4.3tahoe/compat-4.1/vtimes.c b/lib/libc4.3tahoe/compat-4.1/vtimes.c new file mode 100644 index 0000000..e689501 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.1/vtimes.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vtimes.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include + +/* + * Backwards compatible vtimes. + */ +struct vtimes { + int vm_utime; /* user time (60'ths) */ + int vm_stime; /* system time (60'ths) */ + /* divide next two by utime+stime to get averages */ + unsigned vm_idsrss; /* integral of d+s rss */ + unsigned vm_ixrss; /* integral of text rss */ + int vm_maxrss; /* maximum rss */ + int vm_majflt; /* major page faults */ + int vm_minflt; /* minor page faults */ + int vm_nswap; /* number of swaps */ + int vm_inblk; /* block reads */ + int vm_oublk; /* block writes */ +}; + +vtimes(par, chi) + register struct vtimes *par, *chi; +{ + struct rusage ru; + + if (par) { + if (getrusage(RUSAGE_SELF, &ru) < 0) + return (-1); + getvtimes(&ru, par); + } + if (chi) { + if (getrusage(RUSAGE_CHILDREN, &ru) < 0) + return (-1); + getvtimes(&ru, chi); + } + return (0); +} + +static +getvtimes(aru, avt) + register struct rusage *aru; + register struct vtimes *avt; +{ + + avt->vm_utime = scale60(&aru->ru_utime); + avt->vm_stime = scale60(&aru->ru_stime); + avt->vm_idsrss = ((aru->ru_idrss+aru->ru_isrss) / 100) * 60; + avt->vm_ixrss = aru->ru_ixrss / 100 * 60; + avt->vm_maxrss = aru->ru_maxrss; + avt->vm_majflt = aru->ru_majflt; + avt->vm_minflt = aru->ru_minflt; + avt->vm_nswap = aru->ru_nswap; + avt->vm_inblk = aru->ru_inblock; + avt->vm_oublk = aru->ru_oublock; +} + +static +scale60(tvp) + register struct timeval *tvp; +{ + + return (tvp->tv_sec * 60 + tvp->tv_usec / 16667); +} diff --git a/lib/libc4.3tahoe/compat-4.3/.MAP b/lib/libc4.3tahoe/compat-4.3/.MAP new file mode 100644 index 0000000..c18e5c4 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.3/.MAP @@ -0,0 +1,7 @@ +F ECVT.C;1 ecvt.c +F GCVT.C;1 gcvt.c +F MAKEFILE.;1 Makefile +D PROFILED profiled +F SIBUF.C;1 sibuf.c +F SOBUF.C;1 sobuf.c +F STROUT.C;1 strout.c diff --git a/lib/libc4.3tahoe/compat-4.3/Makefile b/lib/libc4.3tahoe/compat-4.3/Makefile new file mode 100644 index 0000000..6d0762d --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.3/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.4 (Berkeley) 7/9/88 +# + +DEFS= -DLIBC_SCCS +CFLAGS= -O ${DEFS} +SRCS= ecvt.c gcvt.c sibuf.c sobuf.c strout.c +OBJS= ecvt.o gcvt.o sibuf.o sobuf.o strout.o +TAGSFILE=tags + +.c.o: + @${CC} -p ${CFLAGS} -c $*.c + @-ld -X -o profiled/$*.o -r $*.o + ${CC} ${CFLAGS} -c $*.c + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../library; rm -f ${OBJS}) + (cd ../profiled; rm -f ${OBJS}) + ln ${OBJS} ../library + (cd profiled; ln ${OBJS} ../../profiled) + +tags: + cwd=`pwd`; \ + for i in ${SRCS}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +ecvt.o: ecvt.c +gcvt.o: gcvt.c +sibuf.o: sibuf.c /usr/include/stdio.h +sobuf.o: sobuf.c /usr/include/stdio.h +strout.o: strout.c /usr/include/stdio.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/compat-4.3/ecvt.c b/lib/libc4.3tahoe/compat-4.3/ecvt.c new file mode 100644 index 0000000..fd84d3b --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.3/ecvt.c @@ -0,0 +1,108 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ecvt.c 5.1 (Berkeley) 3/15/86"; +#endif LIBC_SCCS and not lint + +/* + * ecvt converts to decimal + * the number of digits is specified by ndigit + * decpt is set to the position of the decimal point + * sign is set to 0 for positive, 1 for negative + */ + +char *cvt(); + +#define NDIG 80 +char* +ecvt(arg, ndigits, decpt, sign) +double arg; +int ndigits, *decpt, *sign; +{ + return(cvt(arg, ndigits, decpt, sign, 1)); +} + +char* +fcvt(arg, ndigits, decpt, sign) +double arg; +int ndigits, *decpt, *sign; +{ + return(cvt(arg, ndigits, decpt, sign, 0)); +} + +static char* +cvt(arg, ndigits, decpt, sign, eflag) +double arg; +int ndigits, *decpt, *sign; +{ + register int r2; + double fi, fj; + register char *p, *p1; + static char buf[NDIG]; + double modf(); + + if (ndigits<0) + ndigits = 0; + if (ndigits>=NDIG-1) + ndigits = NDIG-2; + r2 = 0; + *sign = 0; + p = &buf[0]; + if (arg<0) { + *sign = 1; + arg = -arg; + } + arg = modf(arg, &fi); + p1 = &buf[NDIG]; + /* + * Do integer part + */ + if (fi != 0) { + p1 = &buf[NDIG]; + while (fi != 0) { + fj = modf(fi/10, &fi); + *--p1 = (int)((fj+.03)*10) + '0'; + r2++; + } + while (p1 < &buf[NDIG]) + *p++ = *p1++; + } else if (arg > 0) { + while ((fj = arg*10) < 1) { + arg = fj; + r2--; + } + } + p1 = &buf[ndigits]; + if (eflag==0) + p1 += r2; + *decpt = r2; + if (p1 < &buf[0]) { + buf[0] = '\0'; + return(buf); + } + while (p<=p1 && p<&buf[NDIG]) { + arg *= 10; + arg = modf(arg, &fj); + *p++ = (int)fj + '0'; + } + if (p1 >= &buf[NDIG]) { + buf[NDIG-1] = '\0'; + return(buf); + } + p = p1; + *p1 += 5; + while (*p1 > '9') { + *p1 = '0'; + if (p1>buf) + ++*--p1; + else { + *p1 = '1'; + (*decpt)++; + if (eflag==0) { + if (p>buf) + *p = '0'; + p++; + } + } + } + *p = '\0'; + return(buf); +} diff --git a/lib/libc4.3tahoe/compat-4.3/gcvt.c b/lib/libc4.3tahoe/compat-4.3/gcvt.c new file mode 100644 index 0000000..e78925d --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.3/gcvt.c @@ -0,0 +1,66 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)gcvt.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * gcvt - Floating output conversion to + * minimal length string + */ + +char *ecvt(); + +char * +gcvt(number, ndigit, buf) +double number; +char *buf; +{ + int sign, decpt; + register char *p1, *p2; + register i; + + p1 = ecvt(number, ndigit, &decpt, &sign); + p2 = buf; + if (sign) + *p2++ = '-'; + for (i=ndigit-1; i>0 && p1[i]=='0'; i--) + ndigit--; + if (decpt >= 0 && decpt-ndigit > 4 + || decpt < 0 && decpt < -3) { /* use E-style */ + decpt--; + *p2++ = *p1++; + *p2++ = '.'; + for (i=1; i + +char _sibuf[BUFSIZ]; diff --git a/lib/libc4.3tahoe/compat-4.3/sobuf.c b/lib/libc4.3tahoe/compat-4.3/sobuf.c new file mode 100644 index 0000000..e0b63f2 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.3/sobuf.c @@ -0,0 +1,7 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)sobuf.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +char _sobuf[BUFSIZ]; diff --git a/lib/libc4.3tahoe/compat-4.3/strout.c b/lib/libc4.3tahoe/compat-4.3/strout.c new file mode 100644 index 0000000..8b032c2 --- /dev/null +++ b/lib/libc4.3tahoe/compat-4.3/strout.c @@ -0,0 +1,27 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strout.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +_strout(count, string, adjust, file, fillch) +register char *string; +register count; +int adjust; +register FILE *file; +{ + while (adjust < 0) { + if (*string=='-' && fillch=='0') { + putc(*string++, file); + count--; + } + putc(fillch, file); + adjust++; + } + while (--count>=0) + putc(*string++, file); + while (adjust) { + putc(fillch, file); + adjust--; + } +} diff --git a/lib/libc4.3tahoe/compat-sys5/.MAP b/lib/libc4.3tahoe/compat-sys5/.MAP new file mode 100644 index 0000000..2b1cef6 --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/.MAP @@ -0,0 +1,20 @@ +D COMPAT-S.TAH compat-sys5.tahoe +D COMPAT-S.VAX compat-sys5.vax +F GETOPT.C;1 getopt.c +F MAKEFILE.;1 Makefile +F MEMCCPY.C;1 memccpy.c +F MEMCHR.C;1 memchr.c +F MEMCMP.C;1 memcmp.c +F MEMCPY.C;1 memcpy.c +F MEMSET.C;1 memset.c +D PROFILED profiled +F STRCATN.C;1 strcatn.c +F STRCHR.C;1 strchr.c +F STRCMPN.C;1 strcmpn.c +F STRCPYN.C;1 strcpyn.c +F STRCSPN.C;1 strcspn.c +F STRPBRK.C;1 strpbrk.c +F STRRCHR.C;1 strrchr.c +F STRSPN.C;1 strspn.c +F STRTOK.C;1 strtok.c +F TMPNAM.C;1 tmpnam.c diff --git a/lib/libc4.3tahoe/compat-sys5/Makefile b/lib/libc4.3tahoe/compat-sys5/Makefile new file mode 100644 index 0000000..ac1292c --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/Makefile @@ -0,0 +1,109 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that this notice is preserved and that due credit is given +# to the University of California at Berkeley. The name of the University +# may not be used to endorse or promote products derived from this +# software without specific prior written permission. This software +# is provided ``as is'' without express or implied warranty. +# +# @(#)Makefile 5.10.1.1 (Berkeley) 6/9/88 +# +# Many of these routines have been rewritten in assembly. The assembly +# source can be found in the directory stdio.${MACHINE}. The macro +# ${STDSRC} lists the files needed by all current implementations. The +# macros ${VAXSRC} and ${TAHOESRC} are the supplemental files needed by +# the VAX and the TAHOE. ${PORTSRC} is a list of all of the supplemental +# files. +DEFS= -DLIBC_SCCS +CFLAGS= -O ${DEFS} +STDSRC= getopt.c memccpy.c memchr.c memcmp.c memcpy.c memset.c strcspn.c \ + strpbrk.c strspn.c strtok.c tmpnam.c strcatn.c strcmpn.c strcpyn.c +STDOBJ= getopt.o memccpy.o memchr.o memcmp.o memcpy.o memset.o strcspn.o \ + strpbrk.o strspn.o strtok.o tmpnam.o strcatn.o strcmpn.o strcpyn.o +VAXSRC= +VAXOBJ= +TAHOESRC= strchr.c strrchr.c +TAHOEOBJ= strchr.o strrchr.o +PORTSRC= strchr.c strrchr.c +PORTOBJ= strchr.o strrchr.o +TAGSFILE=tags + +.c.o: + @${CC} -p ${CFLAGS} -c $*.c + @-ld -X -o profiled/$*.o -r $*.o + ${CC} ${CFLAGS} -c $*.c + @-ld -x -r $*.o + @mv a.out $*.o + +all: lib.${MACHINE} + +link: lib.${MACHINE} link.${MACHINE} + +link.vax: + (cd ../library; rm -f ${STDOBJ} ${VAXOBJ}) + (cd ../profiled; rm -f ${STDOBJ} ${VAXOBJ}) + ln ${STDOBJ} ${VAXOBJ} ../library + (cd profiled; ln ${STDOBJ} ${VAXOBJ} ../../profiled) + +link.tahoe: + (cd ../library; rm -f ${STDOBJ} ${TAHOEOBJ}) + (cd ../profiled; rm -f ${STDOBJ} ${TAHOEOBJ}) + ln ${STDOBJ} ${TAHOEOBJ} ../library + (cd profiled; ln ${STDOBJ} ${TAHOEOBJ} ../../profiled) + +lib.vax: ${STDOBJ} ${VAXOBJ} + +lib.tahoe: ${STDOBJ} ${TAHOEOBJ} + +tags: tags.${MACHINE} + +tags.vax: + cwd=`pwd`; \ + for i in ${STDSRC} ${VAXSRC}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +tags.tahoe: + cwd=`pwd`; \ + for i in ${STDSRC} ${TAHOESRC}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: depend.${MACHINE} + +depend.vax: ${STDSRC} ${VAXSRC} + mkdep ${CFLAGS} ${STDSRC} ${VAXSRC} + +depend.tahoe: ${STDSRC} ${TAHOESRC} + mkdep ${CFLAGS} ${STDSRC} ${TAHOESRC} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +getopt.o: getopt.c /usr/include/stdio.h +memccpy.o: memccpy.c +memchr.o: memchr.c +memcmp.o: memcmp.c +memcpy.o: memcpy.c +memset.o: memset.c +strcspn.o: strcspn.c +strpbrk.o: strpbrk.c +strspn.o: strspn.c +strtok.o: strtok.c +tmpnam.o: tmpnam.c /usr/include/sys/param.h /usr/include/sys/types.h +tmpnam.o: /usr/include/signal.h /usr/include/machine/trap.h +tmpnam.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +tmpnam.o: /usr/include/sys/stat.h /usr/include/sys/file.h /usr/include/stdio.h +strcatn.o: strcatn.c +strcmpn.o: strcmpn.c +strcpyn.o: strcpyn.c +strchr.o: strchr.c /usr/include/stdio.h +strrchr.o: strrchr.c /usr/include/stdio.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/compat-sys5/compat-sys5.tahoe/.MAP b/lib/libc4.3tahoe/compat-sys5/compat-sys5.tahoe/.MAP new file mode 100644 index 0000000..c3bea24 --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/compat-sys5.tahoe/.MAP @@ -0,0 +1 @@ +F MAKEFILE.;1 Makefile diff --git a/lib/libc4.3tahoe/compat-sys5/compat-sys5.tahoe/Makefile b/lib/libc4.3tahoe/compat-sys5/compat-sys5.tahoe/Makefile new file mode 100644 index 0000000..6ec532f --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/compat-sys5.tahoe/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.2 (Berkeley) 6/27/88 +# +DEFS= -DLIBC_SCCS +FLAGS= -I../../tahoe ${DEFS} +CFLAGS= -O ${FLAGS} +SRCS= +OBJS= +TAGSFILE=tags + +.s.o: + @/lib/cpp -E ${FLAGS} -DPROF $*.s | ${AS} -o $*.o + @-ld -X -o profiled/$*.o -r $*.o + /lib/cpp -E ${FLAGS} $*.s | ${AS} -o $*.o + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} +# (cd ../../library; rm -f ${OBJS}) +# (cd ../../profiled; rm -f ${OBJS}) +# ln ${OBJS} ../../library +# (cd profiled; ln ${OBJS} ../../../profiled) + +tags: +# (P=`pwd`; \ +# egrep "^ENTRY(.*)|^SYSCALL(.*)" ${SRCS} | sed \ +#"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ +# >> ${TAGSFILE}) + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: ${SRCS} +# mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. diff --git a/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/.MAP b/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/.MAP new file mode 100644 index 0000000..f3682dd --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/.MAP @@ -0,0 +1,4 @@ +F MAKEFILE.;1 Makefile +D PROFILED profiled +F STRCHR.S;1 strchr.s +F STRRCHR.S;1 strrchr.s diff --git a/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/Makefile b/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/Makefile new file mode 100644 index 0000000..ddd92ae --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/Makefile @@ -0,0 +1,59 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.2 (Berkeley) 6/27/88 +# +DEFS= -DLIBC_SCCS +FLAGS= -I../../vax ${DEFS} +CFLAGS= -O ${FLAGS} +SRCS= strchr.s strrchr.s +OBJS= strchr.o strrchr.o +TAGSFILE=tags + +.s.o: + @/lib/cpp -E ${FLAGS} -DPROF $*.s | ${AS} -o $*.o + @-ld -X -o profiled/$*.o -r $*.o + /lib/cpp -E ${FLAGS} $*.s | ${AS} -o $*.o + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + (P=`pwd`; \ + egrep "^ENTRY(.*)|^SYSCALL(.*)" ${SRCS} | sed \ +"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ + >> ${TAGSFILE}) + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: ${SRCS} + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +strchr.o: strchr.s ../../vax/DEFS.h +strrchr.o: strrchr.s ../../vax/DEFS.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/profiled/.MAP b/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/strchr.s b/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/strchr.s new file mode 100644 index 0000000..c60dd62 --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/strchr.s @@ -0,0 +1,87 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)strchr.s 5.2 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +#ifdef notdef +_sccsid:.asciz "@(#)index.s 5.4 (Berkeley) 5/25/88" +#endif + +/* + * Find the first occurence of c in the string cp. + * Return pointer to match or null pointer. + * + * char * + * index(cp, c) + * char *cp, c; + */ +#include "DEFS.h" + +ENTRY(strchr, 0) + movq 4(ap),r1 # r1 = cp; r2 = c + tstl r2 # check for special case c == '\0' + bneq 2f +1: + locc $0,$65535,(r1) # just find end of string + beql 1b # still looking + movl r1,r0 # found it + ret +2: + moval tbl,r3 # r3 = address of table + bbss $0,(r3),5f # insure not reentering + movab (r3)[r2],r5 # table entry for c + incb (r5) + movzwl $65535,r4 # fast access +3: + scanc r4,(r1),(r3),$1 # look for c or '\0' + beql 3b # still looking + movl r1,r0 # return pointer to char + tstb (r0) # if have found '\0' + bneq 4f + clrl r0 # else return 0 +4: + clrb (r5) # clean up table + clrb (r3) + ret + + .data +tbl: .space 256 + .text + +/* + * Reentrant, but slower version of index + */ +5: + movl r1,r3 +6: + locc $0,$65535,(r3) # look for '\0' + bneq 7f + locc r2,$65535,(r3) # look for c + bneq 8f + movl r1,r3 # reset pointer and ... + jbr 6b # ... try again +7: + subl3 r3,r1,r4 # length of short block + incl r4 # +1 for '\0' + locc r2,r4,(r3) # look for c + bneq 8f + ret +8: + movl r1,r0 # return pointer to char + ret diff --git a/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/strrchr.s b/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/strrchr.s new file mode 100644 index 0000000..17e02fc --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/compat-sys5.vax/strrchr.s @@ -0,0 +1,101 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)strrchr.s 5.2 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +#ifdef notdef +_sccsid:.asciz "@(#)rindex.s 5.4 (Berkeley) 5/25/88" +#endif + +/* + * Find the last occurence of c in the string cp. + * Return pointer to match or null pointer. + * + * char * + * rindex(cp, c) + * char *cp, c; + */ +#include "DEFS.h" + +ENTRY(strrchr, 0) + movq 4(ap),r1 # r1 = cp; r2 = c + tstl r2 # check for special case c == '\0' + bneq 2f +1: + locc $0,$65535,(r1) # just find end of string + beql 1b # still looking + movl r1,r0 # found it + ret +2: + moval tbl,r3 # r3 = address of table + bbss $0,(r3),5f # insure not reentering + movab (r3)[r2],r5 # table entry for c + incb (r5) + clrl r4 # last found +3: + scanc $65535,(r1),(r3),$1 # look for c or '\0' + beql 3b # keep looking + tstb (r1) # if have found '\0' + beql 4f # we are done + movl r1,r4 # save most recently found + incl r1 # skip over character + jbr 3b # keep looking +4: + movl r4,r0 # return last found (if any) + clrb (r5) # clean up table + clrb (r3) + ret + + .data +tbl: .space 256 + .text + +/* + * Reentrant, but slower version of rindex + */ +5: + movl r1,r3 + clrl r4 # r4 = pointer to last match +6: + locc $0,$65535,(r3) # look for '\0' + bneq 8f + decw r0 # r0 = 65535 +1: + locc r2,r0,(r3) # look for c + bneq 7f + movl r1,r3 # reset pointer and ... + jbr 6b # ... try again +7: + movl r1,r4 # stash pointer ... + addl3 $1,r1,r3 # ... skip over match and ... + decl r0 # ... decrement count + jbr 6b # ... try again +8: + subl3 r3,r1,r0 # length of short block + incl r0 # +1 for '\0' +9: + locc r2,r0,(r3) # look for c + beql 0f + movl r1,r4 # stash pointer ... + addl3 $1,r1,r3 # ... skip over match ... + decl r0 # ... adjust count and ... + jbr 9b # ... try again +0: + movl r4,r0 # return stashed pointer + ret diff --git a/lib/libc4.3tahoe/compat-sys5/getopt.c b/lib/libc4.3tahoe/compat-sys5/getopt.c new file mode 100644 index 0000000..dad7e06 --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/getopt.c @@ -0,0 +1,84 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getopt.c 4.7 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +/* + * get option letter from argument vector + */ +int opterr = 1, /* if error message should be printed */ + optind = 1, /* index into parent argv vector */ + optopt; /* character checked for validity */ +char *optarg; /* argument associated with option */ + +#define BADCH (int)'?' +#define EMSG "" +#define tell(s) { \ + if (opterr) { \ + fputs(*nargv, stderr); \ + fputs(s, stderr); \ + fputc(optopt, stderr); \ + fputc((int)'\n', stderr); \ + } \ + return(BADCH); \ +} + +getopt(nargc, nargv, ostr) + int nargc; + char **nargv, *ostr; +{ + static char *place = EMSG; /* option letter processing */ + register char *oli; /* option letter list index */ + char *index(); + + if (!*place) { /* update scanning pointer */ + if (optind >= nargc || *(place = nargv[optind]) != '-') + return(EOF); + if (place[1] && *++place == '-') { /* found "--" */ + ++optind; + return(EOF); + } + } /* option letter okay? */ + if ((optopt = (int)*place++) == (int)':' || + !(oli = index(ostr, optopt))) { + if (!*place) + ++optind; + tell(": illegal option -- "); + } + if (*++oli != ':') { /* don't need argument */ + optarg = NULL; + if (!*place) + ++optind; + } + else { /* need an argument */ + if (*place) /* no white space */ + optarg = place; + else if (nargc <= ++optind) { /* no arg */ + place = EMSG; + tell(": option requires an argument -- "); + } + else /* white space */ + optarg = nargv[optind]; + place = EMSG; + ++optind; + } + return(optopt); /* dump back option letter */ +} diff --git a/lib/libc4.3tahoe/compat-sys5/memccpy.c b/lib/libc4.3tahoe/compat-sys5/memccpy.c new file mode 100644 index 0000000..0c8e6ef --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/memccpy.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)memccpy.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +char * +memccpy(t, f, c, n) + register char *t, *f; + register c, n; +{ + while (--n >= 0) + if ((*t++ = *f++) == c) + return (t); + return (0); +} diff --git a/lib/libc4.3tahoe/compat-sys5/memchr.c b/lib/libc4.3tahoe/compat-sys5/memchr.c new file mode 100644 index 0000000..9de6b1f --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/memchr.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)memchr.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +char * +memchr(s, c, n) + register char *s; + register c, n; +{ + while (--n >= 0) + if (*s++ == c) + return (--s); + return (0); +} diff --git a/lib/libc4.3tahoe/compat-sys5/memcmp.c b/lib/libc4.3tahoe/compat-sys5/memcmp.c new file mode 100644 index 0000000..9afe727 --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/memcmp.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)memcmp.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +memcmp(s1, s2, n) + register char *s1, *s2; + register n; +{ + while (--n >= 0) + if (*s1++ != *s2++) + return (*--s1 - *--s2); + return (0); +} diff --git a/lib/libc4.3tahoe/compat-sys5/memcpy.c b/lib/libc4.3tahoe/compat-sys5/memcpy.c new file mode 100644 index 0000000..a92b47c --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/memcpy.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)memcpy.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +char * +memcpy(t, f, n) + register char *t, *f; + register n; +{ + register char *p = t; + + while (--n >= 0) + *t++ = *f++; + + return (p); +} diff --git a/lib/libc4.3tahoe/compat-sys5/memset.c b/lib/libc4.3tahoe/compat-sys5/memset.c new file mode 100644 index 0000000..1f92da8 --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/memset.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)memset.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +char * +memset(s, c, n) + register char *s; + register c, n; +{ + register char *p = s; + + while (--n >= 0) + *s++ = c; + + return (p); +} diff --git a/lib/libc4.3tahoe/compat-sys5/profiled/.MAP b/lib/libc4.3tahoe/compat-sys5/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/compat-sys5/strcatn.c b/lib/libc4.3tahoe/compat-sys5/strcatn.c new file mode 100644 index 0000000..8db783b --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/strcatn.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strcatn.c 4.3 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Concatenate s2 on the end of s1. S1's space must be large enough. + * At most n characters are moved. + * Return s1. + */ + +char * +strcatn(s1, s2, n) +register char *s1, *s2; +register n; +{ + register char *os1; + + os1 = s1; + while (*s1++) + ; + --s1; + while (*s1++ = *s2++) + if (--n < 0) { + *--s1 = '\0'; + break; + } + return(os1); +} diff --git a/lib/libc4.3tahoe/compat-sys5/strchr.c b/lib/libc4.3tahoe/compat-sys5/strchr.c new file mode 100644 index 0000000..678cfef --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/strchr.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strchr.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#ifdef notdef +static char sccsid[] = "@(#)index.c 5.3 (Berkeley) 6/2/88"; +#endif + +#include + +char * +strchr(p, ch) + register char *p, ch; +{ + for (;; ++p) { + if (*p == ch) + return(p); + if (!*p) + return((char *)NULL); + } + /* NOTREACHED */ +} diff --git a/lib/libc4.3tahoe/compat-sys5/strcmpn.c b/lib/libc4.3tahoe/compat-sys5/strcmpn.c new file mode 100644 index 0000000..5e5d4f7 --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/strcmpn.c @@ -0,0 +1,24 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strcmpn.c 4.3 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Compare strings (at most n bytes): s1>s2: >0 s1==s2: 0 s1= 0 && *s1 == *s2++) + if (*s1++ == '\0') + return(0); + return(n<0 ? 0 : *s1 - *--s2); +} diff --git a/lib/libc4.3tahoe/compat-sys5/strcpyn.c b/lib/libc4.3tahoe/compat-sys5/strcpyn.c new file mode 100644 index 0000000..f791647 --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/strcpyn.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strcpyn.c 4.3 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Copy s2 to s1, truncating or null-padding to always copy n bytes + * return s1 + */ + +char * +strcpyn(s1, s2, n) +register char *s1, *s2; +{ + register i; + register char *os1; + + os1 = s1; + for (i = 0; i < n; i++) + if ((*s1++ = *s2++) == '\0') { + while (++i < n) + *s1++ = '\0'; + return(os1); + } + return(os1); +} diff --git a/lib/libc4.3tahoe/compat-sys5/strcspn.c b/lib/libc4.3tahoe/compat-sys5/strcspn.c new file mode 100644 index 0000000..8d61d6f --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/strcspn.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strcspn.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +strcspn(s, set) + register char *s, *set; +{ + register n = 0; + register char *p; + register c; + + while (c = *s++) { + for (p = set; *p; p++) + if (c == *p) + break; + if (*p) + return (n); + n++; + } + return (n); +} diff --git a/lib/libc4.3tahoe/compat-sys5/strpbrk.c b/lib/libc4.3tahoe/compat-sys5/strpbrk.c new file mode 100644 index 0000000..2b89140 --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/strpbrk.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strpbrk.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +char * +strpbrk(s, brk) + register char *s, *brk; +{ + register char *p; + register c; + + while (c = *s) { + for (p = brk; *p; p++) + if (c == *p) + return (s); + s++; + } + return (0); +} diff --git a/lib/libc4.3tahoe/compat-sys5/strrchr.c b/lib/libc4.3tahoe/compat-sys5/strrchr.c new file mode 100644 index 0000000..f30068a --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/strrchr.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strrchr.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#ifdef notdef +static char sccsid[] = "@(#)rindex.c 5.3 (Berkeley) 6/2/88"; +#endif + +#include + +char * +strrchr(p, ch) + register char *p, ch; +{ + register char *save; + + for (save = NULL;; ++p) { + if (*p == ch) + save = p; + if (!*p) + return(save); + } + /* NOTREACHED */ +} diff --git a/lib/libc4.3tahoe/compat-sys5/strspn.c b/lib/libc4.3tahoe/compat-sys5/strspn.c new file mode 100644 index 0000000..c02c79b --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/strspn.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strspn.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +strspn(s, set) + register char *s, *set; +{ + register n = 0; + register char *p; + register c; + + while (c = *s++) { + for (p = set; *p; p++) + if (c == *p) + break; + if (!*p) + return (n); + n++; + } + return (n); +} diff --git a/lib/libc4.3tahoe/compat-sys5/strtok.c b/lib/libc4.3tahoe/compat-sys5/strtok.c new file mode 100644 index 0000000..b8ce608 --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/strtok.c @@ -0,0 +1,57 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strtok.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +char * +strtok(s, sep) + register char *s, *sep; +{ + register char *p; + register c; + static char *lasts; + + if (s == 0) + s = lasts; + if (s == 0) + return (0); + + while (c = *s) { + if (!index(sep, c)) + break; + s++; + } + + if (c == '\0') { + lasts = 0; + return (0); + } + + for (p = s; c = *++p; ) + if (index(sep, c)) + break; + + if (c == '\0') + lasts = 0; + else { + *p++ = '\0'; + lasts = p; + } + return (s); +} diff --git a/lib/libc4.3tahoe/compat-sys5/tmpnam.c b/lib/libc4.3tahoe/compat-sys5/tmpnam.c new file mode 100644 index 0000000..fc98027 --- /dev/null +++ b/lib/libc4.3tahoe/compat-sys5/tmpnam.c @@ -0,0 +1,91 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)tmpnam.c 4.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include + +#define P_tmpdir "/usr/tmp" + +FILE * +tmpfile() +{ + FILE *fp; + char *f, name[MAXPATHLEN], *tmpnam(); + + if (!(fp = fopen(f = tmpnam(name), "w+"))) { + fprintf(stderr, "tmpfile: cannot open %s.\n", name); + return(NULL); + } + (void)unlink(f); + return(fp); +} + +char * +tmpnam(s) + char *s; +{ + static char name[MAXPATHLEN]; + char *mktemp(); + + if (!s) + s = name; + (void)sprintf(s, "%s/XXXXXX", P_tmpdir); + return(mktemp(s)); +} + +char * +tempnam(dir, pfx) + char *dir, *pfx; +{ + struct stat buf; + char *f, *name, *getenv(), *malloc(), *mktemp(), *strcat(), *strcpy(); + + if (!(name = malloc((u_int)MAXPATHLEN))) + return(NULL); + if ((f = getenv("TMPDIR")) && !stat(f, &buf) && + (buf.st_mode&S_IFMT) == S_IFDIR && !access(f, W_OK|X_OK)) { + (void)strcpy(name, f); + goto done; + } + if (dir && !stat(dir, &buf) && + (buf.st_mode&S_IFMT) == S_IFDIR && !access(dir, W_OK|X_OK)) { + (void)strcpy(name, dir); + goto done; + } + if (!stat(P_tmpdir, &buf) && + (buf.st_mode&S_IFMT) == S_IFDIR && !access(P_tmpdir, W_OK|X_OK)) { + (void)strcpy(name, P_tmpdir); + goto done; + } + if (!stat("/tmp", &buf) && + (buf.st_mode&S_IFMT) == S_IFDIR && !access("/tmp", W_OK|X_OK)) { + (void)strcpy(name, "/tmp"); + goto done; + } + return(NULL); +done: (void)strcat(name, "/"); + if (pfx) + (void)strcat(name, pfx); + (void)strcat(name, "XXXXXX"); + return(mktemp(name)); +} diff --git a/lib/libc4.3tahoe/gen/.MAP b/lib/libc4.3tahoe/gen/.MAP new file mode 100644 index 0000000..80c89bb --- /dev/null +++ b/lib/libc4.3tahoe/gen/.MAP @@ -0,0 +1,87 @@ +F :ERRFIX.;1 :errfix +F ABORT.C;1 abort.c +F ALARM.C;1 alarm.c +F ATOI.C;1 atoi.c +F ATOL.C;1 atol.c +F BCMP.C;1 bcmp.c +F BCOPY.C;1 bcopy.c +F BZERO.C;1 bzero.c +F CALLOC.C;1 calloc.c +F CLOSEDIR.C;1 closedir.c +F CRYPT.C;1 crypt.c +F CTIME.C;1 ctime.c +F CTYPE_.C;1 ctype_.c +F DISKLABE.C;1 disklabel.c +F ERRLST.C;1 errlst.c +F EXECVP.C;1 execvp.c +F FAKCU.C;1 fakcu.c +F FFS.C;1 ffs.c +F FSTAB.C;1 fstab.c +D GEN.TAH gen.tahoe +D GEN.VAX gen.vax +F GETENV.C;1 getenv.c +F GETGRENT.C;1 getgrent.c +F GETGRGID.C;1 getgrgid.c +F GETGRNAM.C;1 getgrnam.c +F GETLOGIN.C;1 getlogin.c +F GETPASS.C;1 getpass.c +F GETPWENT.C;1 getpwent.c +F GETPWNAM.C;1 getpwnamuid.c +F GETTTYEN.C;1 getttyent.c +F GETTTYNA.C;1 getttynam.c +F GETUSERS.C;1 getusershell.c +F GETWD.C;1 getwd.c +F INDEX.C;1 index.c +F INITGROU.C;1 initgroups.c +F INSQUE.C;1 insque.c +F ISATTY.C;1 isatty.c +F MAKEFILE.;1 Makefile +F MALLOC.C;1 malloc.c +F MKTEMP.C;1 mktemp.c +F NDBM.C;1 ndbm.c +F NLIST.C;1 nlist.c +F OPENDIR.C;1 opendir.c +F PERROR.C;1 perror.c +F POPEN.C;1 popen.c +D PROFILED profiled +F PSIGNAL.C;1 psignal.c +F QSORT.C;1 qsort.c +F RANDOM.C;1 random.c +F READDIR.C;1 readdir.c +F REGEX.C;1 regex.c +D REGEXP regexp +F REMQUE.C;1 remque.c +F RINDEX.C;1 rindex.c +F SCANDIR.C;1 scandir.c +F SEEKDIR.C;1 seekdir.c +F SETEGID.C;1 setegid.c +F SETENV.C;1 setenv.c +F SETEUID.C;1 seteuid.c +F SETGID.C;1 setgid.c +F SETJMPER.C;1 setjmperr.c +F SETRGID.C;1 setrgid.c +F SETRUID.C;1 setruid.c +F SETUID.C;1 setuid.c +F SIGINTER.C;1 siginterrupt.c +F SIGLIST.C;1 siglist.c +F SIGNAL.C;1 signal.c +F SLEEP.C;1 sleep.c +F STRCASEC.C;1 strcasecmp.c +F STRCAT.C;1 strcat.c +F STRCMP.C;1 strcmp.c +F STRCPY.C;1 strcpy.c +F STRLEN.C;1 strlen.c +F STRNCAT.C;1 strncat.c +F STRNCMP.C;1 strncmp.c +F STRNCPY.C;1 strncpy.c +F SWAB.C;1 swab.c +F SYSLOG.C;1 syslog.c +F SYSTEM.C;1 system.c +F TELLDIR.C;1 telldir.c +F TIME.C;1 time.c +F TIMEZONE.C;1 timezone.c +F TTYNAME.C;1 ttyname.c +F TTYSLOT.C;1 ttyslot.c +F UALARM.C;1 ualarm.c +F USLEEP.C;1 usleep.c +F VALLOC.C;1 valloc.c diff --git a/lib/libc4.3tahoe/gen/:errfix b/lib/libc4.3tahoe/gen/:errfix new file mode 100644 index 0000000..299f428 --- /dev/null +++ b/lib/libc4.3tahoe/gen/:errfix @@ -0,0 +1,4 @@ +?sys_nerr? +1,.-5g/\.data/s//\.text/ +w +q diff --git a/lib/libc4.3tahoe/gen/Makefile b/lib/libc4.3tahoe/gen/Makefile new file mode 100644 index 0000000..efde886 --- /dev/null +++ b/lib/libc4.3tahoe/gen/Makefile @@ -0,0 +1,258 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.26 (Berkeley) 6/27/88 +# +# Many of these routines have been rewritten in assembly. The assembly +# source can be found in the directory gen.${MACHINE}. The macro +# ${STDSRC} lists the files needed by all current implementations. The +# macros ${VAXSRC} and ${TAHOESRC} are the supplemental files needed by +# the VAX and the TAHOE. ${PORTSRC} is a list of all of the supplemental +# files. + +VPATH= regexp +DEFS= -DLIBC_SCCS +CFLAGS= -O ${DEFS} +STDSRC= abort.c alarm.c atoi.c atol.c calloc.c closedir.c crypt.c ctime.c \ + ctype_.c disklabel.c errlst.c execvp.c fakcu.c fstab.c \ + getenv.c getgrent.c getgrgid.c getgrnam.c getlogin.c getpass.c \ + getpwent.c getpwnamuid.c getttyent.c getttynam.c getusershell.c \ + getwd.c initgroups.c isatty.c malloc.c mktemp.c ndbm.c nlist.c \ + opendir.c perror.c popen.c psignal.c qsort.c random.c readdir.c \ + regerror.c regex.c regexp.c regsub.c scandir.c seekdir.c setegid.c \ + setenv.c seteuid.c setgid.c setjmperr.c setrgid.c setruid.c setuid.c \ + siginterrupt.c siglist.c signal.c sleep.c strcasecmp.c swab.c \ + syslog.c system.c telldir.c time.c timezone.c ttyname.c ttyslot.c \ + ualarm.c usleep.c valloc.c +STDOBJ= abort.o alarm.o atoi.o atol.o calloc.o closedir.o crypt.o ctime.o \ + ctype_.o disklabel.o errlst.o execvp.o fakcu.o fstab.o \ + getenv.o getgrent.o getgrgid.o getgrnam.o getlogin.o getpass.o \ + getpwent.o getpwnamuid.o getttyent.o getttynam.o getusershell.o \ + getwd.o initgroups.o isatty.o malloc.o mktemp.o ndbm.o nlist.o \ + opendir.o perror.o popen.o psignal.o qsort.o random.o readdir.o \ + regerror.o regex.o regexp.o regsub.o scandir.o seekdir.o setegid.o \ + setenv.o seteuid.o setgid.o setjmperr.o setrgid.o setruid.o setuid.o \ + siginterrupt.o siglist.o signal.o sleep.o strcasecmp.o swab.o \ + syslog.o system.o telldir.o time.o timezone.o ttyname.o ttyslot.o \ + ualarm.o usleep.o valloc.o +VAXSRC= +VAXOBJ= +TAHOESRC= index.c rindex.c +TAHOEOBJ= index.o rindex.o +PORTSRC= bcmp.c bcopy.c bzero.c ffs.c index.c insque.c \ + remque.c rindex.c strcat.c strcmp.c strcpy.c strlen.c \ + strncat.c strncmp.c strncpy.c +PORTOBJ= bcmp.o bcopy.o bzero.o ffs.o index.o insque.o \ + remque.o rindex.o strcat.o strcmp.o strcpy.o strlen.o \ + strncat.o strncmp.o strncpy.o +TAGSFILE=tags + +.c.o: + @${CC} -p ${CFLAGS} -c $*.c + @-ld -X -o profiled/$*.o -r $*.o + ${CC} ${CFLAGS} -c $*.c + @-ld -x -r $*.o + @mv a.out $*.o + +all: lib.${MACHINE} + +link: lib.${MACHINE} link.${MACHINE} + +link.vax: + (cd ../library; rm -f ${STDOBJ} ${VAXOBJ}) + (cd ../profiled; rm -f ${STDOBJ} ${VAXOBJ}) + ln ${STDOBJ} ${VAXOBJ} ../library + (cd profiled; ln ${STDOBJ} ${VAXOBJ} ../../profiled) + +link.tahoe: + (cd ../library; rm -f ${STDOBJ} ${TAHOEOBJ}) + (cd ../profiled; rm -f ${STDOBJ} ${TAHOEOBJ}) + ln ${STDOBJ} ${TAHOEOBJ} ../library + (cd profiled; ln ${STDOBJ} ${TAHOEOBJ} ../../profiled) + +lib.vax: ${STDOBJ} ${VAXOBJ} + +lib.tahoe: ${STDOBJ} ${TAHOEOBJ} + +errlst.o: errlst.c + ${CC} -S ${DEFS} errlst.c + ed - <:errfix errlst.s + as -o errlst.o errlst.s + cp errlst.o profiled/errlst.o + rm -f errlst.s + +tags: tags.${MACHINE} + +tags.vax: ${STDSRC} ${VAXSRC} + cwd=`pwd`; \ + for i in ${STDSRC} ${VAXSRC}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +tags.tahoe: ${STDSRC} ${TAHOESRC} + cwd=`pwd`; \ + for i in ${STDSRC} ${TAHOESRC}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: depend.${MACHINE} + +depend.vax: ${STDSRC} ${VAXSRC} + mkdep ${CFLAGS} ${STDSRC} ${VAXSRC} + +depend.tahoe: ${STDSRC} ${TAHOESRC} + mkdep ${CFLAGS} ${STDSRC} ${TAHOESRC} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +abort.o: abort.c /usr/include/signal.h /usr/include/machine/trap.h +alarm.o: alarm.c /usr/include/sys/time.h /usr/include/time.h +atoi.o: atoi.c +atol.o: atol.c +calloc.o: calloc.c +closedir.o: closedir.c /usr/include/sys/param.h /usr/include/sys/types.h +closedir.o: /usr/include/signal.h /usr/include/machine/trap.h +closedir.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +closedir.o: /usr/include/sys/dir.h +crypt.o: crypt.c +ctime.o: ctime.c /usr/include/sys/param.h /usr/include/sys/types.h +ctime.o: /usr/include/signal.h /usr/include/machine/trap.h +ctime.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +ctime.o: /usr/include/sys/time.h /usr/include/time.h /usr/include/tzfile.h +ctype_.o: ctype_.c /usr/include/ctype.h +disklabel.o: disklabel.c /usr/include/sys/param.h /usr/include/sys/types.h +disklabel.o: /usr/include/signal.h /usr/include/machine/trap.h +disklabel.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +disklabel.o: /usr/include/sys/fs.h /usr/include/sys/file.h +disklabel.o: /usr/include/sys/disklabel.h /usr/include/stdio.h +disklabel.o: /usr/include/strings.h /usr/include/ctype.h +errlst.o: errlst.c +execvp.o: execvp.c /usr/include/errno.h +fakcu.o: fakcu.c +fstab.o: fstab.c /usr/include/fstab.h /usr/include/stdio.h /usr/include/ctype.h +getenv.o: getenv.c /usr/include/stdio.h +getgrent.o: getgrent.c /usr/include/stdio.h /usr/include/grp.h +getgrgid.o: getgrgid.c /usr/include/grp.h +getgrnam.o: getgrnam.c /usr/include/grp.h +getlogin.o: getlogin.c /usr/include/utmp.h +getpass.o: getpass.c /usr/include/stdio.h /usr/include/signal.h +getpass.o: /usr/include/machine/trap.h /usr/include/sgtty.h +getpass.o: /usr/include/sys/ioctl.h /usr/include/sys/ttychars.h +getpass.o: /usr/include/sys/ttydev.h +getpwent.o: getpwent.c /usr/include/stdio.h /usr/include/pwd.h +getpwent.o: /usr/include/ndbm.h +getpwnamuid.o: getpwnamuid.c /usr/include/stdio.h /usr/include/pwd.h +getpwnamuid.o: /usr/include/ndbm.h /usr/include/sys/file.h +getttyent.o: getttyent.c /usr/include/stdio.h /usr/include/strings.h +getttyent.o: /usr/include/ttyent.h +getttynam.o: getttynam.c /usr/include/ttyent.h +getusershell.o: getusershell.c /usr/include/sys/param.h +getusershell.o: /usr/include/sys/types.h /usr/include/signal.h +getusershell.o: /usr/include/machine/trap.h /usr/include/machine/machparam.h +getusershell.o: /usr/include/machine/endian.h /usr/include/sys/file.h +getusershell.o: /usr/include/sys/stat.h /usr/include/ctype.h +getusershell.o: /usr/include/stdio.h +getwd.o: getwd.c /usr/include/sys/param.h /usr/include/sys/types.h +getwd.o: /usr/include/signal.h /usr/include/machine/trap.h +getwd.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +getwd.o: /usr/include/sys/stat.h /usr/include/sys/dir.h +initgroups.o: initgroups.c /usr/include/stdio.h /usr/include/sys/param.h +initgroups.o: /usr/include/sys/types.h /usr/include/signal.h +initgroups.o: /usr/include/machine/trap.h /usr/include/machine/machparam.h +initgroups.o: /usr/include/machine/endian.h /usr/include/grp.h +isatty.o: isatty.c /usr/include/sgtty.h /usr/include/sys/ioctl.h +isatty.o: /usr/include/sys/ttychars.h /usr/include/sys/ttydev.h +malloc.o: malloc.c /usr/include/sys/types.h +mktemp.o: mktemp.c /usr/include/sys/types.h /usr/include/sys/file.h +mktemp.o: /usr/include/sys/stat.h /usr/include/errno.h /usr/include/stdio.h +mktemp.o: /usr/include/ctype.h +ndbm.o: ndbm.c /usr/include/sys/types.h /usr/include/sys/stat.h +ndbm.o: /usr/include/sys/file.h /usr/include/stdio.h /usr/include/errno.h +ndbm.o: /usr/include/ndbm.h +nlist.o: nlist.c /usr/include/sys/types.h /usr/include/a.out.h +nlist.o: /usr/include/sys/exec.h /usr/include/stdio.h +opendir.o: opendir.c /usr/include/sys/param.h /usr/include/sys/types.h +opendir.o: /usr/include/signal.h /usr/include/machine/trap.h +opendir.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +opendir.o: /usr/include/sys/dir.h +perror.o: perror.c /usr/include/sys/types.h /usr/include/sys/uio.h +popen.o: popen.c /usr/include/stdio.h /usr/include/signal.h +popen.o: /usr/include/machine/trap.h +psignal.o: psignal.c /usr/include/signal.h /usr/include/machine/trap.h +qsort.o: qsort.c +random.o: random.c /usr/include/stdio.h +readdir.o: readdir.c /usr/include/sys/param.h /usr/include/sys/types.h +readdir.o: /usr/include/signal.h /usr/include/machine/trap.h +readdir.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +readdir.o: /usr/include/sys/dir.h +regerror.o: regexp/regerror.c /usr/include/stdio.h +regex.o: regex.c +regexp.o: regexp/regexp.c /usr/include/stdio.h /usr/include/ctype.h +regexp.o: /usr/include/regexp.h regexp/regmagic.h +regsub.o: regexp/regsub.c /usr/include/stdio.h /usr/include/regexp.h +regsub.o: regexp/regmagic.h +scandir.o: scandir.c /usr/include/sys/types.h /usr/include/sys/stat.h +scandir.o: /usr/include/sys/dir.h +seekdir.o: seekdir.c /usr/include/sys/param.h /usr/include/sys/types.h +seekdir.o: /usr/include/signal.h /usr/include/machine/trap.h +seekdir.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +seekdir.o: /usr/include/sys/dir.h +setegid.o: setegid.c +setenv.o: setenv.c /usr/include/sys/types.h /usr/include/stdio.h +seteuid.o: seteuid.c +setgid.o: setgid.c +setjmperr.o: setjmperr.c +setrgid.o: setrgid.c +setruid.o: setruid.c +setuid.o: setuid.c +siginterrupt.o: siginterrupt.c /usr/include/signal.h +siginterrupt.o: /usr/include/machine/trap.h +siglist.o: siglist.c /usr/include/signal.h /usr/include/machine/trap.h +signal.o: signal.c /usr/include/signal.h /usr/include/machine/trap.h +sleep.o: sleep.c /usr/include/sys/time.h /usr/include/time.h +sleep.o: /usr/include/signal.h /usr/include/machine/trap.h +strcasecmp.o: strcasecmp.c /usr/include/sys/types.h +swab.o: swab.c +syslog.o: syslog.c /usr/include/sys/types.h /usr/include/sys/socket.h +syslog.o: /usr/include/sys/file.h /usr/include/sys/signal.h +syslog.o: /usr/include/machine/trap.h /usr/include/sys/syslog.h +syslog.o: /usr/include/netdb.h /usr/include/strings.h +system.o: system.c /usr/include/signal.h /usr/include/machine/trap.h +telldir.o: telldir.c /usr/include/sys/param.h /usr/include/sys/types.h +telldir.o: /usr/include/signal.h /usr/include/machine/trap.h +telldir.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +telldir.o: /usr/include/sys/dir.h +time.o: time.c /usr/include/sys/types.h /usr/include/sys/time.h +time.o: /usr/include/time.h +timezone.o: timezone.c /usr/include/sys/types.h /usr/include/sys/time.h +timezone.o: /usr/include/time.h /usr/include/stdio.h /usr/include/tzfile.h +ttyname.o: ttyname.c /usr/include/sys/param.h /usr/include/sys/types.h +ttyname.o: /usr/include/signal.h /usr/include/machine/trap.h +ttyname.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +ttyname.o: /usr/include/sys/dir.h /usr/include/sys/stat.h +ttyslot.o: ttyslot.c /usr/include/ttyent.h +ualarm.o: ualarm.c /usr/include/sys/time.h /usr/include/time.h +usleep.o: usleep.c /usr/include/sys/time.h /usr/include/time.h +usleep.o: /usr/include/signal.h /usr/include/machine/trap.h +valloc.o: valloc.c +index.o: index.c /usr/include/stdio.h +rindex.o: rindex.c /usr/include/stdio.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/gen/abort.c b/lib/libc4.3tahoe/gen/abort.c new file mode 100644 index 0000000..04c3287 --- /dev/null +++ b/lib/libc4.3tahoe/gen/abort.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)abort.c 5.4 (Berkeley) 9/30/87"; +#endif LIBC_SCCS and not lint + +/* C library -- abort */ + +#include "signal.h" + +abort() +{ + sigblock(~0L); + signal(SIGILL, SIG_DFL); + sigsetmask(~sigmask(SIGILL)); + kill(getpid(), SIGILL); +} diff --git a/lib/libc4.3tahoe/gen/alarm.c b/lib/libc4.3tahoe/gen/alarm.c new file mode 100644 index 0000000..81ed615 --- /dev/null +++ b/lib/libc4.3tahoe/gen/alarm.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)alarm.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Backwards compatible alarm. + */ +#include + +alarm(secs) + int secs; +{ + struct itimerval it, oitv; + register struct itimerval *itp = ⁢ + + timerclear(&itp->it_interval); + itp->it_value.tv_sec = secs; + itp->it_value.tv_usec = 0; + if (setitimer(ITIMER_REAL, itp, &oitv) < 0) + return (-1); + if (oitv.it_value.tv_usec) + oitv.it_value.tv_sec++; + return (oitv.it_value.tv_sec); +} diff --git a/lib/libc4.3tahoe/gen/atoi.c b/lib/libc4.3tahoe/gen/atoi.c new file mode 100644 index 0000000..e6f7be2 --- /dev/null +++ b/lib/libc4.3tahoe/gen/atoi.c @@ -0,0 +1,28 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)atoi.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +atoi(p) +register char *p; +{ + register int n; + register int f; + + n = 0; + f = 0; + for(;;p++) { + switch(*p) { + case ' ': + case '\t': + continue; + case '-': + f++; + case '+': + p++; + } + break; + } + while(*p >= '0' && *p <= '9') + n = n*10 + *p++ - '0'; + return(f? -n: n); +} diff --git a/lib/libc4.3tahoe/gen/atol.c b/lib/libc4.3tahoe/gen/atol.c new file mode 100644 index 0000000..bbfab95 --- /dev/null +++ b/lib/libc4.3tahoe/gen/atol.c @@ -0,0 +1,29 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)atol.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +long +atol(p) +register char *p; +{ + long n; + register int f; + + n = 0; + f = 0; + for(;;p++) { + switch(*p) { + case ' ': + case '\t': + continue; + case '-': + f++; + case '+': + p++; + } + break; + } + while(*p >= '0' && *p <= '9') + n = n*10 + *p++ - '0'; + return(f? -n: n); +} diff --git a/lib/libc4.3tahoe/gen/bcmp.c b/lib/libc4.3tahoe/gen/bcmp.c new file mode 100644 index 0000000..c914da9 --- /dev/null +++ b/lib/libc4.3tahoe/gen/bcmp.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bcmp.c 5.1 (Berkeley) 1/27/87"; +#endif LIBC_SCCS and not lint + +/* + * bcmp -- vax cmpc3 instruction + */ +bcmp(b1, b2, length) + register char *b1, *b2; + register int length; +{ + + if (length == 0) + return (0); + do + if (*b1++ != *b2++) + break; + while (--length); + return(length); +} diff --git a/lib/libc4.3tahoe/gen/bcopy.c b/lib/libc4.3tahoe/gen/bcopy.c new file mode 100644 index 0000000..41741df --- /dev/null +++ b/lib/libc4.3tahoe/gen/bcopy.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bcopy.c 5.1 (Berkeley) 1/27/87"; +#endif LIBC_SCCS and not lint + +/* + * bcopy -- vax movc3 instruction + */ +bcopy(src, dst, length) + register char *src, *dst; + register int length; +{ + if (length && src != dst) + if ((u_int)dst < (u_int)src) + if (((int)src | (int)dst | length) & 3) + do /* copy by bytes */ + *dst++ = *src++; + while (--length); + else { + length >>= 2; + do /* copy by longs */ + *((long *)dst)++ = *((long *)src)++; + while (--length); + } + else { /* copy backwards */ + src += length; + dst += length; + if (((int)src | (int)dst | length) & 3) + do /* copy by bytes */ + *--dst = *--src; + while (--length); + else { + length >>= 2; + do /* copy by shorts */ + *--((long *)dst) = *--((long *)src); + while (--length); + } + } + return(0); +} diff --git a/lib/libc4.3tahoe/gen/bzero.c b/lib/libc4.3tahoe/gen/bzero.c new file mode 100644 index 0000000..748214a --- /dev/null +++ b/lib/libc4.3tahoe/gen/bzero.c @@ -0,0 +1,24 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)bzero.c 5.1 (Berkeley) 1/27/87"; +#endif LIBC_SCCS and not lint + +/* + * bzero -- vax movc5 instruction + */ +bzero(b, length) + register char *b; + register int length; +{ + + if (length) + do + *b++ = '\0'; + while (--length); + return(length); +} diff --git a/lib/libc4.3tahoe/gen/calloc.c b/lib/libc4.3tahoe/gen/calloc.c new file mode 100644 index 0000000..20e5422 --- /dev/null +++ b/lib/libc4.3tahoe/gen/calloc.c @@ -0,0 +1,27 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)calloc.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Calloc - allocate and clear memory block + */ +char * +calloc(num, size) + register unsigned num, size; +{ + extern char *malloc(); + register char *p; + + size *= num; + if (p = malloc(size)) + bzero(p, size); + return (p); +} + +cfree(p, num, size) + char *p; + unsigned num; + unsigned size; +{ + free(p); +} diff --git a/lib/libc4.3tahoe/gen/closedir.c b/lib/libc4.3tahoe/gen/closedir.c new file mode 100644 index 0000000..c6c1914 --- /dev/null +++ b/lib/libc4.3tahoe/gen/closedir.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)closedir.c 5.3 (Berkeley) 6/18/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +/* + * close a directory. + */ +void +closedir(dirp) + register DIR *dirp; +{ + close(dirp->dd_fd); + dirp->dd_fd = -1; + dirp->dd_loc = 0; + free(dirp); +} diff --git a/lib/libc4.3tahoe/gen/crypt.c b/lib/libc4.3tahoe/gen/crypt.c new file mode 100644 index 0000000..6c17b88 --- /dev/null +++ b/lib/libc4.3tahoe/gen/crypt.c @@ -0,0 +1,385 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)crypt.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * This program implements the + * Proposed Federal Information Processing + * Data Encryption Standard. + * See Federal Register, March 17, 1975 (40FR12134) + */ + +/* + * Initial permutation, + */ +static char IP[] = { + 58,50,42,34,26,18,10, 2, + 60,52,44,36,28,20,12, 4, + 62,54,46,38,30,22,14, 6, + 64,56,48,40,32,24,16, 8, + 57,49,41,33,25,17, 9, 1, + 59,51,43,35,27,19,11, 3, + 61,53,45,37,29,21,13, 5, + 63,55,47,39,31,23,15, 7, +}; + +/* + * Final permutation, FP = IP^(-1) + */ +static char FP[] = { + 40, 8,48,16,56,24,64,32, + 39, 7,47,15,55,23,63,31, + 38, 6,46,14,54,22,62,30, + 37, 5,45,13,53,21,61,29, + 36, 4,44,12,52,20,60,28, + 35, 3,43,11,51,19,59,27, + 34, 2,42,10,50,18,58,26, + 33, 1,41, 9,49,17,57,25, +}; + +/* + * Permuted-choice 1 from the key bits + * to yield C and D. + * Note that bits 8,16... are left out: + * They are intended for a parity check. + */ +static char PC1_C[] = { + 57,49,41,33,25,17, 9, + 1,58,50,42,34,26,18, + 10, 2,59,51,43,35,27, + 19,11, 3,60,52,44,36, +}; + +static char PC1_D[] = { + 63,55,47,39,31,23,15, + 7,62,54,46,38,30,22, + 14, 6,61,53,45,37,29, + 21,13, 5,28,20,12, 4, +}; + +/* + * Sequence of shifts used for the key schedule. +*/ +static char shifts[] = { + 1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1, +}; + +/* + * Permuted-choice 2, to pick out the bits from + * the CD array that generate the key schedule. + */ +static char PC2_C[] = { + 14,17,11,24, 1, 5, + 3,28,15, 6,21,10, + 23,19,12, 4,26, 8, + 16, 7,27,20,13, 2, +}; + +static char PC2_D[] = { + 41,52,31,37,47,55, + 30,40,51,45,33,48, + 44,49,39,56,34,53, + 46,42,50,36,29,32, +}; + +/* + * The C and D arrays used to calculate the key schedule. + */ + +static char C[28]; +static char D[28]; +/* + * The key schedule. + * Generated from the key. + */ +static char KS[16][48]; + +/* + * The E bit-selection table. + */ +static char E[48]; +static char e[] = { + 32, 1, 2, 3, 4, 5, + 4, 5, 6, 7, 8, 9, + 8, 9,10,11,12,13, + 12,13,14,15,16,17, + 16,17,18,19,20,21, + 20,21,22,23,24,25, + 24,25,26,27,28,29, + 28,29,30,31,32, 1, +}; + +/* + * Set up the key schedule from the key. + */ + +setkey(key) +char *key; +{ + register i, j, k; + int t; + + /* + * First, generate C and D by permuting + * the key. The low order bit of each + * 8-bit char is not used, so C and D are only 28 + * bits apiece. + */ + for (i=0; i<28; i++) { + C[i] = key[PC1_C[i]-1]; + D[i] = key[PC1_D[i]-1]; + } + /* + * To generate Ki, rotate C and D according + * to schedule and pick up a permutation + * using PC2. + */ + for (i=0; i<16; i++) { + /* + * rotate. + */ + for (k=0; k>3)&01; + f[t+1] = (k>>2)&01; + f[t+2] = (k>>1)&01; + f[t+3] = (k>>0)&01; + } + /* + * The new R is L ^ f(R, K). + * The f here has to be permuted first, though. + */ + for (j=0; j<32; j++) + R[j] = L[j] ^ f[P[j]-1]; + /* + * Finally, the new L (the original R) + * is copied back. + */ + for (j=0; j<32; j++) + L[j] = tempL[j]; + } + /* + * The output L and R are reversed. + */ + for (j=0; j<32; j++) { + t = L[j]; + L[j] = R[j]; + R[j] = t; + } + /* + * The final output + * gets the inverse permutation of the very original. + */ + for (j=0; j<64; j++) + block[j] = L[FP[j]-1]; +} + +char * +crypt(pw,salt) +char *pw; +char *salt; +{ + register i, j, c; + int temp; + static char block[66], iobuf[16]; + + for(i=0; i<66; i++) + block[i] = 0; + for(i=0; (c= *pw) && i<64; pw++){ + for(j=0; j<7; j++, i++) + block[i] = (c>>(6-j)) & 01; + i++; + } + + setkey(block); + + for(i=0; i<66; i++) + block[i] = 0; + + for(i=0;i<2;i++){ + c = *salt++; + iobuf[i] = c; + if(c>'Z') c -= 6; + if(c>'9') c -= 7; + c -= '.'; + for(j=0;j<6;j++){ + if((c>>j) & 01){ + temp = E[6*i+j]; + E[6*i+j] = E[6*i+j+24]; + E[6*i+j+24] = temp; + } + } + } + + for(i=0; i<25; i++) + encrypt(block,0); + + for(i=0; i<11; i++){ + c = 0; + for(j=0; j<6; j++){ + c <<= 1; + c |= block[6*i+j]; + } + c += '.'; + if(c>'9') c += 7; + if(c>'Z') c += 6; + iobuf[i+2] = c; + } + iobuf[i+2] = 0; + if(iobuf[1]==0) + iobuf[1] = iobuf[0]; + return(iobuf); +} diff --git a/lib/libc4.3tahoe/gen/ctime.c b/lib/libc4.3tahoe/gen/ctime.c new file mode 100644 index 0000000..3781d82 --- /dev/null +++ b/lib/libc4.3tahoe/gen/ctime.c @@ -0,0 +1,403 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * This code is derived from software contributed to Berkeley by + * Arthur Olson. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ctime.c 5.14 (Berkeley) 7/6/88"; +#endif /* LIBC_SCCS and not lint */ + +#include "sys/param.h" +#include "sys/time.h" +#include "tzfile.h" + +char * +ctime(t) +time_t *t; +{ + struct tm *localtime(); + char *asctime(); + + return(asctime(localtime(t))); +} + +/* +** A la X3J11 +*/ + +char * +asctime(timeptr) +register struct tm * timeptr; +{ + static char wday_name[DAYS_PER_WEEK][3] = { + "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" + }; + static char mon_name[MONS_PER_YEAR][3] = { + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" + }; + static char result[26]; + + (void) sprintf(result, "%.3s %.3s%3d %02d:%02d:%02d %d\n", + wday_name[timeptr->tm_wday], + mon_name[timeptr->tm_mon], + timeptr->tm_mday, timeptr->tm_hour, + timeptr->tm_min, timeptr->tm_sec, + TM_YEAR_BASE + timeptr->tm_year); + return result; +} + +#ifndef TRUE +#define TRUE 1 +#define FALSE 0 +#endif /* !TRUE */ + +extern char * getenv(); +extern char * strcpy(); +extern char * strcat(); +struct tm * offtime(); + +struct ttinfo { /* time type information */ + long tt_gmtoff; /* GMT offset in seconds */ + int tt_isdst; /* used to set tm_isdst */ + int tt_abbrind; /* abbreviation list index */ +}; + +struct state { + int timecnt; + int typecnt; + int charcnt; + time_t ats[TZ_MAX_TIMES]; + unsigned char types[TZ_MAX_TIMES]; + struct ttinfo ttis[TZ_MAX_TYPES]; + char chars[TZ_MAX_CHARS + 1]; +}; + +static struct state s; + +static int tz_is_set; + +char * tzname[2] = { + "GMT", + "GMT" +}; + +#ifdef USG_COMPAT +time_t timezone = 0; +int daylight = 0; +#endif /* USG_COMPAT */ + +static long +detzcode(codep) +char * codep; +{ + register long result; + register int i; + + result = 0; + for (i = 0; i < 4; ++i) + result = (result << 8) | (codep[i] & 0xff); + return result; +} + +static +tzload(name) +register char * name; +{ + register int i; + register int fid; + + if (name == 0 && (name = TZDEFAULT) == 0) + return -1; + { + register char * p; + register int doaccess; + char fullname[MAXPATHLEN]; + + doaccess = name[0] == '/'; + if (!doaccess) { + if ((p = TZDIR) == 0) + return -1; + if ((strlen(p) + strlen(name) + 1) >= sizeof fullname) + return -1; + (void) strcpy(fullname, p); + (void) strcat(fullname, "/"); + (void) strcat(fullname, name); + /* + ** Set doaccess if '.' (as in "../") shows up in name. + */ + while (*name != '\0') + if (*name++ == '.') + doaccess = TRUE; + name = fullname; + } + if (doaccess && access(name, 4) != 0) + return -1; + if ((fid = open(name, 0)) == -1) + return -1; + } + { + register char * p; + register struct tzhead * tzhp; + char buf[sizeof s]; + + i = read(fid, buf, sizeof buf); + if (close(fid) != 0 || i < sizeof *tzhp) + return -1; + tzhp = (struct tzhead *) buf; + s.timecnt = (int) detzcode(tzhp->tzh_timecnt); + s.typecnt = (int) detzcode(tzhp->tzh_typecnt); + s.charcnt = (int) detzcode(tzhp->tzh_charcnt); + if (s.timecnt > TZ_MAX_TIMES || + s.typecnt == 0 || + s.typecnt > TZ_MAX_TYPES || + s.charcnt > TZ_MAX_CHARS) + return -1; + if (i < sizeof *tzhp + + s.timecnt * (4 + sizeof (char)) + + s.typecnt * (4 + 2 * sizeof (char)) + + s.charcnt * sizeof (char)) + return -1; + p = buf + sizeof *tzhp; + for (i = 0; i < s.timecnt; ++i) { + s.ats[i] = detzcode(p); + p += 4; + } + for (i = 0; i < s.timecnt; ++i) + s.types[i] = (unsigned char) *p++; + for (i = 0; i < s.typecnt; ++i) { + register struct ttinfo * ttisp; + + ttisp = &s.ttis[i]; + ttisp->tt_gmtoff = detzcode(p); + p += 4; + ttisp->tt_isdst = (unsigned char) *p++; + ttisp->tt_abbrind = (unsigned char) *p++; + } + for (i = 0; i < s.charcnt; ++i) + s.chars[i] = *p++; + s.chars[i] = '\0'; /* ensure '\0' at end */ + } + /* + ** Check that all the local time type indices are valid. + */ + for (i = 0; i < s.timecnt; ++i) + if (s.types[i] >= s.typecnt) + return -1; + /* + ** Check that all abbreviation indices are valid. + */ + for (i = 0; i < s.typecnt; ++i) + if (s.ttis[i].tt_abbrind >= s.charcnt) + return -1; + /* + ** Set tzname elements to initial values. + */ + tzname[0] = tzname[1] = &s.chars[0]; +#ifdef USG_COMPAT + timezone = -s.ttis[0].tt_gmtoff; + daylight = 0; +#endif /* USG_COMPAT */ + for (i = 1; i < s.typecnt; ++i) { + register struct ttinfo * ttisp; + + ttisp = &s.ttis[i]; + if (ttisp->tt_isdst) { + tzname[1] = &s.chars[ttisp->tt_abbrind]; +#ifdef USG_COMPAT + daylight = 1; +#endif /* USG_COMPAT */ + } else { + tzname[0] = &s.chars[ttisp->tt_abbrind]; +#ifdef USG_COMPAT + timezone = -ttisp->tt_gmtoff; +#endif /* USG_COMPAT */ + } + } + return 0; +} + +static +tzsetkernel() +{ + struct timeval tv; + struct timezone tz; + char *_tztab(); + + if (gettimeofday(&tv, &tz)) + return -1; + s.timecnt = 0; /* UNIX counts *west* of Greenwich */ + s.ttis[0].tt_gmtoff = tz.tz_minuteswest * -SECS_PER_MIN; + s.ttis[0].tt_abbrind = 0; + (void)strcpy(s.chars, _tztab(tz.tz_minuteswest, 0)); + tzname[0] = tzname[1] = s.chars; +#ifdef USG_COMPAT + timezone = tz.tz_minuteswest * 60; + daylight = tz.tz_dsttime; +#endif /* USG_COMPAT */ + return 0; +} + +static +tzsetgmt() +{ + s.timecnt = 0; + s.ttis[0].tt_gmtoff = 0; + s.ttis[0].tt_abbrind = 0; + (void) strcpy(s.chars, "GMT"); + tzname[0] = tzname[1] = s.chars; +#ifdef USG_COMPAT + timezone = 0; + daylight = 0; +#endif /* USG_COMPAT */ +} + +void +tzset() +{ + register char * name; + + tz_is_set = TRUE; + name = getenv("TZ"); + if (!name || *name) { /* did not request GMT */ + if (name && !tzload(name)) /* requested name worked */ + return; + if (!tzload((char *)0)) /* default name worked */ + return; + if (!tzsetkernel()) /* kernel guess worked */ + return; + } + tzsetgmt(); /* GMT is default */ +} + +struct tm * +localtime(timep) +time_t * timep; +{ + register struct ttinfo * ttisp; + register struct tm * tmp; + register int i; + time_t t; + + if (!tz_is_set) + (void) tzset(); + t = *timep; + if (s.timecnt == 0 || t < s.ats[0]) { + i = 0; + while (s.ttis[i].tt_isdst) + if (++i >= s.timecnt) { + i = 0; + break; + } + } else { + for (i = 1; i < s.timecnt; ++i) + if (t < s.ats[i]) + break; + i = s.types[i - 1]; + } + ttisp = &s.ttis[i]; + /* + ** To get (wrong) behavior that's compatible with System V Release 2.0 + ** you'd replace the statement below with + ** tmp = offtime((time_t) (t + ttisp->tt_gmtoff), 0L); + */ + tmp = offtime(&t, ttisp->tt_gmtoff); + tmp->tm_isdst = ttisp->tt_isdst; + tzname[tmp->tm_isdst] = &s.chars[ttisp->tt_abbrind]; + tmp->tm_zone = &s.chars[ttisp->tt_abbrind]; + return tmp; +} + +struct tm * +gmtime(clock) +time_t * clock; +{ + register struct tm * tmp; + + tmp = offtime(clock, 0L); + tzname[0] = "GMT"; + tmp->tm_zone = "GMT"; /* UCT ? */ + return tmp; +} + +static int mon_lengths[2][MONS_PER_YEAR] = { + 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, + 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 +}; + +static int year_lengths[2] = { + DAYS_PER_NYEAR, DAYS_PER_LYEAR +}; + +struct tm * +offtime(clock, offset) +time_t * clock; +long offset; +{ + register struct tm * tmp; + register long days; + register long rem; + register int y; + register int yleap; + register int * ip; + static struct tm tm; + + tmp = &tm; + days = *clock / SECS_PER_DAY; + rem = *clock % SECS_PER_DAY; + rem += offset; + while (rem < 0) { + rem += SECS_PER_DAY; + --days; + } + while (rem >= SECS_PER_DAY) { + rem -= SECS_PER_DAY; + ++days; + } + tmp->tm_hour = (int) (rem / SECS_PER_HOUR); + rem = rem % SECS_PER_HOUR; + tmp->tm_min = (int) (rem / SECS_PER_MIN); + tmp->tm_sec = (int) (rem % SECS_PER_MIN); + tmp->tm_wday = (int) ((EPOCH_WDAY + days) % DAYS_PER_WEEK); + if (tmp->tm_wday < 0) + tmp->tm_wday += DAYS_PER_WEEK; + y = EPOCH_YEAR; + if (days >= 0) + for ( ; ; ) { + yleap = isleap(y); + if (days < (long) year_lengths[yleap]) + break; + ++y; + days = days - (long) year_lengths[yleap]; + } + else do { + --y; + yleap = isleap(y); + days = days + (long) year_lengths[yleap]; + } while (days < 0); + tmp->tm_year = y - TM_YEAR_BASE; + tmp->tm_yday = (int) days; + ip = mon_lengths[yleap]; + for (tmp->tm_mon = 0; days >= (long) ip[tmp->tm_mon]; ++(tmp->tm_mon)) + days = days - (long) ip[tmp->tm_mon]; + tmp->tm_mday = (int) (days + 1); + tmp->tm_isdst = 0; + tmp->tm_zone = ""; + tmp->tm_gmtoff = offset; + return tmp; +} diff --git a/lib/libc4.3tahoe/gen/ctype_.c b/lib/libc4.3tahoe/gen/ctype_.c new file mode 100644 index 0000000..c64d586 --- /dev/null +++ b/lib/libc4.3tahoe/gen/ctype_.c @@ -0,0 +1,25 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ctype_.c 5.4 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +char _ctype_[1 + 256] = { + 0, + _C, _C, _C, _C, _C, _C, _C, _C, + _C, _C|_S, _C|_S, _C|_S, _C|_S, _C|_S, _C, _C, + _C, _C, _C, _C, _C, _C, _C, _C, + _C, _C, _C, _C, _C, _C, _C, _C, + _S|_B, _P, _P, _P, _P, _P, _P, _P, + _P, _P, _P, _P, _P, _P, _P, _P, + _N, _N, _N, _N, _N, _N, _N, _N, + _N, _N, _P, _P, _P, _P, _P, _P, + _P, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U|_X, _U, + _U, _U, _U, _U, _U, _U, _U, _U, + _U, _U, _U, _U, _U, _U, _U, _U, + _U, _U, _U, _P, _P, _P, _P, _P, + _P, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L|_X, _L, + _L, _L, _L, _L, _L, _L, _L, _L, + _L, _L, _L, _L, _L, _L, _L, _L, + _L, _L, _L, _P, _P, _P, _P, _C +}; diff --git a/lib/libc4.3tahoe/gen/disklabel.c b/lib/libc4.3tahoe/gen/disklabel.c new file mode 100644 index 0000000..3c055a1 --- /dev/null +++ b/lib/libc4.3tahoe/gen/disklabel.c @@ -0,0 +1,393 @@ +/* + * Copyright (c) 1983,1987 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)disklabel.c 5.9 (Berkeley) 1/27/88"; +#endif LIBC_SCCS and not lint + +#include +#include +#include +#define DKTYPENAMES +#include +#include +#include + +static char *dgetstr(); + +struct disklabel * +getdiskbyname(name) + char *name; +{ + static struct disklabel disk; + static char boot[BUFSIZ]; + char localbuf[BUFSIZ]; + char buf[BUFSIZ]; + char *cp, *cq; /* can't be register */ + register struct disklabel *dp = &disk; + register struct partition *pp; + char p, max, psize[3], pbsize[3], + pfsize[3], poffset[3], ptype[3]; + u_long *dx; + + if (dgetent(buf, name) <= 0) + return ((struct disklabel *)0); + bzero((char *)&disk, sizeof(disk)); + /* + * typename + */ + cq = dp->d_typename; + cp = buf; + while (cq < dp->d_typename + sizeof(dp->d_typename) - 1 && + (*cq = *cp) && *cq != '|' && *cq != ':') + cq++, cp++; + *cq = '\0'; + /* + * boot name (optional) xxboot, bootxx + */ + cp = boot; + dp->d_boot0 = dgetstr("b0", &cp); + dp->d_boot1 = dgetstr("b1", &cp); + cp = localbuf; + cq = dgetstr("ty", &cp); + if (cq && strcmp(cq, "removable") == 0) + dp->d_flags |= D_REMOVABLE; + else if (cq && strcmp(cq, "simulated") == 0) + dp->d_flags |= D_RAMDISK; + if (dgetflag("sf")) + dp->d_flags |= D_BADSECT; + +#define getnumdflt(field, dname, dflt) \ + { int f = dgetnum(dname); \ + (field) = f == -1 ? (dflt) : f; } + + getnumdflt(dp->d_secsize, "se", DEV_BSIZE); + dp->d_ntracks = dgetnum("nt"); + dp->d_nsectors = dgetnum("ns"); + dp->d_ncylinders = dgetnum("nc"); + cq = dgetstr("dt", &cp); + if (cq) + dp->d_type = gettype(cq, dktypenames); + else + getnumdflt(dp->d_type, "dt", 0); + getnumdflt(dp->d_secpercyl, "sc", dp->d_nsectors * dp->d_ntracks); + getnumdflt(dp->d_secperunit, "su", dp->d_secpercyl * dp->d_ncylinders); + getnumdflt(dp->d_rpm, "rm", 3600); + getnumdflt(dp->d_interleave, "il", 1); + getnumdflt(dp->d_trackskew, "sk", 0); + getnumdflt(dp->d_cylskew, "cs", 0); + getnumdflt(dp->d_headswitch, "hs", 0); + getnumdflt(dp->d_trkseek, "ts", 0); + getnumdflt(dp->d_bbsize, "bs", BBSIZE); + getnumdflt(dp->d_sbsize, "sb", SBSIZE); + strcpy(psize, "px"); + strcpy(pbsize, "bx"); + strcpy(pfsize, "fx"); + strcpy(poffset, "ox"); + strcpy(ptype, "tx"); + max = 'a' - 1; + pp = &dp->d_partitions[0]; + for (p = 'a'; p < 'a' + MAXPARTITIONS; p++, pp++) { + psize[1] = pbsize[1] = pfsize[1] = poffset[1] = ptype[1] = p; + pp->p_size = dgetnum(psize); + if (pp->p_size == -1) + pp->p_size = 0; + else { + pp->p_offset = dgetnum(poffset); + getnumdflt(pp->p_fsize, pfsize, 0); + if (pp->p_fsize) + pp->p_frag = dgetnum(pbsize) / pp->p_fsize; + getnumdflt(pp->p_fstype, ptype, 0); + if (pp->p_fstype == 0 && (cq = dgetstr(ptype, &cp))) + pp->p_fstype = gettype(cq, fstypenames); + max = p; + } + } + dp->d_npartitions = max + 1 - 'a'; + (void)strcpy(psize, "dx"); + dx = dp->d_drivedata; + for (p = '0'; p < '0' + NDDATA; p++, dx++) { + psize[1] = p; + getnumdflt(*dx, psize, 0); + } + dp->d_magic = DISKMAGIC; + dp->d_magic2 = DISKMAGIC; + return (dp); +} + +#include + +static char *tbuf; +static char *dskip(); +static char *ddecode(); + +/* + * Get an entry for disk name in buffer bp, + * from the diskcap file. Parse is very rudimentary; + * we just notice escaped newlines. + */ +static +dgetent(bp, name) + char *bp, *name; +{ + register char *cp; + register int c; + register int i = 0, cnt = 0; + char ibuf[BUFSIZ]; + int tf; + + tbuf = bp; + tf = open(DISKTAB, 0); + if (tf < 0) + return (-1); + for (;;) { + cp = bp; + for (;;) { + if (i == cnt) { + cnt = read(tf, ibuf, BUFSIZ); + if (cnt <= 0) { + close(tf); + return (0); + } + i = 0; + } + c = ibuf[i++]; + if (c == '\n') { + if (cp > bp && cp[-1] == '\\'){ + cp--; + continue; + } + break; + } + if (cp >= bp+BUFSIZ) { + write(2,"Disktab entry too long\n", 23); + break; + } else + *cp++ = c; + } + *cp = 0; + + /* + * The real work for the match. + */ + if (dnamatch(name)) { + close(tf); + return (1); + } + } +} + +/* + * Dnamatch deals with name matching. The first field of the disktab + * entry is a sequence of names separated by |'s, so we compare + * against each such name. The normal : terminator after the last + * name (before the first field) stops us. + */ +static +dnamatch(np) + char *np; +{ + register char *Np, *Bp; + + Bp = tbuf; + if (*Bp == '#') + return (0); + for (;;) { + for (Np = np; *Np && *Bp == *Np; Bp++, Np++) + continue; + if (*Np == 0 && (*Bp == '|' || *Bp == ':' || *Bp == 0)) + return (1); + while (*Bp && *Bp != ':' && *Bp != '|') + Bp++; + if (*Bp == 0 || *Bp == ':') + return (0); + Bp++; + } +} + +/* + * Skip to the next field. Notice that this is very dumb, not + * knowing about \: escapes or any such. If necessary, :'s can be put + * into the diskcap file in octal. + */ +static char * +dskip(bp) + register char *bp; +{ + + while (*bp && *bp != ':') + bp++; + if (*bp == ':') + bp++; + return (bp); +} + +/* + * Return the (numeric) option id. + * Numeric options look like + * li#80 + * i.e. the option string is separated from the numeric value by + * a # character. If the option is not found we return -1. + * Note that we handle octal numbers beginning with 0. + */ +static +dgetnum(id) + char *id; +{ + register int i, base; + register char *bp = tbuf; + + for (;;) { + bp = dskip(bp); + if (*bp == 0) + return (-1); + if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1]) + continue; + if (*bp == '@') + return (-1); + if (*bp != '#') + continue; + bp++; + base = 10; + if (*bp == '0') + base = 8; + i = 0; + while (isdigit(*bp)) + i *= base, i += *bp++ - '0'; + return (i); + } +} + +/* + * Handle a flag option. + * Flag options are given "naked", i.e. followed by a : or the end + * of the buffer. Return 1 if we find the option, or 0 if it is + * not given. + */ +static +dgetflag(id) + char *id; +{ + register char *bp = tbuf; + + for (;;) { + bp = dskip(bp); + if (!*bp) + return (0); + if (*bp++ == id[0] && *bp != 0 && *bp++ == id[1]) { + if (!*bp || *bp == ':') + return (1); + else if (*bp == '@') + return (0); + } + } +} + +/* + * Get a string valued option. + * These are given as + * cl=^Z + * Much decoding is done on the strings, and the strings are + * placed in area, which is a ref parameter which is updated. + * No checking on area overflow. + */ +static char * +dgetstr(id, area) + char *id, **area; +{ + register char *bp = tbuf; + + for (;;) { + bp = dskip(bp); + if (!*bp) + return (0); + if (*bp++ != id[0] || *bp == 0 || *bp++ != id[1]) + continue; + if (*bp == '@') + return (0); + if (*bp != '=') + continue; + bp++; + return (ddecode(bp, area)); + } +} + +/* + * Tdecode does the grung work to decode the + * string capability escapes. + */ +static char * +ddecode(str, area) + register char *str; + char **area; +{ + register char *cp; + register int c; + register char *dp; + int i; + + cp = *area; + while ((c = *str++) && c != ':') { + switch (c) { + + case '^': + c = *str++ & 037; + break; + + case '\\': + dp = "E\033^^\\\\::n\nr\rt\tb\bf\f"; + c = *str++; +nextc: + if (*dp++ == c) { + c = *dp++; + break; + } + dp++; + if (*dp) + goto nextc; + if (isdigit(c)) { + c -= '0', i = 2; + do + c <<= 3, c |= *str++ - '0'; + while (--i && isdigit(*str)); + } + break; + } + *cp++ = c; + } + *cp++ = 0; + str = *area; + *area = cp; + return (str); +} + +static +gettype(t, names) + char *t; + char **names; +{ + register char **nm; + + for (nm = names; *nm; nm++) + if (strcasecmp(t, *nm) == 0) + return (nm - names); + if (isdigit(*t)) + return (atoi(t)); + return (0); +} + +dkcksum(lp) + register struct disklabel *lp; +{ + register u_short *start, *end; + register u_short sum = 0; + + start = (u_short *)lp; + end = (u_short *)&lp->d_partitions[lp->d_npartitions]; + while (start < end) + sum ^= *start++; + return (sum); +} diff --git a/lib/libc4.3tahoe/gen/errlst.c b/lib/libc4.3tahoe/gen/errlst.c new file mode 100644 index 0000000..405d2c0 --- /dev/null +++ b/lib/libc4.3tahoe/gen/errlst.c @@ -0,0 +1,94 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)errlst.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +char *sys_errlist[] = { + "Error 0", + "Not owner", /* 1 - EPERM */ + "No such file or directory", /* 2 - ENOENT */ + "No such process", /* 3 - ESRCH */ + "Interrupted system call", /* 4 - EINTR */ + "I/O error", /* 5 - EIO */ + "No such device or address", /* 6 - ENXIO */ + "Arg list too long", /* 7 - E2BIG */ + "Exec format error", /* 8 - ENOEXEC */ + "Bad file number", /* 9 - EBADF */ + "No children", /* 10 - ECHILD */ + "No more processes", /* 11 - EAGAIN */ + "Not enough memory", /* 12 - ENOMEM */ + "Permission denied", /* 13 - EACCES */ + "Bad address", /* 14 - EFAULT */ + "Block device required", /* 15 - ENOTBLK */ + "Device busy", /* 16 - EBUSY */ + "File exists", /* 17 - EEXIST */ + "Cross-device link", /* 18 - EXDEV */ + "No such device", /* 19 - ENODEV */ + "Not a directory", /* 20 - ENOTDIR */ + "Is a directory", /* 21 - EISDIR */ + "Invalid argument", /* 22 - EINVAL */ + "File table overflow", /* 23 - ENFILE */ + "Too many open files", /* 24 - EMFILE */ + "Inappropriate ioctl for device", /* 25 - ENOTTY */ + "Text file busy", /* 26 - ETXTBSY */ + "File too large", /* 27 - EFBIG */ + "No space left on device", /* 28 - ENOSPC */ + "Illegal seek", /* 29 - ESPIPE */ + "Read-only file system", /* 30 - EROFS */ + "Too many links", /* 31 - EMLINK */ + "Broken pipe", /* 32 - EPIPE */ + +/* math software */ + "Argument too large", /* 33 - EDOM */ + "Result too large", /* 34 - ERANGE */ + +/* non-blocking and interrupt i/o */ + "Operation would block", /* 35 - EWOULDBLOCK */ + "Operation now in progress", /* 36 - EINPROGRESS */ + "Operation already in progress", /* 37 - EALREADY */ + +/* ipc/network software */ + + /* argument errors */ + "Socket operation on non-socket", /* 38 - ENOTSOCK */ + "Destination address required", /* 39 - EDESTADDRREQ */ + "Message too long", /* 40 - EMSGSIZE */ + "Protocol wrong type for socket", /* 41 - EPROTOTYPE */ + "Option not supported by protocol", /* 42 - ENOPROTOOPT */ + "Protocol not supported", /* 43 - EPROTONOSUPPORT */ + "Socket type not supported", /* 44 - ESOCKTNOSUPPORT */ + "Operation not supported on socket", /* 45 - EOPNOTSUPP */ + "Protocol family not supported", /* 46 - EPFNOSUPPORT */ + "Address family not supported by protocol family", + /* 47 - EAFNOSUPPORT */ + "Address already in use", /* 48 - EADDRINUSE */ + "Can't assign requested address", /* 49 - EADDRNOTAVAIL */ + + /* operational errors */ + "Network is down", /* 50 - ENETDOWN */ + "Network is unreachable", /* 51 - ENETUNREACH */ + "Network dropped connection on reset", /* 52 - ENETRESET */ + "Software caused connection abort", /* 53 - ECONNABORTED */ + "Connection reset by peer", /* 54 - ECONNRESET */ + "No buffer space available", /* 55 - ENOBUFS */ + "Socket is already connected", /* 56 - EISCONN */ + "Socket is not connected", /* 57 - ENOTCONN */ + "Can't send after socket shutdown", /* 58 - ESHUTDOWN */ + "Too many references: can't splice", /* 59 - ETOOMANYREFS */ + "Connection timed out", /* 60 - ETIMEDOUT */ + "Connection refused", /* 61 - EREFUSED */ + "Too many levels of symbolic links", /* 62 - ELOOP */ + "File name too long", /* 63 - ENAMETOOLONG */ + "Host is down", /* 64 - EHOSTDOWN */ + "Host is unreachable", /* 65 - EHOSTUNREACH */ + "Directory not empty", /* 66 - ENOTEMPTY */ + "Too many processes", /* 67 - EPROCLIM */ + "Too many users", /* 68 - EUSERS */ + "Disc quota exceeded", /* 69 - EDQUOT */ +}; +int sys_nerr = { sizeof sys_errlist/sizeof sys_errlist[0] }; diff --git a/lib/libc4.3tahoe/gen/execvp.c b/lib/libc4.3tahoe/gen/execvp.c new file mode 100644 index 0000000..429ff84 --- /dev/null +++ b/lib/libc4.3tahoe/gen/execvp.c @@ -0,0 +1,87 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)execvp.c 5.3 (Berkeley) 4/24/88"; +#endif LIBC_SCCS and not lint + +/* + * execlp(name, arg,...,0) (like execl, but does path search) + * execvp(name, argv) (like execv, but does path search) + */ +#include +#define NULL 0 + +static char shell[] = "/bin/sh"; +char *getenv(); +extern errno; + +execlp(name, argv) +char *name, *argv; +{ + return(execvp(name, &argv)); +} + +execvp(name, argv) +char *name, **argv; +{ + char *pathstr; + register char *cp; + char fname[128]; + char *newargs[256], *execat(); + int i; + register unsigned etxtbsy = 1; + register eacces = 0; + + if ((pathstr = getenv("PATH")) == NULL) + pathstr = ":/bin:/usr/bin"; + cp = index(name, '/')? "": pathstr; + + do { + cp = execat(cp, name, fname); + retry: + execv(fname, argv); + switch(errno) { + case ENOEXEC: + newargs[0] = "sh"; + newargs[1] = fname; + for (i=1; newargs[i+1]=argv[i]; i++) { + if (i>=254) { + errno = E2BIG; + return(-1); + } + } + execv(shell, newargs); + return(-1); + case ETXTBSY: + if (++etxtbsy > 5) + return(-1); + sleep(etxtbsy); + goto retry; + case EACCES: + eacces++; + break; + case ENOMEM: + case E2BIG: + return(-1); + } + } while (cp); + if (eacces) + errno = EACCES; + return(-1); +} + +static char * +execat(s1, s2, si) +register char *s1, *s2; +char *si; +{ + register char *s; + + s = si; + while (*s1 && *s1 != ':') + *s++ = *s1++; + if (si != s) + *s++ = '/'; + while (*s2) + *s++ = *s2++; + *s = '\0'; + return(*s1? ++s1: 0); +} diff --git a/lib/libc4.3tahoe/gen/fakcu.c b/lib/libc4.3tahoe/gen/fakcu.c new file mode 100644 index 0000000..f69e296 --- /dev/null +++ b/lib/libc4.3tahoe/gen/fakcu.c @@ -0,0 +1,11 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fakcu.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Null cleanup routine to resolve reference in exit() + * if not using stdio. + */ +_cleanup() +{ +} diff --git a/lib/libc4.3tahoe/gen/ffs.c b/lib/libc4.3tahoe/gen/ffs.c new file mode 100644 index 0000000..9cdd64b --- /dev/null +++ b/lib/libc4.3tahoe/gen/ffs.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ffs.c 5.2 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +/* + * ffs -- vax ffs instruction + */ +ffs(mask) + register long mask; +{ + register int cnt; + + if (mask == 0) + return(0); + for (cnt = 1; !(mask & 1); cnt++) + mask >>= 1; + return(cnt); +} diff --git a/lib/libc4.3tahoe/gen/fstab.c b/lib/libc4.3tahoe/gen/fstab.c new file mode 100644 index 0000000..fab4d13 --- /dev/null +++ b/lib/libc4.3tahoe/gen/fstab.c @@ -0,0 +1,152 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fstab.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include +#include + +static struct fstab fs; +static char line[BUFSIZ+1]; +static FILE *fs_file = 0; + +static char * +fsskip(p) + register char *p; +{ + + while (*p && *p != ':') + ++p; + if (*p) + *p++ = 0; + return (p); +} + +static char * +fsdigit(backp, string, end) + int *backp; + char *string, end; +{ + register int value = 0; + register char *cp; + + for (cp = string; *cp && isdigit(*cp); cp++) { + value *= 10; + value += *cp - '0'; + } + if (*cp == '\0') + return ((char *)0); + *backp = value; + while (*cp && *cp != end) + cp++; + if (*cp == '\0') + return ((char *)0); + return (cp+1); +} + +static +fstabscan(fs) + struct fstab *fs; +{ + register char *cp; + + cp = fgets(line, 256, fs_file); + if (cp == NULL) + return (EOF); + fs->fs_spec = cp; + cp = fsskip(cp); + fs->fs_file = cp; + cp = fsskip(cp); + fs->fs_type = cp; + cp = fsskip(cp); + cp = fsdigit(&fs->fs_freq, cp, ':'); + if (cp == 0) + return (3); + cp = fsdigit(&fs->fs_passno, cp, '\n'); + if (cp == 0) + return (4); + return (5); +} + +setfsent() +{ + + if (fs_file) + endfsent(); + if ((fs_file = fopen(FSTAB, "r")) == NULL) { + fs_file = 0; + return (0); + } + return (1); +} + +endfsent() +{ + + if (fs_file) { + fclose(fs_file); + fs_file = 0; + } + return (1); +} + +struct fstab * +getfsent() +{ + int nfields; + + if ((fs_file == 0) && (setfsent() == 0)) + return ((struct fstab *)0); + nfields = fstabscan(&fs); + if (nfields == EOF || nfields != 5) + return ((struct fstab *)0); + return (&fs); +} + +struct fstab * +getfsspec(name) + char *name; +{ + register struct fstab *fsp; + + if (setfsent() == 0) /* start from the beginning */ + return ((struct fstab *)0); + while((fsp = getfsent()) != 0) + if (strcmp(fsp->fs_spec, name) == 0) + return (fsp); + return ((struct fstab *)0); +} + +struct fstab * +getfsfile(name) + char *name; +{ + register struct fstab *fsp; + + if (setfsent() == 0) /* start from the beginning */ + return ((struct fstab *)0); + while ((fsp = getfsent()) != 0) + if (strcmp(fsp->fs_file, name) == 0) + return (fsp); + return ((struct fstab *)0); +} + +struct fstab * +getfstype(type) + char *type; +{ + register struct fstab *fs; + + if (setfsent() == 0) + return ((struct fstab *)0); + while ((fs = getfsent()) != 0) + if (strcmp(fs->fs_type, type) == 0) + return (fs); + return ((struct fstab *)0); +} diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/.MAP b/lib/libc4.3tahoe/gen/gen.tahoe/.MAP new file mode 100644 index 0000000..82f1fbc --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/.MAP @@ -0,0 +1,28 @@ +F ABORT.S;1 abort.s +F ABS.S;1 abs.s +F ALLOCA.S;1 alloca.s +F ATOF.S;1 atof.s +F BCMP.S;1 bcmp.s +F BCOPY.S;1 bcopy.s +F BZERO.S;1 bzero.s +F FABS.S;1 fabs.s +F FFS.S;1 ffs.s +F FREXP.C;1 frexp.c +F INSQUE.S;1 insque.s +F LDEXP.S;1 ldexp.s +F MAKEFILE.;1 Makefile +F MODF.S;1 modf.s +F NARGS.S;1 nargs.s +D PROFILED profiled +F REMQUE.S;1 remque.s +F SETJMP.S;1 setjmp.s +F STRCAT.S;1 strcat.s +F STRCMP.S;1 strcmp.s +F STRCPY.S;1 strcpy.s +F STRLEN.S;1 strlen.s +F STRNCAT.S;1 strncat.s +F STRNCMP.S;1 strncmp.s +F STRNCPY.S;1 strncpy.s +F UDIV.S;1 udiv.s +F UREM.S;1 urem.s +F _SETJMP.S;1 _setjmp.s diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/Makefile b/lib/libc4.3tahoe/gen/gen.tahoe/Makefile new file mode 100644 index 0000000..fb34b91 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/Makefile @@ -0,0 +1,105 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.13 (Berkeley) 6/27/88 +# +DEFS= -DLIBC_SCCS +FLAGS= -I../../tahoe ${DEFS} +CFLAGS= -O ${FLAGS} +CSRCS= frexp.c +COBJS= frexp.o +ASRCS= _setjmp.s abort.s abs.s alloca.s atof.s bcmp.s bcopy.s bzero.s fabs.s \ + ffs.s insque.s ldexp.s modf.s nargs.s remque.s setjmp.s strcat.s \ + strcmp.s strcpy.s strlen.s strncat.s strncmp.s strncpy.s udiv.s \ + urem.s +AOBJS= _setjmp.o abort.o abs.o alloca.o atof.o bcmp.o bcopy.o bzero.o fabs.o \ + ffs.o insque.o ldexp.o modf.o nargs.o remque.o setjmp.o strcat.o \ + strcmp.o strcpy.o strlen.o strncat.o strncmp.o strncpy.o udiv.o \ + urem.o +SRCS= ${CSRCS} ${ASRCS} +OBJS= ${COBJS} ${AOBJS} +TAGSFILE=tags + +.s.o: + @/lib/cpp -E ${FLAGS} -DPROF $*.s | ${AS} -o $*.o + @ld -X -o profiled/$*.o -r $*.o + /lib/cpp -E ${FLAGS} $*.s | ${AS} -o $*.o + @ld -x -r $*.o + @mv a.out $*.o + +.c.o: + @${CC} -pg -DPROF ${CFLAGS} -c $*.c + @ld -X -o profiled/$*.o -r $*.o + ${CC} ${CFLAGS} -c $*.c + @ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + cwd=`pwd`; \ + for i in ${CSRCS}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + (P=`pwd`; \ + egrep "^ENTRY(.*)|^SYSCALL(.*)" ${ASRCS} | sed \ +"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ + >> ${TAGSFILE}) + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +frexp.o: frexp.c +_setjmp.o: _setjmp.s ../../tahoe/DEFS.h +abort.o: abort.s ../../tahoe/DEFS.h +abs.o: abs.s ../../tahoe/DEFS.h +alloca.o: alloca.s ../../tahoe/DEFS.h +atof.o: atof.s ../../tahoe/DEFS.h +bcmp.o: bcmp.s ../../tahoe/DEFS.h +bcopy.o: bcopy.s ../../tahoe/DEFS.h +bzero.o: bzero.s ../../tahoe/DEFS.h +fabs.o: fabs.s ../../tahoe/DEFS.h +ffs.o: ffs.s ../../tahoe/DEFS.h +insque.o: insque.s ../../tahoe/DEFS.h +ldexp.o: ldexp.s /usr/include/errno.h /usr/include/tahoemath/fp.h +ldexp.o: ../../tahoe/DEFS.h +modf.o: modf.s ../../tahoe/DEFS.h +nargs.o: nargs.s ../../tahoe/DEFS.h +remque.o: remque.s ../../tahoe/DEFS.h +setjmp.o: setjmp.s ../../tahoe/DEFS.h +strcat.o: strcat.s ../../tahoe/DEFS.h +strcmp.o: strcmp.s ../../tahoe/DEFS.h +strcpy.o: strcpy.s ../../tahoe/DEFS.h +strlen.o: strlen.s ../../tahoe/DEFS.h +strncat.o: strncat.s ../../tahoe/DEFS.h +strncmp.o: strncmp.s ../../tahoe/DEFS.h +strncpy.o: strncpy.s ../../tahoe/DEFS.h +udiv.o: udiv.s ../../tahoe/DEFS.h +urem.o: urem.s ../../tahoe/DEFS.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/_setjmp.s b/lib/libc4.3tahoe/gen/gen.tahoe/_setjmp.s new file mode 100644 index 0000000..85221d6 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/_setjmp.s @@ -0,0 +1,76 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)_setjmp.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * C library -- _setjmp, _longjmp + * + * _longjmp(a,v) + * will generate a "return(v)" from + * the last call to + * _setjmp(a) + * by restoring registers from the stack, + * The previous signal state is NOT restored. + */ + +#include "DEFS.h" + +ENTRY(_setjmp, 0) + movl 4(fp),r0 + movl (fp),(r0) # save frame pointer of caller + movl -8(fp),4(r0) # save pc of caller + clrl r0 + ret + +ENTRY(_longjmp, 0) + movl 8(fp),r0 # return(v) + movl 4(fp),r1 # fetch buffer + tstl (r1) + beql botch +loop: + cmpl (r1),(fp) + beql done + blssu botch + movl $loop,-8(fp) + ret # pop another frame + +done: + cmpb *-8(fp),reiins # returning to an "rei"? + bneq 1f + movab 3f,-8(fp) # do return w/ psl-pc pop + brw 2f +1: + movab 4f,-8(fp) # do standard return +2: + ret # unwind stack before signals enabled +3: + addl2 $8,sp # compensate for PSL-PC push +4: + jmp *4(r1) # done, return.... + +botch: + callf $4,_longjmperror + halt + + .data +reiins: rei diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/abort.s b/lib/libc4.3tahoe/gen/gen.tahoe/abort.s new file mode 100644 index 0000000..03dc67d --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/abort.s @@ -0,0 +1,32 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)abort.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* C library -- abort */ + +#include "DEFS.h" + +ENTRY(abort, 0) + rei + clrl r0 + ret diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/abs.s b/lib/libc4.3tahoe/gen/gen.tahoe/abs.s new file mode 100644 index 0000000..68155a3 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/abs.s @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)abs.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* abs - int absolute value */ + +#include "DEFS.h" + +ENTRY(abs, 0) + movl 4(fp),r0 + bgeq 1f + mnegl r0,r0 +1: + ret diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/alloca.s b/lib/libc4.3tahoe/gen/gen.tahoe/alloca.s new file mode 100644 index 0000000..af2cfa8 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/alloca.s @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)alloca.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* like alloc, but automatic automatic free in return */ + +#include "DEFS.h" + +ENTRY(alloca, 0) + moval (sp),r0 # current sp + subl2 4(fp),r0 # allocation size + andl2 $0xfffffffc,r0 # allignment + movl -8(fp),r1 # old pc + movl (fp),fp # old fp + addl2 $4*4,r0 # reuse space of mscp + movl r0,sp # new sp + jmp (r1) # funny return diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/atof.s b/lib/libc4.3tahoe/gen/gen.tahoe/atof.s new file mode 100644 index 0000000..c5d4a64 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/atof.s @@ -0,0 +1,336 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +_sccsid:.asciz "@(#)atof.s 5.1 (Berkeley) 5/24/88" +#endif /* LIBC_SCCS and not lint */ + +#include "DEFS.h" + +/* + * atof: convert ascii to floating + * + * C usage: + * + * double atof (s) + * char *s; + * + * Register usage: + * + * r0-1: value being developed + * r2: first section: pointer to the next character + * second section: binary exponent + * r3: flags + * r4: first section: the current character + * second section: scratch + * r5: the decimal exponent + * r6-7: scratch + */ + .set msign,0 # mantissa has negative sign + .set esign,1 # exponent has negative sign + .set decpt,2 # decimal point encountered + +ENTRY(atof, R6|R7) +/* + * Initialization + */ + clrl r3 # All flags start out false + movl 4(fp),r2 # Address the first character + clrl r5 # Clear starting exponent +/* + * Skip leading white space + */ +sk0: movzbl (r2),r4 # Fetch the next (first) character + incl r2 + cmpb $' ,r4 # Is it blank? + beql sk0 # ...yes + cmpb r4,$8 # 8 is lowest of white-space group + blss sk1 # Jump if char too low to be white space + cmpb r4,$13 # 13 is highest of white-space group + bleq sk0 # Jump if character is white space +sk1: +/* + * Check for a sign + */ + cmpb $'+,r4 # Positive sign? + beql cs1 # ... yes + cmpb $'-,r4 # Negative sign? + bneq cs2 # ... no + orb2 $1=1.0) + while(x>=1.0){ + j = j+1; + x = x/2; + } + else if(x<0.5 && x != 0.0) + while(x<0.5){ + j = j-1; + x = 2*x; + } + *i = j; + if(neg) x = -x; + return(x); + } diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/insque.s b/lib/libc4.3tahoe/gen/gen.tahoe/insque.s new file mode 100644 index 0000000..7a9897b --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/insque.s @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)insque.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* insque(new, pred) */ + +#include "DEFS.h" + +ENTRY(insque, 0) + insque *4(fp), *8(fp) + ret diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/ldexp.s b/lib/libc4.3tahoe/gen/gen.tahoe/ldexp.s new file mode 100644 index 0000000..d6de7c5 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/ldexp.s @@ -0,0 +1,87 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)ldexp.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * double ldexp (value, exp) + * double value; + * int exp; + * + * Ldexp returns value*2**exp, if that result is in range. + * If underflow occurs, it returns zero. If overflow occurs, + * it returns a value of appropriate sign and largest + * possible magnitude. In case of either overflow or underflow, + * the external int "errno" is set to ERANGE. Note that errno is + * not modified if no error occurs, so if you intend to test it + * after you use ldexp, you had better set it to something + * other than ERANGE first (zero is a reasonable value to use). + * + * Constants + */ +#include +#include + +#include "DEFS.h" + +ENTRY(ldexp, 0) + movl 4(fp),r0 /* Fetch "value" */ + movl 8(fp),r1 + + andl3 $EXPMASK,r0,r2 /* r2 := shifted biased exponent */ + jeql ld1 /* If it's zero, we're done */ + shar $EXPSHIFT,r2,r2 /* shift to get value of exponent */ + + addl2 12(fp),r2 /* r2 := new biased exponent */ + jleq under /* if it's <= 0, we have an underflow */ + cmpl r2,$256 /* Otherwise check if it's too big */ + jgeq over /* jump if overflow */ +/* +* Construct the result and return +*/ + andl2 $0!EXPMASK,r0 /* clear old exponent */ + shal $EXPSHIFT,r2,r2 /* Put the exponent back in the result */ + orl2 r2,r0 +ld1: ret +/* +* Underflow +*/ +under: clrl r0 /* Result is zero */ + clrl r1 + jbr err /* Join general error code */ +/* +* Overflow +*/ +over: movl huge0,r0 /* Largest possible floating magnitude */ + movl huge1,r1 + jbc $31,4(fp),err /* Jump if argument was positive */ + orl2 $SIGNBIT,r0 /* If arg < 0, make result negative */ + +err: movl $ERANGE,_errno /* Indicate range error */ + ret + + .data + .globl _errno /* error flag */ +huge0: .word 0x7fff /* The largest number that can */ + .word 0xffff /* be represented in a long floating */ +huge1: .word 0xffff /* number. */ + .word 0xffff diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/modf.s b/lib/libc4.3tahoe/gen/gen.tahoe/modf.s new file mode 100644 index 0000000..a484376 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/modf.s @@ -0,0 +1,72 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)modf.s 1.4 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * double modf (value, iptr) + * double value, *iptr; + * + * Modf returns the fractional part of "value", + * and stores the integer part indirectly through "iptr". + * + * This version uses floating point (look in ../fpe for + * a much slower integer version). + */ + +#include "DEFS.h" + +ENTRY(modf, 0) + ldd 4(fp) # value + cvdl r2 # integerize + bvs 1f # did integer part overflow? + cvld r2 # integer part + std r0 + std *12(fp) # *iptr = r2 + ldd 4(fp) + subd r0 # value-(int)value + std r0 # return fraction + ret +1: + /* + * If the integer portion overflowed, mask out the fractional + * bits in the double word instead of cvdl-ing. + */ + ldd 4(fp) + std r0 # (r0,r1) = value + shrl $23,r0,r2 # extract sign,exponent of value + andl2 $255,r2 # exponent + subl2 $152,r2 # e-152 + /* + * If it overflowed then value>=2^31 and e>=160 + * so we mask only r1 (low bits of fraction), not r0 + */ + mnegl $1,r3 + shrl r2,r3,r3 # -1>>(e-152) is neg mask to clear fraction + mcoml r3,r3 # complement mask + andl2 r3,r1 # mask off truly fractional bits from fraction + ldd r0 # now (r0,r1) = integerized value + std *12(fp) # *iptr = integerized + ldd 4(fp) + subd r0 + std r0 # return fraction + ret diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/nargs.s b/lib/libc4.3tahoe/gen/gen.tahoe/nargs.s new file mode 100644 index 0000000..c4773e8 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/nargs.s @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)nargs.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* C library -- nargs */ + +#include "DEFS.h" + +ENTRY(nargs, 0) + movw -2(fp),r0 # removed word + subw2 $4,r0 + shar $2,r0,r0 # no. of arguments + ret diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/profiled/.MAP b/lib/libc4.3tahoe/gen/gen.tahoe/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/remque.s b/lib/libc4.3tahoe/gen/gen.tahoe/remque.s new file mode 100644 index 0000000..8818aa0 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/remque.s @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)remque.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* remque(entry) */ + +#include "DEFS.h" + +ENTRY(remque, 0) + remque *4(fp) + ret diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/setjmp.s b/lib/libc4.3tahoe/gen/gen.tahoe/setjmp.s new file mode 100644 index 0000000..8204da0 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/setjmp.s @@ -0,0 +1,88 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)setjmp.s 1.4 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * C library -- setjmp, longjmp + * + * longjmp(a,v) + * will generate a "return(v)" from + * the last call to + * setjmp(a) + * by restoring registers from the stack, + * previous signal mask, and doing a return. + */ + +#include "DEFS.h" + +ENTRY(setjmp, R6) + movl 4(fp),r6 # construct sigcontext + movab -8(sp),sp # space for current struct sigstack + pushal (sp) # get current values + pushl $0 # no new values + callf $16,_sigstack # pop args plus signal stack value + movl (sp)+,(r6) # save onsigstack status of caller + pushl $0 + callf $8,_sigblock # get signal mask + movl r0,4(r6) # save signal mask of caller + addl3 $8,fp,8(r6) # save stack pointer of caller + movl (fp),12(r6) # save frame pointer of caller + movl -8(fp),20(r6) # save pc of caller + movpsl 24(r6) # save psl of caller + clrl r0 + ret + +ENTRY(longjmp, 0) + movl 8(fp),r0 # return(v) + movl 4(fp),r1 # fetch buffer + tstl 12(r1) + beql botch +loop: + cmpl 12(r1),(fp) + beql done + blssu botch + movl $loop,-8(fp) + ret # pop another frame + +done: + cmpb *-8(fp),reiins # returning to an "rei"? + bneq 1f + movab 3f,-8(fp) # do return w/ psl-pc pop + brw 2f +1: + movab 4f,-8(fp) # do standard return +2: + ret # unwind stack before signals enabled +3: + addl2 $8,sp # compensate for PSL-PC push +4: + pushl r1 # pointer to sigcontext + callf $4,_sigreturn # restore previous context + # we should never return + +botch: + callf $4,_longjmperror + halt + + .data +reiins: rei diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/strcat.s b/lib/libc4.3tahoe/gen/gen.tahoe/strcat.s new file mode 100644 index 0000000..c087e2c --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/strcat.s @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)strcat.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * Concatenate s2 on the end of s1. S1's space must be large enough. + * Return s1. + * + * char * strcat(s1, s2) + * register char *s1, *s2; +*/ +#include "DEFS.h" + +ENTRY(strcat, 0) + movl 4(fp),r0 + movl r0,r1 + cmps2 # r0 and r1 point at null at end of s1 + movl 8(fp),r0 # source string + movs2 + movl 4(fp),r0 + ret diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/strcmp.s b/lib/libc4.3tahoe/gen/gen.tahoe/strcmp.s new file mode 100644 index 0000000..9abe234 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/strcmp.s @@ -0,0 +1,45 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)strcmp.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +#include "DEFS.h" + +/* + * Compare strings: s1>s2: >0 s1==s2: 0 s1s2: >0 s1==s2: 0 s1 dividend ) + jlequ 2f + clrl r0 # return(0); + ret +2: # else + movl $1,r0 # return(1);} + ret +1: + clrl r2 # return(dividend/divisor); + movl 4(fp),r3 + ediv 8(fp),r2,r0,r1 + ret + +/* + * audiv(dividendp, divisor) -- like udiv but uses address of dividend. + * Implements /= avoiding side effects in the dividend expression. + */ +ASENTRY(audiv, 0) + bitl $0x80000000,8(fp) # if (divisor & 0x80000000){ + jeql 1f + cmpl 8(fp),*4(fp) # if (divisor > dividend ) + jlequ 2f + clrl r0 # return(0); + jbr 3f +2: # else + movl $1,r0 # return(1);} + jbr 3f +1: + clrl r2 # return(dividend/divisor); + movl *4(fp),r3 + ediv 8(fp),r2,r0,r1 +3: + movl r0,*4(fp) + ret diff --git a/lib/libc4.3tahoe/gen/gen.tahoe/urem.s b/lib/libc4.3tahoe/gen/gen.tahoe/urem.s new file mode 100644 index 0000000..5d653ce --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.tahoe/urem.s @@ -0,0 +1,66 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * This code is derived from software contributed to Berkeley by + * Computer Consoles Inc. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)urem.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * Unsigned remainder. + * + * urem(dividend, divisor) + */ +#include "DEFS.h" + +ASENTRY(urem, 0) + bitl $0x80000000,8(fp) # if (divisor & 0x80000000){ + jeql 1f + movl 4(fp),r0 + cmpl 8(fp),r0 # if (divisor <= dividend ) + jgtru 2f + subl2 8(fp),r0 # return(dividend-divisor); +2: # else return(dividend);} + ret +1: + clrl r2 # return(dividend%divisor); + movl 4(fp),r3 + ediv 8(fp),r2,r1,r0 + ret + +/* + * aurem(dividendp, divisor) -- like urem but uses address of dividend. + * Implements %= avoiding side effects in the dividend expression. + */ +ASENTRY(aurem, 0) + bitl $0x80000000,8(fp) # if (divisor & 0x80000000){ + jeql 1f + movl *4(fp),r0 + cmpl 8(fp),r0 # if (divisor <= dividend ) + jgtru 2f + subl2 8(fp),r0 # return(dividend-divisor); + # else return(dividend);} + jbr 2f +1: + clrl r2 # return(dividend%divisor); + movl *4(fp),r3 + ediv 8(fp),r2,r1,r0 +2: + movl r0,*4(fp) + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/.MAP b/lib/libc4.3tahoe/gen/gen.vax/.MAP new file mode 100644 index 0000000..b6aed5c --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/.MAP @@ -0,0 +1,29 @@ +F ABS.S;1 abs.s +F ALLOCA.S;1 alloca.s +F ATOF.S;1 atof.s +F BCMP.S;1 bcmp.s +F BCOPY.S;1 bcopy.s +F BZERO.S;1 bzero.s +F FABS.S;1 fabs.s +F FFS.S;1 ffs.s +F FREXP.S;1 frexp.s +F INDEX.S;1 index.s +F INSQUE.S;1 insque.s +F LDEXP.S;1 ldexp.s +F MAKEFILE.;1 Makefile +F MODF.S;1 modf.s +F NARGS.S;1 nargs.s +D PROFILED profiled +F REMQUE.S;1 remque.s +F RINDEX.S;1 rindex.s +F SETJMP.S;1 setjmp.s +F STRCAT.S;1 strcat.s +F STRCMP.S;1 strcmp.s +F STRCPY.S;1 strcpy.s +F STRLEN.S;1 strlen.s +F STRNCAT.S;1 strncat.s +F STRNCMP.S;1 strncmp.s +F STRNCPY.S;1 strncpy.s +F UDIV.S;1 udiv.s +F UREM.S;1 urem.s +F _SETJMP.S;1 _setjmp.s diff --git a/lib/libc4.3tahoe/gen/gen.vax/Makefile b/lib/libc4.3tahoe/gen/gen.vax/Makefile new file mode 100644 index 0000000..cf6f53e --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/Makefile @@ -0,0 +1,118 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 4.20 (Berkeley) 6/27/88 +# +DEFS= -DLIBC_SCCS +FLAGS= -I../../vax ${DEFS} +CFLAGS= -O ${FLAGS} +SRCS= _setjmp.s abs.s alloca.s atof.s bcmp.s bcopy.s bzero.s fabs.s \ + ffs.s frexp.s index.s insque.s ldexp.s modf.s nargs.s remque.s \ + rindex.s setjmp.s strcat.s strcmp.s strcpy.s strlen.s strncat.s \ + strncmp.s strncpy.s udiv.s urem.s +OBJS= _setjmp.o abs.o alloca.o atof.o bcmp.o bcopy.o bzero.o fabs.o \ + ffs.o frexp.o index.o insque.o ldexp.o modf.o nargs.o remque.o \ + rindex.o setjmp.o strcat.o strcmp.o strcpy.o strlen.o strncat.o \ + strncmp.o strncpy.o udiv.o urem.o +TAGSFILE=tags + +.s.o: + @/lib/cpp -E ${FLAGS} -DPROF $*.s | ${AS} -o $*.o + @-ld -X -o profiled/$*.o -r $*.o + /lib/cpp -E ${FLAGS} $*.s | ${AS} -o $*.o + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + (P=`pwd`; \ + egrep "^ENTRY(.*)|^SYSCALL(.*)" ${SRCS} | sed \ +"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ + >> ${TAGSFILE}) + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +_setjmp.o: _setjmp.s +_setjmp.o:DEFS.h +abs.o: abs.s +abs.o:DEFS.h +alloca.o: alloca.s +alloca.o:DEFS.h +atof.o: atof.s +atof.o:DEFS.h +bcmp.o: bcmp.s +bcmp.o:DEFS.h +bcopy.o: bcopy.s +bcopy.o:DEFS.h +bzero.o: bzero.s +bzero.o:DEFS.h +fabs.o: fabs.s +fabs.o:DEFS.h +ffs.o: ffs.s +ffs.o:DEFS.h +frexp.o: frexp.s +frexp.o:DEFS.h +index.o: index.s +index.o:DEFS.h +insque.o: insque.s +insque.o:DEFS.h +ldexp.o: ldexp.s +ldexp.o:DEFS.h +ldexp.o: /usr/include/errno.h +modf.o: modf.s +modf.o:DEFS.h +nargs.o: nargs.s +nargs.o:DEFS.h +remque.o: remque.s +remque.o:DEFS.h +rindex.o: rindex.s +rindex.o:DEFS.h +setjmp.o: setjmp.s +setjmp.o:DEFS.h +strcat.o: strcat.s +strcat.o:DEFS.h +strcmp.o: strcmp.s +strcmp.o:DEFS.h +strcpy.o: strcpy.s +strcpy.o:DEFS.h +strlen.o: strlen.s +strlen.o:DEFS.h +strncat.o: strncat.s +strncat.o:DEFS.h +strncmp.o: strncmp.s +strncmp.o:DEFS.h +strncpy.o: strncpy.s +strncpy.o:DEFS.h +udiv.o: udiv.s +udiv.o:DEFS.h +urem.o: urem.s +urem.o:DEFS.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/gen/gen.vax/_setjmp.s b/lib/libc4.3tahoe/gen/gen.vax/_setjmp.s new file mode 100644 index 0000000..4a8ed83 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/_setjmp.s @@ -0,0 +1,85 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)_setjmp.s 5.7 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * C library -- _setjmp, _longjmp + * + * _longjmp(a,v) + * will generate a "return(v)" from + * the last call to + * _setjmp(a) + * by restoring registers from the stack, + * The previous signal state is NOT restored. + */ + +#include "DEFS.h" + +ENTRY(_setjmp, 0) + movl 4(ap),r0 + movl 12(fp),(r0) # save frame pointer of caller + movl 16(fp),4(r0) # save pc of caller + clrl r0 + ret + +ENTRY(_longjmp, 0) + movl 8(ap),r0 # return(v) + movl 4(ap),r1 # fetch buffer + tstl (r1) + beql botch +loop: + bitw $1,6(fp) # r0 saved? + beql 1f + movl r0,20(fp) + bitw $2,6(fp) # was r1 saved? + beql 2f + movl r1,24(fp) + brb 2f +1: + bitw $2,6(fp) # was r1 saved? + beql 2f + movl r1,20(fp) +2: + cmpl (r1),12(fp) + beql done + blssu botch + movl $loop,16(fp) + ret # pop another frame + +done: + cmpb *16(fp),reiins # returning to an "rei"? + bneq 1f + movab 3f,16(fp) # do return w/ psl-pc pop + brw 2f +1: + movab 4f,16(fp) # do standard return +2: + ret # unwind stack before signals enabled +3: + addl2 $8,sp # compensate for PSL-PC push +4: + jmp *4(r1) # done, return.... + +botch: + calls $0,_longjmperror + halt + + .data +reiins: rei diff --git a/lib/libc4.3tahoe/gen/gen.vax/abs.s b/lib/libc4.3tahoe/gen/gen.vax/abs.s new file mode 100644 index 0000000..9a66f86 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/abs.s @@ -0,0 +1,21 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifdef LIBC_SCCS + .asciz "@(#)abs.s 5.3 (Berkeley) 3/9/86" +#endif LIBC_SCCS + + +/* abs - int absolute value */ + +#include "DEFS.h" + +ENTRY(abs, 0) + movl 4(ap),r0 + bgeq 1f + mnegl r0,r0 +1: + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/alloca.s b/lib/libc4.3tahoe/gen/gen.vax/alloca.s new file mode 100644 index 0000000..721e41b --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/alloca.s @@ -0,0 +1,22 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifdef LIBC_SCCS + .asciz "@(#)alloca.s 5.3 (Berkeley) 3/9/86" +#endif LIBC_SCCS + +/* like alloc, but automatic free in return */ + +#include "DEFS.h" + +ENTRY(alloca, 0) + subl2 4(ap),sp /* crude allocation */ + movl 16(fp),r1 /* pc */ + movq 8(fp),ap /* new (old) ap and fp */ + bicl2 $3,sp /* 4-byte align */ + addl2 $7*4,sp /* reuse space of mscp */ + movl sp,r0 /* return value */ + jmp (r1) /* funny return */ diff --git a/lib/libc4.3tahoe/gen/gen.vax/atof.s b/lib/libc4.3tahoe/gen/gen.vax/atof.s new file mode 100644 index 0000000..fb5f8c9 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/atof.s @@ -0,0 +1,336 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)atof.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +#include "DEFS.h" + +/* + * atof: convert ascii to floating + * + * C usage: + * + * double atof (s) + * char *s; + * + * Register usage: + * + * r0-1: value being developed + * r2: first section: pointer to the next character + * second section: binary exponent + * r3: flags + * r4: first section: the current character + * second section: scratch + * r5: the decimal exponent + * r6-7: scratch + */ + .set msign,0 # mantissa has negative sign + .set esign,1 # exponent has negative sign + .set decpt,2 # decimal point encountered + +ENTRY(atof, R6|R7) +/* + * Initialization + */ + clrl r3 # All flags start out false + movl 4(ap),r2 # Address the first character + clrl r5 # Clear starting exponent +/* + * Skip leading white space + */ +sk0: movzbl (r2)+,r4 # Fetch the next (first) character + cmpb $' ,r4 # Is it blank? + jeql sk0 # ...yes + cmpb r4,$8 # 8 is lowest of white-space group + jlss sk1 # Jump if char too low to be white space + cmpb r4,$13 # 13 is highest of white-space group + jleq sk0 # Jump if character is white space +sk1: +/* + * Check for a sign + */ + cmpb $'+,r4 # Positive sign? + jeql cs1 # ... yes + cmpb $'-,r4 # Negative sign? + jneq cs2 # ... no + bisb2 $1 + + .globl _errno + +ENTRY(ldexp, 0) + movd 4(ap),r0 /* fetch "value" */ + extzv $7,$8,r0,r2 /* r2 := biased exponent */ + jeql 1f /* if zero, done */ + + addl2 12(ap),r2 /* r2 := new biased exponent */ + jleq 2f /* if <= 0, underflow */ + cmpl r2,$256 /* otherwise check if too big */ + jgeq 3f /* jump if overflow */ + insv r2,$7,$8,r0 /* put exponent back in result */ +1: + ret +2: + clrd r0 + jbr 1f +3: + movd huge,r0 /* largest possible floating magnitude */ + jbc $15,4(ap),1f /* jump if argument was positive */ + mnegd r0,r0 /* if arg < 0, make result negative */ +1: + movl $ERANGE,_errno + ret + + .data +huge: .word 0x7fff /* the largest number that can */ + .word 0xffff /* be represented in a long floating */ + .word 0xffff /* number. This is given in hex in order */ + .word 0xffff /* to avoid floating conversions */ diff --git a/lib/libc4.3tahoe/gen/gen.vax/modf.s b/lib/libc4.3tahoe/gen/gen.vax/modf.s new file mode 100644 index 0000000..1790391 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/modf.s @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)modf.s 5.4 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * double modf (value, iptr) + * double value, *iptr; + * + * Modf returns the fractional part of "value", + * and stores the integer part indirectly through "iptr". + */ + +#include "DEFS.h" + +ENTRY(modf, 0) + emodd 4(ap),$0,$0f1.0,r2,r0 + jvs 1f # integer overflow + cvtld r2,*12(ap) + ret +1: + subd3 r0,4(ap),*12(ap) + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/nargs.s b/lib/libc4.3tahoe/gen/gen.vax/nargs.s new file mode 100644 index 0000000..3e01e8f --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/nargs.s @@ -0,0 +1,17 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#ifdef LIBC_SCCS + .asciz "@(#)nargs.s 5.3 (Berkeley) 3/9/86" +#endif LIBC_SCCS + +/* C library -- nargs */ + +#include "DEFS.h" + +ENTRY(nargs, 0) + movzbl *8(fp),r0 /* 8(fp) is old ap */ + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/profiled/.MAP b/lib/libc4.3tahoe/gen/gen.vax/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/gen/gen.vax/remque.s b/lib/libc4.3tahoe/gen/gen.vax/remque.s new file mode 100644 index 0000000..58f9118 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/remque.s @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)remque.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* remque(entry) */ + +#include "DEFS.h" + +ENTRY(remque, 0) + remque *4(ap),r0 + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/rindex.s b/lib/libc4.3tahoe/gen/gen.vax/rindex.s new file mode 100644 index 0000000..3f28494 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/rindex.s @@ -0,0 +1,97 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)rindex.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * Find the last occurence of c in the string cp. + * Return pointer to match or null pointer. + * + * char * + * rindex(cp, c) + * char *cp, c; + */ +#include "DEFS.h" + +ENTRY(rindex, 0) + movq 4(ap),r1 # r1 = cp; r2 = c + tstl r2 # check for special case c == '\0' + bneq 2f +1: + locc $0,$65535,(r1) # just find end of string + beql 1b # still looking + movl r1,r0 # found it + ret +2: + moval tbl,r3 # r3 = address of table + bbss $0,(r3),5f # insure not reentering + movab (r3)[r2],r5 # table entry for c + incb (r5) + clrl r4 # last found +3: + scanc $65535,(r1),(r3),$1 # look for c or '\0' + beql 3b # keep looking + tstb (r1) # if have found '\0' + beql 4f # we are done + movl r1,r4 # save most recently found + incl r1 # skip over character + jbr 3b # keep looking +4: + movl r4,r0 # return last found (if any) + clrb (r5) # clean up table + clrb (r3) + ret + + .data +tbl: .space 256 + .text + +/* + * Reentrant, but slower version of rindex + */ +5: + movl r1,r3 + clrl r4 # r4 = pointer to last match +6: + locc $0,$65535,(r3) # look for '\0' + bneq 8f + decw r0 # r0 = 65535 +1: + locc r2,r0,(r3) # look for c + bneq 7f + movl r1,r3 # reset pointer and ... + jbr 6b # ... try again +7: + movl r1,r4 # stash pointer ... + addl3 $1,r1,r3 # ... skip over match and ... + decl r0 # ... decrement count + jbr 6b # ... try again +8: + subl3 r3,r1,r0 # length of short block + incl r0 # +1 for '\0' +9: + locc r2,r0,(r3) # look for c + beql 0f + movl r1,r4 # stash pointer ... + addl3 $1,r1,r3 # ... skip over match ... + decl r0 # ... adjust count and ... + jbr 9b # ... try again +0: + movl r4,r0 # return stashed pointer + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/setjmp.s b/lib/libc4.3tahoe/gen/gen.vax/setjmp.s new file mode 100644 index 0000000..993730c --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/setjmp.s @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that this notice is preserved and that due credit is given + * to the University of California at Berkeley. The name of the University + * may not be used to endorse or promote products derived from this + * software without specific written prior permission. This software + * is provided ``as is'' without express or implied warranty. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) +_sccsid:.asciz "@(#)setjmp.s 5.7 (Berkeley) 5/25/88" +#endif /* SYSLIBC_SCCS and not lint */ + +/* + * C library -- setjmp, longjmp + * + * longjmp(a,v) + * will generate a "return(v)" from + * the last call to + * setjmp(a) + * by restoring registers from the stack, + * and a struct sigcontext, see + */ + +#include "DEFS.h" + +ENTRY(setjmp, R6) + movl 4(ap),r6 # construct sigcontext + subl2 $8,sp # space for current struct sigstack + pushl sp # get current values + pushl $0 # no new values + calls $3,_sigstack # pop args plus signal stack value + movl (sp)+,(r6)+ # save onsigstack status of caller + pushl $0 + calls $1,_sigblock # get signal mask + movl r0,(r6)+ # save signal mask of caller + movl (ap),r0 + moval 4(ap)[r0],(r6)+ # save sp of caller + movl 12(fp),(r6)+ # save frame pointer of caller + movl 8(fp),(r6)+ # save argument pointer of caller + movl 16(fp),(r6)+ # save pc of caller + movpsl (r6) # save psl of caller + movw 4(fp),(r6) + clrl r0 + ret + +ENTRY(longjmp, 0) + movl 8(ap),r0 # return(v) + movl 4(ap),r1 # fetch buffer + tstl 12(r1) + beql botch +loop: + cmpl 12(r1),fp # are we there yet? + beql done + blssu botch + moval 20(fp),r2 + blbc 6(fp),1f # was r0 saved? + movl r0,(r2)+ +1: + bbc $1,6(fp),2f # was r1 saved? + movl r1,(r2) +2: + movl $loop,16(fp) + ret # pop another frame + +done: + pushl r1 # pointer to sigcontext + calls $1,_sigreturn # restore previous context + # we should never return +botch: + calls $0,_longjmperror + halt diff --git a/lib/libc4.3tahoe/gen/gen.vax/strcat.s b/lib/libc4.3tahoe/gen/gen.vax/strcat.s new file mode 100644 index 0000000..bffb34d --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/strcat.s @@ -0,0 +1,50 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)strcat.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * Concatenate string s2 to the end of s1 + * and return the base of s1. + * + * char * + * strcat(s1, s2) + * char *s1, *s2; + */ +#include "DEFS.h" + +ENTRY(strcat, R6|R7) + movq 4(ap), r6 # r6 = s1; r7 = s2 + movl r6,r1 +0: + locc $0,$65535,(r1) # look for '\0' + beql 0b + movl r1,r3 # save end of s1 +1: + locc $0,$65535,(r7) # find length of s2 + bneq 2f + movc3 $65535,(r7),(r3)# copy full block + movl r1,r7 + jbr 1b +2: + subl2 r7,r1 # calculate length + incl r1 + movc3 r1,(r7),(r3) # copy remainder + movl r6,r0 + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/strcmp.s b/lib/libc4.3tahoe/gen/gen.vax/strcmp.s new file mode 100644 index 0000000..cbfb5eb --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/strcmp.s @@ -0,0 +1,69 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)strcmp.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * Compare string s1 lexicographically to string s2. + * Return: + * 0 s1 == s2 + * > 0 s1 > s2 + * < 0 s2 < s2 + * + * strcmp(s1, s2) + * char *s1, *s2; + */ +#include "DEFS.h" + +ENTRY(strcmp, 0) + movl 4(ap),r1 # r1 = s1 + movl 8(ap),r3 # r3 = s2 + subb3 (r3),(r1),r0 # quick check for first char different + beql 1f # have to keep checking + cvtbl r0,r0 + ret +1: + clrl r5 # calculate min bytes to next page boundry + subb3 r1,$255,r5 # r5 = (bytes - 1) to end of page for s1 + subb3 r3,$255,r0 # r0 = (bytes - 1) to end of page for s2 + cmpb r0,r5 # r5 = min(r0, r5); + bgtru 2f + movb r0,r5 +2: + incl r5 # r5 = min bytes to next page boundry + cmpc3 r5,(r1),(r3) # compare strings + bneq 3f + subl2 r5,r1 # check if found null yet + locc $0,r5,(r1) + beql 1b # not yet done, continue checking + subl2 r0,r3 + mnegb (r3),r0 # r0 = '\0' - *s2 + cvtbl r0,r0 + ret +3: + subl2 r0,r5 # check for null in matching string + subl2 r5,r1 + locc $0,r5,(r1) + bneq 4f + subb3 (r3),(r1),r0 # r0 = *s1 - *s2 + cvtbl r0,r0 + ret +4: + clrl r0 # both the same to null + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/strcpy.s b/lib/libc4.3tahoe/gen/gen.vax/strcpy.s new file mode 100644 index 0000000..305f1d2 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/strcpy.s @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)strcpy.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * Copy string s2 over top of s1. + * Return base of s1. + * + * char * + * strcpy(s1, s2) + * char *s1, *s2; + */ +#include "DEFS.h" + +ENTRY(strcpy, R6) + movl 4(ap), r3 # r3 = s1 + movl 8(ap), r6 # r6 = s2 +1: + locc $0,$65535,(r6) # find length of s2 + bneq 2f + movc3 $65535,(r6),(r3)# copy full block + movl r1,r6 + jbr 1b +2: + subl2 r6,r1 # calculate length + incl r1 + movc3 r1,(r6),(r3) # copy remainder + movl 4(ap),r0 # return base of s1 + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/strlen.s b/lib/libc4.3tahoe/gen/gen.vax/strlen.s new file mode 100644 index 0000000..64c3863 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/strlen.s @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)strlen.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * Return the length of cp (not counting '\0'). + * + * strlen(cp) + * char *cp; + */ +#include "DEFS.h" + +ENTRY(strlen, 0) + movl 4(ap),r1 +1: + locc $0,$65535,(r1) # look for '\0' + beql 1b + subl3 4(ap),r1,r0 # len = cp - base + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/strncat.s b/lib/libc4.3tahoe/gen/gen.vax/strncat.s new file mode 100644 index 0000000..6ff6e23 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/strncat.s @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)strncat.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * Concatenate string s2 on the end of s1 + * and return the base of s1. The parameter + * n is the maximum length of string s2 to + * concatenate. + * + * char * + * strncat(s1, s2, n) + * char *s1, *s2; + * int n; + */ +#include "DEFS.h" + +ENTRY(strncat, R6) + movl 12(ap),r6 # r6 = n + bleq done # n <= 0 + movl 4(ap),r3 # r3 = s1 + movl r3,r1 +0: + locc $0,$65535,(r1) + beql 0b + movl r1,r3 # r3 = index(s1, '\0'); + movl 8(ap),r1 # r1 = s2 +1: + movzwl $65535,r2 # r2 = bytes in first chunk + cmpl r6,r2 # r2 = min(bytes in chunk, n); + jgeq 2f + movl r6,r2 +2: + subl2 r2,r6 # update n + locc $0,r2,(r1) # '\0' found? + jneq 3f + subl2 r2,r1 # back up pointer updated by locc + movc3 r2,(r1),(r3) # copy in next piece + tstl r6 # run out of space? + jneq 1b + clrb (r3) # force '\0' termination + jbr done +3: + subl2 r0,r2 # r2 = number of bytes to move + subl2 r2,r1 # back up pointer updated by locc + incl r2 # copy '\0' as well + movc3 r2,(r1),(r3) # copy in last piece +done: + movl 4(ap),r0 # return s1 + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/strncmp.s b/lib/libc4.3tahoe/gen/gen.vax/strncmp.s new file mode 100644 index 0000000..aaf9ada --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/strncmp.s @@ -0,0 +1,73 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)strncmp.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * Compare at most n characters of string + * s1 lexicographically to string s2. + * Return: + * 0 s1 == s2 + * > 0 s1 > s2 + * < 0 s2 < s2 + * + * strncmp(s1, s2, n) + * char *s1, *s2; + * int n; + */ +#include "DEFS.h" + +ENTRY(strncmp, 0) + movl 4(ap),r1 # r1 = s1 + movq 8(ap),r3 # r3 = s2; r4 = n +1: + clrl r5 # calculate min bytes to next page boundry + subb3 r1,$255,r5 # r5 = (bytes - 1) to end of page for s1 + subb3 r3,$255,r0 # r0 = (bytes - 1) to end of page for s2 + cmpb r0,r5 # r5 = min(r0, r5); + bgtru 2f + movb r0,r5 +2: + incl r5 # r5 = min bytes to next page boundry + cmpl r4,r5 # r5 = min(n, r5); + bgeq 3f + movl r4,r5 +3: + cmpc3 r5,(r1),(r3) # compare strings + bneq 4f + subl2 r5,r4 # check for end of comparison + beql 5f + subl2 r5,r1 # check if found null yet + locc $0,r5,(r1) + beql 1b # not yet done, continue checking + subl2 r0,r3 + mnegb (r3),r0 # r0 = '\0' - *s2 + cvtbl r0,r0 + ret +4: + subl2 r0,r5 # check for null in matching string + subl2 r5,r1 + locc $0,r5,(r1) + bneq 5f + subb3 (r3),(r1),r0 # r0 = *s1 - *s2 + cvtbl r0,r0 + ret +5: + clrl r0 # both the same to null + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/strncpy.s b/lib/libc4.3tahoe/gen/gen.vax/strncpy.s new file mode 100644 index 0000000..76df831 --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/strncpy.s @@ -0,0 +1,68 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)strncpy.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * Copy string s2 over top of string s1. + * Truncate or null-pad to n bytes. + * + * char * + * strncpy(s1, s2, n) + * char *s1, *s2; + */ +#include "DEFS.h" + +ENTRY(strncpy, R6) + movl 12(ap),r6 # r6 = n + bleq done # n <= 0 + movl 4(ap),r3 # r3 = s1 + movl 8(ap),r1 # r1 = s2 +1: + movzwl $65535,r2 # r2 = bytes in first chunk + cmpl r6,r2 # r2 = min(bytes in chunk, n); + jgeq 2f + movl r6,r2 +2: + subl2 r2,r6 # update n + locc $0,r2,(r1) # '\0' found? + jneq 3f + subl2 r2,r1 # back up pointer updated by locc + movc3 r2,(r1),(r3) # copy in next piece + tstl r6 # run out of space? + jneq 1b + jbr done +3: # copy up to '\0' logic + addl2 r0,r6 # r6 = number of null-pad bytes + subl2 r0,r2 # r2 = number of bytes to move + subl2 r2,r1 # back up pointer updated by locc + movc3 r2,(r1),(r3) # copy in last piece +4: # null-pad logic + movzwl $65535,r2 # r2 = bytes in first chunk + cmpl r6,r2 # r2 = min(bytes in chunk, n); + jgeq 5f + movl r6,r2 +5: + subl2 r2,r6 # update n + movc5 $0,(r3),$0,r2,(r3)# pad with '\0's + tstl r6 # finished padding? + jneq 4b +done: + movl 4(ap),r0 # return s1 + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/udiv.s b/lib/libc4.3tahoe/gen/gen.vax/udiv.s new file mode 100644 index 0000000..c7d1daf --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/udiv.s @@ -0,0 +1,77 @@ +#ifdef LIBC_SCCS + .asciz "@(#)udiv.s 5.2 (Berkeley) 3/9/86" +#endif LIBC_SCCS + +/* + * udiv - unsigned division for vax-11 + * + * arguments: dividend, divisor. + * result: quotient. + * uses r0-r2 + * + * If 1 < divisor <= 2147483647, zero-extend the dividend + * to 64 bits and let ediv do the work. If the divisor is 1, + * ediv will overflow if bit 31 of the dividend is on, so + * just return the dividend unchanged. If the divisor is 0, + * do the ediv also, so it will generate the proper exception. + * All other values of the divisor have bit 31 on: in this case + * the quotient must be 0 if divisor > dividend, and 1 otherwise, + * provided that the comparison is made as unsigned. + */ + +#include "DEFS.h" + +ASENTRY(udiv, 0) + movl 4(ap),r0 /* dividend */ + movl 8(ap),r2 /* divisor */ + jeql 1f /* if divisor=0, force exception */ + cmpl r2,$1 /* if divisor <= 1 (signed), */ + jleq 2f /* no division is necessary */ +1: + clrl r1 /* zero-extend the dividend */ + ediv r2,r0,r0,r2 /* divide. q->r0, r->r2 (discarded) */ + ret +2: + jeql 1f /* if divisor=1, return dividend */ + cmpl r0,r2 /* unsigned comparison between */ + jgequ 2f /* dividend and divisor */ + clrl r0 /* dividend < divisor, return 0 */ + ret +2: + movl $1,r0 /* dividend >= divisor, return 1 */ +1: + ret + +/* + * audiv - unsigned division for vax-11 + * + * arguments: *dividend, divisor. + * result: quotient in r0 and *dividend. + * uses r0-r2 + */ + +#include "DEFS.h" + +ASENTRY(audiv, 0) + movl *4(ap),r0 /* dividend */ + movl 8(ap),r2 /* divisor */ + jeql 1f /* if divisor=0, force exception */ + cmpl r2,$1 /* if divisor <= 1 (signed), */ + jleq 2f /* no division is necessary */ +1: + clrl r1 /* zero-extend the dividend */ + ediv r2,r0,r0,r2 /* divide. q->r0, r->r2 (discarded) */ + movl r0,*4(ap) /* save result */ + ret +2: + jeql 1f /* if divisor=1, return dividend */ + cmpl r0,r2 /* unsigned comparison between */ + jgequ 2f /* dividend and divisor */ + clrl r0 /* dividend < divisor, return 0 */ + clrl *4(ap) /* save result */ + ret +2: + movl $1,r0 /* dividend >= divisor, return 1 */ +1: + movl r0,*4(ap) /* save result */ + ret diff --git a/lib/libc4.3tahoe/gen/gen.vax/urem.s b/lib/libc4.3tahoe/gen/gen.vax/urem.s new file mode 100644 index 0000000..8b2e9ab --- /dev/null +++ b/lib/libc4.3tahoe/gen/gen.vax/urem.s @@ -0,0 +1,75 @@ +#ifdef LIBC_SCCS + .asciz "@(#)urem.s 5.2 (Berkeley) 3/9/86" +#endif LIBC_SCCS + +/* + * urem - unsigned remainder for vax-11 + * + * arguments: dividend, divisor + * result: remainder + * uses r0-r2 + * + * if 1 < divisor <= 2147483647, zero-extend the dividend + * to 64 bits and let ediv do the work. If the divisor is 1, + * ediv will overflow if bit 31 of the dividend is on, so + * just return 0. If the divisor is 0, do the ediv also, + * so it will generate the proper exception. All other values + * of the divisor have bit 31 on: in this case the remainder + * must be the dividend if divisor > dividend, and the dividend + * minus the divisor otherwise. The comparison must be unsigned. + */ +#include "DEFS.h" + +ASENTRY(urem, 0) + movl 4(ap),r0 /* dividend */ + movl 8(ap),r2 /* divisor */ + jeql 1f /* if divisor=0, force exception */ + cmpl r2,$1 /* if divisor <= 1 (signed), */ + jleq 2f /* no division is necessary */ +1: + clrl r1 /* zero-extend the dividend */ + ediv r2,r0,r2,r0 /* divide. q->r2 (discarded), r->r0 */ + ret +2: + jneq 1f /* if divisor=1, return 0 */ + clrl r0 /* (because doing the divide will overflow */ + ret /* if the dividend has its high bit on) */ +1: + cmpl r0,r2 /* if dividend < divisor (unsigned) */ + jlssu 1f /* remainder is dividend */ + subl2 r2,r0 /* else remainder is dividend - divisor */ +1: + ret + +/* + * aurem - unsigned remainder for vax-11 + * + * arguments: *dividend, divisor + * result: remainder in r0 and *dividend + * uses r0-r2 + */ +#include "DEFS.h" + +ASENTRY(aurem, 0) + movl *4(ap),r0 /* dividend */ + movl 8(ap),r2 /* divisor */ + jeql 1f /* if divisor=0, force exception */ + cmpl r2,$1 /* if divisor <= 1 (signed), */ + jleq 2f /* no division is necessary */ +1: + clrl r1 /* zero-extend the dividend */ + ediv r2,r0,r2,r0 /* divide. q->r2 (discarded), r->r0 */ + movl r0,*4(ap) /* save result */ + ret +2: + jneq 1f /* if divisor=1, return 0 */ + clrl r0 /* (because doing the divide will overflow */ + clrl *4(ap) /* if the dividend has its high bit on) */ + ret +1: + cmpl r0,r2 /* if dividend < divisor (unsigned) */ + jlssu 1f /* remainder is dividend */ + subl2 r2,r0 /* else remainder is dividend - divisor */ +1: + movl r0,*4(ap) /* save result */ + ret diff --git a/lib/libc4.3tahoe/gen/getenv.c b/lib/libc4.3tahoe/gen/getenv.c new file mode 100644 index 0000000..e71c31e --- /dev/null +++ b/lib/libc4.3tahoe/gen/getenv.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getenv.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +/* + * getenv -- + * Returns ptr to value associated with name, if any, else NULL. + */ +char * +getenv(name) + char *name; +{ + int offset; + char *_findenv(); + + return(_findenv(name, &offset)); +} + +/* + * _findenv -- + * Returns pointer to value associated with name, if any, else NULL. + * Sets offset to be the offset of the name/value combination in the + * environmental array, for use by setenv(3) and unsetenv(3). + * Explicitly removes '=' in argument name. + * + * This routine *should* be a static; don't use it. + */ +char * +_findenv(name, offset) + register char *name; + int *offset; +{ + extern char **environ; + register int len; + register char **P, *C; + + for (C = name, len = 0; *C && *C != '='; ++C, ++len); + for (P = environ; *P; ++P) + if (!strncmp(*P, name, len)) + if (*(C = *P + len) == '=') { + *offset = P - environ; + return(++C); + } + return(NULL); +} diff --git a/lib/libc4.3tahoe/gen/getgrent.c b/lib/libc4.3tahoe/gen/getgrent.c new file mode 100644 index 0000000..38bda49 --- /dev/null +++ b/lib/libc4.3tahoe/gen/getgrent.c @@ -0,0 +1,71 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getgrent.c 5.3 (Berkeley) 11/5/87"; +#endif LIBC_SCCS and not lint + +#include +#include + +#define MAXGRP 200 + +static char *GROUP = "/etc/group"; +static FILE *grf = NULL; +static char line[BUFSIZ+1]; +static struct group group; +static char *gr_mem[MAXGRP]; + +setgrent() +{ + if( !grf ) + grf = fopen( GROUP, "r" ); + else + rewind( grf ); +} + +endgrent() +{ + if( grf ){ + fclose( grf ); + grf = NULL; + } +} + +static char * +grskip(p,c) +register char *p; +register c; +{ + while( *p && *p != c ) ++p; + if( *p ) *p++ = 0; + return( p ); +} + +struct group * +getgrent() +{ + register char *p, **q; + + if( !grf && !(grf = fopen( GROUP, "r" )) ) + return(NULL); + if( !(p = fgets( line, BUFSIZ, grf )) ) + return(NULL); + group.gr_name = p; + group.gr_passwd = p = grskip(p,':'); + group.gr_gid = atoi( p = grskip(p,':') ); + group.gr_mem = gr_mem; + p = grskip(p,':'); + grskip(p,'\n'); + q = gr_mem; + while( *p ){ + if (q < &gr_mem[MAXGRP-1]) + *q++ = p; + p = grskip(p,','); + } + *q = NULL; + return( &group ); +} + +setgrfile(file) + char *file; +{ + GROUP = file; +} diff --git a/lib/libc4.3tahoe/gen/getgrgid.c b/lib/libc4.3tahoe/gen/getgrgid.c new file mode 100644 index 0000000..d7c07fe --- /dev/null +++ b/lib/libc4.3tahoe/gen/getgrgid.c @@ -0,0 +1,18 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getgrgid.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +struct group * +getgrgid(gid) +register gid; +{ + register struct group *p; + struct group *getgrent(); + + setgrent(); + while( (p = getgrent()) && p->gr_gid != gid ); + endgrent(); + return(p); +} diff --git a/lib/libc4.3tahoe/gen/getgrnam.c b/lib/libc4.3tahoe/gen/getgrnam.c new file mode 100644 index 0000000..5e12284 --- /dev/null +++ b/lib/libc4.3tahoe/gen/getgrnam.c @@ -0,0 +1,18 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getgrnam.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +struct group * +getgrnam(name) +register char *name; +{ + register struct group *p; + struct group *getgrent(); + + setgrent(); + while( (p = getgrent()) && strcmp(p->gr_name,name) ); + endgrent(); + return(p); +} diff --git a/lib/libc4.3tahoe/gen/getlogin.c b/lib/libc4.3tahoe/gen/getlogin.c new file mode 100644 index 0000000..6988fba --- /dev/null +++ b/lib/libc4.3tahoe/gen/getlogin.c @@ -0,0 +1,33 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getlogin.c 5.3 (Berkeley) 5/9/86"; +#endif LIBC_SCCS and not lint + +#include + +static char UTMP[] = "/etc/utmp"; +static struct utmp ubuf; + +char * +getlogin() +{ + register int me, uf; + register char *cp; + + if (!(me = ttyslot())) + return(0); + if ((uf = open(UTMP, 0)) < 0) + return (0); + lseek (uf, (long)(me*sizeof(ubuf)), 0); + if (read(uf, (char *)&ubuf, sizeof (ubuf)) != sizeof (ubuf)) { + close(uf); + return (0); + } + close(uf); + if (ubuf.ut_name[0] == '\0') + return (0); + ubuf.ut_name[sizeof (ubuf.ut_name)] = ' '; + for (cp = ubuf.ut_name; *cp++ != ' '; ) + ; + *--cp = '\0'; + return (ubuf.ut_name); +} diff --git a/lib/libc4.3tahoe/gen/getpass.c b/lib/libc4.3tahoe/gen/getpass.c new file mode 100644 index 0000000..8142fdf --- /dev/null +++ b/lib/libc4.3tahoe/gen/getpass.c @@ -0,0 +1,44 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getpass.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include +#include + +char * +getpass(prompt) +char *prompt; +{ + struct sgttyb ttyb; + int flags; + register char *p; + register c; + FILE *fi; + static char pbuf[9]; + int (*signal())(); + int (*sig)(); + + if ((fi = fdopen(open("/dev/tty", 2), "r")) == NULL) + fi = stdin; + else + setbuf(fi, (char *)NULL); + sig = signal(SIGINT, SIG_IGN); + ioctl(fileno(fi), TIOCGETP, &ttyb); + flags = ttyb.sg_flags; + ttyb.sg_flags &= ~ECHO; + ioctl(fileno(fi), TIOCSETP, &ttyb); + fprintf(stderr, "%s", prompt); fflush(stderr); + for (p=pbuf; (c = getc(fi))!='\n' && c!=EOF;) { + if (p < &pbuf[8]) + *p++ = c; + } + *p = '\0'; + fprintf(stderr, "\n"); fflush(stderr); + ttyb.sg_flags = flags; + ioctl(fileno(fi), TIOCSETP, &ttyb); + signal(SIGINT, sig); + if (fi != stdin) + fclose(fi); + return(pbuf); +} diff --git a/lib/libc4.3tahoe/gen/getpwent.c b/lib/libc4.3tahoe/gen/getpwent.c new file mode 100644 index 0000000..6ac2c73 --- /dev/null +++ b/lib/libc4.3tahoe/gen/getpwent.c @@ -0,0 +1,96 @@ +/* + * Copyright (c) 1984 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getpwent.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include +#include + +static char EMPTY[] = ""; +static FILE *pwf = NULL; +static char line[BUFSIZ+1]; +static struct passwd passwd; + +/* + * The following are shared with getpwnamuid.c + */ +char *_pw_file = "/etc/passwd"; +DBM *_pw_db; +int _pw_stayopen; + +setpwent() +{ + if (pwf == NULL) + pwf = fopen(_pw_file, "r"); + else + rewind(pwf); +} + +endpwent() +{ + if (pwf != NULL) { + fclose(pwf); + pwf = NULL; + } + if (_pw_db != (DBM *)0) { + dbm_close(_pw_db); + _pw_db = (DBM *)0; + _pw_stayopen = 0; + } +} + +static char * +pwskip(p) +register char *p; +{ + while (*p && *p != ':' && *p != '\n') + ++p; + if (*p) + *p++ = 0; + return(p); +} + +struct passwd * +getpwent() +{ + register char *p; + + if (pwf == NULL) { + if ((pwf = fopen( _pw_file, "r" )) == NULL) + return(0); + } + p = fgets(line, BUFSIZ, pwf); + if (p == NULL) + return(0); + passwd.pw_name = p; + p = pwskip(p); + passwd.pw_passwd = p; + p = pwskip(p); + passwd.pw_uid = atoi(p); + p = pwskip(p); + passwd.pw_gid = atoi(p); + passwd.pw_quota = 0; + passwd.pw_comment = EMPTY; + p = pwskip(p); + passwd.pw_gecos = p; + p = pwskip(p); + passwd.pw_dir = p; + p = pwskip(p); + passwd.pw_shell = p; + while (*p && *p != '\n') + p++; + *p = '\0'; + return(&passwd); +} + +setpwfile(file) + char *file; +{ + _pw_file = file; +} diff --git a/lib/libc4.3tahoe/gen/getpwnamuid.c b/lib/libc4.3tahoe/gen/getpwnamuid.c new file mode 100644 index 0000000..8961aa3 --- /dev/null +++ b/lib/libc4.3tahoe/gen/getpwnamuid.c @@ -0,0 +1,121 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getpwnamuid.c 5.3 (Berkeley) 12/21/87"; +#endif LIBC_SCCS and not lint + +#include +#include +#include + +#include + +static char line[BUFSIZ+1]; +static struct passwd passwd; + +/* + * The following are shared with getpwent.c + */ +extern char *_pw_file; +DBM *_pw_db; +int _pw_stayopen; + +static struct passwd * +fetchpw(key) + datum key; +{ + register char *cp, *tp; + + if (key.dptr == 0) + return ((struct passwd *)NULL); + key = dbm_fetch(_pw_db, key); + if (key.dptr == 0) + return ((struct passwd *)NULL); + cp = key.dptr; + tp = line; + +#define EXPAND(e) passwd.e = tp; while (*tp++ = *cp++); + EXPAND(pw_name); + EXPAND(pw_passwd); + bcopy(cp, (char *)&passwd.pw_uid, sizeof (int)); + cp += sizeof (int); + bcopy(cp, (char *)&passwd.pw_gid, sizeof (int)); + cp += sizeof (int); + bcopy(cp, (char *)&passwd.pw_quota, sizeof (int)); + cp += sizeof (int); + EXPAND(pw_comment); + EXPAND(pw_gecos); + EXPAND(pw_dir); + EXPAND(pw_shell); + return (&passwd); +} + +struct passwd * +getpwnam(nam) + char *nam; +{ + datum key; + register struct passwd *pw; + + if (_pw_db == (DBM *)0 && + (_pw_db = dbm_open(_pw_file, O_RDONLY)) == (DBM *)0) { + oldcode: + setpwent(); + while ((pw = getpwent()) && strcmp(nam, pw->pw_name)) + ; + if (!_pw_stayopen) + endpwent(); + return (pw); + } + if (flock(dbm_dirfno(_pw_db), LOCK_SH) < 0) { + dbm_close(_pw_db); + _pw_db = (DBM *)0; + goto oldcode; + } + key.dptr = nam; + key.dsize = strlen(nam); + pw = fetchpw(key); + (void) flock(dbm_dirfno(_pw_db), LOCK_UN); + if (!_pw_stayopen) { + dbm_close(_pw_db); + _pw_db = (DBM *)0; + } + return (pw); +} + +struct passwd * +getpwuid(uid) + int uid; +{ + datum key; + register struct passwd *pw; + + if (_pw_db == (DBM *)0 && + (_pw_db = dbm_open(_pw_file, O_RDONLY)) == (DBM *)0) { + oldcode: + setpwent(); + while ((pw = getpwent()) && pw->pw_uid != uid) + ; + if (!_pw_stayopen) + endpwent(); + return (pw); + } + if (flock(dbm_dirfno(_pw_db), LOCK_SH) < 0) { + dbm_close(_pw_db); + _pw_db = (DBM *)0; + goto oldcode; + } + key.dptr = (char *) &uid; + key.dsize = sizeof uid; + pw = fetchpw(key); + (void) flock(dbm_dirfno(_pw_db), LOCK_UN); + if (!_pw_stayopen) { + dbm_close(_pw_db); + _pw_db = (DBM *)0; + } + return (pw); +} diff --git a/lib/libc4.3tahoe/gen/getttyent.c b/lib/libc4.3tahoe/gen/getttyent.c new file mode 100644 index 0000000..164c6b3 --- /dev/null +++ b/lib/libc4.3tahoe/gen/getttyent.c @@ -0,0 +1,137 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getttyent.c 5.4 (Berkeley) 5/19/86"; +#endif LIBC_SCCS and not lint + +#include +#include +#include + +static char TTYFILE[] = "/etc/ttys"; +static char zapchar; +static FILE *tf = NULL; +#define LINE 256 +static char line[LINE]; +static struct ttyent tty; + +setttyent() +{ + if (tf == NULL) + tf = fopen(TTYFILE, "r"); + else + rewind(tf); +} + +endttyent() +{ + if (tf != NULL) { + (void) fclose(tf); + tf = NULL; + } +} + +#define QUOTED 1 + +/* + * Skip over the current field, removing quotes, + * and return a pointer to the next field. + */ +static char * +skip(p) + register char *p; +{ + register char *t = p; + register int c; + register int q = 0; + + for (; (c = *p) != '\0'; p++) { + if (c == '"') { + q ^= QUOTED; /* obscure, but nice */ + continue; + } + if (q == QUOTED && *p == '\\' && *(p+1) == '"') + p++; + *t++ = *p; + if (q == QUOTED) + continue; + if (c == '#') { + zapchar = c; + *p = 0; + break; + } + if (c == '\t' || c == ' ' || c == '\n') { + zapchar = c; + *p++ = 0; + while ((c = *p) == '\t' || c == ' ' || c == '\n') + p++; + break; + } + } + *--t = '\0'; + return (p); +} + +static char * +value(p) + register char *p; +{ + if ((p = index(p,'=')) == 0) + return(NULL); + p++; /* get past the = sign */ + return(p); +} + +struct ttyent * +getttyent() +{ + register char *p; + register int c; + + if (tf == NULL) { + if ((tf = fopen(TTYFILE, "r")) == NULL) + return (NULL); + } + do { + p = fgets(line, LINE, tf); + if (p == NULL) + return (NULL); + while ((c = *p) == '\t' || c == ' ' || c == '\n') + p++; + } while (c == '\0' || c == '#'); + zapchar = 0; + tty.ty_name = p; + p = skip(p); + tty.ty_getty = p; + p = skip(p); + tty.ty_type = p; + p = skip(p); + tty.ty_status = 0; + tty.ty_window = NULL; + for (; *p; p = skip(p)) { +#define space(x) ((c = p[x]) == ' ' || c == '\t' || c == '\n') + if (strncmp(p, "on", 2) == 0 && space(2)) + tty.ty_status |= TTY_ON; + else if (strncmp(p, "off", 3) == 0 && space(3)) + tty.ty_status &= ~TTY_ON; + else if (strncmp(p, "secure", 6) == 0 && space(6)) + tty.ty_status |= TTY_SECURE; + else if (strncmp(p, "window=", 7) == 0) + tty.ty_window = value(p); + else + break; + } + if (zapchar == '#' || *p == '#') + while ((c = *++p) == ' ' || c == '\t') + ; + tty.ty_comment = p; + if (*p == 0) + tty.ty_comment = 0; + if (p = index(p, '\n')) + *p = '\0'; + return(&tty); +} diff --git a/lib/libc4.3tahoe/gen/getttynam.c b/lib/libc4.3tahoe/gen/getttynam.c new file mode 100644 index 0000000..f947abd --- /dev/null +++ b/lib/libc4.3tahoe/gen/getttynam.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getttynam.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +struct ttyent * +getttynam(tty) + char *tty; +{ + register struct ttyent *t; + + setttyent(); + while (t = getttyent()) { + if (strcmp(tty, t->ty_name) == 0) + break; + } + endttyent(); + return (t); +} diff --git a/lib/libc4.3tahoe/gen/getusershell.c b/lib/libc4.3tahoe/gen/getusershell.c new file mode 100644 index 0000000..f9fe9ae --- /dev/null +++ b/lib/libc4.3tahoe/gen/getusershell.c @@ -0,0 +1,109 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getusershell.c 5.4 (Berkeley) 7/25/86"; +#endif LIBC_SCCS and not lint + +#include +#include +#include +#include +#include + +#define SHELLS "/etc/shells" + +/* + * Do not add local shells here. They should be added in /etc/shells + */ +static char *okshells[] = + { "/bin/sh", "/bin/csh", 0 }; + +static char **shells, *strings; +static char **curshell = NULL; +extern char **initshells(); + +/* + * Get a list of shells from SHELLS, if it exists. + */ +char * +getusershell() +{ + char *ret; + + if (curshell == NULL) + curshell = initshells(); + ret = *curshell; + if (ret != NULL) + curshell++; + return (ret); +} + +endusershell() +{ + + if (shells != NULL) + free((char *)shells); + shells = NULL; + if (strings != NULL) + free(strings); + strings = NULL; + curshell = NULL; +} + +setusershell() +{ + + curshell = initshells(); +} + +static char ** +initshells() +{ + register char **sp, *cp; + register FILE *fp; + struct stat statb; + extern char *malloc(), *calloc(); + + if (shells != NULL) + free((char *)shells); + shells = NULL; + if (strings != NULL) + free(strings); + strings = NULL; + if ((fp = fopen(SHELLS, "r")) == (FILE *)0) + return(okshells); + if (fstat(fileno(fp), &statb) == -1) { + (void)fclose(fp); + return(okshells); + } + if ((strings = malloc((unsigned)statb.st_size)) == NULL) { + (void)fclose(fp); + return(okshells); + } + shells = (char **)calloc((unsigned)statb.st_size / 3, sizeof (char *)); + if (shells == NULL) { + (void)fclose(fp); + free(strings); + strings = NULL; + return(okshells); + } + sp = shells; + cp = strings; + while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) { + while (*cp != '#' && *cp != '/' && *cp != '\0') + cp++; + if (*cp == '#' || *cp == '\0') + continue; + *sp++ = cp; + while (!isspace(*cp) && *cp != '#' && *cp != '\0') + cp++; + *cp++ = '\0'; + } + *sp = (char *)0; + (void)fclose(fp); + return (shells); +} diff --git a/lib/libc4.3tahoe/gen/getwd.c b/lib/libc4.3tahoe/gen/getwd.c new file mode 100644 index 0000000..ac4005a --- /dev/null +++ b/lib/libc4.3tahoe/gen/getwd.c @@ -0,0 +1,114 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getwd.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * getwd() returns the pathname of the current working directory. On error + * an error message is copied to pathname and null pointer is returned. + */ +#include +#include +#include + +#define GETWDERR(s) strcpy(pathname, (s)); + +char *strcpy(); +static int pathsize; /* pathname length */ + +char * +getwd(pathname) + char *pathname; +{ + char pathbuf[MAXPATHLEN]; /* temporary pathname buffer */ + char *pnptr = &pathbuf[(sizeof pathbuf)-1]; /* pathname pointer */ + char curdir[MAXPATHLEN]; /* current directory buffer */ + char *dptr = curdir; /* directory pointer */ + char *prepend(); /* prepend dirname to pathname */ + dev_t cdev, rdev; /* current & root device number */ + ino_t cino, rino; /* current & root inode number */ + DIR *dirp; /* directory stream */ + struct direct *dir; /* directory entry struct */ + struct stat d, dd; /* file status struct */ + + pathsize = 0; + *pnptr = '\0'; + if (stat("/", &d) < 0) { + GETWDERR("getwd: can't stat /"); + return (NULL); + } + rdev = d.st_dev; + rino = d.st_ino; + strcpy(dptr, "./"); + dptr += 2; + if (stat(curdir, &d) < 0) { + GETWDERR("getwd: can't stat ."); + return (NULL); + } + for (;;) { + if (d.st_ino == rino && d.st_dev == rdev) + break; /* reached root directory */ + cino = d.st_ino; + cdev = d.st_dev; + strcpy(dptr, "../"); + dptr += 3; + if ((dirp = opendir(curdir)) == NULL) { + GETWDERR("getwd: can't open .."); + return (NULL); + } + fstat(dirp->dd_fd, &d); + if (cdev == d.st_dev) { + if (cino == d.st_ino) { + /* reached root directory */ + closedir(dirp); + break; + } + do { + if ((dir = readdir(dirp)) == NULL) { + closedir(dirp); + GETWDERR("getwd: read error in .."); + return (NULL); + } + } while (dir->d_ino != cino); + } else + do { + if ((dir = readdir(dirp)) == NULL) { + closedir(dirp); + GETWDERR("getwd: read error in .."); + return (NULL); + } + strcpy(dptr, dir->d_name); + lstat(curdir, &dd); + } while(dd.st_ino != cino || dd.st_dev != cdev); + closedir(dirp); + pnptr = prepend("/", prepend(dir->d_name, pnptr)); + } + if (*pnptr == '\0') /* current dir == root dir */ + strcpy(pathname, "/"); + else + strcpy(pathname, pnptr); + return (pathname); +} + +/* + * prepend() tacks a directory name onto the front of a pathname. + */ +static char * +prepend(dirname, pathname) + register char *dirname; + register char *pathname; +{ + register int i; /* directory name size counter */ + + for (i = 0; *dirname != '\0'; i++, dirname++) + continue; + if ((pathsize += i) < MAXPATHLEN) + while (i-- > 0) + *--pathname = *--dirname; + return (pathname); +} diff --git a/lib/libc4.3tahoe/gen/index.c b/lib/libc4.3tahoe/gen/index.c new file mode 100644 index 0000000..e2b5bd6 --- /dev/null +++ b/lib/libc4.3tahoe/gen/index.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)index.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +char * +index(p, ch) + register char *p, ch; +{ + for (;; ++p) { + if (*p == ch) + return(p); + if (!*p) + return((char *)NULL); + } + /* NOTREACHED */ +} diff --git a/lib/libc4.3tahoe/gen/initgroups.c b/lib/libc4.3tahoe/gen/initgroups.c new file mode 100644 index 0000000..362e3e6 --- /dev/null +++ b/lib/libc4.3tahoe/gen/initgroups.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)initgroups.c 5.3 (Berkeley) 4/27/86"; +#endif LIBC_SCCS and not lint + +/* + * initgroups + */ +#include +#include +#include + +struct group *getgrent(); + +initgroups(uname, agroup) + char *uname; + int agroup; +{ + int groups[NGROUPS], ngroups = 0; + register struct group *grp; + register int i; + + if (agroup >= 0) + groups[ngroups++] = agroup; + setgrent(); + while (grp = getgrent()) { + if (grp->gr_gid == agroup) + continue; + for (i = 0; grp->gr_mem[i]; i++) + if (!strcmp(grp->gr_mem[i], uname)) { + if (ngroups == NGROUPS) { +fprintf(stderr, "initgroups: %s is in too many groups\n", uname); + goto toomany; + } + groups[ngroups++] = grp->gr_gid; + } + } +toomany: + endgrent(); + if (setgroups(ngroups, groups) < 0) { + perror("setgroups"); + return (-1); + } + return (0); +} diff --git a/lib/libc4.3tahoe/gen/insque.c b/lib/libc4.3tahoe/gen/insque.c new file mode 100644 index 0000000..e43b1a2 --- /dev/null +++ b/lib/libc4.3tahoe/gen/insque.c @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)insque.c 5.1 (Berkeley) 1/27/87"; +#endif LIBC_SCCS and not lint + +/* + * insque -- vax insque instruction + * + * NOTE: this implementation is non-atomic!! + */ + +struct vaxque { /* queue format expected by VAX queue instructions */ + struct vaxque *vq_next; + struct vaxque *vq_prev; +}; + +insque(e, prev) + register struct vaxque *e, *prev; +{ + e->vq_prev = prev; + e->vq_next = prev->vq_next; + prev->vq_next->vq_prev = e; + prev->vq_next = e; +} diff --git a/lib/libc4.3tahoe/gen/isatty.c b/lib/libc4.3tahoe/gen/isatty.c new file mode 100644 index 0000000..42eb42e --- /dev/null +++ b/lib/libc4.3tahoe/gen/isatty.c @@ -0,0 +1,18 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)isatty.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Returns 1 iff file is a tty + */ + +#include + +isatty(f) +{ + struct sgttyb ttyb; + + if (ioctl(f, TIOCGETP, &ttyb) < 0) + return(0); + return(1); +} diff --git a/lib/libc4.3tahoe/gen/malloc.c b/lib/libc4.3tahoe/gen/malloc.c new file mode 100644 index 0000000..4d200ed --- /dev/null +++ b/lib/libc4.3tahoe/gen/malloc.c @@ -0,0 +1,384 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)malloc.c 5.6 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * malloc.c (Caltech) 2/21/82 + * Chris Kingsley, kingsley@cit-20. + * + * This is a very fast storage allocator. It allocates blocks of a small + * number of different sizes, and keeps free lists of each size. Blocks that + * don't exactly fit are passed up to the next larger size. In this + * implementation, the available sizes are 2^n-4 (or 2^n-10) bytes long. + * This is designed for use in a virtual memory environment. + */ + +#include + +#define NULL 0 + +/* + * The overhead on a block is at least 4 bytes. When free, this space + * contains a pointer to the next free block, and the bottom two bits must + * be zero. When in use, the first byte is set to MAGIC, and the second + * byte is the size index. The remaining bytes are for alignment. + * If range checking is enabled then a second word holds the size of the + * requested block, less 1, rounded up to a multiple of sizeof(RMAGIC). + * The order of elements is critical: ov_magic must overlay the low order + * bits of ov_next, and ov_magic can not be a valid ov_next bit pattern. + */ +union overhead { + union overhead *ov_next; /* when free */ + struct { + u_char ovu_magic; /* magic number */ + u_char ovu_index; /* bucket # */ +#ifdef RCHECK + u_short ovu_rmagic; /* range magic number */ + u_int ovu_size; /* actual block size */ +#endif + } ovu; +#define ov_magic ovu.ovu_magic +#define ov_index ovu.ovu_index +#define ov_rmagic ovu.ovu_rmagic +#define ov_size ovu.ovu_size +}; + +#define MAGIC 0xef /* magic # on accounting info */ +#define RMAGIC 0x5555 /* magic # on range info */ + +#ifdef RCHECK +#define RSLOP sizeof (u_short) +#else +#define RSLOP 0 +#endif + +/* + * nextf[i] is the pointer to the next free block of size 2^(i+3). The + * smallest allocatable block is 8 bytes. The overhead information + * precedes the data area returned to the user. + */ +#define NBUCKETS 30 +static union overhead *nextf[NBUCKETS]; +extern char *sbrk(); + +static int pagesz; /* page size */ +static int pagebucket; /* page size bucket */ + +#ifdef MSTATS +/* + * nmalloc[i] is the difference between the number of mallocs and frees + * for a given block size. + */ +static u_int nmalloc[NBUCKETS]; +#include +#endif + +#if defined(DEBUG) || defined(RCHECK) +#define ASSERT(p) if (!(p)) botch("p") +#include +static +botch(s) + char *s; +{ + fprintf(stderr, "\r\nassertion botched: %s\r\n", s); + (void) fflush(stderr); /* just in case user buffered it */ + abort(); +} +#else +#define ASSERT(p) +#endif + +char * +malloc(nbytes) + unsigned nbytes; +{ + register union overhead *op; + register int bucket; + register unsigned amt, n; + + /* + * First time malloc is called, setup page size and + * align break pointer so all data will be page aligned. + */ + if (pagesz == 0) { + pagesz = n = getpagesize(); + op = (union overhead *)sbrk(0); + n = n - sizeof (*op) - ((int)op & (n - 1)); + if (n < 0) + n += pagesz; + if (n) { + if (sbrk(n) == (char *)-1) + return (NULL); + } + bucket = 0; + amt = 8; + while (pagesz > amt) { + amt <<= 1; + bucket++; + } + pagebucket = bucket; + } + /* + * Convert amount of memory requested into closest block size + * stored in hash buckets which satisfies request. + * Account for space used per block for accounting. + */ + if (nbytes <= (n = pagesz - sizeof (*op) - RSLOP)) { +#ifndef RCHECK + amt = 8; /* size of first bucket */ + bucket = 0; +#else + amt = 16; /* size of first bucket */ + bucket = 1; +#endif + n = -(sizeof (*op) + RSLOP); + } else { + amt = pagesz; + bucket = pagebucket; + } + while (nbytes > amt + n) { + amt <<= 1; + if (amt == 0) + return (NULL); + bucket++; + } + /* + * If nothing in hash bucket right now, + * request more memory from the system. + */ + if ((op = nextf[bucket]) == NULL) { + morecore(bucket); + if ((op = nextf[bucket]) == NULL) + return (NULL); + } + /* remove from linked list */ + nextf[bucket] = op->ov_next; + op->ov_magic = MAGIC; + op->ov_index = bucket; +#ifdef MSTATS + nmalloc[bucket]++; +#endif +#ifdef RCHECK + /* + * Record allocated size of block and + * bound space with magic numbers. + */ + op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); + op->ov_rmagic = RMAGIC; + *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; +#endif + return ((char *)(op + 1)); +} + +/* + * Allocate more memory to the indicated bucket. + */ +morecore(bucket) + int bucket; +{ + register union overhead *op; + register int sz; /* size of desired block */ + int amt; /* amount to allocate */ + int nblks; /* how many blocks we get */ + + /* + * sbrk_size <= 0 only for big, FLUFFY, requests (about + * 2^30 bytes on a VAX, I think) or for a negative arg. + */ + sz = 1 << (bucket + 3); +#ifdef DEBUG + ASSERT(sz > 0); +#else + if (sz <= 0) + return; +#endif + if (sz < pagesz) { + amt = pagesz; + nblks = amt / sz; + } else { + amt = sz + pagesz; + nblks = 1; + } + op = (union overhead *)sbrk(amt); + /* no more room! */ + if ((int)op == -1) + return; + /* + * Add new memory allocated to that on + * free list for this hash bucket. + */ + nextf[bucket] = op; + while (--nblks > 0) { + op->ov_next = (union overhead *)((caddr_t)op + sz); + op = (union overhead *)((caddr_t)op + sz); + } +} + +free(cp) + char *cp; +{ + register int size; + register union overhead *op; + + if (cp == NULL) + return; + op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); +#ifdef DEBUG + ASSERT(op->ov_magic == MAGIC); /* make sure it was in use */ +#else + if (op->ov_magic != MAGIC) + return; /* sanity */ +#endif +#ifdef RCHECK + ASSERT(op->ov_rmagic == RMAGIC); + ASSERT(*(u_short *)((caddr_t)(op + 1) + op->ov_size) == RMAGIC); +#endif + size = op->ov_index; + ASSERT(size < NBUCKETS); + op->ov_next = nextf[size]; /* also clobbers ov_magic */ + nextf[size] = op; +#ifdef MSTATS + nmalloc[size]--; +#endif +} + +/* + * When a program attempts "storage compaction" as mentioned in the + * old malloc man page, it realloc's an already freed block. Usually + * this is the last block it freed; occasionally it might be farther + * back. We have to search all the free lists for the block in order + * to determine its bucket: 1st we make one pass thru the lists + * checking only the first block in each; if that fails we search + * ``realloc_srchlen'' blocks in each list for a match (the variable + * is extern so the caller can modify it). If that fails we just copy + * however many bytes was given to realloc() and hope it's not huge. + */ +int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ + +char * +realloc(cp, nbytes) + char *cp; + unsigned nbytes; +{ + register u_int onb, i; + union overhead *op; + char *res; + int was_alloced = 0; + + if (cp == NULL) + return (malloc(nbytes)); + op = (union overhead *)((caddr_t)cp - sizeof (union overhead)); + if (op->ov_magic == MAGIC) { + was_alloced++; + i = op->ov_index; + } else { + /* + * Already free, doing "compaction". + * + * Search for the old block of memory on the + * free list. First, check the most common + * case (last element free'd), then (this failing) + * the last ``realloc_srchlen'' items free'd. + * If all lookups fail, then assume the size of + * the memory block being realloc'd is the + * largest possible (so that all "nbytes" of new + * memory are copied into). Note that this could cause + * a memory fault if the old area was tiny, and the moon + * is gibbous. However, that is very unlikely. + */ + if ((i = findbucket(op, 1)) < 0 && + (i = findbucket(op, realloc_srchlen)) < 0) + i = NBUCKETS; + } + onb = 1 << (i + 3); + if (onb < pagesz) + onb -= sizeof (*op) + RSLOP; + else + onb += pagesz - sizeof (*op) - RSLOP; + /* avoid the copy if same size block */ + if (was_alloced) { + if (i) { + i = 1 << (i + 2); + if (i < pagesz) + i -= sizeof (*op) + RSLOP; + else + i += pagesz - sizeof (*op) - RSLOP; + } + if (nbytes <= onb && nbytes > i) { +#ifdef RCHECK + op->ov_size = (nbytes + RSLOP - 1) & ~(RSLOP - 1); + *(u_short *)((caddr_t)(op + 1) + op->ov_size) = RMAGIC; +#endif + return(cp); + } else + free(cp); + } + if ((res = malloc(nbytes)) == NULL) + return (NULL); + if (cp != res) /* common optimization if "compacting" */ + bcopy(cp, res, (nbytes < onb) ? nbytes : onb); + return (res); +} + +/* + * Search ``srchlen'' elements of each free list for a block whose + * header starts at ``freep''. If srchlen is -1 search the whole list. + * Return bucket number, or -1 if not found. + */ +static +findbucket(freep, srchlen) + union overhead *freep; + int srchlen; +{ + register union overhead *p; + register int i, j; + + for (i = 0; i < NBUCKETS; i++) { + j = 0; + for (p = nextf[i]; p && j != srchlen; p = p->ov_next) { + if (p == freep) + return (i); + j++; + } + } + return (-1); +} + +#ifdef MSTATS +/* + * mstats - print out statistics about malloc + * + * Prints two lines of numbers, one showing the length of the free list + * for each size category, the second showing the number of mallocs - + * frees for each size category. + */ +mstats(s) + char *s; +{ + register int i, j; + register union overhead *p; + int totfree = 0, + totused = 0; + + fprintf(stderr, "Memory allocation statistics %s\nfree:\t", s); + for (i = 0; i < NBUCKETS; i++) { + for (j = 0, p = nextf[i]; p; p = p->ov_next, j++) + ; + fprintf(stderr, " %d", j); + totfree += j * (1 << (i + 3)); + } + fprintf(stderr, "\nused:\t"); + for (i = 0; i < NBUCKETS; i++) { + fprintf(stderr, " %d", nmalloc[i]); + totused += nmalloc[i] * (1 << (i + 3)); + } + fprintf(stderr, "\n\tTotal in use: %d, total free: %d\n", + totused, totfree); +} +#endif diff --git a/lib/libc4.3tahoe/gen/mktemp.c b/lib/libc4.3tahoe/gen/mktemp.c new file mode 100644 index 0000000..5916a77 --- /dev/null +++ b/lib/libc4.3tahoe/gen/mktemp.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)mktemp.c 5.7 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include +#include + +#define YES 1 +#define NO 0 + +mkstemp(as) + char *as; +{ + int fd; + + return (_gettemp(as, &fd) ? fd : -1); +} + +char * +mktemp(as) + char *as; +{ + return(_gettemp(as, (int *)NULL) ? as : (char *)NULL); +} + +static +_gettemp(as, doopen) + char *as; + register int *doopen; +{ + extern int errno; + register char *start, *trv; + struct stat sbuf; + u_int pid; + + pid = getpid(); + + /* extra X's get set to 0's */ + for (trv = as; *trv; ++trv); + while (*--trv == 'X') { + *trv = (pid % 10) + '0'; + pid /= 10; + } + + /* + * check for write permission on target directory; if you have + * six X's and you can't write the directory, this will run for + * a *very* long time. + */ + for (start = ++trv; trv > as && *trv != '/'; --trv); + if (*trv == '/') { + *trv = '\0'; + if (stat(as, &sbuf) || !(sbuf.st_mode & S_IFDIR)) + return(NO); + *trv = '/'; + } + else if (stat(".", &sbuf) == -1) + return(NO); + + for (;;) { + if (doopen) { + if ((*doopen = open(as, O_CREAT|O_EXCL|O_RDWR, 0600)) >= 0) + return(YES); + if (errno != EEXIST) + return(NO); + } + else if (stat(as, &sbuf)) + return(errno == ENOENT ? YES : NO); + + /* tricky little algorithm for backward compatibility */ + for (trv = start;;) { + if (!*trv) + return(NO); + if (*trv == 'z') + *trv++ = 'a'; + else { + if (isdigit(*trv)) + *trv = 'a'; + else + ++*trv; + break; + } + } + } + /*NOTREACHED*/ +} diff --git a/lib/libc4.3tahoe/gen/ndbm.c b/lib/libc4.3tahoe/gen/ndbm.c new file mode 100644 index 0000000..94c2cdf --- /dev/null +++ b/lib/libc4.3tahoe/gen/ndbm.c @@ -0,0 +1,528 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ndbm.c 5.4 (Berkeley) 9/4/87"; +#endif LIBC_SCCS and not lint + +#include +#include +#include +#include +#include +#include + +#define BYTESIZ 8 +#undef setbit + +static datum makdatum(); +static long hashinc(); +static long dcalchash(); +extern int errno; + +DBM * +dbm_open(file, flags, mode) + char *file; + int flags, mode; +{ + struct stat statb; + register DBM *db; + + if ((db = (DBM *)malloc(sizeof *db)) == 0) { + errno = ENOMEM; + return ((DBM *)0); + } + db->dbm_flags = (flags & 03) == O_RDONLY ? _DBM_RDONLY : 0; + if ((flags & 03) == O_WRONLY) + flags = (flags & ~03) | O_RDWR; + strcpy(db->dbm_pagbuf, file); + strcat(db->dbm_pagbuf, ".pag"); + db->dbm_pagf = open(db->dbm_pagbuf, flags, mode); + if (db->dbm_pagf < 0) + goto bad; + strcpy(db->dbm_pagbuf, file); + strcat(db->dbm_pagbuf, ".dir"); + db->dbm_dirf = open(db->dbm_pagbuf, flags, mode); + if (db->dbm_dirf < 0) + goto bad1; + fstat(db->dbm_dirf, &statb); + db->dbm_maxbno = statb.st_size*BYTESIZ-1; + db->dbm_pagbno = db->dbm_dirbno = -1; + return (db); +bad1: + (void) close(db->dbm_pagf); +bad: + free((char *)db); + return ((DBM *)0); +} + +void +dbm_close(db) + DBM *db; +{ + + (void) close(db->dbm_dirf); + (void) close(db->dbm_pagf); + free((char *)db); +} + +long +dbm_forder(db, key) + register DBM *db; + datum key; +{ + long hash; + + hash = dcalchash(key); + for (db->dbm_hmask=0;; db->dbm_hmask=(db->dbm_hmask<<1)+1) { + db->dbm_blkno = hash & db->dbm_hmask; + db->dbm_bitno = db->dbm_blkno + db->dbm_hmask; + if (getbit(db) == 0) + break; + } + return (db->dbm_blkno); +} + +datum +dbm_fetch(db, key) + register DBM *db; + datum key; +{ + register i; + datum item; + + if (dbm_error(db)) + goto err; + dbm_access(db, dcalchash(key)); + if ((i = finddatum(db->dbm_pagbuf, key)) >= 0) { + item = makdatum(db->dbm_pagbuf, i+1); + if (item.dptr != NULL) + return (item); + } +err: + item.dptr = NULL; + item.dsize = 0; + return (item); +} + +dbm_delete(db, key) + register DBM *db; + datum key; +{ + register i; + datum item; + + if (dbm_error(db)) + return (-1); + if (dbm_rdonly(db)) { + errno = EPERM; + return (-1); + } + dbm_access(db, dcalchash(key)); + if ((i = finddatum(db->dbm_pagbuf, key)) < 0) + return (-1); + if (!delitem(db->dbm_pagbuf, i)) + goto err; + db->dbm_pagbno = db->dbm_blkno; + (void) lseek(db->dbm_pagf, db->dbm_blkno*PBLKSIZ, L_SET); + if (write(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ) { + err: + db->dbm_flags |= _DBM_IOERR; + return (-1); + } + return (0); +} + +dbm_store(db, key, dat, replace) + register DBM *db; + datum key, dat; + int replace; +{ + register i; + datum item, item1; + char ovfbuf[PBLKSIZ]; + + if (dbm_error(db)) + return (-1); + if (dbm_rdonly(db)) { + errno = EPERM; + return (-1); + } +loop: + dbm_access(db, dcalchash(key)); + if ((i = finddatum(db->dbm_pagbuf, key)) >= 0) { + if (!replace) + return (1); + if (!delitem(db->dbm_pagbuf, i)) { + db->dbm_flags |= _DBM_IOERR; + return (-1); + } + } + if (!additem(db->dbm_pagbuf, key, dat)) + goto split; + db->dbm_pagbno = db->dbm_blkno; + (void) lseek(db->dbm_pagf, db->dbm_blkno*PBLKSIZ, L_SET); + if (write(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ) { + db->dbm_flags |= _DBM_IOERR; + return (-1); + } + return (0); + +split: + if (key.dsize+dat.dsize+3*sizeof(short) >= PBLKSIZ) { + db->dbm_flags |= _DBM_IOERR; + errno = ENOSPC; + return (-1); + } + bzero(ovfbuf, PBLKSIZ); + for (i=0;;) { + item = makdatum(db->dbm_pagbuf, i); + if (item.dptr == NULL) + break; + if (dcalchash(item) & (db->dbm_hmask+1)) { + item1 = makdatum(db->dbm_pagbuf, i+1); + if (item1.dptr == NULL) { + fprintf(stderr, "ndbm: split not paired\n"); + db->dbm_flags |= _DBM_IOERR; + break; + } + if (!additem(ovfbuf, item, item1) || + !delitem(db->dbm_pagbuf, i)) { + db->dbm_flags |= _DBM_IOERR; + return (-1); + } + continue; + } + i += 2; + } + db->dbm_pagbno = db->dbm_blkno; + (void) lseek(db->dbm_pagf, db->dbm_blkno*PBLKSIZ, L_SET); + if (write(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ) { + db->dbm_flags |= _DBM_IOERR; + return (-1); + } + (void) lseek(db->dbm_pagf, (db->dbm_blkno+db->dbm_hmask+1)*PBLKSIZ, L_SET); + if (write(db->dbm_pagf, ovfbuf, PBLKSIZ) != PBLKSIZ) { + db->dbm_flags |= _DBM_IOERR; + return (-1); + } + setbit(db); + goto loop; +} + +datum +dbm_firstkey(db) + DBM *db; +{ + + db->dbm_blkptr = 0L; + db->dbm_keyptr = 0; + return (dbm_nextkey(db)); +} + +datum +dbm_nextkey(db) + register DBM *db; +{ + struct stat statb; + datum item; + + if (dbm_error(db) || fstat(db->dbm_pagf, &statb) < 0) + goto err; + statb.st_size /= PBLKSIZ; + for (;;) { + if (db->dbm_blkptr != db->dbm_pagbno) { + db->dbm_pagbno = db->dbm_blkptr; + (void) lseek(db->dbm_pagf, db->dbm_blkptr*PBLKSIZ, L_SET); + if (read(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ) + bzero(db->dbm_pagbuf, PBLKSIZ); +#ifdef DEBUG + else if (chkblk(db->dbm_pagbuf) < 0) + db->dbm_flags |= _DBM_IOERR; +#endif + } + if (((short *)db->dbm_pagbuf)[0] != 0) { + item = makdatum(db->dbm_pagbuf, db->dbm_keyptr); + if (item.dptr != NULL) { + db->dbm_keyptr += 2; + return (item); + } + db->dbm_keyptr = 0; + } + if (++db->dbm_blkptr >= statb.st_size) + break; + } +err: + item.dptr = NULL; + item.dsize = 0; + return (item); +} + +static +dbm_access(db, hash) + register DBM *db; + long hash; +{ + + for (db->dbm_hmask=0;; db->dbm_hmask=(db->dbm_hmask<<1)+1) { + db->dbm_blkno = hash & db->dbm_hmask; + db->dbm_bitno = db->dbm_blkno + db->dbm_hmask; + if (getbit(db) == 0) + break; + } + if (db->dbm_blkno != db->dbm_pagbno) { + db->dbm_pagbno = db->dbm_blkno; + (void) lseek(db->dbm_pagf, db->dbm_blkno*PBLKSIZ, L_SET); + if (read(db->dbm_pagf, db->dbm_pagbuf, PBLKSIZ) != PBLKSIZ) + bzero(db->dbm_pagbuf, PBLKSIZ); +#ifdef DEBUG + else if (chkblk(db->dbm_pagbuf) < 0) + db->dbm_flags |= _DBM_IOERR; +#endif + } +} + +static +getbit(db) + register DBM *db; +{ + long bn; + register b, i, n; + + + if (db->dbm_bitno > db->dbm_maxbno) + return (0); + n = db->dbm_bitno % BYTESIZ; + bn = db->dbm_bitno / BYTESIZ; + i = bn % DBLKSIZ; + b = bn / DBLKSIZ; + if (b != db->dbm_dirbno) { + db->dbm_dirbno = b; + (void) lseek(db->dbm_dirf, (long)b*DBLKSIZ, L_SET); + if (read(db->dbm_dirf, db->dbm_dirbuf, DBLKSIZ) != DBLKSIZ) + bzero(db->dbm_dirbuf, DBLKSIZ); + } + return (db->dbm_dirbuf[i] & (1<dbm_bitno > db->dbm_maxbno) + db->dbm_maxbno = db->dbm_bitno; + n = db->dbm_bitno % BYTESIZ; + bn = db->dbm_bitno / BYTESIZ; + i = bn % DBLKSIZ; + b = bn / DBLKSIZ; + if (b != db->dbm_dirbno) { + db->dbm_dirbno = b; + (void) lseek(db->dbm_dirf, (long)b*DBLKSIZ, L_SET); + if (read(db->dbm_dirf, db->dbm_dirbuf, DBLKSIZ) != DBLKSIZ) + bzero(db->dbm_dirbuf, DBLKSIZ); + } + db->dbm_dirbuf[i] |= 1<dbm_dirbno = b; + (void) lseek(db->dbm_dirf, (long)b*DBLKSIZ, L_SET); + if (write(db->dbm_dirf, db->dbm_dirbuf, DBLKSIZ) != DBLKSIZ) + db->dbm_flags |= _DBM_IOERR; +} + +static datum +makdatum(buf, n) + char buf[PBLKSIZ]; +{ + register short *sp; + register t; + datum item; + + sp = (short *)buf; + if ((unsigned)n >= sp[0]) { + item.dptr = NULL; + item.dsize = 0; + return (item); + } + t = PBLKSIZ; + if (n > 0) + t = sp[n]; + item.dptr = buf+sp[n+1]; + item.dsize = t - sp[n+1]; + return (item); +} + +static +finddatum(buf, item) + char buf[PBLKSIZ]; + datum item; +{ + register short *sp; + register int i, n, j; + + sp = (short *)buf; + n = PBLKSIZ; + for (i=0, j=sp[0]; idbm_hmask; + bit = db->dbm_hmask+1; + for (;;) { + bit >>= 1; + if (bit == 0) + return (0L); + if ((hash & bit) == 0) + return (hash | bit); + hash &= ~bit; + } +} + +static long +dcalchash(item) + datum item; +{ + register int s, c, j; + register char *cp; + register long hashl; + register int hashi; + + hashl = 0; + hashi = 0; + for (cp = item.dptr, s=item.dsize; --s >= 0; ) { + c = *cp++; + for (j=0; j>= 4; + } + } + return (hashl); +} + +/* + * Delete pairs of items (n & n+1). + */ +static +delitem(buf, n) + char buf[PBLKSIZ]; +{ + register short *sp, *sp1; + register i1, i2; + + sp = (short *)buf; + i2 = sp[0]; + if ((unsigned)n >= i2 || (n & 1)) + return (0); + if (n == i2-2) { + sp[0] -= 2; + return (1); + } + i1 = PBLKSIZ; + if (n > 0) + i1 = sp[n]; + i1 -= sp[n+2]; + if (i1 > 0) { + i2 = sp[i2]; + bcopy(&buf[i2], &buf[i2 + i1], sp[n+2] - i2); + } + sp[0] -= 2; + for (sp1 = sp + sp[0], sp += n+1; sp <= sp1; sp++) + sp[0] = sp[2] + i1; + return (1); +} + +/* + * Add pairs of items (item & item1). + */ +static +additem(buf, item, item1) + char buf[PBLKSIZ]; + datum item, item1; +{ + register short *sp; + register i1, i2; + + sp = (short *)buf; + i1 = PBLKSIZ; + i2 = sp[0]; + if (i2 > 0) + i1 = sp[i2]; + i1 -= item.dsize + item1.dsize; + if (i1 <= (i2+3) * (int)sizeof(short)) + return (0); + sp[0] += 2; + sp[++i2] = i1 + item1.dsize; + bcopy(item.dptr, &buf[i1 + item1.dsize], item.dsize); + sp[++i2] = i1; + bcopy(item1.dptr, &buf[i1], item1.dsize); + return (1); +} + +#ifdef DEBUG +static +chkblk(buf) + char buf[PBLKSIZ]; +{ + register short *sp; + register t, i; + + sp = (short *)buf; + t = PBLKSIZ; + for (i=0; i t) + return (-1); + t = sp[i+1]; + } + if (t < (sp[0]+1)*sizeof(short)) + return (-1); + return (0); +} +#endif diff --git a/lib/libc4.3tahoe/gen/nlist.c b/lib/libc4.3tahoe/gen/nlist.c new file mode 100644 index 0000000..4c43b05 --- /dev/null +++ b/lib/libc4.3tahoe/gen/nlist.c @@ -0,0 +1,99 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)nlist.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include +#include + +/* + * nlist - retreive attributes from name list (string table version) + */ +nlist(name, list) + char *name; + struct nlist *list; +{ + register struct nlist *p, *q; + register char *s1, *s2; + register n, m; + int maxlen, nreq; + FILE *f; + FILE *sf; + off_t sa; /* symbol address */ + off_t ss; /* start of strings */ + struct exec buf; + struct nlist space[BUFSIZ/sizeof (struct nlist)]; + + maxlen = 0; + for (q = list, nreq = 0; q->n_un.n_name && q->n_un.n_name[0]; q++, nreq++) { + q->n_type = 0; + q->n_value = 0; + q->n_desc = 0; + q->n_other = 0; + n = strlen(q->n_un.n_name); + if (n > maxlen) + maxlen = n; + } + f = fopen(name, "r"); + if (f == NULL) + return (-1); + fread((char *)&buf, sizeof buf, 1, f); + if (N_BADMAG(buf)) { + fclose(f); + return (-1); + } + sf = fopen(name, "r"); + if (sf == NULL) { + /* ??? */ + fclose(f); + return(-1); + } + sa = N_SYMOFF(buf); + ss = sa + buf.a_syms; + n = buf.a_syms; + fseek(f, sa, 0); + while (n) { + m = sizeof (space); + if (n < m) + m = n; + if (fread((char *)space, m, 1, f) != 1) + break; + n -= m; + for (q = space; (m -= sizeof(struct nlist)) >= 0; q++) { + char nambuf[BUFSIZ]; + + if (q->n_un.n_strx == 0 || q->n_type & N_STAB) + continue; + fseek(sf, ss+q->n_un.n_strx, 0); + fread(nambuf, maxlen+1, 1, sf); + for (p = list; p->n_un.n_name && p->n_un.n_name[0]; p++) { + s1 = p->n_un.n_name; + s2 = nambuf; + while (*s1) { + if (*s1++ != *s2++) + goto cont; + } + if (*s2) + goto cont; + p->n_value = q->n_value; + p->n_type = q->n_type; + p->n_desc = q->n_desc; + p->n_other = q->n_other; + if (--nreq == 0) + goto alldone; + break; + cont: ; + } + } + } +alldone: + fclose(f); + fclose(sf); + return (nreq); +} diff --git a/lib/libc4.3tahoe/gen/opendir.c b/lib/libc4.3tahoe/gen/opendir.c new file mode 100644 index 0000000..42d6853 --- /dev/null +++ b/lib/libc4.3tahoe/gen/opendir.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)opendir.c 5.3 (Berkeley) 6/18/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +/* + * open a directory. + */ +DIR * +opendir(name) + char *name; +{ + register DIR *dirp; + register int fd; + + if ((fd = open(name, 0)) == -1) + return NULL; + if ((dirp = (DIR *)malloc(sizeof(DIR))) == NULL) { + close (fd); + return NULL; + } + dirp->dd_fd = fd; + dirp->dd_loc = 0; + return dirp; +} diff --git a/lib/libc4.3tahoe/gen/perror.c b/lib/libc4.3tahoe/gen/perror.c new file mode 100644 index 0000000..89e21b8 --- /dev/null +++ b/lib/libc4.3tahoe/gen/perror.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)perror.c 5.3 (Berkeley) 9/30/87"; +#endif LIBC_SCCS and not lint + +/* + * Print the error indicated + * in the cerror cell. + */ +#include +#include + +int errno; +extern int sys_nerr; +extern char *sys_errlist[]; +perror(s) + char *s; +{ + struct iovec iov[4]; + register struct iovec *v = iov; + + if (s && *s) { + v->iov_base = s; + v->iov_len = strlen(s); + v++; + v->iov_base = ": "; + v->iov_len = 2; + v++; + } + v->iov_base = errno < sys_nerr ? sys_errlist[errno] : "Unknown error"; + v->iov_len = strlen(v->iov_base); + v++; + v->iov_base = "\n"; + v->iov_len = 1; + writev(2, iov, (v - iov) + 1); +} diff --git a/lib/libc4.3tahoe/gen/popen.c b/lib/libc4.3tahoe/gen/popen.c new file mode 100644 index 0000000..633dba9 --- /dev/null +++ b/lib/libc4.3tahoe/gen/popen.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)popen.c 5.5 (Berkeley) 9/30/87"; +#endif LIBC_SCCS and not lint + +#include +#include + +#define tst(a,b) (*mode == 'r'? (b) : (a)) +#define RDR 0 +#define WTR 1 + +extern char *malloc(); + +static int *popen_pid; +static int nfiles; + +FILE * +popen(cmd,mode) + char *cmd; + char *mode; +{ + int p[2]; + int myside, hisside, pid; + + if (nfiles <= 0) + nfiles = getdtablesize(); + if (popen_pid == NULL) { + popen_pid = (int *)malloc(nfiles * sizeof *popen_pid); + if (popen_pid == NULL) + return (NULL); + for (pid = 0; pid < nfiles; pid++) + popen_pid[pid] = -1; + } + if (pipe(p) < 0) + return (NULL); + myside = tst(p[WTR], p[RDR]); + hisside = tst(p[RDR], p[WTR]); + if ((pid = vfork()) == 0) { + /* myside and hisside reverse roles in child */ + close(myside); + if (hisside != tst(0, 1)) { + dup2(hisside, tst(0, 1)); + close(hisside); + } + execl("/bin/sh", "sh", "-c", cmd, (char *)NULL); + _exit(127); + } + if (pid == -1) { + close(myside); + close(hisside); + return (NULL); + } + popen_pid[myside] = pid; + close(hisside); + return (fdopen(myside, mode)); +} + +pclose(ptr) + FILE *ptr; +{ + long omask; + int child, pid, status; + + child = popen_pid[fileno(ptr)]; + popen_pid[fileno(ptr)] = -1; + fclose(ptr); + if (child == -1) + return (-1); + omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP)); + while ((pid = wait(&status)) != child && pid != -1) + ; + (void) sigsetmask(omask); + return (pid == -1 ? -1 : status); +} diff --git a/lib/libc4.3tahoe/gen/profiled/.MAP b/lib/libc4.3tahoe/gen/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/gen/psignal.c b/lib/libc4.3tahoe/gen/psignal.c new file mode 100644 index 0000000..9929948 --- /dev/null +++ b/lib/libc4.3tahoe/gen/psignal.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)psignal.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Print the name of the signal indicated + * along with the supplied message. + */ +#include + +extern char *sys_siglist[]; + +psignal(sig, s) + unsigned sig; + char *s; +{ + register char *c; + register n; + + c = "Unknown signal"; + if (sig < NSIG) + c = sys_siglist[sig]; + n = strlen(s); + if (n) { + write(2, s, n); + write(2, ": ", 2); + } + write(2, c, strlen(c)); + write(2, "\n", 1); +} diff --git a/lib/libc4.3tahoe/gen/qsort.c b/lib/libc4.3tahoe/gen/qsort.c new file mode 100644 index 0000000..428d4bd --- /dev/null +++ b/lib/libc4.3tahoe/gen/qsort.c @@ -0,0 +1,218 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)qsort.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +/* + * qsort.c: + * Our own version of the system qsort routine which is faster by an average + * of 25%, with lows and highs of 10% and 50%. + * The THRESHold below is the insertion sort threshold, and has been adjusted + * for records of size 48 bytes. + * The MTHREShold is where we stop finding a better median. + */ + +#define THRESH 4 /* threshold for insertion */ +#define MTHRESH 6 /* threshold for median */ + +static int (*qcmp)(); /* the comparison routine */ +static int qsz; /* size of each record */ +static int thresh; /* THRESHold in chars */ +static int mthresh; /* MTHRESHold in chars */ + +/* + * qsort: + * First, set up some global parameters for qst to share. Then, quicksort + * with qst(), and then a cleanup insertion sort ourselves. Sound simple? + * It's not... + */ + +qsort(base, n, size, compar) + char *base; + int n; + int size; + int (*compar)(); +{ + register char c, *i, *j, *lo, *hi; + char *min, *max; + + if (n <= 1) + return; + qsz = size; + qcmp = compar; + thresh = qsz * THRESH; + mthresh = qsz * MTHRESH; + max = base + n * qsz; + if (n >= THRESH) { + qst(base, max); + hi = base + thresh; + } else { + hi = max; + } + /* + * First put smallest element, which must be in the first THRESH, in + * the first position as a sentinel. This is done just by searching + * the first THRESH elements (or the first n if n < THRESH), finding + * the min, and swapping it into the first position. + */ + for (j = lo = base; (lo += qsz) < hi; ) + if (qcmp(j, lo) > 0) + j = lo; + if (j != base) { + /* swap j into place */ + for (i = base, hi = base + qsz; i < hi; ) { + c = *j; + *j++ = *i; + *i++ = c; + } + } + /* + * With our sentinel in place, we now run the following hyper-fast + * insertion sort. For each remaining element, min, from [1] to [n-1], + * set hi to the index of the element AFTER which this one goes. + * Then, do the standard insertion sort shift on a character at a time + * basis for each element in the frob. + */ + for (min = base; (hi = min += qsz) < max; ) { + while (qcmp(hi -= qsz, min) > 0) + /* void */; + if ((hi += qsz) != min) { + for (lo = min + qsz; --lo >= min; ) { + c = *lo; + for (i = j = lo; (j -= qsz) >= hi; i = j) + *i = *j; + *i = c; + } + } + } +} + +/* + * qst: + * Do a quicksort + * First, find the median element, and put that one in the first place as the + * discriminator. (This "median" is just the median of the first, last and + * middle elements). (Using this median instead of the first element is a big + * win). Then, the usual partitioning/swapping, followed by moving the + * discriminator into the right place. Then, figure out the sizes of the two + * partions, do the smaller one recursively and the larger one via a repeat of + * this code. Stopping when there are less than THRESH elements in a partition + * and cleaning up with an insertion sort (in our caller) is a huge win. + * All data swaps are done in-line, which is space-losing but time-saving. + * (And there are only three places where this is done). + */ + +static +qst(base, max) + char *base, *max; +{ + register char c, *i, *j, *jj; + register int ii; + char *mid, *tmp; + int lo, hi; + + /* + * At the top here, lo is the number of characters of elements in the + * current partition. (Which should be max - base). + * Find the median of the first, last, and middle element and make + * that the middle element. Set j to largest of first and middle. + * If max is larger than that guy, then it's that guy, else compare + * max with loser of first and take larger. Things are set up to + * prefer the middle, then the first in case of ties. + */ + lo = max - base; /* number of elements as chars */ + do { + mid = i = base + qsz * ((lo / qsz) >> 1); + if (lo >= mthresh) { + j = (qcmp((jj = base), i) > 0 ? jj : i); + if (qcmp(j, (tmp = max - qsz)) > 0) { + /* switch to first loser */ + j = (j == jj ? i : jj); + if (qcmp(j, tmp) < 0) + j = tmp; + } + if (j != i) { + ii = qsz; + do { + c = *i; + *i++ = *j; + *j++ = c; + } while (--ii); + } + } + /* + * Semi-standard quicksort partitioning/swapping + */ + for (i = base, j = max - qsz; ; ) { + while (i < mid && qcmp(i, mid) <= 0) + i += qsz; + while (j > mid) { + if (qcmp(mid, j) <= 0) { + j -= qsz; + continue; + } + tmp = i + qsz; /* value of i after swap */ + if (i == mid) { + /* j <-> mid, new mid is j */ + mid = jj = j; + } else { + /* i <-> j */ + jj = j; + j -= qsz; + } + goto swap; + } + if (i == mid) { + break; + } else { + /* i <-> mid, new mid is i */ + jj = mid; + tmp = mid = i; /* value of i after swap */ + j -= qsz; + } + swap: + ii = qsz; + do { + c = *i; + *i++ = *jj; + *jj++ = c; + } while (--ii); + i = tmp; + } + /* + * Look at sizes of the two partitions, do the smaller + * one first by recursion, then do the larger one by + * making sure lo is its size, base and max are update + * correctly, and branching back. But only repeat + * (recursively or by branching) if the partition is + * of at least size THRESH. + */ + i = (j = mid) + qsz; + if ((lo = j - base) <= (hi = max - i)) { + if (lo >= thresh) + qst(base, j); + base = i; + lo = hi; + } else { + if (hi >= thresh) + qst(i, max); + max = j; + } + } while (lo >= thresh); +} diff --git a/lib/libc4.3tahoe/gen/random.c b/lib/libc4.3tahoe/gen/random.c new file mode 100644 index 0000000..5e82f3e --- /dev/null +++ b/lib/libc4.3tahoe/gen/random.c @@ -0,0 +1,366 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)random.c 5.5 (Berkeley) 7/6/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +/* + * 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. + */ + +srandom( x ) + + unsigned x; +{ + register int i, j; + long random(); + + 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++ ) 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 ) + + unsigned seed; /* seed for R. N. G. */ + char *arg_state; /* pointer to state array */ + int 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_1 ) { + if( n < BREAK_0 ) { + fprintf( stderr, "initstate: not enough state (%d bytes) with which to do jack; ignored.\n", n ); + return; + } + 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 ) + + 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: + fprintf( stderr, "setstate: state info has been munged; 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 ther 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 ); +} + diff --git a/lib/libc4.3tahoe/gen/readdir.c b/lib/libc4.3tahoe/gen/readdir.c new file mode 100644 index 0000000..ca3cb4c --- /dev/null +++ b/lib/libc4.3tahoe/gen/readdir.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)readdir.c 5.4 (Berkeley) 6/18/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +/* + * get next entry in a directory. + */ +struct direct * +readdir(dirp) + register DIR *dirp; +{ + register struct direct *dp; + + for (;;) { + if (dirp->dd_loc == 0) { + dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, + DIRBLKSIZ); + if (dirp->dd_size <= 0) + return NULL; + } + if (dirp->dd_loc >= dirp->dd_size) { + dirp->dd_loc = 0; + continue; + } + dp = (struct direct *)(dirp->dd_buf + dirp->dd_loc); + if ((int)dp & 03) /* bogus pointer check */ + return NULL; + if (dp->d_reclen <= 0 || + dp->d_reclen > DIRBLKSIZ + 1 - dirp->dd_loc) + return NULL; + dirp->dd_loc += dp->d_reclen; + if (dp->d_ino == 0) + continue; + return (dp); + } +} diff --git a/lib/libc4.3tahoe/gen/regex.c b/lib/libc4.3tahoe/gen/regex.c new file mode 100644 index 0000000..73c1e0c --- /dev/null +++ b/lib/libc4.3tahoe/gen/regex.c @@ -0,0 +1,401 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)regex.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +# + +/* + * routines to do regular expression matching + * + * Entry points: + * + * re_comp(s) + * char *s; + * ... returns 0 if the string s was compiled successfully, + * a pointer to an error message otherwise. + * If passed 0 or a null string returns without changing + * the currently compiled re (see note 11 below). + * + * re_exec(s) + * char *s; + * ... returns 1 if the string s matches the last compiled regular + * expression, + * 0 if the string s failed to match the last compiled + * regular expression, and + * -1 if the compiled regular expression was invalid + * (indicating an internal error). + * + * The strings passed to both re_comp and re_exec may have trailing or + * embedded newline characters; they are terminated by nulls. + * + * The identity of the author of these routines is lost in antiquity; + * this is essentially the same as the re code in the original V6 ed. + * + * The regular expressions recognized are described below. This description + * is essentially the same as that for ed. + * + * A regular expression specifies a set of strings of characters. + * A member of this set of strings is said to be matched by + * the regular expression. In the following specification for + * regular expressions the word `character' means any character but NUL. + * + * 1. Any character except a special character matches itself. + * Special characters are the regular expression delimiter plus + * \ [ . and sometimes ^ * $. + * 2. A . matches any character. + * 3. A \ followed by any character except a digit or ( ) + * matches that character. + * 4. A nonempty string s bracketed [s] (or [^s]) matches any + * character in (or not in) s. In s, \ has no special meaning, + * and ] may only appear as the first letter. A substring + * a-b, with a and b in ascending ASCII order, stands for + * the inclusive range of ASCII characters. + * 5. A regular expression of form 1-4 followed by * matches a + * sequence of 0 or more matches of the regular expression. + * 6. A regular expression, x, of form 1-8, bracketed \(x\) + * matches what x matches. + * 7. A \ followed by a digit n matches a copy of the string that the + * bracketed regular expression beginning with the nth \( matched. + * 8. A regular expression of form 1-8, x, followed by a regular + * expression of form 1-7, y matches a match for x followed by + * a match for y, with the x match being as long as possible + * while still permitting a y match. + * 9. A regular expression of form 1-8 preceded by ^ (or followed + * by $), is constrained to matches that begin at the left + * (or end at the right) end of a line. + * 10. A regular expression of form 1-9 picks out the longest among + * the leftmost matches in a line. + * 11. An empty regular expression stands for a copy of the last + * regular expression encountered. + */ + +/* + * constants for re's + */ +#define CBRA 1 +#define CCHR 2 +#define CDOT 4 +#define CCL 6 +#define NCCL 8 +#define CDOL 10 +#define CEOF 11 +#define CKET 12 +#define CBACK 18 + +#define CSTAR 01 + +#define ESIZE 512 +#define NBRA 9 + +static char expbuf[ESIZE], *braslist[NBRA], *braelist[NBRA]; +static char circf; + +/* + * compile the regular expression argument into a dfa + */ +char * +re_comp(sp) + register char *sp; +{ + register int c; + register char *ep = expbuf; + int cclcnt, numbra = 0; + char *lastep = 0; + char bracket[NBRA]; + char *bracketp = &bracket[0]; + static char *retoolong = "Regular expression too long"; + +#define comerr(msg) {expbuf[0] = 0; numbra = 0; return(msg); } + + if (sp == 0 || *sp == '\0') { + if (*ep == 0) + return("No previous regular expression"); + return(0); + } + if (*sp == '^') { + circf = 1; + sp++; + } + else + circf = 0; + for (;;) { + if (ep >= &expbuf[ESIZE]) + comerr(retoolong); + if ((c = *sp++) == '\0') { + if (bracketp != bracket) + comerr("unmatched \\("); + *ep++ = CEOF; + *ep++ = 0; + return(0); + } + if (c != '*') + lastep = ep; + switch (c) { + + case '.': + *ep++ = CDOT; + continue; + + case '*': + if (lastep == 0 || *lastep == CBRA || *lastep == CKET) + goto defchar; + *lastep |= CSTAR; + continue; + + case '$': + if (*sp != '\0') + goto defchar; + *ep++ = CDOL; + continue; + + case '[': + *ep++ = CCL; + *ep++ = 0; + cclcnt = 1; + if ((c = *sp++) == '^') { + c = *sp++; + ep[-2] = NCCL; + } + do { + if (c == '\0') + comerr("missing ]"); + if (c == '-' && ep [-1] != 0) { + if ((c = *sp++) == ']') { + *ep++ = '-'; + cclcnt++; + break; + } + while (ep[-1] < c) { + *ep = ep[-1] + 1; + ep++; + cclcnt++; + if (ep >= &expbuf[ESIZE]) + comerr(retoolong); + } + } + *ep++ = c; + cclcnt++; + if (ep >= &expbuf[ESIZE]) + comerr(retoolong); + } while ((c = *sp++) != ']'); + lastep[1] = cclcnt; + continue; + + case '\\': + if ((c = *sp++) == '(') { + if (numbra >= NBRA) + comerr("too many \\(\\) pairs"); + *bracketp++ = numbra; + *ep++ = CBRA; + *ep++ = numbra++; + continue; + } + if (c == ')') { + if (bracketp <= bracket) + comerr("unmatched \\)"); + *ep++ = CKET; + *ep++ = *--bracketp; + continue; + } + if (c >= '1' && c < ('1' + NBRA)) { + *ep++ = CBACK; + *ep++ = c - '1'; + continue; + } + *ep++ = CCHR; + *ep++ = c; + continue; + + defchar: + default: + *ep++ = CCHR; + *ep++ = c; + } + } +} + +/* + * match the argument string against the compiled re + */ +int +re_exec(p1) + register char *p1; +{ + register char *p2 = expbuf; + register int c; + int rv; + + for (c = 0; c < NBRA; c++) { + braslist[c] = 0; + braelist[c] = 0; + } + if (circf) + return((advance(p1, p2))); + /* + * fast check for first character + */ + if (*p2 == CCHR) { + c = p2[1]; + do { + if (*p1 != c) + continue; + if (rv = advance(p1, p2)) + return(rv); + } while (*p1++); + return(0); + } + /* + * regular algorithm + */ + do + if (rv = advance(p1, p2)) + return(rv); + while (*p1++); + return(0); +} + +/* + * try to match the next thing in the dfa + */ +static int +advance(lp, ep) + register char *lp, *ep; +{ + register char *curlp; + int ct, i; + int rv; + + for (;;) + switch (*ep++) { + + case CCHR: + if (*ep++ == *lp++) + continue; + return(0); + + case CDOT: + if (*lp++) + continue; + return(0); + + case CDOL: + if (*lp == '\0') + continue; + return(0); + + case CEOF: + return(1); + + case CCL: + if (cclass(ep, *lp++, 1)) { + ep += *ep; + continue; + } + return(0); + + case NCCL: + if (cclass(ep, *lp++, 0)) { + ep += *ep; + continue; + } + return(0); + + case CBRA: + braslist[*ep++] = lp; + continue; + + case CKET: + braelist[*ep++] = lp; + continue; + + case CBACK: + if (braelist[i = *ep++] == 0) + return(-1); + if (backref(i, lp)) { + lp += braelist[i] - braslist[i]; + continue; + } + return(0); + + case CBACK|CSTAR: + if (braelist[i = *ep++] == 0) + return(-1); + curlp = lp; + ct = braelist[i] - braslist[i]; + while (backref(i, lp)) + lp += ct; + while (lp >= curlp) { + if (rv = advance(lp, ep)) + return(rv); + lp -= ct; + } + continue; + + case CDOT|CSTAR: + curlp = lp; + while (*lp++) + ; + goto star; + + case CCHR|CSTAR: + curlp = lp; + while (*lp++ == *ep) + ; + ep++; + goto star; + + case CCL|CSTAR: + case NCCL|CSTAR: + curlp = lp; + while (cclass(ep, *lp++, ep[-1] == (CCL|CSTAR))) + ; + ep += *ep; + goto star; + + star: + do { + lp--; + if (rv = advance(lp, ep)) + return(rv); + } while (lp > curlp); + return(0); + + default: + return(-1); + } +} + +backref(i, lp) + register int i; + register char *lp; +{ + register char *bp; + + bp = braslist[i]; + while (*bp++ == *lp++) + if (bp >= braelist[i]) + return(1); + return(0); +} + +int +cclass(set, c, af) + register char *set, c; + int af; +{ + register int n; + + if (c == 0) + return(0); + n = *set++; + while (--n) + if (*set++ == c) + return(af); + return(! af); +} diff --git a/lib/libc4.3tahoe/gen/regexp/.MAP b/lib/libc4.3tahoe/gen/regexp/.MAP new file mode 100644 index 0000000..3675a0f --- /dev/null +++ b/lib/libc4.3tahoe/gen/regexp/.MAP @@ -0,0 +1,11 @@ +F MAKEFILE.;1 Makefile +F README.;1 README +F REGERROR.C;1 regerror.c +F REGEXP.3;1 regexp.3 +F REGEXP.C;1 regexp.c +F REGEXP.H;1 regexp.h +F REGMAGIC.H;1 regmagic.h +F REGSUB.C;1 regsub.c +F TESTS.;1 tests +F TIMER.C;1 timer.c +F TRY.C;1 try.c diff --git a/lib/libc4.3tahoe/gen/regexp/Makefile b/lib/libc4.3tahoe/gen/regexp/Makefile new file mode 100644 index 0000000..4ae8180 --- /dev/null +++ b/lib/libc4.3tahoe/gen/regexp/Makefile @@ -0,0 +1,63 @@ +# Things you might want to put in ENV and LENV: +# -Dvoid=int compilers that don't do void +# -DCHARBITS=0377 compilers that don't do unsigned char +# -DSTATIC=extern compilers that don't like "static foo();" as forward decl +# -DSTRCSPN library does not have strcspn() +# -Dstrchr=index library does not have strchr() +# -DERRAVAIL have utzoo-compatible error() function and friends +ENV= +LENV= + +# Things you might want to put in TEST: +# -DDEBUG debugging hooks +# -I. regexp.h from current directory, not /usr/include +TEST= -I. + +# Things you might want to put in PROF: +# -Dstatic='/* */' make everything global so profiler can see it. +# -p profiler +PROF= + +CFLAGS=-O $(ENV) $(TEST) $(PROF) +LINTFLAGS=$(LENV) $(TEST) -ha +#LDFLAGS=-i uncomment for pdp 11 + +OBJ=regexp.o regsub.o +LSRC=regexp.c regsub.c regerror.c +DTR=README.regexp dMakefile regexp.3 regexp.h regexp.c regsub.c regerror.c \ + regmagic.h try.c timer.c tests + +try: try.o $(OBJ) + cc $(LDFLAGS) try.o $(OBJ) -o try + +# Making timer will probably require putting stuff in $(PROF) and then +# recompiling everything; the following is just the final stage. +timer: timer.o $(OBJ) + cc $(LDFLAGS) $(PROF) timer.o $(OBJ) -o timer + +timer.o: timer.c timer.t.h + +timer.t.h: tests + sed 's/ /","/g;s/\\/&&/g;s/.*/{"&"},/' tests >timer.t.h + +# Regression test. +r: try tests + @echo 'No news is good news...' + try dtr + +dMakefile: Makefile + sed '/^L*ENV=/s/ *-DERRAVAIL//' Makefile >dMakefile diff --git a/lib/libc4.3tahoe/gen/regexp/README b/lib/libc4.3tahoe/gen/regexp/README new file mode 100644 index 0000000..37d6f51 --- /dev/null +++ b/lib/libc4.3tahoe/gen/regexp/README @@ -0,0 +1,84 @@ +This is a nearly-public-domain reimplementation of the V8 regexp(3) package. +It gives C programs the ability to use egrep-style regular expressions, and +does it in a much cleaner fashion than the analogous routines in SysV. + + 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. + +Barring a couple of small items in the BUGS list, this implementation is +believed 100% compatible with V8. It should even be binary-compatible, +sort of, since the only fields in a "struct regexp" that other people have +any business touching are declared in exactly the same way at the same +location in the struct (the beginning). + +This implementation is *NOT* AT&T/Bell code, and is not derived from licensed +software. Even though U of T is a V8 licensee. This software is based on +a V8 manual page sent to me by Dennis Ritchie (the manual page enclosed +here is a complete rewrite and hence is not covered by AT&T copyright). +The software was nearly complete at the time of arrival of our V8 tape. +I haven't even looked at V8 yet, although a friend elsewhere at U of T has +been kind enough to run a few test programs using the V8 regexp(3) to resolve +a few fine points. I admit to some familiarity with regular-expression +implementations of the past, but the only one that this code traces any +ancestry to is the one published in Kernighan & Plauger (from which this +one draws ideas but not code). + +Simplistically: put this stuff into a source directory, copy regexp.h into +/usr/include, inspect Makefile for compilation options that need changing +to suit your local environment, and then do "make r". This compiles the +regexp(3) functions, compiles a test program, and runs a large set of +regression tests. If there are no complaints, then put regexp.o, regsub.o, +and regerror.o into your C library, and regexp.3 into your manual-pages +directory. + +Note that if you don't put regexp.h into /usr/include *before* compiling, +you'll have to add "-I." to CFLAGS before compiling. + +The files are: + +Makefile instructions to make everything +regexp.3 manual page +regexp.h header file, for /usr/include +regexp.c source for regcomp() and regexec() +regsub.c source for regsub() +regerror.c source for default regerror() +regmagic.h internal header file +try.c source for test program +timer.c source for timing program +tests test list for try and timer + +This implementation uses nondeterministic automata rather than the +deterministic ones found in some other implementations, which makes it +simpler, smaller, and faster at compiling regular expressions, but slower +at executing them. In theory, anyway. This implementation does employ +some special-case optimizations to make the simpler cases (which do make +up the bulk of regular expressions actually used) run quickly. In general, +if you want blazing speed you're in the wrong place. Replacing the insides +of egrep with this stuff is probably a mistake; if you want your own egrep +you're going to have to do a lot more work. But if you want to use regular +expressions a little bit in something else, you're in luck. Note that many +existing text editors use nondeterministic regular-expression implementations, +so you're in good company. + +This stuff should be pretty portable, given appropriate option settings. +If your chars have less than 8 bits, you're going to have to change the +internal representation of the automaton, although knowledge of the details +of this is fairly localized. There are no "reserved" char values except for +NUL, and no special significance is attached to the top bit of chars. +The string(3) functions are used a fair bit, on the grounds that they are +probably faster than coding the operations in line. Some attempts at code +tuning have been made, but this is invariably a bit machine-specific. diff --git a/lib/libc4.3tahoe/gen/regexp/regerror.c b/lib/libc4.3tahoe/gen/regexp/regerror.c new file mode 100644 index 0000000..e51820c --- /dev/null +++ b/lib/libc4.3tahoe/gen/regexp/regerror.c @@ -0,0 +1,17 @@ +#include + +void +regerror(s) +char *s; +{ +#ifdef ERRAVAIL + error("regexp: %s", s); +#else +/* + fprintf(stderr, "regexp(3): %s\n", s); + exit(1); +*/ + return; /* let std. egrep handle errors */ +#endif + /* NOTREACHED */ +} diff --git a/lib/libc4.3tahoe/gen/regexp/regexp.3 b/lib/libc4.3tahoe/gen/regexp/regexp.3 new file mode 100644 index 0000000..c5b6b09 --- /dev/null +++ b/lib/libc4.3tahoe/gen/regexp/regexp.3 @@ -0,0 +1,179 @@ +.TH REGEXP 3 local +.DA 30 Nov 1985 +.SH NAME +regcomp, regexec, regsub, regerror \- regular expression handler +.SH SYNOPSIS +.ft B +.nf +#include + +regexp *regcomp(exp) +char *exp; + +int regexec(prog, string) +regexp *prog; +char *string; + +regsub(prog, source, dest) +regexp *prog; +char *source; +char *dest; + +regerror(msg) +char *msg; +.SH DESCRIPTION +These functions implement +.IR egrep (1)-style +regular expressions and supporting facilities. +.PP +.I Regcomp +compiles a regular expression into a structure of type +.IR regexp , +and returns a pointer to it. +The space has been allocated using +.IR malloc (3) +and may be released by +.IR free . +.PP +.I Regexec +matches a NUL-terminated \fIstring\fR against the compiled regular expression +in \fIprog\fR. +It returns 1 for success and 0 for failure, and adjusts the contents of +\fIprog\fR's \fIstartp\fR and \fIendp\fR (see below) accordingly. +.PP +The members of a +.I regexp +structure include at least the following (not necessarily in order): +.PP +.RS +char *startp[NSUBEXP]; +.br +char *endp[NSUBEXP]; +.RE +.PP +where +.I NSUBEXP +is defined (as 10) in the header file. +Once a successful \fIregexec\fR has been done using the \fIregexp\fR, +each \fIstartp\fR-\fIendp\fR pair describes one substring +within the \fIstring\fR, +with the \fIstartp\fR pointing to the first character of the substring and +the \fIendp\fR pointing to the first character following the substring. +The 0th substring is the substring of \fIstring\fR that matched the whole +regular expression. +The others are those substrings that matched parenthesized expressions +within the regular expression, with parenthesized expressions numbered +in left-to-right order of their opening parentheses. +.PP +.I Regsub +copies \fIsource\fR to \fIdest\fR, making substitutions according to the +most recent \fIregexec\fR performed using \fIprog\fR. +Each instance of `&' in \fIsource\fR is replaced by the substring +indicated by \fIstartp\fR[\fI0\fR] and +\fIendp\fR[\fI0\fR]. +Each instance of `\e\fIn\fR', where \fIn\fR is a digit, is replaced by +the substring indicated by +\fIstartp\fR[\fIn\fR] and +\fIendp\fR[\fIn\fR]. +To get a literal `&' or `\e\fIn\fR' into \fIdest\fR, prefix it with `\e'; +to get a literal `\e' preceding `&' or `\e\fIn\fR', prefix it with +another `\e'. +.PP +.I Regerror +is called whenever an error is detected in \fIregcomp\fR, \fIregexec\fR, +or \fIregsub\fR. +The default \fIregerror\fR writes the string \fImsg\fR, +with a suitable indicator of origin, +on the standard +error output +and invokes \fIexit\fR(2). +.I Regerror +can be replaced by the user if other actions are desirable. +.SH "REGULAR EXPRESSION SYNTAX" +A regular expression is zero or more \fIbranches\fR, separated by `|'. +It matches anything that matches one of the branches. +.PP +A branch is zero or more \fIpieces\fR, concatenated. +It matches a match for the first, followed by a match for the second, etc. +.PP +A piece is an \fIatom\fR possibly followed by `*', `+', or `?'. +An atom followed by `*' matches a sequence of 0 or more matches of the atom. +An atom followed by `+' matches a sequence of 1 or more matches of the atom. +An atom followed by `?' matches a match of the atom, or the null string. +.PP +An atom is a regular expression in parentheses (matching a match for the +regular expression), a \fIrange\fR (see below), `.' +(matching any single character), `^' (matching the null string at the +beginning of the input string), `$' (matching the null string at the +end of the input string), a `\e' followed by a single character (matching +that character), or a single character with no other significance +(matching that character). +.PP +A \fIrange\fR is a sequence of characters enclosed in `[]'. +It normally matches any single character from the sequence. +If the sequence begins with `^', +it matches any single character \fInot\fR from the rest of the sequence. +If two characters in the sequence are separated by `\-', this is shorthand +for the full list of ASCII characters between them +(e.g. `[0-9]' matches any decimal digit). +To include a literal `]' in the sequence, make it the first character +(following a possible `^'). +To include a literal `\-', make it the first or last character. +.SH AMBIGUITY +If a regular expression could match two different parts of the input string, +it will match the one which begins earliest. +If both begin in the same place but match different lengths, or match +the same length in different ways, life gets messier, as follows. +.PP +In general, the possibilities in a list of branches are considered in +left-to-right order, the possibilities for `*', `+', and `?' are +considered longest-first, nested constructs are considered from the +outermost in, and concatenated constructs are considered leftmost-first. +The match that will be chosen is the one that uses the earliest +possibility in the first choice that has to be made. +If there is more than one choice, the next will be made in the same manner +(earliest possibility) subject to the decision on the first choice. +And so forth. +.PP +For example, `(ab|a)b*c' could match `abc' in one of two ways. +The first choice is between `ab' and `a'; since `ab' is earlier, and does +lead to a successful overall match, it is chosen. +Since the `b' is already spoken for, +the `b*' must match its last possibility\(emthe empty string\(emsince +it must respect the earlier choice. +.PP +In the particular case where no `|'s are present and there is only one +`*', `+', or `?', the net effect is that the longest possible +match will be chosen. +So `ab*', presented with `xabbbby', will match `abbbb'. +Note that if `ab*' is tried against `xabyabbbz', it +will match `ab' just after `x', due to the begins-earliest rule. +(In effect, the decision on where to start the match is the first choice +to be made, hence subsequent choices must respect it even if this leads them +to less-preferred alternatives.) +.SH SEE ALSO +egrep(1), expr(1) +.SH DIAGNOSTICS +\fIRegcomp\fR returns NULL for a failure +(\fIregerror\fR permitting), +where failures are syntax errors, exceeding implementation limits, +or applying `+' or `*' to a possibly-null operand. +.SH HISTORY +Both code and manual page were +written at U of T. +They are intended to be compatible with the Bell V8 \fIregexp\fR(3), +but are not derived from Bell code. +.SH BUGS +Empty branches and empty regular expressions are not portable to V8. +.PP +The restriction against +applying `*' or `+' to a possibly-null operand is an artifact of the +simplistic implementation. +.PP +Does not support \fIegrep\fR's newline-separated branches; +neither does the V8 \fIregexp\fR(3), though. +.PP +Due to emphasis on +compactness and simplicity, +it's not strikingly fast. +It does give special attention to handling simple cases quickly. diff --git a/lib/libc4.3tahoe/gen/regexp/regexp.c b/lib/libc4.3tahoe/gen/regexp/regexp.c new file mode 100644 index 0000000..0a35dd1 --- /dev/null +++ b/lib/libc4.3tahoe/gen/regexp/regexp.c @@ -0,0 +1,1317 @@ +/* + * 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. + *** THIS IS AN ALTERED VERSION. It was altered by John Gilmore, + *** hoptoad!gnu, on 27 Dec 1986, to add \n as an alternative to | + *** to assist in implementing egrep. + *** THIS IS AN ALTERED VERSION. It was altered by John Gilmore, + *** hoptoad!gnu, on 27 Dec 1986, to add \< and \> for word-matching + *** as in BSD grep and ex. + *** THIS IS AN ALTERED VERSION. It was altered by John Gilmore, + *** hoptoad!gnu, on 28 Dec 1986, to optimize characters quoted with \. + *** THIS IS AN ALTERED VERSION. It was altered by James A. Woods, + *** ames!jaw, on 19 June 1987, to quash a regcomp() redundancy. + * + * 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. + */ +#include +#include +#include +#include "regmagic.h" + +/* + * 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 WORDA 12 /* no Match "" at wordchar, where prev is nonword */ +#define WORDZ 13 /* no Match "" at nonwordchar, where prev is word */ +#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) + +/* + * See regmagic.h for one further detail of program structure. + */ + + +/* + * Utility definitions. + */ +#ifndef CHARBITS +#define UCHARAT(p) ((int)*(unsigned char *)(p)) +#else +#define UCHARAT(p) ((int)*(p)&CHARBITS) +#endif + +#define FAIL(m) { regerror(m); return(NULL); } +#define ISMULT(c) ((c) == '*' || (c) == '+' || (c) == '?') + +/* + * 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; ®dummy = don't. */ +static long regsize; /* Code size. */ + +/* + * Forward declarations for regcomp()'s friends. + */ +#ifndef STATIC +#define STATIC static +#endif +STATIC char *reg(); +STATIC char *regbranch(); +STATIC char *regpiece(); +STATIC char *regatom(); +STATIC char *regnode(); +STATIC char *regnext(); +STATIC void regc(); +STATIC void reginsert(); +STATIC void regtail(); +STATIC void regoptail(); +#ifdef STRCSPN +STATIC int strcspn(); +#endif + +/* + - 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; + extern char *malloc(); + + if (exp == NULL) + FAIL("NULL argument"); + + /* First pass: determine size, legality. */ + if (exp[0] == '.' && exp[1] == '*') exp += 2; /* aid grep */ + regparse = exp; + regnpar = 1; + regsize = 0L; + regcode = ®dummy; + regc(MAGIC); + if (reg(0, &flags) == NULL) + return(NULL); + + /* Small enough for pointer-storage convention? */ + if (regsize >= 32767L) /* Probably could be 65535L. */ + FAIL("regexp too big"); + + /* Allocate space. */ + r = (regexp *)malloc(sizeof(regexp) + (unsigned)regsize); + if (r == NULL) + FAIL("out of space"); + + /* Second pass: emit code. */ + regparse = exp; + regnpar = 1; + regcode = r->program; + regc(MAGIC); + if (reg(0, &flags) == NULL) + return(NULL); + + /* Dig out information for optimizations. */ + r->regstart = '\0'; /* Worst-case defaults. */ + r->reganch = 0; + r->regmust = 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 = NULL; + len = 0; + for (; scan != 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) + FAIL("too many ()"); + parno = regnpar; + regnpar++; + ret = regnode(OPEN+parno); + } else + ret = NULL; + + /* Pick up the branches, linking them together. */ + br = regbranch(&flags); + if (br == NULL) + return(NULL); + if (ret != NULL) + regtail(ret, br); /* OPEN -> first. */ + else + ret = br; + if (!(flags&HASWIDTH)) + *flagp &= ~HASWIDTH; + *flagp |= flags&SPSTART; + while (*regparse == '|' || *regparse == '\n') { + regparse++; + br = regbranch(&flags); + if (br == NULL) + return(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 != NULL; br = regnext(br)) + regoptail(br, ender); + + /* Check for proper termination. */ + if (paren && *regparse++ != ')') { + FAIL("unmatched ()"); + } else if (!paren && *regparse != '\0') { + if (*regparse == ')') { + FAIL("unmatched ()"); + } else + FAIL("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 = NULL; + while (*regparse != '\0' && *regparse != ')' && + *regparse != '\n' && *regparse != '|') { + latest = regpiece(&flags); + if (latest == NULL) + return(NULL); + *flagp |= flags&HASWIDTH; + if (chain == NULL) /* First piece. */ + *flagp |= flags&SPSTART; + else + regtail(chain, latest); + chain = latest; + } + if (chain == NULL) /* Loop ran zero times. */ + (void) 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 == NULL) + return(NULL); + + op = *regparse; + if (!ISMULT(op)) { + *flagp = flags; + return(ret); + } + + if (!(flags&HASWIDTH) && op != '?') + FAIL("*+ 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)) + FAIL("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++) { + /* FIXME: these chars only have meaning at beg/end of pat? */ + 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) + FAIL("invalid [] range"); + for (; class <= classend; class++) + regc(class); + regparse++; + } + } else + regc(*regparse++); + } + regc('\0'); + if (*regparse != ']') + FAIL("unmatched []"); + regparse++; + *flagp |= HASWIDTH|SIMPLE; + } + break; + case '(': + ret = reg(1, &flags); + if (ret == NULL) + return(NULL); + *flagp |= flags&(HASWIDTH|SPSTART); + break; + case '\0': + case '|': + case '\n': + case ')': + FAIL("internal urp"); /* Supposed to be caught earlier. */ + break; + case '?': + case '+': + case '*': + FAIL("?+* follows nothing"); + break; + case '\\': + switch (*regparse++) { + case '\0': + FAIL("trailing \\"); + break; + case '<': + ret = regnode(WORDA); + break; + case '>': + ret = regnode(WORDZ); + break; + /* FIXME: Someday handle \1, \2, ... */ + default: + /* Handle general quoted chars in exact-match routine */ + goto de_fault; + } + break; + de_fault: + default: + /* + * Encode a string of characters to be matched exactly. + * + * This is a bit tricky due to quoted chars and due to + * '*', '+', and '?' taking the SINGLE char previous + * as their operand. + * + * On entry, the char at regparse[-1] is going to go + * into the string, no matter what it is. (It could be + * following a \ if we are entered from the '\' case.) + * + * Basic idea is to pick up a good char in ch and + * examine the next char. If it's *+? then we twiddle. + * If it's \ then we frozzle. If it's other magic char + * we push ch and terminate the string. If none of the + * above, we push ch on the string and go around again. + * + * regprev is used to remember where "the current char" + * starts in the string, if due to a *+? we need to back + * up and put the current char in a separate, 1-char, string. + * When regprev is NULL, ch is the only char in the + * string; this is used in *+? handling, and in setting + * flags |= SIMPLE at the end. + */ + { + char *regprev; + register char ch; + + regparse--; /* Look at cur char */ + ret = regnode(EXACTLY); + for ( regprev = 0 ; ; ) { + ch = *regparse++; /* Get current char */ + switch (*regparse) { /* look at next one */ + + default: + regc(ch); /* Add cur to string */ + break; + + case '.': case '[': case '(': + case ')': case '|': case '\n': + case '$': case '^': + case '\0': + /* FIXME, $ and ^ should not always be magic */ + magic: + regc(ch); /* dump cur char */ + goto done; /* and we are done */ + + case '?': case '+': case '*': + if (!regprev) /* If just ch in str, */ + goto magic; /* use it */ + /* End mult-char string one early */ + regparse = regprev; /* Back up parse */ + goto done; + + case '\\': + regc(ch); /* Cur char OK */ + switch (regparse[1]){ /* Look after \ */ + case '\0': + case '<': + case '>': + /* FIXME: Someday handle \1, \2, ... */ + goto done; /* Not quoted */ + default: + /* Backup point is \, scan * point is after it. */ + regprev = regparse; + regparse++; + continue; /* NOT break; */ + } + } + regprev = regparse; /* Set backup point */ + } + done: + regc('\0'); + *flagp |= HASWIDTH; + if (!regprev) /* One char? */ + *flagp |= SIMPLE; + } + break; + } + + return(ret); +} + +/* + - regnode - emit a node + */ +static char * /* Location. */ +regnode(op) +char op; +{ + register char *ret; + register char *ptr; + + ret = regcode; + if (ret == ®dummy) { + 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 != ®dummy) + *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 == ®dummy) { + 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 == ®dummy) + return; + + /* Find last node. */ + scan = p; + for (;;) { + temp = regnext(scan); + if (temp == 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 == NULL || p == ®dummy || 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(); +STATIC int regmatch(); +STATIC int regrepeat(); + +#ifdef DEBUG +int regnarrate = 0; +void regdump(); +STATIC char *regprop(); +#endif + +/* + - regexec - match a regexp against a string + */ +int +regexec(prog, string) +register regexp *prog; +register char *string; +{ + register char *s; + extern char *strchr(); + + /* Be paranoid... */ + if (prog == NULL || string == 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 != NULL) { + s = string; + while ((s = strchr(s, prog->regmust[0])) != NULL) { + if (strncmp(s, prog->regmust, prog->regmlen) == 0) + break; /* Found it. */ + s++; + } + if (s == NULL) /* Not present. */ + return(0); + } + + /* Mark beginning of line for ^ . */ + regbol = string; + + /* 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)) != 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 /* 0 failure, 1 success */ +regtry(prog, string) +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++ = NULL; + *ep++ = 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 /* 0 failure, 1 success */ +regmatch(prog) +char *prog; +{ + register char *scan; /* Current node. */ + char *next; /* Next node. */ + extern char *strchr(); + + scan = prog; +#ifdef DEBUG + if (scan != NULL && regnarrate) + fprintf(stderr, "%s(\n", regprop(scan)); +#endif + while (scan != 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 WORDA: + /* Must be looking at a letter, digit, or _ */ + if ((!isalnum(*reginput)) && *reginput != '_') + return(0); + /* Prev must be BOL or nonword */ + if (reginput > regbol && + (isalnum(reginput[-1]) || reginput[-1] == '_')) + return(0); + break; + case WORDZ: + /* Must be looking at non letter, digit, or _ */ + if (isalnum(*reginput) || *reginput == '_') + return(0); + /* We don't care what the previous char was */ + 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) == NULL) + return(0); + reginput++; + break; + case ANYBUT: + if (*reginput == '\0' || strchr(OPERAND(scan), *reginput) != 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] == 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] == 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 != 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) != NULL) { + count++; + scan++; + } + break; + case ANYBUT: + while (*scan != '\0' && strchr(opnd, *scan) == 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 == ®dummy) + return(NULL); + + offset = NEXT(p); + if (offset == 0) + return(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; + extern char *strchr(); + + + s = r->program + 1; + while (op != END) { /* While that wasn't END last time... */ + op = OP(s); + printf("%2d%s", s-r->program, regprop(s)); /* Where, what. */ + next = regnext(s); + if (next == NULL) /* Next ptr. */ + printf("(0)"); + else + printf("(%d)", (s-r->program)+(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 != 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 = 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 = NULL; + break; + case STAR: + p = "STAR"; + break; + case PLUS: + p = "PLUS"; + break; + case WORDA: + p = "WORDA"; + break; + case WORDZ: + p = "WORDZ"; + break; + default: + regerror("corrupted opcode"); + break; + } + if (p != NULL) + (void) strcat(buf, p); + return(buf); +} +#endif + +/* + * The following is provided for those people who do not have strcspn() in + * their C libraries. They should get off their butts and do something + * about it; at least one public-domain implementation of those (highly + * useful) string routines has been published on Usenet. + */ +#ifdef STRCSPN +/* + * strcspn - find length of initial segment of s1 consisting entirely + * of characters not from s2 + */ + +static int +strcspn(s1, s2) +char *s1; +char *s2; +{ + register char *scan1; + register char *scan2; + register int count; + + count = 0; + for (scan1 = s1; *scan1 != '\0'; scan1++) { + for (scan2 = s2; *scan2 != '\0';) /* ++ moved down. */ + if (*scan1 == *scan2++) + return(count); + count++; + } + return(count); +} +#endif diff --git a/lib/libc4.3tahoe/gen/regexp/regexp.h b/lib/libc4.3tahoe/gen/regexp/regexp.h new file mode 100644 index 0000000..73d6bf4 --- /dev/null +++ b/lib/libc4.3tahoe/gen/regexp/regexp.h @@ -0,0 +1,21 @@ +/* + * Definitions etc. for regexp(3) routines. + * + * Caveat: this is V8 regexp(3) [actually, a reimplementation thereof], + * not the System V one. + */ +#define NSUBEXP 10 +typedef struct regexp { + char *startp[NSUBEXP]; + char *endp[NSUBEXP]; + char regstart; /* Internal use only. */ + char reganch; /* Internal use only. */ + char *regmust; /* Internal use only. */ + int regmlen; /* Internal use only. */ + char program[1]; /* Unwarranted chumminess with compiler. */ +} regexp; + +extern regexp *regcomp(); +extern int regexec(); +extern void regsub(); +extern void regerror(); diff --git a/lib/libc4.3tahoe/gen/regexp/regmagic.h b/lib/libc4.3tahoe/gen/regexp/regmagic.h new file mode 100644 index 0000000..5acf447 --- /dev/null +++ b/lib/libc4.3tahoe/gen/regexp/regmagic.h @@ -0,0 +1,5 @@ +/* + * The first byte of the regexp internal "program" is actually this magic + * number; the start node begins in the second byte. + */ +#define MAGIC 0234 diff --git a/lib/libc4.3tahoe/gen/regexp/regsub.c b/lib/libc4.3tahoe/gen/regexp/regsub.c new file mode 100644 index 0000000..d8cc53d --- /dev/null +++ b/lib/libc4.3tahoe/gen/regexp/regsub.c @@ -0,0 +1,80 @@ +/* + * 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 +#include +#include "regmagic.h" + +#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; + extern char *strncpy(); + + if (prog == NULL || source == NULL || dest == 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] != NULL && prog->endp[no] != NULL) { + len = prog->endp[no] - prog->startp[no]; + (void) strncpy(dst, prog->startp[no], len); + dst += len; + if (len != 0 && *(dst-1) == '\0') { /* strncpy hit NUL. */ + regerror("damaged match string"); + return; + } + } + } + *dst++ = '\0'; +} diff --git a/lib/libc4.3tahoe/gen/regexp/tests b/lib/libc4.3tahoe/gen/regexp/tests new file mode 100644 index 0000000..78d43ab --- /dev/null +++ b/lib/libc4.3tahoe/gen/regexp/tests @@ -0,0 +1,121 @@ +abc abc y & abc +abc xbc n - - +abc axc n - - +abc abx n - - +abc xabcy y & abc +abc ababc y & abc +ab*c abc y & abc +ab*bc abc y & abc +ab*bc abbc y & abbc +ab*bc abbbbc y & abbbbc +ab+bc abbc y & abbc +ab+bc abc n - - +ab+bc abq n - - +ab+bc abbbbc y & abbbbc +ab?bc abbc y & abbc +ab?bc abc y & abc +ab?bc abbbbc n - - +ab?c abc y & abc +^abc$ abc y & abc +^abc$ abcc n - - +^abc abcc y & abc +^abc$ aabc n - - +abc$ aabc y & abc +^ abc y & +$ abc y & +a.c abc y & abc +a.c axc y & axc +a.*c axyzc y & axyzc +a.*c axyzd n - - +a[bc]d abc n - - +a[bc]d abd y & abd +a[b-d]e abd n - - +a[b-d]e ace y & ace +a[b-d] aac y & ac +a[-b] a- y & a- +a[b-] a- y & a- +a[b-a] - c - - +a[]b - c - - +a[ - c - - +a] a] y & a] +a[]]b a]b y & a]b +a[^bc]d aed y & aed +a[^bc]d abd n - - +a[^-b]c adc y & adc +a[^-b]c a-c n - - +a[^]b]c a]c n - - +a[^]b]c adc y & adc +ab|cd abc y & ab +ab|cd abcd y & ab +()ef def y &-\1 ef- +()* - c - - +*a - c - - +^* - c - - +$* - c - - +(*)b - c - - +$b b n - - +a\ - c - - +a\(b a(b y &-\1 a(b- +a\(*b ab y & ab +a\(*b a((b y & a((b +a\\b a\b y & a\b +abc) - c - - +(abc - c - - +((a)) abc y &-\1-\2 a-a-a +(a)b(c) abc y &-\1-\2 abc-a-c +a+b+c aabbabc y & abc +a** - c - - +a*? - c - - +(a*)* - c - - +(a*)+ - c - - +(a|)* - c - - +(a*|b)* - c - - +(a+|b)* ab y &-\1 ab-b +(a+|b)+ ab y &-\1 ab-b +(a+|b)? ab y &-\1 a-a +[^ab]* cde y & cde +(^)* - c - - +(ab|)* - c - - +)( - c - - + abc y & +abc n - - +a* y & +([abc])*d abbbcd y &-\1 abbbcd-c +([abc])*bcd abcd y &-\1 abcd-a +a|b|c|d|e e y & e +(a|b|c|d|e)f ef y &-\1 ef-e +((a*|b))* - c - - +abcd*efg abcdefg y & abcdefg +ab* xabyabbbz y & ab +ab* xayabbbz y & a +(ab|cd)e abcde y &-\1 cde-cd +[abhgefdc]ij hij y & hij +^(ab|cd)e abcde n x\1y xy +(abc|)ef abcdef y &-\1 ef- +(a|b)c*d abcd y &-\1 bcd-b +(ab|ab*)bc abc y &-\1 abc-a +a([bc]*)c* abc y &-\1 abc-bc +a([bc]*)(c*d) abcd y &-\1-\2 abcd-bc-d +a([bc]+)(c*d) abcd y &-\1-\2 abcd-bc-d +a([bc]*)(c+d) abcd y &-\1-\2 abcd-b-cd +a[bcd]*dcdcde adcdcde y & adcdcde +a[bcd]+dcdcde adcdcde n - - +(ab|a)b*c abc y &-\1 abc-ab +((a)(b)c)(d) abcd y \1-\2-\3-\4 abc-a-b-d +[a-zA-Z_][a-zA-Z0-9_]* alpha y & alpha +^a(bc+|b[eh])g|.h$ abh y &-\1 bh- +(bc+d$|ef*g.|h?i(j|k)) effgz y &-\1-\2 effgz-effgz- +(bc+d$|ef*g.|h?i(j|k)) ij y &-\1-\2 ij-ij-j +(bc+d$|ef*g.|h?i(j|k)) effg n - - +(bc+d$|ef*g.|h?i(j|k)) bcdd n - - +(bc+d$|ef*g.|h?i(j|k)) reffgz y &-\1-\2 effgz-effgz- +((((((((((a)))))))))) - c - - +(((((((((a))))))))) a y & a +multiple words of text uh-uh n - - +multiple words multiple words, yeah y & multiple words +(.*)c(.*) abcde y &-\1-\2 abcde-ab-de +\((.*), (.*)\) (a, b) y (\2, \1) (b, a) +[k] ab n - - +abcd abcd y &-\&-\\& abcd-&-\abcd +a(bc)d abcd y \1-\\1-\\\1 bc-\1-\bc +a[-]?c ac y & ac diff --git a/lib/libc4.3tahoe/gen/regexp/timer.c b/lib/libc4.3tahoe/gen/regexp/timer.c new file mode 100644 index 0000000..2d84a12 --- /dev/null +++ b/lib/libc4.3tahoe/gen/regexp/timer.c @@ -0,0 +1,182 @@ +/* + * Simple timing program for regcomp(). + * + * 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. + * + * Usage: timer ncomp nexec nsub + * or + * timer ncomp nexec nsub regexp string [ answer [ sub ] ] + * + * The second form is for timing repetitions of a single test case. + * The first form's test data is a compiled-in copy of the "tests" file. + * Ncomp, nexec, nsub are how many times to do each regcomp, regexec, + * and regsub. The way to time an operation individually is to do something + * like "timer 1 50 1". + */ +#include + +struct try { + char *re, *str, *ans, *src, *dst; +} tests[] = { +#include "timer.t.h" +{ NULL, NULL, NULL, NULL, NULL } +}; + +#include + +int errreport = 0; /* Report errors via errseen? */ +char *errseen = NULL; /* Error message. */ + +char *progname; + +/* ARGSUSED */ +main(argc, argv) +int argc; +char *argv[]; +{ + int ncomp, nexec, nsub; + struct try one; + char dummy[512]; + + if (argc < 4) { + ncomp = 1; + nexec = 1; + nsub = 1; + } else { + ncomp = atoi(argv[1]); + nexec = atoi(argv[2]); + nsub = atoi(argv[3]); + } + + progname = argv[0]; + if (argc > 5) { + one.re = argv[4]; + one.str = argv[5]; + if (argc > 6) + one.ans = argv[6]; + else + one.ans = "y"; + if (argc > 7) { + one.src = argv[7]; + one.dst = "xxx"; + } else { + one.src = "x"; + one.dst = "x"; + } + errreport = 1; + try(one, ncomp, nexec, nsub); + } else + multiple(ncomp, nexec, nsub); + exit(0); +} + +void +regerror(s) +char *s; +{ + if (errreport) + errseen = s; + else + error(s, ""); +} + +#ifndef ERRAVAIL +error(s1, s2) +char *s1; +char *s2; +{ + fprintf(stderr, "regexp: "); + fprintf(stderr, s1, s2); + fprintf(stderr, "\n"); + exit(1); +} +#endif + +int lineno = 0; + +multiple(ncomp, nexec, nsub) +int ncomp, nexec, nsub; +{ + register int i; + extern char *strchr(); + + errreport = 1; + for (i = 0; tests[i].re != NULL; i++) { + lineno++; + try(tests[i], ncomp, nexec, nsub); + } +} + +try(fields, ncomp, nexec, nsub) +struct try fields; +int ncomp, nexec, nsub; +{ + regexp *r; + char dbuf[BUFSIZ]; + register int i; + + errseen = NULL; + r = regcomp(fields.re); + if (r == NULL) { + if (*fields.ans != 'c') + complain("regcomp failure in `%s'", fields.re); + return; + } + if (*fields.ans == 'c') { + complain("unexpected regcomp success in `%s'", fields.re); + free((char *)r); + return; + } + for (i = ncomp-1; i > 0; i--) { + free((char *)r); + r = regcomp(fields.re); + } + if (!regexec(r, fields.str)) { + if (*fields.ans != 'n') + complain("regexec failure in `%s'", ""); + free((char *)r); + return; + } + if (*fields.ans == 'n') { + complain("unexpected regexec success", ""); + free((char *)r); + return; + } + for (i = nexec-1; i > 0; i--) + (void) regexec(r, fields.str); + errseen = NULL; + for (i = nsub; i > 0; i--) + regsub(r, fields.src, dbuf); + if (errseen != NULL) { + complain("regsub complaint", ""); + free((char *)r); + return; + } + if (strcmp(dbuf, fields.dst) != 0) + complain("regsub result `%s' wrong", dbuf); + free((char *)r); +} + +complain(s1, s2) +char *s1; +char *s2; +{ + fprintf(stderr, "try: %d: ", lineno); + fprintf(stderr, s1, s2); + fprintf(stderr, " (%s)\n", (errseen != NULL) ? errseen : ""); +} diff --git a/lib/libc4.3tahoe/gen/regexp/try.c b/lib/libc4.3tahoe/gen/regexp/try.c new file mode 100644 index 0000000..71620c2 --- /dev/null +++ b/lib/libc4.3tahoe/gen/regexp/try.c @@ -0,0 +1,238 @@ +/* + * Simple test program for regexp(3) stuff. Knows about debugging hooks. + * + * 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. + * + * Usage: try re [string [output [-]]] + * The re is compiled and dumped, regexeced against the string, the result + * is applied to output using regsub(). The - triggers a running narrative + * from regexec(). Dumping and narrative don't happen unless DEBUG. + * + * If there are no arguments, stdin is assumed to be a stream of lines with + * five fields: a r.e., a string to match it against, a result code, a + * source string for regsub, and the proper result. Result codes are 'c' + * for compile failure, 'y' for match success, 'n' for match failure. + * Field separator is tab. + */ +#include +#include + +#ifdef ERRAVAIL +char *progname; +extern char *mkprogname(); +#endif + +#ifdef DEBUG +extern int regnarrate; +#endif + +char buf[BUFSIZ]; + +int errreport = 0; /* Report errors via errseen? */ +char *errseen = NULL; /* Error message. */ +int status = 0; /* Exit status. */ + +/* ARGSUSED */ +main(argc, argv) +int argc; +char *argv[]; +{ + regexp *r; + int i; + +#ifdef ERRAVAIL + progname = mkprogname(argv[0]); +#endif + + if (argc == 1) { + multiple(); + exit(status); + } + + r = regcomp(argv[1]); + if (r == NULL) + error("regcomp failure", ""); +#ifdef DEBUG + regdump(r); + if (argc > 4) + regnarrate++; +#endif + if (argc > 2) { + i = regexec(r, argv[2]); + printf("%d", i); + for (i = 1; i < NSUBEXP; i++) + if (r->startp[i] != NULL && r->endp[i] != NULL) + printf(" \\%d", i); + printf("\n"); + } + if (argc > 3) { + regsub(r, argv[3], buf); + printf("%s\n", buf); + } + exit(status); +} + +void +regerror(s) +char *s; +{ + if (errreport) + errseen = s; + else + error(s, ""); +} + +#ifndef ERRAVAIL +error(s1, s2) +char *s1; +char *s2; +{ + fprintf(stderr, "regexp: "); + fprintf(stderr, s1, s2); + fprintf(stderr, "\n"); + exit(1); +} +#endif + +int lineno; + +regexp badregexp; /* Implicit init to 0. */ + +multiple() +{ + char rbuf[BUFSIZ]; + char *field[5]; + char *scan; + int i; + regexp *r; + extern char *strchr(); + + errreport = 1; + lineno = 0; + while (fgets(rbuf, sizeof(rbuf), stdin) != NULL) { + rbuf[strlen(rbuf)-1] = '\0'; /* Dispense with \n. */ + lineno++; + scan = rbuf; + for (i = 0; i < 5; i++) { + field[i] = scan; + if (field[i] == NULL) { + complain("bad testfile format", ""); + exit(1); + } + scan = strchr(scan, '\t'); + if (scan != NULL) + *scan++ = '\0'; + } + try(field); + } + + /* And finish up with some internal testing... */ + lineno = 9990; + errseen = NULL; + if (regcomp((char *)NULL) != NULL || errseen == NULL) + complain("regcomp(NULL) doesn't complain", ""); + lineno = 9991; + errseen = NULL; + if (regexec((regexp *)NULL, "foo") || errseen == NULL) + complain("regexec(NULL, ...) doesn't complain", ""); + lineno = 9992; + r = regcomp("foo"); + if (r == NULL) { + complain("regcomp(\"foo\") fails", ""); + return; + } + lineno = 9993; + errseen = NULL; + if (regexec(r, (char *)NULL) || errseen == NULL) + complain("regexec(..., NULL) doesn't complain", ""); + lineno = 9994; + errseen = NULL; + regsub((regexp *)NULL, "foo", rbuf); + if (errseen == NULL) + complain("regsub(NULL, ..., ...) doesn't complain", ""); + lineno = 9995; + errseen = NULL; + regsub(r, (char *)NULL, rbuf); + if (errseen == NULL) + complain("regsub(..., NULL, ...) doesn't complain", ""); + lineno = 9996; + errseen = NULL; + regsub(r, "foo", (char *)NULL); + if (errseen == NULL) + complain("regsub(..., ..., NULL) doesn't complain", ""); + lineno = 9997; + errseen = NULL; + if (regexec(&badregexp, "foo") || errseen == NULL) + complain("regexec(nonsense, ...) doesn't complain", ""); + lineno = 9998; + errseen = NULL; + regsub(&badregexp, "foo", rbuf); + if (errseen == NULL) + complain("regsub(nonsense, ..., ...) doesn't complain", ""); +} + +try(fields) +char **fields; +{ + regexp *r; + char dbuf[BUFSIZ]; + + errseen = NULL; + r = regcomp(fields[0]); + if (r == NULL) { + if (*fields[2] != 'c') + complain("regcomp failure in `%s'", fields[0]); + return; + } + if (*fields[2] == 'c') { + complain("unexpected regcomp success in `%s'", fields[0]); + free((char *)r); + return; + } + if (!regexec(r, fields[1])) { + if (*fields[2] != 'n') + complain("regexec failure in `%s'", ""); + free((char *)r); + return; + } + if (*fields[2] == 'n') { + complain("unexpected regexec success", ""); + free((char *)r); + return; + } + errseen = NULL; + regsub(r, fields[3], dbuf); + if (errseen != NULL) { + complain("regsub complaint", ""); + free((char *)r); + return; + } + if (strcmp(dbuf, fields[4]) != 0) + complain("regsub result `%s' wrong", dbuf); + free((char *)r); +} + +complain(s1, s2) +char *s1; +char *s2; +{ + fprintf(stderr, "try: %d: ", lineno); + fprintf(stderr, s1, s2); + fprintf(stderr, " (%s)\n", (errseen != NULL) ? errseen : ""); + status = 1; +} diff --git a/lib/libc4.3tahoe/gen/remque.c b/lib/libc4.3tahoe/gen/remque.c new file mode 100644 index 0000000..6212918 --- /dev/null +++ b/lib/libc4.3tahoe/gen/remque.c @@ -0,0 +1,27 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)remque.c 5.1 (Berkeley) 1/27/87"; +#endif LIBC_SCCS and not lint + +/* + * remque -- vax remque instruction + * + * NOTE: this implementation is non-atomic!! + */ + +struct vaxque { /* queue format expected by VAX queue instructions */ + struct vaxque *vq_next; + struct vaxque *vq_prev; +}; + +remque(e) + register struct vaxque *e; +{ + e->vq_prev->vq_next = e->vq_next; + e->vq_next->vq_prev = e->vq_prev; +} diff --git a/lib/libc4.3tahoe/gen/rindex.c b/lib/libc4.3tahoe/gen/rindex.c new file mode 100644 index 0000000..9482a8d --- /dev/null +++ b/lib/libc4.3tahoe/gen/rindex.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rindex.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +char * +rindex(p, ch) + register char *p, ch; +{ + register char *save; + + for (save = NULL;; ++p) { + if (*p == ch) + save = p; + if (!*p) + return(save); + } + /* NOTREACHED */ +} diff --git a/lib/libc4.3tahoe/gen/scandir.c b/lib/libc4.3tahoe/gen/scandir.c new file mode 100644 index 0000000..15d6e45 --- /dev/null +++ b/lib/libc4.3tahoe/gen/scandir.c @@ -0,0 +1,102 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)scandir.c 5.3 (Berkeley) 6/18/88"; +#endif /* LIBC_SCCS and not lint */ + +/* + * Scan the directory dirname calling select to make a list of selected + * directory entries then sort using qsort and compare routine dcomp. + * Returns the number of entries and a pointer to a list of pointers to + * struct direct (through namelist). Returns -1 if there were any errors. + */ + +#include +#include +#include + +scandir(dirname, namelist, select, dcomp) + char *dirname; + struct direct *(*namelist[]); + int (*select)(), (*dcomp)(); +{ + register struct direct *d, *p, **names; + register int nitems; + register char *cp1, *cp2; + struct stat stb; + long arraysz; + DIR *dirp; + + if ((dirp = opendir(dirname)) == NULL) + return(-1); + if (fstat(dirp->dd_fd, &stb) < 0) + return(-1); + + /* + * estimate the array size by taking the size of the directory file + * and dividing it by a multiple of the minimum size entry. + */ + arraysz = (stb.st_size / 24); + names = (struct direct **)malloc(arraysz * sizeof(struct direct *)); + if (names == NULL) + return(-1); + + nitems = 0; + while ((d = readdir(dirp)) != NULL) { + if (select != NULL && !(*select)(d)) + continue; /* just selected names */ + /* + * Make a minimum size copy of the data + */ + p = (struct direct *)malloc(DIRSIZ(d)); + if (p == NULL) + return(-1); + p->d_ino = d->d_ino; + p->d_reclen = d->d_reclen; + p->d_namlen = d->d_namlen; + for (cp1 = p->d_name, cp2 = d->d_name; *cp1++ = *cp2++; ); + /* + * Check to make sure the array has space left and + * realloc the maximum size. + */ + if (++nitems >= arraysz) { + if (fstat(dirp->dd_fd, &stb) < 0) + return(-1); /* just might have grown */ + arraysz = stb.st_size / 12; + names = (struct direct **)realloc((char *)names, + arraysz * sizeof(struct direct *)); + if (names == NULL) + return(-1); + } + names[nitems-1] = p; + } + closedir(dirp); + if (nitems && dcomp != NULL) + qsort(names, nitems, sizeof(struct direct *), dcomp); + *namelist = names; + return(nitems); +} + +/* + * Alphabetic order comparison routine for those who want it. + */ +alphasort(d1, d2) + struct direct **d1, **d2; +{ + return(strcmp((*d1)->d_name, (*d2)->d_name)); +} diff --git a/lib/libc4.3tahoe/gen/seekdir.c b/lib/libc4.3tahoe/gen/seekdir.c new file mode 100644 index 0000000..772ed9b --- /dev/null +++ b/lib/libc4.3tahoe/gen/seekdir.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)seekdir.c 5.3 (Berkeley) 6/18/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +/* + * seek to an entry in a directory. + * Only values returned by "telldir" should be passed to seekdir. + */ +void +seekdir(dirp, loc) + register DIR *dirp; + long loc; +{ + long curloc, base, offset; + struct direct *dp; + extern long lseek(); + + curloc = telldir(dirp); + if (loc == curloc) + return; + base = loc & ~(DIRBLKSIZ - 1); + offset = loc & (DIRBLKSIZ - 1); + (void) lseek(dirp->dd_fd, base, 0); + dirp->dd_loc = 0; + while (dirp->dd_loc < offset) { + dp = readdir(dirp); + if (dp == NULL) + return; + } +} diff --git a/lib/libc4.3tahoe/gen/setegid.c b/lib/libc4.3tahoe/gen/setegid.c new file mode 100644 index 0000000..cb332d0 --- /dev/null +++ b/lib/libc4.3tahoe/gen/setegid.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setegid.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +setegid(egid) + int egid; +{ + + return (setregid(-1, egid)); +} diff --git a/lib/libc4.3tahoe/gen/setenv.c b/lib/libc4.3tahoe/gen/setenv.c new file mode 100644 index 0000000..6df8f4d --- /dev/null +++ b/lib/libc4.3tahoe/gen/setenv.c @@ -0,0 +1,99 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setenv.c 5.2 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +/* + * setenv -- + * Set the value of the environmental variable "name" to be + * "value". If rewrite is set, replace any current value. + */ +setenv(name, value, rewrite) + register char *name, *value; + int rewrite; +{ + extern char **environ; + static int alloced; /* if allocated space before */ + register char *C; + int l_value, offset; + char *malloc(), *realloc(), *_findenv(); + + if (*value == '=') /* no `=' in value */ + ++value; + l_value = strlen(value); + if ((C = _findenv(name, &offset))) { /* find if already exists */ + if (!rewrite) + return(0); + if (strlen(C) >= l_value) { /* old larger; copy over */ + while (*C++ = *value++); + return(0); + } + } + else { /* create new slot */ + register int cnt; + register char **P; + + for (P = environ, cnt = 0; *P; ++P, ++cnt); + if (alloced) { /* just increase size */ + environ = (char **)realloc((char *)environ, + (u_int)(sizeof(char *) * (cnt + 2))); + if (!environ) + return(-1); + } + else { /* get new space */ + alloced = 1; /* copy old entries into it */ + P = (char **)malloc((u_int)(sizeof(char *) * + (cnt + 2))); + if (!P) + return(-1); + bcopy(environ, P, cnt * sizeof(char *)); + environ = P; + } + environ[cnt + 1] = NULL; + offset = cnt; + } + for (C = name; *C && *C != '='; ++C); /* no `=' in name */ + if (!(environ[offset] = /* name + `=' + value */ + malloc((u_int)((int)(C - name) + l_value + 2)))) + return(-1); + for (C = environ[offset]; (*C = *name++) && *C != '='; ++C); + for (*C++ = '='; *C++ = *value++;); + return(0); +} + +/* + * unsetenv(name) -- + * Delete environmental variable "name". + */ +void +unsetenv(name) + char *name; +{ + extern char **environ; + register char **P; + int offset; + + while (_findenv(name, &offset)) /* if set multiple times */ + for (P = &environ[offset];; ++P) + if (!(*P = *(P + 1))) + break; +} diff --git a/lib/libc4.3tahoe/gen/seteuid.c b/lib/libc4.3tahoe/gen/seteuid.c new file mode 100644 index 0000000..2c6096c --- /dev/null +++ b/lib/libc4.3tahoe/gen/seteuid.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)seteuid.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +seteuid(euid) + int euid; +{ + + return (setreuid(-1, euid)); +} diff --git a/lib/libc4.3tahoe/gen/setgid.c b/lib/libc4.3tahoe/gen/setgid.c new file mode 100644 index 0000000..bed8d8a --- /dev/null +++ b/lib/libc4.3tahoe/gen/setgid.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setgid.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Backwards compatible setgid. + */ +setgid(gid) + int gid; +{ + + return (setregid(gid, gid)); +} diff --git a/lib/libc4.3tahoe/gen/setjmperr.c b/lib/libc4.3tahoe/gen/setjmperr.c new file mode 100644 index 0000000..f3ad7c6 --- /dev/null +++ b/lib/libc4.3tahoe/gen/setjmperr.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setjmperr.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +/* + * This routine is called from longjmp() when an error occurs. + * Programs that wish to exit gracefully from this error may + * write their own versions. + * If this routine returns, the program is aborted. + */ + +longjmperror() +{ +#define ERRMSG "longjmp botch\n" + write(2, ERRMSG, sizeof(ERRMSG) - 1); +} diff --git a/lib/libc4.3tahoe/gen/setrgid.c b/lib/libc4.3tahoe/gen/setrgid.c new file mode 100644 index 0000000..c5c38cf --- /dev/null +++ b/lib/libc4.3tahoe/gen/setrgid.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setrgid.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +setrgid(rgid) + int rgid; +{ + + return (setregid(rgid, -1)); +} diff --git a/lib/libc4.3tahoe/gen/setruid.c b/lib/libc4.3tahoe/gen/setruid.c new file mode 100644 index 0000000..49a4a79 --- /dev/null +++ b/lib/libc4.3tahoe/gen/setruid.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setruid.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +setruid(ruid) + int ruid; +{ + + return (setreuid(ruid, -1)); +} diff --git a/lib/libc4.3tahoe/gen/setuid.c b/lib/libc4.3tahoe/gen/setuid.c new file mode 100644 index 0000000..3e33294 --- /dev/null +++ b/lib/libc4.3tahoe/gen/setuid.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setuid.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Backwards compatible setuid. + */ +setuid(uid) + int uid; +{ + + return (setreuid(uid, uid)); +} diff --git a/lib/libc4.3tahoe/gen/siginterrupt.c b/lib/libc4.3tahoe/gen/siginterrupt.c new file mode 100644 index 0000000..ecbeff5 --- /dev/null +++ b/lib/libc4.3tahoe/gen/siginterrupt.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)siginterrupt.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +/* + * Set signal state to prevent restart of system calls + * after an instance of the indicated signal. + */ +siginterrupt(sig, flag) + int sig, flag; +{ + struct sigvec sv; + int ret; + + if ((ret = sigvec(sig, 0, &sv)) < 0) + return (ret); + if (flag) + sv.sv_flags |= SV_INTERRUPT; + else + sv.sv_flags &= ~SV_INTERRUPT; + return (sigvec(sig, &sv, 0)); +} diff --git a/lib/libc4.3tahoe/gen/siglist.c b/lib/libc4.3tahoe/gen/siglist.c new file mode 100644 index 0000000..276e5fc --- /dev/null +++ b/lib/libc4.3tahoe/gen/siglist.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)siglist.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +char *sys_siglist[NSIG] = { + "Signal 0", + "Hangup", /* SIGHUP */ + "Interrupt", /* SIGINT */ + "Quit", /* SIGQUIT */ + "Illegal instruction", /* SIGILL */ + "Trace/BPT trap", /* SIGTRAP */ + "IOT trap", /* SIGIOT */ + "EMT trap", /* SIGEMT */ + "Floating point exception", /* SIGFPE */ + "Killed", /* SIGKILL */ + "Bus error", /* SIGBUS */ + "Segmentation fault", /* SIGSEGV */ + "Bad system call", /* SIGSYS */ + "Broken pipe", /* SIGPIPE */ + "Alarm clock", /* SIGALRM */ + "Terminated", /* SIGTERM */ + "Urgent I/O condition", /* SIGURG */ + "Stopped (signal)", /* SIGSTOP */ + "Stopped", /* SIGTSTP */ + "Continued", /* SIGCONT */ + "Child exited", /* SIGCHLD */ + "Stopped (tty input)", /* SIGTTIN */ + "Stopped (tty output)", /* SIGTTOU */ + "I/O possible", /* SIGIO */ + "Cputime limit exceeded", /* SIGXCPU */ + "Filesize limit exceeded", /* SIGXFSZ */ + "Virtual timer expired", /* SIGVTALRM */ + "Profiling timer expired", /* SIGPROF */ + "Window size changes", /* SIGWINCH */ + "Signal 29", + "User defined signal 1", /* SIGUSR1 */ + "User defined signal 2" /* SIGUSR2 */ +}; diff --git a/lib/libc4.3tahoe/gen/signal.c b/lib/libc4.3tahoe/gen/signal.c new file mode 100644 index 0000000..7c0710a --- /dev/null +++ b/lib/libc4.3tahoe/gen/signal.c @@ -0,0 +1,36 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)signal.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Almost backwards compatible signal. + */ +#include + +int (* +signal(s, a))() + int s, (*a)(); +{ + struct sigvec osv, sv; + static int mask[NSIG]; + static int flags[NSIG]; + + sv.sv_handler = a; + sv.sv_mask = mask[s]; + sv.sv_flags = flags[s]; + if (sigvec(s, &sv, &osv) < 0) + return (BADSIG); + if (sv.sv_mask != osv.sv_mask || sv.sv_flags != osv.sv_flags) { + mask[s] = sv.sv_mask = osv.sv_mask; + flags[s] = sv.sv_flags = osv.sv_flags; + if (sigvec(s, &sv, 0) < 0) + return (BADSIG); + } + return (osv.sv_handler); +} diff --git a/lib/libc4.3tahoe/gen/sleep.c b/lib/libc4.3tahoe/gen/sleep.c new file mode 100644 index 0000000..e5c208d --- /dev/null +++ b/lib/libc4.3tahoe/gen/sleep.c @@ -0,0 +1,67 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)sleep.c 5.3 (Berkeley) 9/30/87"; +#endif LIBC_SCCS and not lint + +#include +#include + +#define setvec(vec, a) \ + vec.sv_handler = a; vec.sv_mask = vec.sv_onstack = 0 + +static int ringring; + +sleep(n) + unsigned n; +{ + int sleepx(); + long omask; + struct itimerval itv, oitv; + register struct itimerval *itp = &itv; + struct sigvec vec, ovec; + + if (n == 0) + return; + timerclear(&itp->it_interval); + timerclear(&itp->it_value); + if (setitimer(ITIMER_REAL, itp, &oitv) < 0) + return; + itp->it_value.tv_sec = n; + if (timerisset(&oitv.it_value)) { + if (timercmp(&oitv.it_value, &itp->it_value, >)) + oitv.it_value.tv_sec -= itp->it_value.tv_sec; + else { + itp->it_value = oitv.it_value; + /* + * This is a hack, but we must have time to + * return from the setitimer after the alarm + * or else it'll be restarted. And, anyway, + * sleep never did anything more than this before. + */ + oitv.it_value.tv_sec = 1; + oitv.it_value.tv_usec = 0; + } + } + setvec(vec, sleepx); + (void) sigvec(SIGALRM, &vec, &ovec); + omask = sigblock(sigmask(SIGALRM)); + ringring = 0; + (void) setitimer(ITIMER_REAL, itp, (struct itimerval *)0); + while (!ringring) + sigpause(omask &~ sigmask(SIGALRM)); + (void) sigvec(SIGALRM, &ovec, (struct sigvec *)0); + (void) sigsetmask(omask); + (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0); +} + +static +sleepx() +{ + + ringring = 1; +} diff --git a/lib/libc4.3tahoe/gen/strcasecmp.c b/lib/libc4.3tahoe/gen/strcasecmp.c new file mode 100644 index 0000000..2c57c85 --- /dev/null +++ b/lib/libc4.3tahoe/gen/strcasecmp.c @@ -0,0 +1,89 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strcasecmp.c 5.6 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +/* + * This array is designed for mapping upper and lower case letter + * together for a case independent comparison. The mappings are + * based upon ascii character sequences. + */ +static u_char charmap[] = { + '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', + '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', + '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', + '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', + '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', + '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', + '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', + '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', + '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', + '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', + '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', + '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', + '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', + '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', + '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', + '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', + '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', + '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', + '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', + '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', + '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', + '\300', '\341', '\342', '\343', '\344', '\345', '\346', '\347', + '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', + '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', + '\370', '\371', '\372', '\333', '\334', '\335', '\336', '\337', + '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', + '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', + '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', +}; + +strcasecmp(s1, s2) + char *s1, *s2; +{ + register u_char *cm = charmap, + *us1 = (u_char *)s1, + *us2 = (u_char *)s2; + + while (cm[*us1] == cm[*us2++]) + if (*us1++ == '\0') + return(0); + return(cm[*us1] - cm[*--us2]); +} + +strncasecmp(s1, s2, n) + char *s1, *s2; + register int n; +{ + register u_char *cm = charmap, + *us1 = (u_char *)s1, + *us2 = (u_char *)s2; + + while (--n >= 0 && cm[*us1] == cm[*us2++]) + if (*us1++ == '\0') + return(0); + return(n < 0 ? 0 : cm[*us1] - cm[*--us2]); +} diff --git a/lib/libc4.3tahoe/gen/strcat.c b/lib/libc4.3tahoe/gen/strcat.c new file mode 100644 index 0000000..6030ccc --- /dev/null +++ b/lib/libc4.3tahoe/gen/strcat.c @@ -0,0 +1,23 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strcat.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Concatenate s2 on the end of s1. S1's space must be large enough. + * Return s1. + */ + +char * +strcat(s1, s2) +register char *s1, *s2; +{ + register char *os1; + + os1 = s1; + while (*s1++) + ; + --s1; + while (*s1++ = *s2++) + ; + return(os1); +} diff --git a/lib/libc4.3tahoe/gen/strcmp.c b/lib/libc4.3tahoe/gen/strcmp.c new file mode 100644 index 0000000..cd152f2 --- /dev/null +++ b/lib/libc4.3tahoe/gen/strcmp.c @@ -0,0 +1,17 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strcmp.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Compare strings: s1>s2: >0 s1==s2: 0 s1s2: >0 s1==s2: 0 s1= 0 && *s1 == *s2++) + if (*s1++ == '\0') + return(0); + return(n<0 ? 0 : *s1 - *--s2); +} diff --git a/lib/libc4.3tahoe/gen/strncpy.c b/lib/libc4.3tahoe/gen/strncpy.c new file mode 100644 index 0000000..40be252 --- /dev/null +++ b/lib/libc4.3tahoe/gen/strncpy.c @@ -0,0 +1,25 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)strncpy.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Copy s2 to s1, truncating or null-padding to always copy n bytes + * return s1 + */ + +char * +strncpy(s1, s2, n) +register char *s1, *s2; +{ + register i; + register char *os1; + + os1 = s1; + for (i = 0; i < n; i++) + if ((*s1++ = *s2++) == '\0') { + while (++i < n) + *s1++ = '\0'; + return(os1); + } + return(os1); +} diff --git a/lib/libc4.3tahoe/gen/swab.c b/lib/libc4.3tahoe/gen/swab.c new file mode 100644 index 0000000..07c447b --- /dev/null +++ b/lib/libc4.3tahoe/gen/swab.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)swab.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +/* + * Swab bytes + * Jeffrey Mogul, Stanford + */ + +swab(from, to, n) + register char *from, *to; + register int n; +{ + register unsigned long temp; + + n >>= 1; n++; +#define STEP temp = *from++,*to++ = *from++,*to++ = temp + /* round to multiple of 8 */ + while ((--n) & 07) + STEP; + n >>= 3; + while (--n >= 0) { + STEP; STEP; STEP; STEP; + STEP; STEP; STEP; STEP; + } +} diff --git a/lib/libc4.3tahoe/gen/syslog.c b/lib/libc4.3tahoe/gen/syslog.c new file mode 100644 index 0000000..08c3ceb --- /dev/null +++ b/lib/libc4.3tahoe/gen/syslog.c @@ -0,0 +1,213 @@ +/* + * Copyright (c) 1983, 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)syslog.c 5.16 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +/* + * 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 /etc/syslogd. + * + * Author: Eric Allman + * Modified to use UNIX domain IPC by Ralph Campbell + */ + +#include +#include +#include +#include +#include +#include +#include + +#define MAXLINE 1024 /* max message size */ +#define NULL 0 /* manifest */ + +#define IMPORTANT LOG_ERR + +static char logname[] = "/dev/log"; +static char ctty[] = "/dev/console"; + +static int LogFile = -1; /* fd for log */ +static int connected; /* have done connect */ +static int LogStat = 0; /* status bits, set by openlog() */ +static char *LogTag = "syslog"; /* string to tag the entry with */ +static int LogMask = 0xff; /* mask of priorities to be logged */ +static int LogFacility = LOG_USER; /* default facility code */ + +static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */ + +extern int errno, sys_nerr; +extern char *sys_errlist[]; + +syslog(pri, fmt, p0, p1, p2, p3, p4) + int pri; + char *fmt; +{ + char buf[MAXLINE + 1], outline[MAXLINE + 1]; + register char *b, *f, *o; + register int c; + long now; + int pid, olderrno = errno; + + /* see if we should just throw out this message */ + if ((unsigned) LOG_FAC(pri) >= LOG_NFACILITIES || + LOG_MASK(LOG_PRI(pri)) == 0 || + (pri &~ (LOG_PRIMASK|LOG_FACMASK)) != 0) + return; + if (LogFile < 0 || !connected) + openlog(LogTag, LogStat | LOG_NDELAY, 0); + + /* set default facility if none specified */ + if ((pri & LOG_FACMASK) == 0) + pri |= LogFacility; + + /* build the message */ + o = outline; + (void)sprintf(o, "<%d>", pri); + o += strlen(o); + time(&now); + (void)sprintf(o, "%.15s ", ctime(&now) + 4); + o += strlen(o); + if (LogTag) { + strcpy(o, LogTag); + o += strlen(o); + } + if (LogStat & LOG_PID) { + (void)sprintf(o, "[%d]", getpid()); + o += strlen(o); + } + if (LogTag) { + strcpy(o, ": "); + o += 2; + } + + b = buf; + f = fmt; + while ((c = *f++) != '\0' && c != '\n' && b < &buf[MAXLINE]) { + if (c != '%') { + *b++ = c; + continue; + } + if ((c = *f++) != 'm') { + *b++ = '%'; + *b++ = c; + continue; + } + if ((unsigned)olderrno > sys_nerr) + (void)sprintf(b, "error %d", olderrno); + else + strcpy(b, sys_errlist[olderrno]); + b += strlen(b); + } + *b++ = '\n'; + *b = '\0'; + (void)sprintf(o, buf, p0, p1, p2, p3, p4); + c = strlen(outline); + if (c > MAXLINE) + c = MAXLINE; + + /* output the message to the local logger */ + if (send(LogFile, outline, c, 0) >= 0) + return; + if (!(LogStat & LOG_CONS)) + return; + + /* output the message to the console */ + pid = vfork(); + if (pid == -1) + return; + if (pid == 0) { + int fd; + + signal(SIGALRM, SIG_DFL); + sigsetmask(sigblock(0L) & ~sigmask(SIGALRM)); + alarm(5); + fd = open(ctty, O_WRONLY); + alarm(0); + strcat(o, "\r"); + o = index(outline, '>') + 1; + write(fd, o, c + 1 - (o - outline)); + close(fd); + _exit(0); + } + if (!(LogStat & LOG_NOWAIT)) + while ((c = wait((int *)0)) > 0 && c != pid) + ; +} + +/* + * OPENLOG -- open system log + */ + +openlog(ident, logstat, logfac) + char *ident; + int logstat, logfac; +{ + if (ident != NULL) + LogTag = ident; + LogStat = logstat; + if (logfac != 0 && (logfac &~ LOG_FACMASK) == 0) + LogFacility = logfac; + if (LogFile == -1) { + SyslogAddr.sa_family = AF_UNIX; + strncpy(SyslogAddr.sa_data, logname, sizeof SyslogAddr.sa_data); + if (LogStat & LOG_NDELAY) { + LogFile = socket(AF_UNIX, SOCK_DGRAM, 0); + fcntl(LogFile, F_SETFD, 1); + } + } + if (LogFile != -1 && !connected && + connect(LogFile, &SyslogAddr, sizeof(SyslogAddr)) != -1) + connected = 1; +} + +/* + * CLOSELOG -- close the system log + */ + +closelog() +{ + + (void) close(LogFile); + LogFile = -1; + connected = 0; +} + +/* + * SETLOGMASK -- set the log mask level + */ +setlogmask(pmask) + int pmask; +{ + int omask; + + omask = LogMask; + if (pmask != 0) + LogMask = pmask; + return (omask); +} diff --git a/lib/libc4.3tahoe/gen/system.c b/lib/libc4.3tahoe/gen/system.c new file mode 100644 index 0000000..b8cc181 --- /dev/null +++ b/lib/libc4.3tahoe/gen/system.c @@ -0,0 +1,26 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)system.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +system(s) +char *s; +{ + int status, pid, w; + register int (*istat)(), (*qstat)(); + + if ((pid = vfork()) == 0) { + execl("/bin/sh", "sh", "-c", s, 0); + _exit(127); + } + istat = signal(SIGINT, SIG_IGN); + qstat = signal(SIGQUIT, SIG_IGN); + while ((w = wait(&status)) != pid && w != -1) + ; + if (w == -1) + status = -1; + signal(SIGINT, istat); + signal(SIGQUIT, qstat); + return(status); +} diff --git a/lib/libc4.3tahoe/gen/telldir.c b/lib/libc4.3tahoe/gen/telldir.c new file mode 100644 index 0000000..167fa41 --- /dev/null +++ b/lib/libc4.3tahoe/gen/telldir.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)telldir.c 5.3 (Berkeley) 6/18/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +/* + * return a pointer into a directory + */ +long +telldir(dirp) + DIR *dirp; +{ + extern long lseek(); + + return (lseek(dirp->dd_fd, 0L, 1) - dirp->dd_size + dirp->dd_loc); +} diff --git a/lib/libc4.3tahoe/gen/time.c b/lib/libc4.3tahoe/gen/time.c new file mode 100644 index 0000000..49eeb8d --- /dev/null +++ b/lib/libc4.3tahoe/gen/time.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)time.c 5.3 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Backwards compatible time call. + */ +#include +#include + +long +time(t) + time_t *t; +{ + struct timeval tt; + + if (gettimeofday(&tt, (struct timezone *)0) < 0) + return (-1); + if (t) + *t = tt.tv_sec; + return (tt.tv_sec); +} diff --git a/lib/libc4.3tahoe/gen/timezone.c b/lib/libc4.3tahoe/gen/timezone.c new file mode 100644 index 0000000..5171b02 --- /dev/null +++ b/lib/libc4.3tahoe/gen/timezone.c @@ -0,0 +1,115 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)timezone.c 5.8 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include + +/* + * timezone -- + * The arguments are the number of minutes of time you are westward + * from Greenwich and whether DST is in effect. It returns a string + * giving the name of the local timezone. Should be replaced, in the + * application code, by a call to localtime. + */ + +static char czone[TZ_MAX_CHARS]; /* space for zone name */ + +char * +timezone(zone, dst) + int zone, + dst; +{ + register char *beg, + *end; + char *getenv(), *index(), *strncpy(), *_tztab(); + + if (beg = getenv("TZNAME")) { /* set in environment */ + if (end = index(beg, ',')) { /* "PST,PDT" */ + if (dst) + return(++end); + *end = '\0'; + (void)strncpy(czone,beg,sizeof(czone) - 1); + czone[sizeof(czone) - 1] = '\0'; + *end = ','; + return(czone); + } + return(beg); + } + return(_tztab(zone,dst)); /* default: table or created zone */ +} + +static struct zone { + int offset; + char *stdzone; + char *dlzone; +} zonetab[] = { + -1*60, "MET", "MET DST", /* Middle European */ + -2*60, "EET", "EET DST", /* Eastern European */ + 4*60, "AST", "ADT", /* Atlantic */ + 5*60, "EST", "EDT", /* Eastern */ + 6*60, "CST", "CDT", /* Central */ + 7*60, "MST", "MDT", /* Mountain */ + 8*60, "PST", "PDT", /* Pacific */ +#ifdef notdef + /* there's no way to distinguish this from WET */ + 0, "GMT", 0, /* Greenwich */ +#endif + 0*60, "WET", "WET DST", /* Western European */ + -10*60, "EST", "EST", /* Aust: Eastern */ + -10*60+30, "CST", "CST", /* Aust: Central */ + -8*60, "WST", 0, /* Aust: Western */ + -1 +}; + +/* + * _tztab -- + * check static tables or create a new zone name; broken out so that + * we can make a guess as to what the zone is if the standard tables + * aren't in place in /etc. DO NOT USE THIS ROUTINE OUTSIDE OF THE + * STANDARD LIBRARY. + */ +char * +_tztab(zone,dst) + register int zone; + int dst; +{ + register struct zone *zp; + register char sign; + + for (zp = zonetab; zp->offset != -1;++zp) /* static tables */ + if (zp->offset == zone) { + if (dst && zp->dlzone) + return(zp->dlzone); + if (!dst && zp->stdzone) + return(zp->stdzone); + } + + if (zone < 0) { /* create one */ + zone = -zone; + sign = '+'; + } + else + sign = '-'; + (void)sprintf(czone,"GMT%c%d:%02d",sign,zone / 60,zone % 60); + return(czone); +} diff --git a/lib/libc4.3tahoe/gen/ttyname.c b/lib/libc4.3tahoe/gen/ttyname.c new file mode 100644 index 0000000..9fd0c91 --- /dev/null +++ b/lib/libc4.3tahoe/gen/ttyname.c @@ -0,0 +1,51 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ttyname.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * ttyname(f): return "/dev/ttyXX" which the the name of the + * tty belonging to file f. + * NULL if it is not a tty + */ + +#define NULL 0 +#include +#include +#include + +static char dev[] = "/dev/"; +char *strcpy(); +char *strcat(); + +char * +ttyname(f) +{ + struct stat fsb; + struct stat tsb; + register struct direct *db; + register DIR *df; + static char rbuf[32]; + + if (isatty(f)==0) + return(NULL); + if (fstat(f, &fsb) < 0) + return(NULL); + if ((fsb.st_mode&S_IFMT) != S_IFCHR) + return(NULL); + if ((df = opendir(dev)) == NULL) + return(NULL); + while ((db = readdir(df)) != NULL) { + if (db->d_ino != fsb.st_ino) + continue; + strcpy(rbuf, dev); + strcat(rbuf, db->d_name); + if (stat(rbuf, &tsb) < 0) + continue; + if (tsb.st_dev == fsb.st_dev && tsb.st_ino == fsb.st_ino) { + closedir(df); + return(rbuf); + } + } + closedir(df); + return(NULL); +} diff --git a/lib/libc4.3tahoe/gen/ttyslot.c b/lib/libc4.3tahoe/gen/ttyslot.c new file mode 100644 index 0000000..e8ba04f --- /dev/null +++ b/lib/libc4.3tahoe/gen/ttyslot.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 1984 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ttyslot.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Return the number of the slot in the utmp file + * corresponding to the current user: try for file 0, 1, 2. + * Definition is the line number in the /etc/ttys file. + */ +#include + +char *ttyname(); +char *rindex(); + +#define NULL 0 + +ttyslot() +{ + register struct ttyent *ty; + register char *tp, *p; + register s; + + if ((tp = ttyname(0)) == NULL && + (tp = ttyname(1)) == NULL && + (tp = ttyname(2)) == NULL) + return(0); + if ((p = rindex(tp, '/')) == NULL) + p = tp; + else + p++; + setttyent(); + s = 0; + while ((ty = getttyent()) != NULL) { + s++; + if (strcmp(ty->ty_name, p) == 0) { + endttyent(); + return (s); + } + } + endttyent(); + return (0); +} diff --git a/lib/libc4.3tahoe/gen/ualarm.c b/lib/libc4.3tahoe/gen/ualarm.c new file mode 100644 index 0000000..6f14494 --- /dev/null +++ b/lib/libc4.3tahoe/gen/ualarm.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ualarm.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +#define USPS 1000000 /* # of microseconds in a second */ + +/* + * Generate a SIGALRM signal in ``usecs'' microseconds. + * If ``reload'' is non-zero, keep generating SIGALRM + * every ``reload'' microseconds after the first signal. + */ +unsigned +ualarm(usecs, reload) + register unsigned usecs; + register unsigned reload; +{ + struct itimerval new, old; + + new.it_interval.tv_usec = reload % USPS; + new.it_interval.tv_sec = reload / USPS; + + new.it_value.tv_usec = usecs % USPS; + new.it_value.tv_sec = usecs / USPS; + + if (setitimer(ITIMER_REAL, &new, &old) == 0) + return (old.it_value.tv_sec * USPS + old.it_value.tv_usec); + /* else */ + return (-1); +} diff --git a/lib/libc4.3tahoe/gen/usleep.c b/lib/libc4.3tahoe/gen/usleep.c new file mode 100644 index 0000000..17edf0f --- /dev/null +++ b/lib/libc4.3tahoe/gen/usleep.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)usleep.c 5.3 (Berkeley) 9/30/87"; +#endif LIBC_SCCS and not lint + +#include +#include + +#define USPS 1000000 /* number of microseconds in a second */ +#define TICK 10000 /* system clock resolution in microseconds */ + +#define setvec(vec, a) \ + vec.sv_handler = a; vec.sv_mask = vec.sv_onstack = 0 + +static int ringring; + +usleep(n) + unsigned n; +{ + int sleepx(); + long omask; + struct itimerval itv, oitv; + register struct itimerval *itp = &itv; + struct sigvec vec, ovec; + + if (n == 0) + return; + timerclear(&itp->it_interval); + timerclear(&itp->it_value); + if (setitimer(ITIMER_REAL, itp, &oitv) < 0) + return; + itp->it_value.tv_sec = n / USPS; + itp->it_value.tv_usec = n % USPS; + if (timerisset(&oitv.it_value)) { + if (timercmp(&oitv.it_value, &itp->it_value, >)) { + oitv.it_value.tv_sec -= itp->it_value.tv_sec; + oitv.it_value.tv_usec -= itp->it_value.tv_usec; + if (oitv.it_value.tv_usec < 0) { + oitv.it_value.tv_usec += USPS; + oitv.it_value.tv_sec--; + } + } else { + itp->it_value = oitv.it_value; + oitv.it_value.tv_sec = 0; + oitv.it_value.tv_usec = 2 * TICK; + } + } + setvec(vec, sleepx); + (void) sigvec(SIGALRM, &vec, &ovec); + omask = sigblock(sigmask(SIGALRM)); + ringring = 0; + (void) setitimer(ITIMER_REAL, itp, (struct itimerval *)0); + while (!ringring) + sigpause(omask &~ sigmask(SIGALRM)); + (void) sigvec(SIGALRM, &ovec, (struct sigvec *)0); + (void) sigsetmask(omask); + (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0); +} + +static +sleepx() +{ + + ringring = 1; +} diff --git a/lib/libc4.3tahoe/gen/valloc.c b/lib/libc4.3tahoe/gen/valloc.c new file mode 100644 index 0000000..1388d1d --- /dev/null +++ b/lib/libc4.3tahoe/gen/valloc.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)valloc.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +char *malloc(); + +char * +valloc(i) + int i; +{ + int valsiz = getpagesize(), j; + char *cp = malloc(i + (valsiz-1)); + + j = ((int)cp + (valsiz-1)) &~ (valsiz-1); + return ((char *)j); +} diff --git a/lib/libc4.3tahoe/inet/.MAP b/lib/libc4.3tahoe/inet/.MAP new file mode 100644 index 0000000..373cc02 --- /dev/null +++ b/lib/libc4.3tahoe/inet/.MAP @@ -0,0 +1,8 @@ +F INET_ADD.C;1 inet_addr.c +F INET_LNA.C;1 inet_lnaof.c +F INET_MAK.C;1 inet_makeaddr.c +F INET_NET.000;1 inet_network.c +F INET_NET.C;1 inet_netof.c +F INET_NTO.C;1 inet_ntoa.c +F MAKEFILE.;1 Makefile +D PROFILED profiled diff --git a/lib/libc4.3tahoe/inet/Makefile b/lib/libc4.3tahoe/inet/Makefile new file mode 100644 index 0000000..1294778 --- /dev/null +++ b/lib/libc4.3tahoe/inet/Makefile @@ -0,0 +1,67 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.8 (Berkeley) 6/27/88 +# +DEFS= -DLIBC_SCCS +CFLAGS= -O ${DEFS} +SRCS= inet_addr.c inet_network.c inet_netof.c inet_ntoa.c inet_lnaof.c \ + inet_makeaddr.c +OBJS= inet_addr.o inet_network.o inet_netof.o inet_ntoa.o inet_lnaof.o \ + inet_makeaddr.o +TAGSFILE=tags + +.c.o: + @${CC} -p -c ${CFLAGS} $*.c + @-ld -X -o profiled/$*.o -r $*.o + ${CC} ${CFLAGS} -c $*.c + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../library; rm -f ${OBJS}) + (cd ../profiled; rm -f ${OBJS}) + ln ${OBJS} ../library + (cd profiled; ln ${OBJS} ../../profiled) + +tags: + cwd=`pwd`; \ + for i in ${SRCS}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +inet_addr.o: inet_addr.c /usr/include/sys/types.h /usr/include/ctype.h +inet_addr.o: /usr/include/netinet/in.h +inet_network.o: inet_network.c /usr/include/sys/types.h +inet_network.o: /usr/include/netinet/in.h /usr/include/ctype.h +inet_netof.o: inet_netof.c /usr/include/sys/types.h /usr/include/netinet/in.h +inet_ntoa.o: inet_ntoa.c /usr/include/sys/types.h /usr/include/netinet/in.h +inet_lnaof.o: inet_lnaof.c /usr/include/sys/types.h /usr/include/netinet/in.h +inet_makeaddr.o: inet_makeaddr.c /usr/include/sys/types.h +inet_makeaddr.o: /usr/include/netinet/in.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/inet/inet_addr.c b/lib/libc4.3tahoe/inet/inet_addr.c new file mode 100644 index 0000000..6d97c1b --- /dev/null +++ b/lib/libc4.3tahoe/inet/inet_addr.c @@ -0,0 +1,115 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)inet_addr.c 5.6 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include + +/* + * Internet address interpretation routine. + * All the network library routines call this + * routine to interpret entries in the data bases + * which are expected to be an address. + * The value returned is in network order. + */ +u_long +inet_addr(cp) + register char *cp; +{ + register u_long val, base, n; + register char c; + u_long parts[4], *pp = parts; + +again: + /* + * Collect number up to ``.''. + * Values are specified as for C: + * 0x=hex, 0=octal, other=decimal. + */ + val = 0; base = 10; + if (*cp == '0') { + if (*++cp == 'x' || *cp == 'X') + base = 16, cp++; + else + base = 8; + } + while (c = *cp) { + if (isdigit(c)) { + val = (val * base) + (c - '0'); + cp++; + continue; + } + if (base == 16 && isxdigit(c)) { + val = (val << 4) + (c + 10 - (islower(c) ? 'a' : 'A')); + cp++; + continue; + } + break; + } + if (*cp == '.') { + /* + * Internet format: + * a.b.c.d + * a.b.c (with c treated as 16-bits) + * a.b (with b treated as 24 bits) + */ + if (pp >= parts + 4) + return (INADDR_NONE); + *pp++ = val, cp++; + goto again; + } + /* + * Check for trailing characters. + */ + if (*cp && !isspace(*cp)) + return (INADDR_NONE); + *pp++ = val; + /* + * Concoct the address according to + * the number of parts specified. + */ + n = pp - parts; + switch (n) { + + case 1: /* a -- 32 bits */ + val = parts[0]; + break; + + case 2: /* a.b -- 8.24 bits */ + val = (parts[0] << 24) | (parts[1] & 0xffffff); + break; + + case 3: /* a.b.c -- 8.8.16 bits */ + val = (parts[0] << 24) | ((parts[1] & 0xff) << 16) | + (parts[2] & 0xffff); + break; + + case 4: /* a.b.c.d -- 8.8.8.8 bits */ + val = (parts[0] << 24) | ((parts[1] & 0xff) << 16) | + ((parts[2] & 0xff) << 8) | (parts[3] & 0xff); + break; + + default: + return (INADDR_NONE); + } + val = htonl(val); + return (val); +} diff --git a/lib/libc4.3tahoe/inet/inet_lnaof.c b/lib/libc4.3tahoe/inet/inet_lnaof.c new file mode 100644 index 0000000..452ec95 --- /dev/null +++ b/lib/libc4.3tahoe/inet/inet_lnaof.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)inet_lnaof.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +/* + * Return the local network address portion of an + * internet address; handles class a/b/c network + * number formats. + */ +u_long +inet_lnaof(in) + struct in_addr in; +{ + register u_long i = ntohl(in.s_addr); + + if (IN_CLASSA(i)) + return ((i)&IN_CLASSA_HOST); + else if (IN_CLASSB(i)) + return ((i)&IN_CLASSB_HOST); + else + return ((i)&IN_CLASSC_HOST); +} diff --git a/lib/libc4.3tahoe/inet/inet_makeaddr.c b/lib/libc4.3tahoe/inet/inet_makeaddr.c new file mode 100644 index 0000000..7f5f7dc --- /dev/null +++ b/lib/libc4.3tahoe/inet/inet_makeaddr.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)inet_makeaddr.c 5.3 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +/* + * Formulate an Internet address from network + host. Used in + * building addresses stored in the ifnet structure. + */ +struct in_addr +inet_makeaddr(net, host) + int net, host; +{ + u_long addr; + + if (net < 128) + addr = (net << IN_CLASSA_NSHIFT) | (host & IN_CLASSA_HOST); + else if (net < 65536) + addr = (net << IN_CLASSB_NSHIFT) | (host & IN_CLASSB_HOST); + else + addr = (net << IN_CLASSC_NSHIFT) | (host & IN_CLASSC_HOST); + addr = htonl(addr); + return (*(struct in_addr *)&addr); +} diff --git a/lib/libc4.3tahoe/inet/inet_netof.c b/lib/libc4.3tahoe/inet/inet_netof.c new file mode 100644 index 0000000..2e8ed07 --- /dev/null +++ b/lib/libc4.3tahoe/inet/inet_netof.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)inet_netof.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +/* + * Return the network number from an internet + * address; handles class a/b/c network #'s. + */ +u_long +inet_netof(in) + struct in_addr in; +{ + register u_long i = ntohl(in.s_addr); + + if (IN_CLASSA(i)) + return (((i)&IN_CLASSA_NET) >> IN_CLASSA_NSHIFT); + else if (IN_CLASSB(i)) + return (((i)&IN_CLASSB_NET) >> IN_CLASSB_NSHIFT); + else + return (((i)&IN_CLASSC_NET) >> IN_CLASSC_NSHIFT); +} diff --git a/lib/libc4.3tahoe/inet/inet_network.c b/lib/libc4.3tahoe/inet/inet_network.c new file mode 100644 index 0000000..a87aa8c --- /dev/null +++ b/lib/libc4.3tahoe/inet/inet_network.c @@ -0,0 +1,76 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)inet_network.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include + +/* + * Internet network address interpretation routine. + * The library routines call this routine to interpret + * network numbers. + */ +u_long +inet_network(cp) + register char *cp; +{ + register u_long val, base, n; + register char c; + u_long parts[4], *pp = parts; + register int i; + +again: + val = 0; base = 10; + if (*cp == '0') + base = 8, cp++; + if (*cp == 'x' || *cp == 'X') + base = 16, cp++; + while (c = *cp) { + if (isdigit(c)) { + val = (val * base) + (c - '0'); + cp++; + continue; + } + if (base == 16 && isxdigit(c)) { + val = (val << 4) + (c + 10 - (islower(c) ? 'a' : 'A')); + cp++; + continue; + } + break; + } + if (*cp == '.') { + if (pp >= parts + 4) + return (INADDR_NONE); + *pp++ = val, cp++; + goto again; + } + if (*cp && !isspace(*cp)) + return (INADDR_NONE); + *pp++ = val; + n = pp - parts; + if (n > 4) + return (INADDR_NONE); + for (val = 0, i = 0; i < n; i++) { + val <<= 8; + val |= parts[i] & 0xff; + } + return (val); +} diff --git a/lib/libc4.3tahoe/inet/inet_ntoa.c b/lib/libc4.3tahoe/inet/inet_ntoa.c new file mode 100644 index 0000000..ccea501 --- /dev/null +++ b/lib/libc4.3tahoe/inet/inet_ntoa.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)inet_ntoa.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +/* + * Convert network-format internet address + * to base 256 d.d.d.d representation. + */ +#include +#include + +char * +inet_ntoa(in) + struct in_addr in; +{ + static char b[18]; + register char *p; + + p = (char *)∈ +#define UC(b) (((int)b)&0xff) + sprintf(b, "%d.%d.%d.%d", UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3])); + return (b); +} diff --git a/lib/libc4.3tahoe/inet/profiled/.MAP b/lib/libc4.3tahoe/inet/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/net/.MAP b/lib/libc4.3tahoe/net/.MAP new file mode 100644 index 0000000..30c3c0a --- /dev/null +++ b/lib/libc4.3tahoe/net/.MAP @@ -0,0 +1,26 @@ +F GETNETBY.000;1 getnetbyname.c +F GETNETBY.C;1 getnetbyaddr.c +F GETNETEN.C;1 getnetent.c +F GETPROTO.000;1 getprotoname.c +F GETPROTO.001;1 getprotoent.c +F GETPROTO.C;1 getproto.c +F GETSERVB.000;1 getservbyport.c +F GETSERVB.C;1 getservbyname.c +F GETSERVE.C;1 getservent.c +F HERROR.C;1 herror.c +D HOSTTABL hosttable +F MAKE.RES;1 Make.resolv +F MAKEFILE.;1 Makefile +D NAMED named +D NET.TAH net.tahoe +D NET.VAX net.vax +D PROFILED profiled +F RCMD.C;1 rcmd.c +F RES_COMP.C;1 res_comp.c +F RES_DEBU.C;1 res_debug.c +F RES_INIT.C;1 res_init.c +F RES_MKQU.C;1 res_mkquery.c +F RES_QUER.C;1 res_query.c +F RES_SEND.C;1 res_send.c +F REXEC.C;1 rexec.c +F RUSERPAS.C;1 ruserpass.c diff --git a/lib/libc4.3tahoe/net/Make.resolv b/lib/libc4.3tahoe/net/Make.resolv new file mode 100644 index 0000000..e7d471e --- /dev/null +++ b/lib/libc4.3tahoe/net/Make.resolv @@ -0,0 +1,83 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Make.resolv 5.2 (Berkeley) 7/9/88 +# +VPATH= named +SRCS= herror.c res_comp.c res_debug.c res_init.c res_mkquery.c res_send.c \ + gethostnamadr.c sethostent.c res_query.c +OBJS= herror.o res_comp.o res_debug.o res_init.o res_mkquery.o res_send.o \ + gethostnamadr.o sethostent.o res_query.o +CFLAGS= -O -DDEBUG + +.c.o: + ${CC} ${CFLAGS} -c $*.c + -ld -x -r $*.o + mv a.out $*.o + +all: clean libresolv.a FRC + +libresolv.a: ${OBJS} FRC + ar cru libresolv.a ${OBJS} + rm -f *.o errs core named/gethostnamadr.o named/sethostent.o + +install: FRC + install -o bin -g bin -m 644 libresolv.a ${DESTDIR}/usr/lib + ranlib ${DESTDIR}/usr/lib/libresolv.a + +clean: FRC + rm -f *.o errs core libresolv.a named/gethostnamadr.o \ + named/sethostent.o + +depend: ${SRCS} FRC + mkdep -f Make.resolv ${CFLAGS} ${SRCS} + +FRC: + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +herror.o: herror.c /usr/include/sys/types.h /usr/include/sys/uio.h +res_comp.o: res_comp.c /usr/include/sys/types.h /usr/include/stdio.h +res_comp.o: /usr/include/arpa/nameser.h +res_debug.o: res_debug.c /usr/include/sys/types.h /usr/include/netinet/in.h +res_debug.o: /usr/include/stdio.h /usr/include/arpa/nameser.h +res_init.o: res_init.c /usr/include/sys/types.h /usr/include/sys/socket.h +res_init.o: /usr/include/netinet/in.h /usr/include/stdio.h +res_init.o: /usr/include/arpa/nameser.h /usr/include/resolv.h +res_mkquery.o: res_mkquery.c /usr/include/stdio.h /usr/include/sys/types.h +res_mkquery.o: /usr/include/netinet/in.h /usr/include/arpa/nameser.h +res_mkquery.o: /usr/include/resolv.h +res_send.o: res_send.c /usr/include/sys/param.h /usr/include/sys/types.h +res_send.o: /usr/include/signal.h /usr/include/machine/trap.h +res_send.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +res_send.o: /usr/include/sys/time.h /usr/include/time.h +res_send.o: /usr/include/sys/socket.h /usr/include/sys/uio.h +res_send.o: /usr/include/netinet/in.h /usr/include/stdio.h /usr/include/errno.h +res_send.o: /usr/include/arpa/nameser.h /usr/include/resolv.h +gethostnamadr.o: named/gethostnamadr.c /usr/include/sys/param.h +gethostnamadr.o: /usr/include/sys/types.h /usr/include/signal.h +gethostnamadr.o: /usr/include/machine/trap.h /usr/include/machine/machparam.h +gethostnamadr.o: /usr/include/machine/endian.h /usr/include/sys/socket.h +gethostnamadr.o: /usr/include/netinet/in.h /usr/include/ctype.h +gethostnamadr.o: /usr/include/netdb.h /usr/include/stdio.h /usr/include/errno.h +gethostnamadr.o: /usr/include/arpa/inet.h /usr/include/arpa/nameser.h +gethostnamadr.o: /usr/include/resolv.h +sethostent.o: named/sethostent.c /usr/include/sys/types.h +sethostent.o: /usr/include/arpa/nameser.h /usr/include/netinet/in.h +sethostent.o: /usr/include/resolv.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/net/Makefile b/lib/libc4.3tahoe/net/Makefile new file mode 100644 index 0000000..a12488a --- /dev/null +++ b/lib/libc4.3tahoe/net/Makefile @@ -0,0 +1,119 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.19 (Berkeley) 6/27/88 +# +DEFS= -DLIBC_SCCS +CFLAGS= -O ${DEFS} +SRCS= getnetbyaddr.c getnetent.c getnetbyname.c getproto.c getprotoent.c \ + getprotoname.c getservent.c getservbyport.c getservbyname.c \ + herror.c rcmd.c rexec.c ruserpass.c res_comp.c res_debug.c \ + res_init.c res_mkquery.c res_query.c res_send.c +OBJS= getnetbyaddr.o getnetent.o getnetbyname.o getproto.o getprotoent.o \ + getprotoname.o getservent.o getservbyport.o getservbyname.o \ + herror.o rcmd.o rexec.o ruserpass.o res_comp.o res_debug.o \ + res_init.o res_mkquery.o res_query.o res_send.o +TAGSFILE=tags + +.c.o: + @${CC} -p -c ${CFLAGS} $*.c + @-ld -X -o profiled/$*.o -r $*.o + ${CC} ${CFLAGS} -c $*.c + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../library; rm -f ${OBJS}) + (cd ../profiled; rm -f ${OBJS}) + ln ${OBJS} ../library + (cd profiled; ln ${OBJS} ../../profiled) + +tags: + cwd=`pwd`; \ + for i in ${SRCS}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +getnetbyaddr.o: getnetbyaddr.c /usr/include/netdb.h +getnetent.o: getnetent.c /usr/include/stdio.h /usr/include/sys/types.h +getnetent.o: /usr/include/sys/socket.h /usr/include/netdb.h +getnetent.o: /usr/include/ctype.h +getnetbyname.o: getnetbyname.c /usr/include/netdb.h +getproto.o: getproto.c /usr/include/netdb.h +getprotoent.o: getprotoent.c /usr/include/stdio.h /usr/include/sys/types.h +getprotoent.o: /usr/include/sys/socket.h /usr/include/netdb.h +getprotoent.o: /usr/include/ctype.h +getprotoname.o: getprotoname.c /usr/include/netdb.h +getservent.o: getservent.c /usr/include/stdio.h /usr/include/sys/param.h +getservent.o: /usr/include/sys/types.h /usr/include/signal.h +getservent.o: /usr/include/machine/trap.h /usr/include/machine/machparam.h +getservent.o: /usr/include/machine/endian.h /usr/include/sys/types.h +getservent.o: /usr/include/sys/socket.h /usr/include/netdb.h +getservent.o: /usr/include/ctype.h +getservbyport.o: getservbyport.c /usr/include/netdb.h +getservbyname.o: getservbyname.c /usr/include/netdb.h +herror.o: herror.c /usr/include/sys/types.h /usr/include/sys/uio.h +rcmd.o: rcmd.c /usr/include/stdio.h /usr/include/ctype.h /usr/include/pwd.h +rcmd.o: /usr/include/sys/param.h /usr/include/sys/types.h /usr/include/signal.h +rcmd.o: /usr/include/machine/trap.h /usr/include/machine/machparam.h +rcmd.o: /usr/include/machine/endian.h /usr/include/sys/file.h +rcmd.o: /usr/include/sys/signal.h /usr/include/sys/socket.h +rcmd.o: /usr/include/sys/stat.h /usr/include/netinet/in.h /usr/include/netdb.h +rcmd.o: /usr/include/errno.h +rexec.o: rexec.c /usr/include/sys/types.h /usr/include/sys/socket.h +rexec.o: /usr/include/netinet/in.h /usr/include/stdio.h /usr/include/netdb.h +rexec.o: /usr/include/errno.h +ruserpass.o: ruserpass.c /usr/include/stdio.h /usr/include/utmp.h +ruserpass.o: /usr/include/ctype.h /usr/include/sys/types.h +ruserpass.o: /usr/include/sys/stat.h /usr/include/errno.h +res_comp.o: res_comp.c /usr/include/sys/types.h /usr/include/stdio.h +res_comp.o: /usr/include/arpa/nameser.h +res_debug.o: res_debug.c /usr/include/sys/types.h /usr/include/netinet/in.h +res_debug.o: /usr/include/stdio.h /usr/include/arpa/nameser.h +res_init.o: res_init.c /usr/include/sys/types.h /usr/include/sys/socket.h +res_init.o: /usr/include/netinet/in.h /usr/include/stdio.h +res_init.o: /usr/include/arpa/nameser.h /usr/include/resolv.h +res_mkquery.o: res_mkquery.c /usr/include/stdio.h /usr/include/sys/types.h +res_mkquery.o: /usr/include/netinet/in.h /usr/include/arpa/nameser.h +res_mkquery.o: /usr/include/resolv.h +res_query.o: res_query.c /usr/include/sys/param.h /usr/include/sys/types.h +res_query.o: /usr/include/signal.h /usr/include/machine/trap.h +res_query.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +res_query.o: /usr/include/sys/socket.h /usr/include/netinet/in.h +res_query.o: /usr/include/ctype.h /usr/include/netdb.h /usr/include/stdio.h +res_query.o: /usr/include/errno.h /usr/include/strings.h +res_query.o: /usr/include/arpa/inet.h /usr/include/arpa/nameser.h +res_query.o: /usr/include/resolv.h +res_send.o: res_send.c /usr/include/sys/param.h /usr/include/sys/types.h +res_send.o: /usr/include/signal.h /usr/include/machine/trap.h +res_send.o: /usr/include/machine/machparam.h /usr/include/machine/endian.h +res_send.o: /usr/include/sys/time.h /usr/include/time.h +res_send.o: /usr/include/sys/socket.h /usr/include/sys/uio.h +res_send.o: /usr/include/netinet/in.h /usr/include/stdio.h /usr/include/errno.h +res_send.o: /usr/include/arpa/nameser.h /usr/include/resolv.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/net/getnetbyaddr.c b/lib/libc4.3tahoe/net/getnetbyaddr.c new file mode 100644 index 0000000..9bcb166 --- /dev/null +++ b/lib/libc4.3tahoe/net/getnetbyaddr.c @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getnetbyaddr.c 5.6 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +extern int _net_stayopen; + +struct netent * +getnetbyaddr(net, type) + register long net; + register int type; +{ + register struct netent *p; + + setnetent(_net_stayopen); + while (p = getnetent()) + if (p->n_addrtype == type && p->n_net == net) + break; + if (!_net_stayopen) + endnetent(); + return (p); +} diff --git a/lib/libc4.3tahoe/net/getnetbyname.c b/lib/libc4.3tahoe/net/getnetbyname.c new file mode 100644 index 0000000..e107f95 --- /dev/null +++ b/lib/libc4.3tahoe/net/getnetbyname.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getnetbyname.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +extern int _net_stayopen; + +struct netent * +getnetbyname(name) + register char *name; +{ + register struct netent *p; + register char **cp; + + setnetent(_net_stayopen); + while (p = getnetent()) { + if (strcmp(p->n_name, name) == 0) + break; + for (cp = p->n_aliases; *cp != 0; cp++) + if (strcmp(*cp, name) == 0) + goto found; + } +found: + if (!_net_stayopen) + endnetent(); + return (p); +} diff --git a/lib/libc4.3tahoe/net/getnetent.c b/lib/libc4.3tahoe/net/getnetent.c new file mode 100644 index 0000000..ce91b88 --- /dev/null +++ b/lib/libc4.3tahoe/net/getnetent.c @@ -0,0 +1,119 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getnetent.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include + +#define MAXALIASES 35 + +static char NETDB[] = "/etc/networks"; +static FILE *netf = NULL; +static char line[BUFSIZ+1]; +static struct netent net; +static char *net_aliases[MAXALIASES]; +int _net_stayopen; +static char *any(); + +setnetent(f) + int f; +{ + if (netf == NULL) + netf = fopen(NETDB, "r" ); + else + rewind(netf); + _net_stayopen |= f; +} + +endnetent() +{ + if (netf) { + fclose(netf); + netf = NULL; + } + _net_stayopen = 0; +} + +struct netent * +getnetent() +{ + char *p; + register char *cp, **q; + + if (netf == NULL && (netf = fopen(NETDB, "r" )) == NULL) + return (NULL); +again: + p = fgets(line, BUFSIZ, netf); + if (p == NULL) + return (NULL); + if (*p == '#') + goto again; + cp = any(p, "#\n"); + if (cp == NULL) + goto again; + *cp = '\0'; + net.n_name = p; + cp = any(p, " \t"); + if (cp == NULL) + goto again; + *cp++ = '\0'; + while (*cp == ' ' || *cp == '\t') + cp++; + p = any(cp, " \t"); + if (p != NULL) + *p++ = '\0'; + net.n_net = inet_network(cp); + net.n_addrtype = AF_INET; + q = net.n_aliases = net_aliases; + if (p != NULL) + cp = p; + while (cp && *cp) { + if (*cp == ' ' || *cp == '\t') { + cp++; + continue; + } + if (q < &net_aliases[MAXALIASES - 1]) + *q++ = cp; + cp = any(cp, " \t"); + if (cp != NULL) + *cp++ = '\0'; + } + *q = NULL; + return (&net); +} + +static char * +any(cp, match) + register char *cp; + char *match; +{ + register char *mp, c; + + while (c = *cp) { + for (mp = match; *mp; mp++) + if (*mp == c) + return (cp); + cp++; + } + return ((char *)0); +} diff --git a/lib/libc4.3tahoe/net/getproto.c b/lib/libc4.3tahoe/net/getproto.c new file mode 100644 index 0000000..17d4b85 --- /dev/null +++ b/lib/libc4.3tahoe/net/getproto.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getproto.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +extern int _proto_stayopen; + +struct protoent * +getprotobynumber(proto) + register int proto; +{ + register struct protoent *p; + + setprotoent(_proto_stayopen); + while (p = getprotoent()) + if (p->p_proto == proto) + break; + if (!_proto_stayopen) + endprotoent(); + return (p); +} diff --git a/lib/libc4.3tahoe/net/getprotoent.c b/lib/libc4.3tahoe/net/getprotoent.c new file mode 100644 index 0000000..9796cc1 --- /dev/null +++ b/lib/libc4.3tahoe/net/getprotoent.c @@ -0,0 +1,118 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getprotoent.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include + +#define MAXALIASES 35 + +static char PROTODB[] = "/etc/protocols"; +static FILE *protof = NULL; +static char line[BUFSIZ+1]; +static struct protoent proto; +static char *proto_aliases[MAXALIASES]; +static char *any(); +int _proto_stayopen; + +setprotoent(f) + int f; +{ + if (protof == NULL) + protof = fopen(PROTODB, "r" ); + else + rewind(protof); + _proto_stayopen |= f; +} + +endprotoent() +{ + if (protof) { + fclose(protof); + protof = NULL; + } + _proto_stayopen = 0; +} + +struct protoent * +getprotoent() +{ + char *p; + register char *cp, **q; + + if (protof == NULL && (protof = fopen(PROTODB, "r" )) == NULL) + return (NULL); +again: + if ((p = fgets(line, BUFSIZ, protof)) == NULL) + return (NULL); + if (*p == '#') + goto again; + cp = any(p, "#\n"); + if (cp == NULL) + goto again; + *cp = '\0'; + proto.p_name = p; + cp = any(p, " \t"); + if (cp == NULL) + goto again; + *cp++ = '\0'; + while (*cp == ' ' || *cp == '\t') + cp++; + p = any(cp, " \t"); + if (p != NULL) + *p++ = '\0'; + proto.p_proto = atoi(cp); + q = proto.p_aliases = proto_aliases; + if (p != NULL) { + cp = p; + while (cp && *cp) { + if (*cp == ' ' || *cp == '\t') { + cp++; + continue; + } + if (q < &proto_aliases[MAXALIASES - 1]) + *q++ = cp; + cp = any(cp, " \t"); + if (cp != NULL) + *cp++ = '\0'; + } + } + *q = NULL; + return (&proto); +} + +static char * +any(cp, match) + register char *cp; + char *match; +{ + register char *mp, c; + + while (c = *cp) { + for (mp = match; *mp; mp++) + if (*mp == c) + return (cp); + cp++; + } + return ((char *)0); +} diff --git a/lib/libc4.3tahoe/net/getprotoname.c b/lib/libc4.3tahoe/net/getprotoname.c new file mode 100644 index 0000000..5ec618b --- /dev/null +++ b/lib/libc4.3tahoe/net/getprotoname.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getprotoname.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +extern int _proto_stayopen; + +struct protoent * +getprotobyname(name) + register char *name; +{ + register struct protoent *p; + register char **cp; + + setprotoent(_proto_stayopen); + while (p = getprotoent()) { + if (strcmp(p->p_name, name) == 0) + break; + for (cp = p->p_aliases; *cp != 0; cp++) + if (strcmp(*cp, name) == 0) + goto found; + } +found: + if (!_proto_stayopen) + endprotoent(); + return (p); +} diff --git a/lib/libc4.3tahoe/net/getservbyname.c b/lib/libc4.3tahoe/net/getservbyname.c new file mode 100644 index 0000000..3f5cd92 --- /dev/null +++ b/lib/libc4.3tahoe/net/getservbyname.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getservbyname.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +extern int _serv_stayopen; + +struct servent * +getservbyname(name, proto) + char *name, *proto; +{ + register struct servent *p; + register char **cp; + + setservent(_serv_stayopen); + while (p = getservent()) { + if (strcmp(name, p->s_name) == 0) + goto gotname; + for (cp = p->s_aliases; *cp; cp++) + if (strcmp(name, *cp) == 0) + goto gotname; + continue; +gotname: + if (proto == 0 || strcmp(p->s_proto, proto) == 0) + break; + } + if (!_serv_stayopen) + endservent(); + return (p); +} diff --git a/lib/libc4.3tahoe/net/getservbyport.c b/lib/libc4.3tahoe/net/getservbyport.c new file mode 100644 index 0000000..0325408 --- /dev/null +++ b/lib/libc4.3tahoe/net/getservbyport.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getservbyport.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +extern int _serv_stayopen; + +struct servent * +getservbyport(port, proto) + int port; + char *proto; +{ + register struct servent *p; + + setservent(_serv_stayopen); + while (p = getservent()) { + if (p->s_port != port) + continue; + if (proto == 0 || strcmp(p->s_proto, proto) == 0) + break; + } + if (!_serv_stayopen) + endservent(); + return (p); +} diff --git a/lib/libc4.3tahoe/net/getservent.c b/lib/libc4.3tahoe/net/getservent.c new file mode 100644 index 0000000..850f917 --- /dev/null +++ b/lib/libc4.3tahoe/net/getservent.c @@ -0,0 +1,121 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getservent.c 5.6 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include +#include + +#define MAXALIASES 35 + +static char SERVDB[] = "/etc/services"; +static FILE *servf = NULL; +static char line[BUFSIZ+1]; +static struct servent serv; +static char *serv_aliases[MAXALIASES]; +static char *any(); +int _serv_stayopen; + +setservent(f) + int f; +{ + if (servf == NULL) + servf = fopen(SERVDB, "r" ); + else + rewind(servf); + _serv_stayopen |= f; +} + +endservent() +{ + if (servf) { + fclose(servf); + servf = NULL; + } + _serv_stayopen = 0; +} + +struct servent * +getservent() +{ + char *p; + register char *cp, **q; + + if (servf == NULL && (servf = fopen(SERVDB, "r" )) == NULL) + return (NULL); +again: + if ((p = fgets(line, BUFSIZ, servf)) == NULL) + return (NULL); + if (*p == '#') + goto again; + cp = any(p, "#\n"); + if (cp == NULL) + goto again; + *cp = '\0'; + serv.s_name = p; + p = any(p, " \t"); + if (p == NULL) + goto again; + *p++ = '\0'; + while (*p == ' ' || *p == '\t') + p++; + cp = any(p, ",/"); + if (cp == NULL) + goto again; + *cp++ = '\0'; + serv.s_port = htons((u_short)atoi(p)); + serv.s_proto = cp; + q = serv.s_aliases = serv_aliases; + cp = any(cp, " \t"); + if (cp != NULL) + *cp++ = '\0'; + while (cp && *cp) { + if (*cp == ' ' || *cp == '\t') { + cp++; + continue; + } + if (q < &serv_aliases[MAXALIASES - 1]) + *q++ = cp; + cp = any(cp, " \t"); + if (cp != NULL) + *cp++ = '\0'; + } + *q = NULL; + return (&serv); +} + +static char * +any(cp, match) + register char *cp; + char *match; +{ + register char *mp, c; + + while (c = *cp) { + for (mp = match; *mp; mp++) + if (*mp == c) + return (cp); + cp++; + } + return ((char *)0); +} diff --git a/lib/libc4.3tahoe/net/herror.c b/lib/libc4.3tahoe/net/herror.c new file mode 100644 index 0000000..d6515d6 --- /dev/null +++ b/lib/libc4.3tahoe/net/herror.c @@ -0,0 +1,60 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)herror.c 6.3 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +char *h_errlist[] = { + "Error 0", + "Unknown host", /* 1 HOST_NOT_FOUND */ + "Host name lookup failure", /* 2 TRY_AGAIN */ + "Unknown server error", /* 3 NO_RECOVERY */ + "No address associated with name", /* 4 NO_ADDRESS */ +}; +int h_nerr = { sizeof(h_errlist)/sizeof(h_errlist[0]) }; + +extern int h_errno; + +/* + * herror -- + * print the error indicated by the h_errno value. + */ +herror(s) + char *s; +{ + struct iovec iov[4]; + register struct iovec *v = iov; + + if (s && *s) { + v->iov_base = s; + v->iov_len = strlen(s); + v++; + v->iov_base = ": "; + v->iov_len = 2; + v++; + } + v->iov_base = h_errno < h_nerr ? h_errlist[h_errno] : "Unknown error"; + v->iov_len = strlen(v->iov_base); + v++; + v->iov_base = "\n"; + v->iov_len = 1; + writev(2, iov, (v - iov) + 1); +} diff --git a/lib/libc4.3tahoe/net/hosttable/.MAP b/lib/libc4.3tahoe/net/hosttable/.MAP new file mode 100644 index 0000000..7d229d8 --- /dev/null +++ b/lib/libc4.3tahoe/net/hosttable/.MAP @@ -0,0 +1,4 @@ +F GETHOSTE.C;1 gethostent.c +F GETHOSTN.C;1 gethostnamadr.c +F MAKEFILE.;1 Makefile +D PROFILED profiled diff --git a/lib/libc4.3tahoe/net/hosttable/Makefile b/lib/libc4.3tahoe/net/hosttable/Makefile new file mode 100644 index 0000000..a829abc --- /dev/null +++ b/lib/libc4.3tahoe/net/hosttable/Makefile @@ -0,0 +1,62 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.8 (Berkeley) 6/27/88 +# +DEFS= -DLIBC_SCCS +CFLAGS= -O ${DEFS} +OBJS= gethostnamadr.o gethostent.o +SRCS= gethostnamadr.c gethostent.c +TAGSFILE=tags + +.c.o: + @${CC} -p -c ${CFLAGS} $*.c + @-ld -X -o profiled/$*.o -r $*.o + ${CC} ${CFLAGS} -c $*.c + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + cwd=`pwd`; \ + for i in ${SRCS}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +gethostnamadr.o: gethostnamadr.c /usr/include/stdio.h /usr/include/netdb.h +gethostnamadr.o: /usr/include/sys/file.h /usr/include/ndbm.h +gethostnamadr.o: /usr/include/ctype.h +gethostent.o: gethostent.c /usr/include/stdio.h /usr/include/sys/types.h +gethostent.o: /usr/include/sys/socket.h /usr/include/netdb.h +gethostent.o: /usr/include/ctype.h /usr/include/ndbm.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/net/hosttable/gethostent.c b/lib/libc4.3tahoe/net/hosttable/gethostent.c new file mode 100644 index 0000000..306fc37 --- /dev/null +++ b/lib/libc4.3tahoe/net/hosttable/gethostent.c @@ -0,0 +1,143 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)gethostent.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include +#include + +/* + * Internet version. + */ +#define MAXALIASES 35 +#define MAXADDRSIZE 14 + +static FILE *hostf = NULL; +static char line[BUFSIZ+1]; +static char hostaddr[MAXADDRSIZE]; +static struct hostent host; +static char *host_aliases[MAXALIASES]; +static char *host_addrs[] = { + hostaddr, + NULL +}; + +/* + * The following is shared with gethostnamadr.c + */ +char *_host_file = "/etc/hosts"; +int _host_stayopen; +DBM *_host_db; /* set by gethostbyname(), gethostbyaddr() */ + +static char *any(); + +sethostent(f) + int f; +{ + if (hostf != NULL) + rewind(hostf); + _host_stayopen |= f; +} + +endhostent() +{ + if (hostf) { + fclose(hostf); + hostf = NULL; + } + if (_host_db) { + dbm_close(_host_db); + _host_db = (DBM *)NULL; + } + _host_stayopen = 0; +} + +struct hostent * +gethostent() +{ + char *p; + register char *cp, **q; + + if (hostf == NULL && (hostf = fopen(_host_file, "r" )) == NULL) + return (NULL); +again: + if ((p = fgets(line, BUFSIZ, hostf)) == NULL) + return (NULL); + if (*p == '#') + goto again; + cp = any(p, "#\n"); + if (cp == NULL) + goto again; + *cp = '\0'; + cp = any(p, " \t"); + if (cp == NULL) + goto again; + *cp++ = '\0'; + /* THIS STUFF IS INTERNET SPECIFIC */ + host.h_addr_list = host_addrs; + *((u_long *)host.h_addr) = inet_addr(p); + host.h_length = sizeof (u_long); + host.h_addrtype = AF_INET; + while (*cp == ' ' || *cp == '\t') + cp++; + host.h_name = cp; + q = host.h_aliases = host_aliases; + cp = any(cp, " \t"); + if (cp != NULL) + *cp++ = '\0'; + while (cp && *cp) { + if (*cp == ' ' || *cp == '\t') { + cp++; + continue; + } + if (q < &host_aliases[MAXALIASES - 1]) + *q++ = cp; + cp = any(cp, " \t"); + if (cp != NULL) + *cp++ = '\0'; + } + *q = NULL; + return (&host); +} + +sethostfile(file) + char *file; +{ + _host_file = file; +} + +static char * +any(cp, match) + register char *cp; + char *match; +{ + register char *mp, c; + + while (c = *cp) { + for (mp = match; *mp; mp++) + if (*mp == c) + return (cp); + cp++; + } + return ((char *)0); +} diff --git a/lib/libc4.3tahoe/net/hosttable/gethostnamadr.c b/lib/libc4.3tahoe/net/hosttable/gethostnamadr.c new file mode 100644 index 0000000..64cff34 --- /dev/null +++ b/lib/libc4.3tahoe/net/hosttable/gethostnamadr.c @@ -0,0 +1,156 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)gethostnamadr.c 5.7 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include + +#define MAXALIASES 35 + +static struct hostent host; +static char *host_aliases[MAXALIASES]; +static char hostbuf[BUFSIZ+1]; +static char *host_addrs[2]; + +int h_errno; + +/* + * The following is shared with gethostent.c + */ +extern char *_host_file; +DBM *_host_db = (DBM *)NULL; +int _host_stayopen; /* set by sethostent(), cleared by endhostent() */ + +static struct hostent * +fetchhost(key) + datum key; +{ + register char *cp, *tp, **ap; + int naliases; + + if (key.dptr == 0) + return ((struct hostent *)NULL); + key = dbm_fetch(_host_db, key); + if (key.dptr == 0) + return ((struct hostent *)NULL); + cp = key.dptr; + tp = hostbuf; + host.h_name = tp; + while (*tp++ = *cp++) + ; + bcopy(cp, (char *)&naliases, sizeof(int)); cp += sizeof (int); + for (ap = host_aliases; naliases > 0; naliases--) { + *ap++ = tp; + while (*tp++ = *cp++) + ; + } + *ap = (char *)NULL; + host.h_aliases = host_aliases; + bcopy(cp, (char *)&host.h_addrtype, sizeof (int)); + cp += sizeof (int); + bcopy(cp, (char *)&host.h_length, sizeof (int)); + cp += sizeof (int); + host.h_addr_list = host_addrs; + host.h_addr = tp; + bcopy(cp, tp, host.h_length); + return (&host); +} + +struct hostent * +gethostbyname(nam) + register char *nam; +{ + register struct hostent *hp; + register char **cp; + datum key; + char lowname[128]; + register char *lp = lowname; + + while (*nam) + if (isupper(*nam)) + *lp++ = tolower(*nam++); + else + *lp++ = *nam++; + *lp = '\0'; + + if ((_host_db == (DBM *)NULL) + && ((_host_db = dbm_open(_host_file, O_RDONLY)) == (DBM *)NULL)) { + sethostent(_host_stayopen); + while (hp = gethostent()) { + if (strcmp(hp->h_name, lowname) == 0) + break; + for (cp = hp->h_aliases; cp != 0 && *cp != 0; cp++) + if (strcmp(*cp, lowname) == 0) + goto found; + } + found: + if (!_host_stayopen) + endhostent(); + return (hp); + } + key.dptr = lowname; + key.dsize = strlen(lowname); + hp = fetchhost(key); + if (!_host_stayopen) { + dbm_close(_host_db); + _host_db = (DBM *)NULL; + } + if ( hp == NULL) + h_errno = HOST_NOT_FOUND; + return (hp); +} + +struct hostent * +gethostbyaddr(addr, length, type) + char *addr; + register int length; + register int type; +{ + register struct hostent *hp; + datum key; + + if ((_host_db == (DBM *)NULL) + && ((_host_db = dbm_open(_host_file, O_RDONLY)) == (DBM *)NULL)) { + sethostent(_host_stayopen); + while (hp = gethostent()) { + if (hp->h_addrtype == type && hp->h_length == length + && bcmp(hp->h_addr, addr, length) == 0) + break; + } + if (!_host_stayopen) + endhostent(); + if ( hp == NULL) + h_errno = HOST_NOT_FOUND; + return (hp); + } + key.dptr = addr; + key.dsize = length; + hp = fetchhost(key); + if (!_host_stayopen) { + dbm_close(_host_db); + _host_db = (DBM *)NULL; + } + if ( hp == NULL) + h_errno = HOST_NOT_FOUND; + return (hp); +} diff --git a/lib/libc4.3tahoe/net/hosttable/profiled/.MAP b/lib/libc4.3tahoe/net/hosttable/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/net/named/.MAP b/lib/libc4.3tahoe/net/named/.MAP new file mode 100644 index 0000000..2b7bae2 --- /dev/null +++ b/lib/libc4.3tahoe/net/named/.MAP @@ -0,0 +1,4 @@ +F GETHOSTN.C;1 gethostnamadr.c +F MAKEFILE.;1 Makefile +D PROFILED profiled +F SETHOSTE.C;1 sethostent.c diff --git a/lib/libc4.3tahoe/net/named/Makefile b/lib/libc4.3tahoe/net/named/Makefile new file mode 100644 index 0000000..30d74f6 --- /dev/null +++ b/lib/libc4.3tahoe/net/named/Makefile @@ -0,0 +1,66 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 6.7 (Berkeley) 6/27/88 +# +DEFS= -DLIBC_SCCS +CFLAGS= -O ${DEFS} +SRCS= gethostnamadr.c sethostent.c +OBJS= gethostnamadr.o sethostent.o +TAGSFILE= tags + +.c.o: + @${CC} -p -c ${CFLAGS} $*.c + @-ld -X -o profiled/$*.o -r $*.o + ${CC} ${CFLAGS} -c $*.c + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + cwd=`pwd`; \ + for i in ${SRCS}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +gethostnamadr.o: gethostnamadr.c /usr/include/sys/param.h +gethostnamadr.o: /usr/include/sys/types.h /usr/include/signal.h +gethostnamadr.o: /usr/include/machine/trap.h /usr/include/machine/machparam.h +gethostnamadr.o: /usr/include/machine/endian.h /usr/include/sys/socket.h +gethostnamadr.o: /usr/include/netinet/in.h /usr/include/ctype.h +gethostnamadr.o: /usr/include/netdb.h /usr/include/stdio.h /usr/include/errno.h +gethostnamadr.o: /usr/include/arpa/inet.h /usr/include/arpa/nameser.h +gethostnamadr.o: /usr/include/resolv.h +sethostent.o: sethostent.c /usr/include/sys/types.h /usr/include/arpa/nameser.h +sethostent.o: /usr/include/netinet/in.h /usr/include/resolv.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/net/named/gethostnamadr.c b/lib/libc4.3tahoe/net/named/gethostnamadr.c new file mode 100644 index 0000000..5dab54a --- /dev/null +++ b/lib/libc4.3tahoe/net/named/gethostnamadr.c @@ -0,0 +1,406 @@ +/* + * Copyright (c) 1985, 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)gethostnamadr.c 6.34 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MAXALIASES 35 +#define MAXADDRS 35 + +static char *h_addr_ptrs[MAXADDRS + 1]; + +static struct hostent host; +static char *host_aliases[MAXALIASES]; +static char hostbuf[BUFSIZ+1]; +static struct in_addr host_addr; +static char HOSTDB[] = "/etc/hosts"; +static FILE *hostf = NULL; +static char hostaddr[MAXADDRS]; +static char *host_addrs[2]; +static int stayopen = 0; +static char *any(); + +#if PACKETSZ > 1024 +#define MAXPACKET PACKETSZ +#else +#define MAXPACKET 1024 +#endif + +typedef union { + HEADER hdr; + u_char buf[MAXPACKET]; +} querybuf; + +static union { + long al; + char ac; +} align; + + +int h_errno; +extern errno; + +static struct hostent * +getanswer(answer, anslen, iquery) + querybuf *answer; + int anslen; + int iquery; +{ + register HEADER *hp; + register u_char *cp; + register int n; + u_char *eom; + char *bp, **ap; + int type, class, buflen, ancount, qdcount; + int haveanswer, getclass = C_ANY; + char **hap; + + eom = answer->buf + anslen; + /* + * find first satisfactory answer + */ + hp = &answer->hdr; + ancount = ntohs(hp->ancount); + qdcount = ntohs(hp->qdcount); + bp = hostbuf; + buflen = sizeof(hostbuf); + cp = answer->buf + sizeof(HEADER); + if (qdcount) { + if (iquery) { + if ((n = dn_expand((char *)answer->buf, eom, + cp, bp, buflen)) < 0) { + h_errno = NO_RECOVERY; + return ((struct hostent *) NULL); + } + cp += n + QFIXEDSZ; + host.h_name = bp; + n = strlen(bp) + 1; + bp += n; + buflen -= n; + } else + cp += dn_skipname(cp, eom) + QFIXEDSZ; + while (--qdcount > 0) + cp += dn_skipname(cp, eom) + QFIXEDSZ; + } else if (iquery) { + if (hp->aa) + h_errno = HOST_NOT_FOUND; + else + h_errno = TRY_AGAIN; + return ((struct hostent *) NULL); + } + ap = host_aliases; + host.h_aliases = host_aliases; + hap = h_addr_ptrs; +#if BSD >= 43 || defined(h_addr) /* new-style hostent structure */ + host.h_addr_list = h_addr_ptrs; +#endif + haveanswer = 0; + while (--ancount >= 0 && cp < eom) { + if ((n = dn_expand((char *)answer->buf, eom, cp, bp, buflen)) < 0) + break; + cp += n; + type = _getshort(cp); + cp += sizeof(u_short); + class = _getshort(cp); + cp += sizeof(u_short) + sizeof(u_long); + n = _getshort(cp); + cp += sizeof(u_short); + if (type == T_CNAME) { + cp += n; + if (ap >= &host_aliases[MAXALIASES-1]) + continue; + *ap++ = bp; + n = strlen(bp) + 1; + bp += n; + buflen -= n; + continue; + } + if (iquery && type == T_PTR) { + if ((n = dn_expand((char *)answer->buf, eom, + cp, bp, buflen)) < 0) { + cp += n; + continue; + } + cp += n; + host.h_name = bp; + return(&host); + } + if (iquery || type != T_A) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("unexpected answer type %d, size %d\n", + type, n); +#endif + cp += n; + continue; + } + if (haveanswer) { + if (n != host.h_length) { + cp += n; + continue; + } + if (class != getclass) { + cp += n; + continue; + } + } else { + host.h_length = n; + getclass = class; + host.h_addrtype = (class == C_IN) ? AF_INET : AF_UNSPEC; + if (!iquery) { + host.h_name = bp; + bp += strlen(bp) + 1; + } + } + + bp += sizeof(align) - ((u_long)bp % sizeof(align)); + + if (bp + n >= &hostbuf[sizeof(hostbuf)]) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("size (%d) too big\n", n); +#endif + break; + } + bcopy(cp, *hap++ = bp, n); + bp +=n; + cp += n; + haveanswer++; + } + if (haveanswer) { + *ap = NULL; +#if BSD >= 43 || defined(h_addr) /* new-style hostent structure */ + *hap = NULL; +#else + host.h_addr = h_addr_ptrs[0]; +#endif + return (&host); + } else { + h_errno = TRY_AGAIN; + return ((struct hostent *) NULL); + } +} + +struct hostent * +gethostbyname(name) + char *name; +{ + querybuf buf; + register char *cp; + int n; + struct hostent *hp; + extern struct hostent *_gethtbyname(); + + /* + * disallow names consisting only of digits/dots, unless + * they end in a dot. + */ + if (isdigit(name[0])) + for (cp = name;; ++cp) { + if (!*cp) { + if (*--cp == '.') + break; + h_errno = HOST_NOT_FOUND; + return ((struct hostent *) NULL); + } + if (!isdigit(*cp) && *cp != '.') + break; + } + + if ((n = res_search(name, C_IN, T_A, buf.buf, sizeof(buf))) < 0) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("res_search failed\n"); +#endif + if (errno == ECONNREFUSED) + return (_gethtbyname(name)); + else + return ((struct hostent *) NULL); + } + return (getanswer(&buf, n, 0)); +} + +struct hostent * +gethostbyaddr(addr, len, type) + char *addr; + int len, type; +{ + int n; + querybuf buf; + register struct hostent *hp; + char qbuf[MAXDNAME]; + extern struct hostent *_gethtbyaddr(); + + if (type != AF_INET) + return ((struct hostent *) NULL); + (void)sprintf(qbuf, "%d.%d.%d.%d.in-addr.arpa", + ((unsigned)addr[3] & 0xff), + ((unsigned)addr[2] & 0xff), + ((unsigned)addr[1] & 0xff), + ((unsigned)addr[0] & 0xff)); + n = res_query(qbuf, C_IN, T_PTR, (char *)&buf, sizeof(buf)); + if (n < 0) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("res_query failed\n"); +#endif + if (errno == ECONNREFUSED) + return (_gethtbyaddr(addr, len, type)); + return ((struct hostent *) NULL); + } + hp = getanswer(&buf, n, 1); + if (hp == NULL) + return ((struct hostent *) NULL); + hp->h_addrtype = type; + hp->h_length = len; + h_addr_ptrs[0] = (char *)&host_addr; + h_addr_ptrs[1] = (char *)0; + host_addr = *(struct in_addr *)addr; + return(hp); +} + +_sethtent(f) + int f; +{ + if (hostf == NULL) + hostf = fopen(HOSTDB, "r" ); + else + rewind(hostf); + stayopen |= f; +} + +_endhtent() +{ + if (hostf && !stayopen) { + (void) fclose(hostf); + hostf = NULL; + } +} + +struct hostent * +_gethtent() +{ + char *p; + register char *cp, **q; + + if (hostf == NULL && (hostf = fopen(HOSTDB, "r" )) == NULL) + return (NULL); +again: + if ((p = fgets(hostbuf, BUFSIZ, hostf)) == NULL) + return (NULL); + if (*p == '#') + goto again; + cp = any(p, "#\n"); + if (cp == NULL) + goto again; + *cp = '\0'; + cp = any(p, " \t"); + if (cp == NULL) + goto again; + *cp++ = '\0'; + /* THIS STUFF IS INTERNET SPECIFIC */ +#if BSD >= 43 || defined(h_addr) /* new-style hostent structure */ + host.h_addr_list = host_addrs; +#endif + host.h_addr = hostaddr; + *((u_long *)host.h_addr) = inet_addr(p); + host.h_length = sizeof (u_long); + host.h_addrtype = AF_INET; + while (*cp == ' ' || *cp == '\t') + cp++; + host.h_name = cp; + q = host.h_aliases = host_aliases; + cp = any(cp, " \t"); + if (cp != NULL) + *cp++ = '\0'; + while (cp && *cp) { + if (*cp == ' ' || *cp == '\t') { + cp++; + continue; + } + if (q < &host_aliases[MAXALIASES - 1]) + *q++ = cp; + cp = any(cp, " \t"); + if (cp != NULL) + *cp++ = '\0'; + } + *q = NULL; + return (&host); +} + +static char * +any(cp, match) + register char *cp; + char *match; +{ + register char *mp, c; + + while (c = *cp) { + for (mp = match; *mp; mp++) + if (*mp == c) + return (cp); + cp++; + } + return ((char *)0); +} + +struct hostent * +_gethtbyname(name) + char *name; +{ + register struct hostent *p; + register char **cp; + + _sethtent(0); + while (p = _gethtent()) { + if (strcasecmp(p->h_name, name) == 0) + break; + for (cp = p->h_aliases; *cp != 0; cp++) + if (strcasecmp(*cp, name) == 0) + goto found; + } +found: + _endhtent(); + return (p); +} + +struct hostent * +_gethtbyaddr(addr, len, type) + char *addr; + int len, type; +{ + register struct hostent *p; + + _sethtent(0); + while (p = _gethtent()) + if (p->h_addrtype == type && !bcmp(p->h_addr, addr, len)) + break; + _endhtent(); + return (p); +} diff --git a/lib/libc4.3tahoe/net/named/profiled/.MAP b/lib/libc4.3tahoe/net/named/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/net/named/sethostent.c b/lib/libc4.3tahoe/net/named/sethostent.c new file mode 100644 index 0000000..d619a5a --- /dev/null +++ b/lib/libc4.3tahoe/net/named/sethostent.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)sethostent.c 6.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include + +sethostent(stayopen) +{ + if (stayopen) + _res.options |= RES_STAYOPEN | RES_USEVC; +} + +endhostent() +{ + _res.options &= ~(RES_STAYOPEN | RES_USEVC); + _res_close(); +} + +sethostfile(name) +char *name; +{ +#ifdef lint +name = name; +#endif +} diff --git a/lib/libc4.3tahoe/net/net.tahoe/.MAP b/lib/libc4.3tahoe/net/net.tahoe/.MAP new file mode 100644 index 0000000..3906a70 --- /dev/null +++ b/lib/libc4.3tahoe/net/net.tahoe/.MAP @@ -0,0 +1,6 @@ +F HTONL.S;1 htonl.s +F HTONS.S;1 htons.s +F MAKEFILE.;1 Makefile +F NTOHL.S;1 ntohl.s +F NTOHS.S;1 ntohs.s +D PROFILED profiled diff --git a/lib/libc4.3tahoe/net/net.tahoe/Makefile b/lib/libc4.3tahoe/net/net.tahoe/Makefile new file mode 100644 index 0000000..47f8da4 --- /dev/null +++ b/lib/libc4.3tahoe/net/net.tahoe/Makefile @@ -0,0 +1,61 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.8 (Berkeley) 5/20/88 +# +DEFS= -DLIBC_SCCS +FLAGS= -I../../tahoe ${DEFS} +CFLAGS= -O ${FLAGS} +SRCS= htonl.s htons.s ntohl.s ntohs.s +OBJS= htonl.o htons.o ntohl.o ntohs.o +TAGSFILE=tags + +.s.o: + @/lib/cpp -E ${FLAGS} -DPROF $*.s | ${AS} -o $*.o + @ld -X -o profiled/$*.o -r $*.o + /lib/cpp -E ${FLAGS} $*.s | ${AS} -o $*.o + @ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + (P=`pwd`; \ + egrep "^ENTRY(.*)|^SYSCALL(.*)" ${SRCS} | /bin/sed \ +"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ + >> ${TAGSFILE}) + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +htonl.o: htonl.s ../../tahoe/DEFS.h +htons.o: htons.s ../../tahoe/DEFS.h +ntohl.o: ntohl.s ../../tahoe/DEFS.h +ntohs.o: ntohs.s ../../tahoe/DEFS.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/net/net.tahoe/htonl.s b/lib/libc4.3tahoe/net/net.tahoe/htonl.s new file mode 100644 index 0000000..8f58f19 --- /dev/null +++ b/lib/libc4.3tahoe/net/net.tahoe/htonl.s @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)htonl.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* netorder = htonl(hostorder) */ + +#include "DEFS.h" + +ENTRY(htonl, 0) + movl 4(fp),r0 + ret diff --git a/lib/libc4.3tahoe/net/net.tahoe/htons.s b/lib/libc4.3tahoe/net/net.tahoe/htons.s new file mode 100644 index 0000000..633bb4c --- /dev/null +++ b/lib/libc4.3tahoe/net/net.tahoe/htons.s @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)htons.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* hostorder = htons(netorder) */ + +#include "DEFS.h" + +ENTRY(htons, 0) + movzwl 6(fp),r0 + ret diff --git a/lib/libc4.3tahoe/net/net.tahoe/ntohl.s b/lib/libc4.3tahoe/net/net.tahoe/ntohl.s new file mode 100644 index 0000000..f706319 --- /dev/null +++ b/lib/libc4.3tahoe/net/net.tahoe/ntohl.s @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)ntohl.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* hostorder = ntohl(netorder) */ + +#include "DEFS.h" + +ENTRY(ntohl, 0) + movl 4(fp),r0 + ret diff --git a/lib/libc4.3tahoe/net/net.tahoe/ntohs.s b/lib/libc4.3tahoe/net/net.tahoe/ntohs.s new file mode 100644 index 0000000..9438ba5 --- /dev/null +++ b/lib/libc4.3tahoe/net/net.tahoe/ntohs.s @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)ntohs.s 1.3 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* hostorder = ntohs(netorder) */ + +#include "DEFS.h" + +ENTRY(ntohs, 0) + movzwl 6(fp),r0 + ret diff --git a/lib/libc4.3tahoe/net/net.tahoe/profiled/.MAP b/lib/libc4.3tahoe/net/net.tahoe/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/net/net.vax/.MAP b/lib/libc4.3tahoe/net/net.vax/.MAP new file mode 100644 index 0000000..3906a70 --- /dev/null +++ b/lib/libc4.3tahoe/net/net.vax/.MAP @@ -0,0 +1,6 @@ +F HTONL.S;1 htonl.s +F HTONS.S;1 htons.s +F MAKEFILE.;1 Makefile +F NTOHL.S;1 ntohl.s +F NTOHS.S;1 ntohs.s +D PROFILED profiled diff --git a/lib/libc4.3tahoe/net/net.vax/Makefile b/lib/libc4.3tahoe/net/net.vax/Makefile new file mode 100644 index 0000000..0de274c --- /dev/null +++ b/lib/libc4.3tahoe/net/net.vax/Makefile @@ -0,0 +1,60 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.10 (Berkeley) 6/27/88 +# +DEFS= -DLIBC_SCCS +CFLAGS= ${DEFS} -I../../vax +SRCS= htonl.s htons.s ntohl.s ntohs.s +OBJS= htonl.o htons.o ntohl.o ntohs.o +TAGSFILE=tags + +.s.o: + @/lib/cpp -E ${CFLAGS} -DPROF $*.s | ${AS} -o $*.o + @-ld -x -o profiled/$*.o -r $*.o + /lib/cpp -E ${CFLAGS} $*.s | ${AS} -o $*.o + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + (P=`pwd`; \ + egrep "^ENTRY(.*)|^SYSCALL(.*)" ${SRCS} | /bin/sed \ +"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ + >> ${TAGSFILE}) + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +htonl.o: htonl.s ../../vax/DEFS.h +htons.o: htons.s ../../vax/DEFS.h +ntohl.o: ntohl.s ../../vax/DEFS.h +ntohs.o: ntohs.s ../../vax/DEFS.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/net/net.vax/htonl.s b/lib/libc4.3tahoe/net/net.vax/htonl.s new file mode 100644 index 0000000..af5b96c --- /dev/null +++ b/lib/libc4.3tahoe/net/net.vax/htonl.s @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)htonl.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* netorder = htonl(hostorder) */ + +#include "DEFS.h" + +ENTRY(htonl, 0) + rotl $-8,4(ap),r0 + insv r0,$16,$8,r0 + movb 7(ap),r0 + ret diff --git a/lib/libc4.3tahoe/net/net.vax/htons.s b/lib/libc4.3tahoe/net/net.vax/htons.s new file mode 100644 index 0000000..c500e84 --- /dev/null +++ b/lib/libc4.3tahoe/net/net.vax/htons.s @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)htons.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* hostorder = htons(netorder) */ + +#include "DEFS.h" + +ENTRY(htons, 0) + rotl $8,4(ap),r0 + movb 5(ap),r0 + movzwl r0,r0 + ret diff --git a/lib/libc4.3tahoe/net/net.vax/ntohl.s b/lib/libc4.3tahoe/net/net.vax/ntohl.s new file mode 100644 index 0000000..0fcaa2f --- /dev/null +++ b/lib/libc4.3tahoe/net/net.vax/ntohl.s @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)ntohl.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* hostorder = ntohl(netorder) */ + +#include "DEFS.h" + +ENTRY(ntohl, 0) + rotl $-8,4(ap),r0 + insv r0,$16,$8,r0 + movb 7(ap),r0 + ret diff --git a/lib/libc4.3tahoe/net/net.vax/ntohs.s b/lib/libc4.3tahoe/net/net.vax/ntohs.s new file mode 100644 index 0000000..626a37b --- /dev/null +++ b/lib/libc4.3tahoe/net/net.vax/ntohs.s @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)ntohs.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* hostorder = ntohs(netorder) */ + +#include "DEFS.h" + +ENTRY(ntohs, 0) + rotl $8,4(ap),r0 + movb 5(ap),r0 + movzwl r0,r0 + ret diff --git a/lib/libc4.3tahoe/net/net.vax/profiled/.MAP b/lib/libc4.3tahoe/net/net.vax/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/net/profiled/.MAP b/lib/libc4.3tahoe/net/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/net/rcmd.c b/lib/libc4.3tahoe/net/rcmd.c new file mode 100644 index 0000000..74abcb2 --- /dev/null +++ b/lib/libc4.3tahoe/net/rcmd.c @@ -0,0 +1,313 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rcmd.c 5.17 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +extern errno; +char *index(); + +rcmd(ahost, rport, locuser, remuser, cmd, fd2p) + char **ahost; + u_short rport; + char *locuser, *remuser, *cmd; + int *fd2p; +{ + int s, timo = 1, pid; + long oldmask; + struct sockaddr_in sin, sin2, from; + char c; + int lport = IPPORT_RESERVED - 1; + struct hostent *hp; + + pid = getpid(); + hp = gethostbyname(*ahost); + if (hp == 0) { + fprintf(stderr, "%s: unknown host\n", *ahost); + return (-1); + } + *ahost = hp->h_name; + oldmask = sigblock(sigmask(SIGURG)); + for (;;) { + s = rresvport(&lport); + if (s < 0) { + if (errno == EAGAIN) + fprintf(stderr, "socket: All ports in use\n"); + else + perror("rcmd: socket"); + sigsetmask(oldmask); + return (-1); + } + fcntl(s, F_SETOWN, pid); + sin.sin_family = hp->h_addrtype; + bcopy(hp->h_addr_list[0], (caddr_t)&sin.sin_addr, hp->h_length); + sin.sin_port = rport; + if (connect(s, (caddr_t)&sin, sizeof (sin), 0) >= 0) + break; + (void) close(s); + if (errno == EADDRINUSE) { + lport--; + continue; + } + if (errno == ECONNREFUSED && timo <= 16) { + sleep(timo); + timo *= 2; + continue; + } + if (hp->h_addr_list[1] != NULL) { + int oerrno = errno; + + fprintf(stderr, + "connect to address %s: ", inet_ntoa(sin.sin_addr)); + errno = oerrno; + perror(0); + hp->h_addr_list++; + bcopy(hp->h_addr_list[0], (caddr_t)&sin.sin_addr, + hp->h_length); + fprintf(stderr, "Trying %s...\n", + inet_ntoa(sin.sin_addr)); + continue; + } + perror(hp->h_name); + sigsetmask(oldmask); + return (-1); + } + lport--; + if (fd2p == 0) { + write(s, "", 1); + lport = 0; + } else { + char num[8]; + int s2 = rresvport(&lport), s3; + int len = sizeof (from); + + if (s2 < 0) + goto bad; + listen(s2, 1); + (void) sprintf(num, "%d", lport); + if (write(s, num, strlen(num)+1) != strlen(num)+1) { + perror("write: setting up stderr"); + (void) close(s2); + goto bad; + } + s3 = accept(s2, &from, &len, 0); + (void) close(s2); + if (s3 < 0) { + perror("accept"); + lport = 0; + goto bad; + } + *fd2p = s3; + from.sin_port = ntohs((u_short)from.sin_port); + if (from.sin_family != AF_INET || + from.sin_port >= IPPORT_RESERVED) { + fprintf(stderr, + "socket: protocol failure in circuit setup.\n"); + goto bad2; + } + } + (void) write(s, locuser, strlen(locuser)+1); + (void) write(s, remuser, strlen(remuser)+1); + (void) write(s, cmd, strlen(cmd)+1); + if (read(s, &c, 1) != 1) { + perror(*ahost); + goto bad2; + } + if (c != 0) { + while (read(s, &c, 1) == 1) { + (void) write(2, &c, 1); + if (c == '\n') + break; + } + goto bad2; + } + sigsetmask(oldmask); + return (s); +bad2: + if (lport) + (void) close(*fd2p); +bad: + (void) close(s); + sigsetmask(oldmask); + return (-1); +} + +rresvport(alport) + int *alport; +{ + struct sockaddr_in sin; + int s; + + sin.sin_family = AF_INET; + sin.sin_addr.s_addr = INADDR_ANY; + s = socket(AF_INET, SOCK_STREAM, 0); + if (s < 0) + return (-1); + for (;;) { + sin.sin_port = htons((u_short)*alport); + if (bind(s, (caddr_t)&sin, sizeof (sin)) >= 0) + return (s); + if (errno != EADDRINUSE) { + (void) close(s); + return (-1); + } + (*alport)--; + if (*alport == IPPORT_RESERVED/2) { + (void) close(s); + errno = EAGAIN; /* close */ + return (-1); + } + } +} + +ruserok(rhost, superuser, ruser, luser) + char *rhost; + int superuser; + char *ruser, *luser; +{ + FILE *hostf; + char fhost[MAXHOSTNAMELEN]; + int first = 1; + register char *sp, *p; + int baselen = -1; + + sp = rhost; + p = fhost; + while (*sp) { + if (*sp == '.') { + if (baselen == -1) + baselen = sp - rhost; + *p++ = *sp++; + } else { + *p++ = isupper(*sp) ? tolower(*sp++) : *sp++; + } + } + *p = '\0'; + hostf = superuser ? (FILE *)0 : fopen("/etc/hosts.equiv", "r"); +again: + if (hostf) { + if (!_validuser(hostf, fhost, luser, ruser, baselen)) { + (void) fclose(hostf); + return(0); + } + (void) fclose(hostf); + } + if (first == 1) { + struct stat sbuf; + struct passwd *pwd; + char pbuf[MAXPATHLEN]; + + first = 0; + if ((pwd = getpwnam(luser)) == NULL) + return(-1); + (void)strcpy(pbuf, pwd->pw_dir); + (void)strcat(pbuf, "/.rhosts"); + if ((hostf = fopen(pbuf, "r")) == NULL) + return(-1); + (void)fstat(fileno(hostf), &sbuf); + if (sbuf.st_uid && sbuf.st_uid != pwd->pw_uid) { + fclose(hostf); + return(-1); + } + goto again; + } + return (-1); +} + +_validuser(hostf, rhost, luser, ruser, baselen) +char *rhost, *luser, *ruser; +FILE *hostf; +int baselen; +{ + char *user; + char ahost[MAXHOSTNAMELEN]; + register char *p; + + while (fgets(ahost, sizeof (ahost), hostf)) { + p = ahost; + while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') { + *p = isupper(*p) ? tolower(*p) : *p; + p++; + } + if (*p == ' ' || *p == '\t') { + *p++ = '\0'; + while (*p == ' ' || *p == '\t') + p++; + user = p; + while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') + p++; + } else + user = p; + *p = '\0'; + if (_checkhost(rhost, ahost, baselen) && + !strcmp(ruser, *user ? user : luser)) { + return (0); + } + } + return (-1); +} + +_checkhost(rhost, lhost, len) +char *rhost, *lhost; +int len; +{ + static char ldomain[MAXHOSTNAMELEN + 1]; + static char *domainp = NULL; + static int nodomain = 0; + register char *cp; + + if (len == -1) + return(!strcmp(rhost, lhost)); + if (strncmp(rhost, lhost, len)) + return(0); + if (!strcmp(rhost, lhost)) + return(1); + if (*(lhost + len) != '\0') + return(0); + if (nodomain) + return(0); + if (!domainp) { + if (gethostname(ldomain, sizeof(ldomain)) == -1) { + nodomain = 1; + return(0); + } + ldomain[MAXHOSTNAMELEN] = NULL; + if ((domainp = index(ldomain, '.')) == (char *)NULL) { + nodomain = 1; + return(0); + } + for (cp = ++domainp; *cp; ++cp) + if (isupper(*cp)) + *cp = tolower(*cp); + } + return(!strcmp(domainp, rhost + len +1)); +} diff --git a/lib/libc4.3tahoe/net/res_comp.c b/lib/libc4.3tahoe/net/res_comp.c new file mode 100644 index 0000000..1f79747 --- /dev/null +++ b/lib/libc4.3tahoe/net/res_comp.c @@ -0,0 +1,314 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)res_comp.c 6.14 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include + +/* + * Expand compressed domain name 'comp_dn' to full domain name. + * 'msg' is a pointer to the begining of the message, + * 'eomorig' points to the first location after the message, + * 'exp_dn' is a pointer to a buffer of size 'length' for the result. + * Return size of compressed name or -1 if there was an error. + */ +dn_expand(msg, eomorig, comp_dn, exp_dn, length) + u_char *msg, *eomorig, *comp_dn, *exp_dn; + int length; +{ + register u_char *cp, *dn; + register int n, c; + u_char *eom; + int len = -1, checked = 0; + + dn = exp_dn; + cp = comp_dn; + eom = exp_dn + length - 1; + /* + * fetch next label in domain name + */ + while (n = *cp++) { + /* + * Check for indirection + */ + switch (n & INDIR_MASK) { + case 0: + if (dn != exp_dn) { + if (dn >= eom) + return (-1); + *dn++ = '.'; + } + if (dn+n >= eom) + return (-1); + checked += n + 1; + while (--n >= 0) { + if ((c = *cp++) == '.') { + if (dn+n+1 >= eom) + return (-1); + *dn++ = '\\'; + } + *dn++ = c; + if (cp >= eomorig) /* out of range */ + return(-1); + } + break; + + case INDIR_MASK: + if (len < 0) + len = cp - comp_dn + 1; + cp = msg + (((n & 0x3f) << 8) | (*cp & 0xff)); + if (cp < msg || cp >= eomorig) /* out of range */ + return(-1); + checked += 2; + /* + * Check for loops in the compressed name; + * if we've looked at the whole message, + * there must be a loop. + */ + if (checked >= eomorig - msg) + return (-1); + break; + + default: + return (-1); /* flag error */ + } + } + *dn = '\0'; + if (len < 0) + len = cp - comp_dn; + return (len); +} + +/* + * Compress domain name 'exp_dn' into 'comp_dn'. + * Return the size of the compressed name or -1. + * 'length' is the size of the array pointed to by 'comp_dn'. + * 'dnptrs' is a list of pointers to previous compressed names. dnptrs[0] + * is a pointer to the beginning of the message. The list ends with NULL. + * 'lastdnptr' is a pointer to the end of the arrary pointed to + * by 'dnptrs'. Side effect is to update the list of pointers for + * labels inserted into the message as we compress the name. + * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr' + * is NULL, we don't update the list. + */ +dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) + u_char *exp_dn, *comp_dn; + int length; + u_char **dnptrs, **lastdnptr; +{ + register u_char *cp, *dn; + register int c, l; + u_char **cpp, **lpp, *sp, *eob; + u_char *msg; + + dn = exp_dn; + cp = comp_dn; + eob = cp + length; + if (dnptrs != NULL) { + if ((msg = *dnptrs++) != NULL) { + for (cpp = dnptrs; *cpp != NULL; cpp++) + ; + lpp = cpp; /* end of list to search */ + } + } else + msg = NULL; + for (c = *dn++; c != '\0'; ) { + /* look to see if we can use pointers */ + if (msg != NULL) { + if ((l = dn_find(dn-1, msg, dnptrs, lpp)) >= 0) { + if (cp+1 >= eob) + return (-1); + *cp++ = (l >> 8) | INDIR_MASK; + *cp++ = l % 256; + return (cp - comp_dn); + } + /* not found, save it */ + if (lastdnptr != NULL && cpp < lastdnptr-1) { + *cpp++ = cp; + *cpp = NULL; + } + } + sp = cp++; /* save ptr to length byte */ + do { + if (c == '.') { + c = *dn++; + break; + } + if (c == '\\') { + if ((c = *dn++) == '\0') + break; + } + if (cp >= eob) + return (-1); + *cp++ = c; + } while ((c = *dn++) != '\0'); + /* catch trailing '.'s but not '..' */ + if ((l = cp - sp - 1) == 0 && c == '\0') { + cp--; + break; + } + if (l <= 0 || l > MAXLABEL) + return (-1); + *sp = l; + } + if (cp >= eob) + return (-1); + *cp++ = '\0'; + return (cp - comp_dn); +} + +/* + * Skip over a compressed domain name. Return the size or -1. + */ +dn_skipname(comp_dn, eom) + u_char *comp_dn, *eom; +{ + register u_char *cp; + register int n; + + cp = comp_dn; + while (cp < eom && (n = *cp++)) { + /* + * check for indirection + */ + switch (n & INDIR_MASK) { + case 0: /* normal case, n == len */ + cp += n; + continue; + default: /* illegal type */ + return (-1); + case INDIR_MASK: /* indirection */ + cp++; + } + break; + } + return (cp - comp_dn); +} + +/* + * Search for expanded name from a list of previously compressed names. + * Return the offset from msg if found or -1. + * dnptrs is the pointer to the first name on the list, + * not the pointer to the start of the message. + */ +static +dn_find(exp_dn, msg, dnptrs, lastdnptr) + u_char *exp_dn, *msg; + u_char **dnptrs, **lastdnptr; +{ + register u_char *dn, *cp, **cpp; + register int n; + u_char *sp; + + for (cpp = dnptrs; cpp < lastdnptr; cpp++) { + dn = exp_dn; + sp = cp = *cpp; + while (n = *cp++) { + /* + * check for indirection + */ + switch (n & INDIR_MASK) { + case 0: /* normal case, n == len */ + while (--n >= 0) { + if (*dn == '\\') + dn++; + if (*dn++ != *cp++) + goto next; + } + if ((n = *dn++) == '\0' && *cp == '\0') + return (sp - msg); + if (n == '.') + continue; + goto next; + + default: /* illegal type */ + return (-1); + + case INDIR_MASK: /* indirection */ + cp = msg + (((n & 0x3f) << 8) | *cp); + } + } + if (*dn == '\0') + return (sp - msg); + next: ; + } + return (-1); +} + +/* + * Routines to insert/extract short/long's. Must account for byte + * order and non-alignment problems. This code at least has the + * advantage of being portable. + * + * used by sendmail. + */ + +u_short +_getshort(msgp) + u_char *msgp; +{ + register u_char *p = (u_char *) msgp; +#ifdef vax + /* + * vax compiler doesn't put shorts in registers + */ + register u_long u; +#else + register u_short u; +#endif + + u = *p++ << 8; + return ((u_short)(u | *p)); +} + +u_long +_getlong(msgp) + u_char *msgp; +{ + register u_char *p = (u_char *) msgp; + register u_long u; + + u = *p++; u <<= 8; + u |= *p++; u <<= 8; + u |= *p++; u <<= 8; + return (u | *p); +} + + +putshort(s, msgp) + register u_short s; + register u_char *msgp; +{ + + msgp[1] = s; + msgp[0] = s >> 8; +} + +putlong(l, msgp) + register u_long l; + register u_char *msgp; +{ + + msgp[3] = l; + msgp[2] = (l >>= 8); + msgp[1] = (l >>= 8); + msgp[0] = l >> 8; +} diff --git a/lib/libc4.3tahoe/net/res_debug.c b/lib/libc4.3tahoe/net/res_debug.c new file mode 100644 index 0000000..622527e --- /dev/null +++ b/lib/libc4.3tahoe/net/res_debug.c @@ -0,0 +1,488 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)res_debug.c 5.24 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#if defined(lint) && !defined(DEBUG) +#define DEBUG +#endif + +#include +#include +#include +#include + +extern char *p_cdname(), *p_rr(), *p_type(), *p_class(), *p_time(); +extern char *inet_ntoa(); + +char *_res_opcodes[] = { + "QUERY", + "IQUERY", + "CQUERYM", + "CQUERYU", + "4", + "5", + "6", + "7", + "8", + "UPDATEA", + "UPDATED", + "UPDATEDA", + "UPDATEM", + "UPDATEMA", + "ZONEINIT", + "ZONEREF", +}; + +char *_res_resultcodes[] = { + "NOERROR", + "FORMERR", + "SERVFAIL", + "NXDOMAIN", + "NOTIMP", + "REFUSED", + "6", + "7", + "8", + "9", + "10", + "11", + "12", + "13", + "14", + "NOCHANGE", +}; + +p_query(msg) + char *msg; +{ +#ifdef DEBUG + fp_query(msg,stdout); +#endif +} + +/* + * Print the contents of a query. + * This is intended to be primarily a debugging routine. + */ +fp_query(msg,file) + char *msg; + FILE *file; +{ +#ifdef DEBUG + register char *cp; + register HEADER *hp; + register int n; + + /* + * Print header fields. + */ + hp = (HEADER *)msg; + cp = msg + sizeof(HEADER); + fprintf(file,"HEADER:\n"); + fprintf(file,"\topcode = %s", _res_opcodes[hp->opcode]); + fprintf(file,", id = %d", ntohs(hp->id)); + fprintf(file,", rcode = %s\n", _res_resultcodes[hp->rcode]); + fprintf(file,"\theader flags: "); + if (hp->qr) + fprintf(file," qr"); + if (hp->aa) + fprintf(file," aa"); + if (hp->tc) + fprintf(file," tc"); + if (hp->rd) + fprintf(file," rd"); + if (hp->ra) + fprintf(file," ra"); + if (hp->pr) + fprintf(file," pr"); + fprintf(file,"\n\tqdcount = %d", ntohs(hp->qdcount)); + fprintf(file,", ancount = %d", ntohs(hp->ancount)); + fprintf(file,", nscount = %d", ntohs(hp->nscount)); + fprintf(file,", arcount = %d\n\n", ntohs(hp->arcount)); + /* + * Print question records. + */ + if (n = ntohs(hp->qdcount)) { + fprintf(file,"QUESTIONS:\n"); + while (--n >= 0) { + fprintf(file,"\t"); + cp = p_cdname(cp, msg, file); + if (cp == NULL) + return; + fprintf(file,", type = %s", p_type(_getshort(cp))); + cp += sizeof(u_short); + fprintf(file,", class = %s\n\n", p_class(_getshort(cp))); + cp += sizeof(u_short); + } + } + /* + * Print authoritative answer records + */ + if (n = ntohs(hp->ancount)) { + fprintf(file,"ANSWERS:\n"); + while (--n >= 0) { + fprintf(file,"\t"); + cp = p_rr(cp, msg, file); + if (cp == NULL) + return; + } + } + /* + * print name server records + */ + if (n = ntohs(hp->nscount)) { + fprintf(file,"NAME SERVERS:\n"); + while (--n >= 0) { + fprintf(file,"\t"); + cp = p_rr(cp, msg, file); + if (cp == NULL) + return; + } + } + /* + * print additional records + */ + if (n = ntohs(hp->arcount)) { + fprintf(file,"ADDITIONAL RECORDS:\n"); + while (--n >= 0) { + fprintf(file,"\t"); + cp = p_rr(cp, msg, file); + if (cp == NULL) + return; + } + } +#endif +} + +char * +p_cdname(cp, msg, file) + char *cp, *msg; + FILE *file; +{ +#ifdef DEBUG + char name[MAXDNAME]; + int n; + + if ((n = dn_expand(msg, msg + 512, cp, name, sizeof(name))) < 0) + return (NULL); + if (name[0] == '\0') { + name[0] = '.'; + name[1] = '\0'; + } + fputs(name, file); + return (cp + n); +#endif +} + +/* + * Print resource record fields in human readable form. + */ +char * +p_rr(cp, msg, file) + char *cp, *msg; + FILE *file; +{ +#ifdef DEBUG + int type, class, dlen, n, c; + struct in_addr inaddr; + char *cp1; + + if ((cp = p_cdname(cp, msg, file)) == NULL) + return (NULL); /* compression error */ + fprintf(file,"\n\ttype = %s", p_type(type = _getshort(cp))); + cp += sizeof(u_short); + fprintf(file,", class = %s", p_class(class = _getshort(cp))); + cp += sizeof(u_short); + fprintf(file,", ttl = %s", p_time(cp)); + cp += sizeof(u_long); + fprintf(file,", dlen = %d\n", dlen = _getshort(cp)); + cp += sizeof(u_short); + cp1 = cp; + /* + * Print type specific data, if appropriate + */ + switch (type) { + case T_A: + switch (class) { + case C_IN: + bcopy(cp, (char *)&inaddr, sizeof(inaddr)); + if (dlen == 4) { + fprintf(file,"\tinternet address = %s\n", + inet_ntoa(inaddr)); + cp += dlen; + } else if (dlen == 7) { + fprintf(file,"\tinternet address = %s", + inet_ntoa(inaddr)); + fprintf(file,", protocol = %d", cp[4]); + fprintf(file,", port = %d\n", + (cp[5] << 8) + cp[6]); + cp += dlen; + } + break; + default: + cp += dlen; + } + break; + case T_CNAME: + case T_MB: +#ifdef OLDRR + case T_MD: + case T_MF: +#endif /* OLDRR */ + case T_MG: + case T_MR: + case T_NS: + case T_PTR: + fprintf(file,"\tdomain name = "); + cp = p_cdname(cp, msg, file); + fprintf(file,"\n"); + break; + + case T_HINFO: + if (n = *cp++) { + fprintf(file,"\tCPU=%.*s\n", n, cp); + cp += n; + } + if (n = *cp++) { + fprintf(file,"\tOS=%.*s\n", n, cp); + cp += n; + } + break; + + case T_SOA: + fprintf(file,"\torigin = "); + cp = p_cdname(cp, msg, file); + fprintf(file,"\n\tmail addr = "); + cp = p_cdname(cp, msg, file); + fprintf(file,"\n\tserial=%ld", _getlong(cp)); + cp += sizeof(u_long); + fprintf(file,", refresh=%s", p_time(cp)); + cp += sizeof(u_long); + fprintf(file,", retry=%s", p_time(cp)); + cp += sizeof(u_long); + fprintf(file,", expire=%s", p_time(cp)); + cp += sizeof(u_long); + fprintf(file,", min=%s\n", p_time(cp)); + cp += sizeof(u_long); + break; + + case T_MX: + fprintf(file,"\tpreference = %ld,",_getshort(cp)); + cp += sizeof(u_short); + fprintf(file," name = "); + cp = p_cdname(cp, msg, file); + break; + + case T_MINFO: + fprintf(file,"\trequests = "); + cp = p_cdname(cp, msg, file); + fprintf(file,"\n\terrors = "); + cp = p_cdname(cp, msg, file); + break; + + case T_UINFO: + fprintf(file,"\t%s\n", cp); + cp += dlen; + break; + + case T_UID: + case T_GID: + if (dlen == 4) { + fprintf(file,"\t%ld\n", _getlong(cp)); + cp += sizeof(int); + } + break; + + case T_WKS: + if (dlen < sizeof(u_long) + 1) + break; + bcopy(cp, (char *)&inaddr, sizeof(inaddr)); + cp += sizeof(u_long); + fprintf(file,"\tinternet address = %s, protocol = %d\n\t", + inet_ntoa(inaddr), *cp++); + n = 0; + while (cp < cp1 + dlen) { + c = *cp++; + do { + if (c & 0200) + fprintf(file," %d", n); + c <<= 1; + } while (++n & 07); + } + putc('\n',file); + break; + +#ifdef ALLOW_T_UNSPEC + case T_UNSPEC: + { + int NumBytes = 8; + char *DataPtr; + int i; + + if (dlen < NumBytes) NumBytes = dlen; + fprintf(file, "\tFirst %d bytes of hex data:", + NumBytes); + for (i = 0, DataPtr = cp; i < NumBytes; i++, DataPtr++) + fprintf(file, " %x", *DataPtr); + fputs("\n", file); + cp += dlen; + } + break; +#endif /* ALLOW_T_UNSPEC */ + + default: + fprintf(file,"\t???\n"); + cp += dlen; + } + if (cp != cp1 + dlen) + fprintf(file,"packet size error (%#x != %#x)\n", cp, cp1+dlen); + fprintf(file,"\n"); + return (cp); +#endif +} + +static char nbuf[40]; + +/* + * Return a string for the type + */ +char * +p_type(type) + int type; +{ + switch (type) { + case T_A: + return("A"); + case T_NS: /* authoritative server */ + return("NS"); +#ifdef OLDRR + case T_MD: /* mail destination */ + return("MD"); + case T_MF: /* mail forwarder */ + return("MF"); +#endif /* OLDRR */ + case T_CNAME: /* connonical name */ + return("CNAME"); + case T_SOA: /* start of authority zone */ + return("SOA"); + case T_MB: /* mailbox domain name */ + return("MB"); + case T_MG: /* mail group member */ + return("MG"); + case T_MX: /* mail routing info */ + return("MX"); + case T_MR: /* mail rename name */ + return("MR"); + case T_NULL: /* null resource record */ + return("NULL"); + case T_WKS: /* well known service */ + return("WKS"); + case T_PTR: /* domain name pointer */ + return("PTR"); + case T_HINFO: /* host information */ + return("HINFO"); + case T_MINFO: /* mailbox information */ + return("MINFO"); + case T_AXFR: /* zone transfer */ + return("AXFR"); + case T_MAILB: /* mail box */ + return("MAILB"); + case T_MAILA: /* mail address */ + return("MAILA"); + case T_ANY: /* matches any type */ + return("ANY"); + case T_UINFO: + return("UINFO"); + case T_UID: + return("UID"); + case T_GID: + return("GID"); +#ifdef ALLOW_T_UNSPEC + case T_UNSPEC: + return("UNSPEC"); +#endif /* ALLOW_T_UNSPEC */ + default: + (void)sprintf(nbuf, "%d", type); + return(nbuf); + } +} + +/* + * Return a mnemonic for class + */ +char * +p_class(class) + int class; +{ + + switch (class) { + case C_IN: /* internet class */ + return("IN"); + case C_ANY: /* matches any class */ + return("ANY"); + default: + (void)sprintf(nbuf, "%d", class); + return(nbuf); + } +} + +/* + * Return a mnemonic for a time to live + */ +char +*p_time(value) + u_long value; +{ + int secs, mins, hours; + register char *p; + + secs = value % 60; + value /= 60; + mins = value % 60; + value /= 60; + hours = value % 24; + value /= 24; + +#define PLURALIZE(x) x, (x == 1) ? "" : "s" + p = nbuf; + if (value) { + (void)sprintf(p, "%d day%s", PLURALIZE(value)); + while (*++p); + } + if (hours) { + if (p != nbuf) + *p++ = ' '; + (void)sprintf(p, "%d hour%s", PLURALIZE(hours)); + while (*++p); + } + if (mins) { + if (p != nbuf) + *p++ = ' '; + (void)sprintf(p, "%d min%s", PLURALIZE(mins)); + while (*++p); + } + if (secs) { + if (p != nbuf) + *p++ = ' '; + (void)sprintf(p, "%d sec%s", PLURALIZE(secs)); + while (*++p); + } + return(nbuf); +} diff --git a/lib/libc4.3tahoe/net/res_init.c b/lib/libc4.3tahoe/net/res_init.c new file mode 100644 index 0000000..afdbce3 --- /dev/null +++ b/lib/libc4.3tahoe/net/res_init.c @@ -0,0 +1,143 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)res_init.c 6.9 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include +#include + +/* + * Resolver configuration file. Contains the address of the + * inital name server to query and the default domain for + * non fully qualified domain names. + */ + +#ifndef CONFFILE +#define CONFFILE "/etc/resolv.conf" +#endif + +/* + * Resolver state default settings + */ + +struct state _res = { + RES_TIMEOUT, /* retransmition time interval */ + 4, /* number of times to retransmit */ + RES_DEFAULT, /* options flags */ + 1, /* number of name servers */ +}; + +/* + * Set up default settings. If the configuration file exist, the values + * there will have precedence. Otherwise, the server address is set to + * INADDR_ANY and the default domain name comes from the gethostname(). + * + * The configuration file should only be used if you want to redefine your + * domain or run without a server on your machine. + * + * Return 0 if completes successfully, -1 on error + */ +res_init() +{ + register FILE *fp; + register char *cp, **pp; + char buf[BUFSIZ]; + extern u_long inet_addr(); + extern char *index(); + extern char *strcpy(), *strncpy(); + extern char *getenv(); + int n = 0; /* number of nameserver records read from file */ + + _res.nsaddr.sin_addr.s_addr = INADDR_ANY; + _res.nsaddr.sin_family = AF_INET; + _res.nsaddr.sin_port = htons(NAMESERVER_PORT); + _res.nscount = 1; + _res.defdname[0] = '\0'; + + if ((fp = fopen(CONFFILE, "r")) != NULL) { + /* read the config file */ + while (fgets(buf, sizeof(buf), fp) != NULL) { + /* read default domain name */ + if (!strncmp(buf, "domain", sizeof("domain") - 1)) { + cp = buf + sizeof("domain") - 1; + while (*cp == ' ' || *cp == '\t') + cp++; + if (*cp == '\0') + continue; + (void)strncpy(_res.defdname, cp, sizeof(_res.defdname)); + _res.defdname[sizeof(_res.defdname) - 1] = '\0'; + if ((cp = index(_res.defdname, '\n')) != NULL) + *cp = '\0'; + continue; + } + /* read nameservers to query */ + if (!strncmp(buf, "nameserver", + sizeof("nameserver") - 1) && (n < MAXNS)) { + cp = buf + sizeof("nameserver") - 1; + while (*cp == ' ' || *cp == '\t') + cp++; + if (*cp == '\0') + continue; + _res.nsaddr_list[n].sin_addr.s_addr = inet_addr(cp); + if (_res.nsaddr_list[n].sin_addr.s_addr == (unsigned)-1) + _res.nsaddr_list[n].sin_addr.s_addr = INADDR_ANY; + _res.nsaddr_list[n].sin_family = AF_INET; + _res.nsaddr_list[n].sin_port = htons(NAMESERVER_PORT); + if ( ++n >= MAXNS) { + n = MAXNS; +#ifdef DEBUG + if ( _res.options & RES_DEBUG ) + printf("MAXNS reached, reading resolv.conf\n"); +#endif DEBUG + } + continue; + } + } + if ( n > 1 ) + _res.nscount = n; + (void) fclose(fp); + } + if (_res.defdname[0] == 0) { + if (gethostname(buf, sizeof(_res.defdname)) == 0 && + (cp = index(buf, '.'))) + (void)strcpy(_res.defdname, cp + 1); + } + + /* Allow user to override the local domain definition */ + if ((cp = getenv("LOCALDOMAIN")) != NULL) + (void)strncpy(_res.defdname, cp, sizeof(_res.defdname)); + + /* find components of local domain that might be searched */ + pp = _res.dnsrch; + *pp++ = _res.defdname; + for (cp = _res.defdname, n = 0; *cp; cp++) + if (*cp == '.') + n++; + cp = _res.defdname; + for (; n >= LOCALDOMAINPARTS && pp < _res.dnsrch + MAXDNSRCH; n--) { + cp = index(cp, '.'); + *pp++ = ++cp; + } + _res.options |= RES_INIT; + return(0); +} diff --git a/lib/libc4.3tahoe/net/res_mkquery.c b/lib/libc4.3tahoe/net/res_mkquery.c new file mode 100644 index 0000000..91ec800 --- /dev/null +++ b/lib/libc4.3tahoe/net/res_mkquery.c @@ -0,0 +1,200 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that this notice is preserved and that due credit is given + * to the University of California at Berkeley. The name of the University + * may not be used to endorse or promote products derived from this + * software without specific prior written permission. This software + * is provided ``as is'' without express or implied warranty. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)res_mkquery.c 6.7 (Berkeley) 3/7/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include + +/* + * Form all types of queries. + * Returns the size of the result or -1. + */ +res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) + int op; /* opcode of query */ + char *dname; /* domain name */ + int class, type; /* class and type of query */ + char *data; /* resource record data */ + int datalen; /* length of data */ + struct rrec *newrr; /* new rr for modify or append */ + char *buf; /* buffer to put query */ + int buflen; /* size of buffer */ +{ + register HEADER *hp; + register char *cp; + register int n; + char dnbuf[MAXDNAME]; + char *dnptrs[10], **dpp, **lastdnptr; + extern char *index(); + +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("res_mkquery(%d, %s, %d, %d)\n", op, dname, class, type); +#endif DEBUG + /* + * Initialize header fields. + */ + hp = (HEADER *) buf; + hp->id = htons(++_res.id); + hp->opcode = op; + hp->qr = hp->aa = hp->tc = hp->ra = 0; + hp->pr = (_res.options & RES_PRIMARY) != 0; + hp->rd = (_res.options & RES_RECURSE) != 0; + hp->rcode = NOERROR; + hp->qdcount = 0; + hp->ancount = 0; + hp->nscount = 0; + hp->arcount = 0; + cp = buf + sizeof(HEADER); + buflen -= sizeof(HEADER); + dpp = dnptrs; + *dpp++ = buf; + *dpp++ = NULL; + lastdnptr = dnptrs + sizeof(dnptrs)/sizeof(dnptrs[0]); + /* + * If the domain name contains no dots (single label), then + * append the default domain name to the one given. + */ + if ((_res.options & RES_DEFNAMES) && dname != 0 && dname[0] != '\0' && + index(dname, '.') == NULL) { + if (!(_res.options & RES_INIT)) + if (res_init() == -1) + return(-1); + if (_res.defdname[0] != '\0') { + (void)sprintf(dnbuf, "%s.%s", dname, _res.defdname); + dname = dnbuf; + } + } + /* + * perform opcode specific processing + */ + switch (op) { + case QUERY: + buflen -= QFIXEDSZ; + if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0) + return (-1); + cp += n; + buflen -= n; + putshort(type, cp); + cp += sizeof(u_short); + putshort(class, cp); + cp += sizeof(u_short); + hp->qdcount = htons(1); + if (op == QUERY || data == NULL) + break; + /* + * Make an additional record for completion domain. + */ + buflen -= RRFIXEDSZ; + if ((n = dn_comp(data, cp, buflen, dnptrs, lastdnptr)) < 0) + return (-1); + cp += n; + buflen -= n; + putshort(T_NULL, cp); + cp += sizeof(u_short); + putshort(class, cp); + cp += sizeof(u_short); + putlong(0, cp); + cp += sizeof(u_long); + putshort(0, cp); + cp += sizeof(u_short); + hp->arcount = htons(1); + break; + + case IQUERY: + /* + * Initialize answer section + */ + if (buflen < 1 + RRFIXEDSZ + datalen) + return (-1); + *cp++ = '\0'; /* no domain name */ + putshort(type, cp); + cp += sizeof(u_short); + putshort(class, cp); + cp += sizeof(u_short); + putlong(0, cp); + cp += sizeof(u_long); + putshort(datalen, cp); + cp += sizeof(u_short); + if (datalen) { + bcopy(data, cp, datalen); + cp += datalen; + } + hp->ancount = htons(1); + break; + +#ifdef ALLOW_UPDATES + /* + * For UPDATEM/UPDATEMA, do UPDATED/UPDATEDA followed by UPDATEA + * (Record to be modified is followed by its replacement in msg.) + */ + case UPDATEM: + case UPDATEMA: + + case UPDATED: + /* + * The res code for UPDATED and UPDATEDA is the same; user + * calls them differently: specifies data for UPDATED; server + * ignores data if specified for UPDATEDA. + */ + case UPDATEDA: + buflen -= RRFIXEDSZ + datalen; + if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0) + return (-1); + cp += n; + putshort(type, cp); + cp += sizeof(u_short); + putshort(class, cp); + cp += sizeof(u_short); + putlong(0, cp); + cp += sizeof(u_long); + putshort(datalen, cp); + cp += sizeof(u_short); + if (datalen) { + bcopy(data, cp, datalen); + cp += datalen; + } + if ( (op == UPDATED) || (op == UPDATEDA) ) { + hp->ancount = htons(0); + break; + } + /* Else UPDATEM/UPDATEMA, so drop into code for UPDATEA */ + + case UPDATEA: /* Add new resource record */ + buflen -= RRFIXEDSZ + datalen; + if ((n = dn_comp(dname, cp, buflen, dnptrs, lastdnptr)) < 0) + return (-1); + cp += n; + putshort(newrr->r_type, cp); + cp += sizeof(u_short); + putshort(newrr->r_class, cp); + cp += sizeof(u_short); + putlong(0, cp); + cp += sizeof(u_long); + putshort(newrr->r_size, cp); + cp += sizeof(u_short); + if (newrr->r_size) { + bcopy(newrr->r_data, cp, newrr->r_size); + cp += newrr->r_size; + } + hp->ancount = htons(0); + break; + +#endif ALLOW_UPDATES + } + return (cp - buf); +} diff --git a/lib/libc4.3tahoe/net/res_query.c b/lib/libc4.3tahoe/net/res_query.c new file mode 100644 index 0000000..eddf488 --- /dev/null +++ b/lib/libc4.3tahoe/net/res_query.c @@ -0,0 +1,251 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that this notice is preserved and that due credit is given + * to the University of California at Berkeley. The name of the University + * may not be used to endorse or promote products derived from this + * software without specific prior written permission. This software + * is provided ``as is'' without express or implied warranty. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)res_query.c 5.4 (Berkeley) 4/21/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if PACKETSZ > 1024 +#define MAXPACKET PACKETSZ +#else +#define MAXPACKET 1024 +#endif + +extern int errno; +int h_errno; + +/* + * Formulate a normal query, send, and await answer. + * Returned answer is placed in supplied buffer "answer". + * Perform preliminary check of answer, returning success only + * if no error is indicated and the answer count is nonzero. + * Return the size of the response on success, -1 on error. + * Error number is left in h_errno. + * Caller must parse answer and determine whether it answers the question. + */ +res_query(name, class, type, answer, anslen) + char *name; /* domain name */ + int class, type; /* class and type of query */ + u_char *answer; /* buffer to put answer */ + int anslen; /* size of answer buffer */ +{ + char buf[MAXPACKET]; + HEADER *hp; + int n; + + if ((_res.options & RES_INIT) == 0 && res_init() == -1) + return (-1); +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("res_query(%s, %d, %d)\n", name, class, type); +#endif + n = res_mkquery(QUERY, name, class, type, (char *)NULL, 0, NULL, + buf, sizeof(buf)); + + if (n <= 0) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("res_query: mkquery failed\n"); +#endif + h_errno = NO_RECOVERY; + return (n); + } + n = res_send(buf, n, answer, anslen); + if (n < 0) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("res_query: send error\n"); +#endif + h_errno = TRY_AGAIN; + return(n); + } + + hp = (HEADER *) answer; + if (hp->rcode != NOERROR || ntohs(hp->ancount) == 0) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("rcode = %d, ancount=%d\n", hp->rcode, + ntohs(hp->ancount)); +#endif + switch (hp->rcode) { + case NXDOMAIN: + h_errno = HOST_NOT_FOUND; + break; + case SERVFAIL: + h_errno = TRY_AGAIN; + break; + case NOERROR: + h_errno = NO_DATA; + break; + case FORMERR: + case NOTIMP: + case REFUSED: + default: + h_errno = NO_RECOVERY; + break; + } + return (-1); + } + return(n); +} + +/* + * Formulate a normal query, send, and retrieve answer in supplied buffer. + * Return the size of the response on success, -1 on error. + * If enabled, implement search rules until answer or unrecoverable failure + * is detected. Error number is left in h_errno. + * Only useful for queries in the same name hierarchy as the local host + * (not, for example, for host address-to-name lookups in domain in-addr.arpa). + */ +res_search(name, class, type, answer, anslen) + char *name; /* domain name */ + int class, type; /* class and type of query */ + u_char *answer; /* buffer to put answer */ + int anslen; /* size of answer */ +{ + register char *cp, **domain; + int n, ret, got_nodata = 0; + char *hostalias(); + + if ((_res.options & RES_INIT) == 0 && res_init() == -1) + return (-1); + + errno = 0; + h_errno = HOST_NOT_FOUND; /* default, if we never query */ + for (cp = name, n = 0; *cp; cp++) + if (*cp == '.') + n++; + if (n == 0 && (cp = hostalias(name))) + return (res_query(cp, class, type, answer, anslen)); + + if ((n == 0 || *--cp != '.') && (_res.options & RES_DEFNAMES)) + for (domain = _res.dnsrch; *domain; domain++) { + ret = res_querydomain(name, *domain, class, type, + answer, anslen); + if (ret > 0) + return (ret); + /* + * If no server present, give up. + * If name isn't found in this domain, + * keep trying higher domains in the search list + * (if that's enabled). + * On a NO_DATA error, keep trying, otherwise + * a wildcard entry of another type could keep us + * from finding this entry higher in the domain. + * If we get some other error (non-authoritative negative + * answer or server failure), then stop searching up, + * but try the input name below in case it's fully-qualified. + */ + if (errno == ECONNREFUSED) { + h_errno = TRY_AGAIN; + return (-1); + } + if (h_errno == NO_DATA) + got_nodata++; + if ((h_errno != HOST_NOT_FOUND && h_errno != NO_DATA) || + (_res.options & RES_DNSRCH) == 0) + break; + } + /* + * If the search/default failed, try the name as fully-qualified, + * but only if it contained at least one dot (even trailing). + */ + if (n) + return (res_querydomain(name, (char *)NULL, class, type, + answer, anslen)); + if (got_nodata) + h_errno = NO_DATA; + return (-1); +} + +/* + * Perform a call on res_query on the concatenation of name and domain, + * removing a trailing dot from name if domain is NULL. + */ +res_querydomain(name, domain, class, type, answer, anslen) + char *name, *domain; + int class, type; /* class and type of query */ + u_char *answer; /* buffer to put answer */ + int anslen; /* size of answer */ +{ + char nbuf[2*MAXDNAME+2]; + char *longname = nbuf; + int n; + +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("res_querydomain(%s, %s, %d, %d)\n", + name, domain, class, type); +#endif + if (domain == NULL) { + /* + * Check for trailing '.'; + * copy without '.' if present. + */ + n = strlen(name) - 1; + if (name[n] == '.' && n < sizeof(nbuf) - 1) { + bcopy(name, nbuf, n); + nbuf[n] = '\0'; + } else + longname = name; + } else + (void)sprintf(nbuf, "%.*s.%.*s", + MAXDNAME, name, MAXDNAME, domain); + + return (res_query(longname, class, type, answer, anslen)); +} + +char * +hostalias(name) + register char *name; +{ + register char *C1, *C2; + FILE *fp; + char *file, *getenv(), *strcpy(), *strncpy(); + char buf[BUFSIZ]; + static char abuf[MAXDNAME]; + + file = getenv("HOSTALIASES"); + if (file == NULL || (fp = fopen(file, "r")) == NULL) + return (NULL); + buf[sizeof(buf) - 1] = '\0'; + while (fgets(buf, sizeof(buf), fp)) { + for (C1 = buf; *C1 && !isspace(*C1); ++C1); + if (!*C1) + break; + *C1 = '\0'; + if (!strcasecmp(buf, name)) { + while (isspace(*++C1)); + if (!*C1) + break; + for (C2 = C1 + 1; *C2 && !isspace(*C2); ++C2); + abuf[sizeof(abuf) - 1] = *C2 = '\0'; + (void)strncpy(abuf, C1, sizeof(abuf) - 1); + fclose(fp); + return (abuf); + } + } + fclose(fp); + return (NULL); +} diff --git a/lib/libc4.3tahoe/net/res_send.c b/lib/libc4.3tahoe/net/res_send.c new file mode 100644 index 0000000..daae7fe --- /dev/null +++ b/lib/libc4.3tahoe/net/res_send.c @@ -0,0 +1,371 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)res_send.c 6.21 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +/* + * Send query to name server and wait for reply. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern int errno; + +static int s = -1; /* socket used for communications */ +static struct sockaddr no_addr; + + +#ifndef FD_SET +#define NFDBITS 32 +#define FD_SETSIZE 32 +#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) +#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) +#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) +#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) +#endif + +#define KEEPOPEN (RES_USEVC|RES_STAYOPEN) + +res_send(buf, buflen, answer, anslen) + char *buf; + int buflen; + char *answer; + int anslen; +{ + register int n; + int retry, v_circuit, resplen, ns; + int gotsomewhere = 0, connected = 0; + u_short id, len; + char *cp; + fd_set dsmask; + struct timeval timeout; + HEADER *hp = (HEADER *) buf; + HEADER *anhp = (HEADER *) answer; + struct iovec iov[2]; + int terrno = ETIMEDOUT; + char junk[512]; + +#ifdef DEBUG + if (_res.options & RES_DEBUG) { + printf("res_send()\n"); + p_query(buf); + } +#endif DEBUG + if (!(_res.options & RES_INIT)) + if (res_init() == -1) { + return(-1); + } + v_circuit = (_res.options & RES_USEVC) || buflen > PACKETSZ; + id = hp->id; + /* + * Send request, RETRY times, or until successful + */ + for (retry = _res.retry; retry > 0; retry--) { + for (ns = 0; ns < _res.nscount; ns++) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("Querying server (# %d) address = %s\n", ns+1, + inet_ntoa(_res.nsaddr_list[ns].sin_addr)); +#endif DEBUG + if (v_circuit) { + int truncated = 0; + + /* + * Use virtual circuit. + */ + if (s < 0) { + s = socket(AF_INET, SOCK_STREAM, 0); + if (s < 0) { + terrno = errno; +#ifdef DEBUG + if (_res.options & RES_DEBUG) + perror("socket failed"); +#endif DEBUG + continue; + } + if (connect(s, &(_res.nsaddr_list[ns]), + sizeof(struct sockaddr)) < 0) { + terrno = errno; +#ifdef DEBUG + if (_res.options & RES_DEBUG) + perror("connect failed"); +#endif DEBUG + (void) close(s); + s = -1; + continue; + } + } + /* + * Send length & message + */ + len = htons((u_short)buflen); + iov[0].iov_base = (caddr_t)&len; + iov[0].iov_len = sizeof(len); + iov[1].iov_base = buf; + iov[1].iov_len = buflen; + if (writev(s, iov, 2) != sizeof(len) + buflen) { + terrno = errno; +#ifdef DEBUG + if (_res.options & RES_DEBUG) + perror("write failed"); +#endif DEBUG + (void) close(s); + s = -1; + continue; + } + /* + * Receive length & response + */ + cp = answer; + len = sizeof(short); + while (len != 0 && + (n = read(s, (char *)cp, (int)len)) > 0) { + cp += n; + len -= n; + } + if (n <= 0) { + terrno = errno; +#ifdef DEBUG + if (_res.options & RES_DEBUG) + perror("read failed"); +#endif DEBUG + (void) close(s); + s = -1; + continue; + } + cp = answer; + if ((resplen = ntohs(*(u_short *)cp)) > anslen) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + fprintf(stderr, "response truncated\n"); +#endif DEBUG + len = anslen; + truncated = 1; + } else + len = resplen; + while (len != 0 && + (n = read(s, (char *)cp, (int)len)) > 0) { + cp += n; + len -= n; + } + if (n <= 0) { + terrno = errno; +#ifdef DEBUG + if (_res.options & RES_DEBUG) + perror("read failed"); +#endif DEBUG + (void) close(s); + s = -1; + continue; + } + if (truncated) { + /* + * Flush rest of answer + * so connection stays in synch. + */ + anhp->tc = 1; + len = resplen - anslen; + while (len != 0) { + n = (len > sizeof(junk) ? + sizeof(junk) : len); + if ((n = read(s, junk, n)) > 0) + len -= n; + else + break; + } + } + } else { + /* + * Use datagrams. + */ + if (s < 0) + s = socket(AF_INET, SOCK_DGRAM, 0); +#if BSD >= 43 + if (_res.nscount == 1 || retry == _res.retry) { + /* + * Don't use connect if we might + * still receive a response + * from another server. + */ + if (connected == 0) { + if (connect(s, &_res.nsaddr_list[ns], + sizeof(struct sockaddr)) < 0) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + perror("connect"); +#endif DEBUG + continue; + } + connected = 1; + } + if (send(s, buf, buflen, 0) != buflen) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + perror("send"); +#endif DEBUG + continue; + } + } else { + /* + * Disconnect if we want to listen + * for responses from more than one server. + */ + if (connected) { + (void) connect(s, &no_addr, + sizeof(no_addr)); + connected = 0; + } +#endif BSD + if (sendto(s, buf, buflen, 0, + &_res.nsaddr_list[ns], + sizeof(struct sockaddr)) != buflen) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + perror("sendto"); +#endif DEBUG + continue; + } +#if BSD >= 43 + } +#endif + + /* + * Wait for reply + */ + timeout.tv_sec = (_res.retrans << (_res.retry - retry)) + / _res.nscount; + if (timeout.tv_sec <= 0) + timeout.tv_sec = 1; + timeout.tv_usec = 0; +wait: + FD_ZERO(&dsmask); + FD_SET(s, &dsmask); + n = select(s+1, &dsmask, (fd_set *)NULL, + (fd_set *)NULL, &timeout); + if (n < 0) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + perror("select"); +#endif DEBUG + continue; + } + if (n == 0) { + /* + * timeout + */ +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("timeout\n"); +#endif DEBUG + gotsomewhere = 1; + continue; + } + if ((resplen = recv(s, answer, anslen, 0)) <= 0) { +#ifdef DEBUG + if (_res.options & RES_DEBUG) + perror("recvfrom"); +#endif DEBUG + continue; + } + gotsomewhere = 1; + if (id != anhp->id) { + /* + * response from old query, ignore it + */ +#ifdef DEBUG + if (_res.options & RES_DEBUG) { + printf("old answer:\n"); + p_query(answer); + } +#endif DEBUG + goto wait; + } + if (!(_res.options & RES_IGNTC) && anhp->tc) { + /* + * get rest of answer + */ +#ifdef DEBUG + if (_res.options & RES_DEBUG) + printf("truncated answer\n"); +#endif DEBUG + (void) close(s); + s = -1; + /* + * retry decremented on continue + * to desired starting value + */ + retry = _res.retry + 1; + v_circuit = 1; + continue; + } + } +#ifdef DEBUG + if (_res.options & RES_DEBUG) { + printf("got answer:\n"); + p_query(answer); + } +#endif DEBUG + /* + * We are going to assume that the first server is preferred + * over the rest (i.e. it is on the local machine) and only + * keep that one open. + */ + if ((_res.options & KEEPOPEN) == 0 || ns != 0) { + (void) close(s); + s = -1; + } + return (resplen); + } + } + if (s >= 0) { + (void) close(s); + s = -1; + } + if (v_circuit == 0) + if (gotsomewhere == 0) + errno = ECONNREFUSED; + else + errno = ETIMEDOUT; + else + errno = terrno; + return (-1); +} + +/* + * This routine is for closing the socket if a virtual circuit is used and + * the program wants to close it. This provides support for endhostent() + * which expects to close the socket. + * + * This routine is not expected to be user visible. + */ +_res_close() +{ + if (s != -1) { + (void) close(s); + s = -1; + } +} diff --git a/lib/libc4.3tahoe/net/rexec.c b/lib/libc4.3tahoe/net/rexec.c new file mode 100644 index 0000000..f065e6b --- /dev/null +++ b/lib/libc4.3tahoe/net/rexec.c @@ -0,0 +1,130 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rexec.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +#include + +#include +#include +#include + +extern errno; +char *index(); +int rexecoptions; +char *getpass(), *getlogin(); + +rexec(ahost, rport, name, pass, cmd, fd2p) + char **ahost; + int rport; + char *name, *pass, *cmd; + int *fd2p; +{ + int s, timo = 1, s3; + struct sockaddr_in sin, sin2, from; + char c; + short port; + struct hostent *hp; + + hp = gethostbyname(*ahost); + if (hp == 0) { + fprintf(stderr, "%s: unknown host\n", *ahost); + return (-1); + } + *ahost = hp->h_name; + ruserpass(hp->h_name, &name, &pass); +retry: + s = socket(AF_INET, SOCK_STREAM, 0); + if (s < 0) { + perror("rexec: socket"); + return (-1); + } + sin.sin_family = hp->h_addrtype; + sin.sin_port = rport; + bcopy(hp->h_addr, (caddr_t)&sin.sin_addr, hp->h_length); + if (connect(s, &sin, sizeof(sin)) < 0) { + if (errno == ECONNREFUSED && timo <= 16) { + (void) close(s); + sleep(timo); + timo *= 2; + goto retry; + } + perror(hp->h_name); + return (-1); + } + if (fd2p == 0) { + (void) write(s, "", 1); + port = 0; + } else { + char num[8]; + int s2, sin2len; + + s2 = socket(AF_INET, SOCK_STREAM, 0); + if (s2 < 0) { + (void) close(s); + return (-1); + } + listen(s2, 1); + sin2len = sizeof (sin2); + if (getsockname(s2, (char *)&sin2, &sin2len) < 0 || + sin2len != sizeof (sin2)) { + perror("getsockname"); + (void) close(s2); + goto bad; + } + port = ntohs((u_short)sin2.sin_port); + (void) sprintf(num, "%d", port); + (void) write(s, num, strlen(num)+1); + { int len = sizeof (from); + s3 = accept(s2, &from, &len, 0); + close(s2); + if (s3 < 0) { + perror("accept"); + port = 0; + goto bad; + } + } + *fd2p = s3; + } + (void) write(s, name, strlen(name) + 1); + /* should public key encypt the password here */ + (void) write(s, pass, strlen(pass) + 1); + (void) write(s, cmd, strlen(cmd) + 1); + if (read(s, &c, 1) != 1) { + perror(*ahost); + goto bad; + } + if (c != 0) { + while (read(s, &c, 1) == 1) { + (void) write(2, &c, 1); + if (c == '\n') + break; + } + goto bad; + } + return (s); +bad: + if (port) + (void) close(*fd2p); + (void) close(s); + return (-1); +} diff --git a/lib/libc4.3tahoe/net/ruserpass.c b/lib/libc4.3tahoe/net/ruserpass.c new file mode 100644 index 0000000..029ba98 --- /dev/null +++ b/lib/libc4.3tahoe/net/ruserpass.c @@ -0,0 +1,819 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ruserpass.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include +#include +#include + +char *renvlook(), *malloc(), *index(), *getenv(), *getpass(), *getlogin(); +struct utmp *getutmp(); +static FILE *cfile; + +ruserpass(host, aname, apass) + char *host, **aname, **apass; +{ + + renv(host, aname, apass); + if (*aname == 0 || *apass == 0) + rnetrc(host, aname, apass); + if (*aname == 0) { + char *myname = getlogin(); + *aname = malloc(16); + printf("Name (%s:%s): ", host, myname); + fflush(stdout); + if (read(2, *aname, 16) <= 0) + exit(1); + if ((*aname)[0] == '\n') + *aname = myname; + else + if (index(*aname, '\n')) + *index(*aname, '\n') = 0; + } + if (*aname && *apass == 0) { + printf("Password (%s:%s): ", host, *aname); + fflush(stdout); + *apass = getpass(""); + } +} + +static +renv(host, aname, apass) + char *host, **aname, **apass; +{ + register char *cp; + char *stemp, fgetlogin, *comma; + + cp = renvlook(host); + if (cp == NULL) + return; + if (!isalpha(cp[0])) + return; + comma = index(cp, ','); + if (comma == 0) + return; + if (*aname == 0) { + *aname = malloc(comma - cp + 1); + strncpy(*aname, cp, comma - cp); + } else + if (strncmp(*aname, cp, comma - cp)) + return; + comma++; + cp = malloc(strlen(comma)+1); + strcpy(cp, comma); + *apass = malloc(16); + mkpwclear(cp, host[0], *apass); +} + +static +char * +renvlook(host) + char *host; +{ + register char *cp, **env; + extern char **environ; + + env = environ; + for (env = environ; *env != NULL; env++) + if (!strncmp(*env, "MACH", 4)) { + cp = index(*env, '='); + if (cp == 0) + continue; + if (strncmp(*env+4, host, cp-(*env+4))) + continue; + return (cp+1); + } + return (NULL); +} + +#define DEFAULT 1 +#define LOGIN 2 +#define PASSWD 3 +#define NOTIFY 4 +#define WRITE 5 +#define YES 6 +#define NO 7 +#define COMMAND 8 +#define FORCE 9 +#define ID 10 +#define MACHINE 11 + +static char tokval[100]; + +static struct toktab { + char *tokstr; + int tval; +} toktab[]= { + "default", DEFAULT, + "login", LOGIN, + "password", PASSWD, + "notify", NOTIFY, + "write", WRITE, + "yes", YES, + "y", YES, + "no", NO, + "n", NO, + "command", COMMAND, + "force", FORCE, + "machine", MACHINE, + 0, 0 +}; + +static +rnetrc(host, aname, apass) + char *host, **aname, **apass; +{ + char *hdir, buf[BUFSIZ]; + int t; + struct stat stb; + extern int errno; + + hdir = getenv("HOME"); + if (hdir == NULL) + hdir = "."; + (void)sprintf(buf, "%s/.netrc", hdir); + cfile = fopen(buf, "r"); + if (cfile == NULL) { + if (errno != ENOENT) + perror(buf); + return; + } +next: + while ((t = token())) switch(t) { + + case DEFAULT: + (void) token(); + continue; + + case MACHINE: + if (token() != ID || strcmp(host, tokval)) + continue; + while ((t = token()) && t != MACHINE) switch(t) { + + case LOGIN: + if (token()) + if (*aname == 0) { + *aname = malloc(strlen(tokval) + 1); + strcpy(*aname, tokval); + } else { + if (strcmp(*aname, tokval)) + goto next; + } + break; + case PASSWD: + if (fstat(fileno(cfile), &stb) >= 0 + && (stb.st_mode & 077) != 0) { + fprintf(stderr, "Error - .netrc file not correct mode.\n"); + fprintf(stderr, "Remove password or correct mode.\n"); + exit(1); + } + if (token() && *apass == 0) { + *apass = malloc(strlen(tokval) + 1); + strcpy(*apass, tokval); + } + break; + case COMMAND: + case NOTIFY: + case WRITE: + case FORCE: + (void) token(); + break; + default: + fprintf(stderr, "Unknown .netrc option %s\n", tokval); + break; + } + goto done; + } +done: + fclose(cfile); +} + +static +token() +{ + char *cp; + int c; + struct toktab *t; + + if (feof(cfile)) + return (0); + while ((c = getc(cfile)) != EOF && + (c == '\n' || c == '\t' || c == ' ' || c == ',')) + continue; + if (c == EOF) + return (0); + cp = tokval; + if (c == '"') { + while ((c = getc(cfile)) != EOF && c != '"') { + if (c == '\\') + c = getc(cfile); + *cp++ = c; + } + } else { + *cp++ = c; + while ((c = getc(cfile)) != EOF + && c != '\n' && c != '\t' && c != ' ' && c != ',') { + if (c == '\\') + c = getc(cfile); + *cp++ = c; + } + } + *cp = 0; + if (tokval[0] == 0) + return (0); + for (t = toktab; t->tokstr; t++) + if (!strcmp(t->tokstr, tokval)) + return (t->tval); + return (ID); +} +/* rest is nbs.c stolen from berknet */ + +char *deblknot(), *deblkclr(); +char *nbs8decrypt(), *nbs8encrypt(); +static char E[48]; + +/* + * The E bit-selection table. + */ +static char e[] = { + 32, 1, 2, 3, 4, 5, + 4, 5, 6, 7, 8, 9, + 8, 9,10,11,12,13, + 12,13,14,15,16,17, + 16,17,18,19,20,21, + 20,21,22,23,24,25, + 24,25,26,27,28,29, + 28,29,30,31,32, 1, +}; +static +char *nbsencrypt(str,key,result) + char *result; + char *str, *key; { + static char buf[20],oldbuf[20]; + register int j; + result[0] = 0; + strcpy(oldbuf,key); + while(*str){ + for(j=0;j<10;j++)buf[j] = 0; + for(j=0;j<8 && *str;j++)buf[j] = *str++; + strcat(result,nbs8encrypt(buf,oldbuf)); + strcat(result,"$"); + strcpy(oldbuf,buf); + } + return(result); + } +static +char *nbsdecrypt(cpt,key,result) + char *result; + char *cpt,*key; { + char *s; + char c,oldbuf[20]; + result[0] = 0; + strcpy(oldbuf,key); + while(*cpt){ + for(s = cpt;*s && *s != '$';s++); + c = *s; + *s = 0; + strcpy(oldbuf,nbs8decrypt(cpt,oldbuf)); + strcat(result,oldbuf); + if(c == 0)break; + cpt = s + 1; + } + return(result); + } + +static +char *nbs8encrypt(str,key) +char *str, *key; { + static char keyblk[100], blk[100]; + register int i; + + enblkclr(keyblk,key); + nbssetkey(keyblk); + + for(i=0;i<48;i++) E[i] = e[i]; + enblkclr(blk,str); + blkencrypt(blk,0); /* forward dir */ + + return(deblknot(blk)); +} + +static +char *nbs8decrypt(crp,key) +char *crp, *key; { + static char keyblk[100], blk[100]; + register int i; + + enblkclr(keyblk,key); + nbssetkey(keyblk); + + for(i=0;i<48;i++) E[i] = e[i]; + enblknot(blk,crp); + blkencrypt(blk,1); /* backward dir */ + + return(deblkclr(blk)); +} + +static +enblkclr(blk,str) /* ignores top bit of chars in string str */ +char *blk,*str; { + register int i,j; + char c; + for(i=0;i<70;i++)blk[i] = 0; + for(i=0; (c= *str) && i<64; str++){ + for(j=0; j<7; j++, i++) + blk[i] = (c>>(6-j)) & 01; + i++; + } + } + +static +char *deblkclr(blk) +char *blk; { + register int i,j; + char c; + static char iobuf[30]; + for(i=0; i<10; i++){ + c = 0; + for(j=0; j<7; j++){ + c <<= 1; + c |= blk[8*i+j]; + } + iobuf[i] = c; + } + iobuf[i] = 0; + return(iobuf); + } + +static +enblknot(blk,crp) +char *blk; +char *crp; { + register int i,j; + char c; + for(i=0;i<70;i++)blk[i] = 0; + for(i=0; (c= *crp) && i<64; crp++){ + if(c>'Z') c -= 6; + if(c>'9') c -= 7; + c -= '.'; + for(j=0; j<6; j++, i++) + blk[i] = (c>>(5-j)) & 01; + } + } + +static +char *deblknot(blk) +char *blk; { + register int i,j; + char c; + static char iobuf[30]; + for(i=0; i<11; i++){ + c = 0; + for(j=0; j<6; j++){ + c <<= 1; + c |= blk[6*i+j]; + } + c += '.'; + if(c > '9')c += 7; + if(c > 'Z')c += 6; + iobuf[i] = c; + } + iobuf[i] = 0; + return(iobuf); +} + +/* + * This program implements the + * Proposed Federal Information Processing + * Data Encryption Standard. + * See Federal Register, March 17, 1975 (40FR12134) + */ + +/* + * Initial permutation, + */ +static char IP[] = { + 58,50,42,34,26,18,10, 2, + 60,52,44,36,28,20,12, 4, + 62,54,46,38,30,22,14, 6, + 64,56,48,40,32,24,16, 8, + 57,49,41,33,25,17, 9, 1, + 59,51,43,35,27,19,11, 3, + 61,53,45,37,29,21,13, 5, + 63,55,47,39,31,23,15, 7, +}; + +/* + * Final permutation, FP = IP^(-1) + */ +static char FP[] = { + 40, 8,48,16,56,24,64,32, + 39, 7,47,15,55,23,63,31, + 38, 6,46,14,54,22,62,30, + 37, 5,45,13,53,21,61,29, + 36, 4,44,12,52,20,60,28, + 35, 3,43,11,51,19,59,27, + 34, 2,42,10,50,18,58,26, + 33, 1,41, 9,49,17,57,25, +}; + +/* + * Permuted-choice 1 from the key bits + * to yield C and D. + * Note that bits 8,16... are left out: + * They are intended for a parity check. + */ +static char PC1_C[] = { + 57,49,41,33,25,17, 9, + 1,58,50,42,34,26,18, + 10, 2,59,51,43,35,27, + 19,11, 3,60,52,44,36, +}; + +static char PC1_D[] = { + 63,55,47,39,31,23,15, + 7,62,54,46,38,30,22, + 14, 6,61,53,45,37,29, + 21,13, 5,28,20,12, 4, +}; + +/* + * Sequence of shifts used for the key schedule. +*/ +static char shifts[] = { + 1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1, +}; + +/* + * Permuted-choice 2, to pick out the bits from + * the CD array that generate the key schedule. + */ +static char PC2_C[] = { + 14,17,11,24, 1, 5, + 3,28,15, 6,21,10, + 23,19,12, 4,26, 8, + 16, 7,27,20,13, 2, +}; + +static char PC2_D[] = { + 41,52,31,37,47,55, + 30,40,51,45,33,48, + 44,49,39,56,34,53, + 46,42,50,36,29,32, +}; + +/* + * The C and D arrays used to calculate the key schedule. + */ + +static char C[28]; +static char D[28]; +/* + * The key schedule. + * Generated from the key. + */ +static char KS[16][48]; + +/* + * Set up the key schedule from the key. + */ + +static +nbssetkey(key) +char *key; +{ + register i, j, k; + int t; + + /* + * First, generate C and D by permuting + * the key. The low order bit of each + * 8-bit char is not used, so C and D are only 28 + * bits apiece. + */ + for (i=0; i<28; i++) { + C[i] = key[PC1_C[i]-1]; + D[i] = key[PC1_D[i]-1]; + } + /* + * To generate Ki, rotate C and D according + * to schedule and pick up a permutation + * using PC2. + */ + for (i=0; i<16; i++) { + /* + * rotate. + */ + for (k=0; k>3)&01; + f[t+1] = (k>>2)&01; + f[t+2] = (k>>1)&01; + f[t+3] = (k>>0)&01; + } + /* + * The new R is L ^ f(R, K). + * The f here has to be permuted first, though. + */ + for (j=0; j<32; j++) + R[j] = L[j] ^ f[P[j]-1]; + /* + * Finally, the new L (the original R) + * is copied back. + */ + for (j=0; j<32; j++) + L[j] = tempL[j]; + } + /* + * The output L and R are reversed. + */ + for (j=0; j<32; j++) { + t = L[j]; + L[j] = R[j]; + R[j] = t; + } + /* + * The final output + * gets the inverse permutation of the very original. + */ + for (j=0; j<64; j++) + block[j] = L[FP[j]-1]; +} +/* + getutmp() + return a pointer to the system utmp structure associated with + terminal sttyname, e.g. "/dev/tty3" + Is version independent-- will work on v6 systems + return NULL if error +*/ +static +struct utmp *getutmp(sttyname) +char *sttyname; +{ + static struct utmp utmpstr; + FILE *fdutmp; + + if(sttyname == NULL || sttyname[0] == 0)return(NULL); + + fdutmp = fopen("/etc/utmp","r"); + if(fdutmp == NULL)return(NULL); + + while(fread(&utmpstr,1,sizeof utmpstr,fdutmp) == sizeof utmpstr) + if(strcmp(utmpstr.ut_line,sttyname+5) == 0){ + fclose(fdutmp); + return(&utmpstr); + } + fclose(fdutmp); + return(NULL); +} + +static +sreverse(sto, sfrom) + register char *sto, *sfrom; +{ + register int i; + + i = strlen(sfrom); + while (i >= 0) + *sto++ = sfrom[i--]; +} + +static +char *mkenvkey(mch) + char mch; +{ + static char skey[40]; + register struct utmp *putmp; + char stemp[40], stemp1[40], sttyname[30]; + register char *sk,*p; + + if (isatty(2)) + strcpy(sttyname,ttyname(2)); + else if (isatty(0)) + strcpy(sttyname,ttyname(0)); + else if (isatty(1)) + strcpy(sttyname,ttyname(1)); + else + return (NULL); + putmp = getutmp(sttyname); + if (putmp == NULL) + return (NULL); + sk = skey; + p = putmp->ut_line; + while (*p) + *sk++ = *p++; + *sk++ = mch; + (void)sprintf(stemp, "%ld", putmp->ut_time); + sreverse(stemp1, stemp); + p = stemp1; + while (*p) + *sk++ = *p++; + *sk = 0; + return (skey); +} + +mkpwunclear(spasswd,mch,sencpasswd) + char mch, *spasswd, *sencpasswd; +{ + register char *skey; + + if (spasswd[0] == 0) { + sencpasswd[0] = 0; + return; + } + skey = mkenvkey(mch); + if (skey == NULL) { + fprintf(stderr, "Can't make key\n"); + exit(1); + } + nbsencrypt(spasswd, skey, sencpasswd); +} + +mkpwclear(sencpasswd,mch,spasswd) + char mch, *spasswd, *sencpasswd; +{ + register char *skey; + + if (sencpasswd[0] == 0) { + spasswd[0] = 0; + return; + } + skey = mkenvkey(mch); + if (skey == NULL) { + fprintf(stderr, "Can't make key\n"); + exit(1); + } + nbsdecrypt(sencpasswd, skey, spasswd); +} diff --git a/lib/libc4.3tahoe/ns/.MAP b/lib/libc4.3tahoe/ns/.MAP new file mode 100644 index 0000000..f848db8 --- /dev/null +++ b/lib/libc4.3tahoe/ns/.MAP @@ -0,0 +1,4 @@ +F MAKEFILE.;1 Makefile +F NS_ADDR.C;1 ns_addr.c +F NS_NTOA.C;1 ns_ntoa.c +D PROFILED profiled diff --git a/lib/libc4.3tahoe/ns/Makefile b/lib/libc4.3tahoe/ns/Makefile new file mode 100644 index 0000000..feb2339 --- /dev/null +++ b/lib/libc4.3tahoe/ns/Makefile @@ -0,0 +1,58 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 6.5 (Berkeley) 7/9/88 +# +DEFS= -DLIBC_SCCS +CFLAGS= -O ${DEFS} +SRCS= ns_addr.c ns_ntoa.c +OBJS= ns_addr.o ns_ntoa.o +TAGSFILE=tags + +.c.o: + @${CC} -p -c ${CFLAGS} $*.c + @-ld -X -o profiled/$*.o -r $*.o + ${CC} ${CFLAGS} -c $*.c + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../library; rm -f ${OBJS}) + (cd ../profiled; rm -f ${OBJS}) + ln ${OBJS} ../library + (cd profiled; ln ${OBJS} ../../profiled) + +tags: + cwd=`pwd`; \ + for i in ${SRCS}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +ns_addr.o: ns_addr.c /usr/include/sys/types.h /usr/include/netns/ns.h +ns_ntoa.o: ns_ntoa.c /usr/include/sys/types.h /usr/include/netns/ns.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/ns/ns_addr.c b/lib/libc4.3tahoe/ns/ns_addr.c new file mode 100644 index 0000000..7c98b34 --- /dev/null +++ b/lib/libc4.3tahoe/ns/ns_addr.c @@ -0,0 +1,194 @@ +/* + * Copyright (c) 1986 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * Includes material written at Cornell University, by J. Q. Johnson. + * Used by permission. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ns_addr.c 6.3 (Berkeley) 9/30/87"; +#endif LIBC_SCCS and not lint + +#include +#include + +static struct ns_addr addr, zero_addr; + +struct ns_addr +ns_addr(name) + char *name; +{ + char separator = '.'; + char *hostname, *socketname, *cp; + char buf[50]; + extern char *index(); + + addr = zero_addr; + (void)strncpy(buf, name, 49); + + /* + * First, figure out what he intends as a field separtor. + * Despite the way this routine is written, the prefered + * form 2-272.AA001234H.01777, i.e. XDE standard. + * Great efforts are made to insure backward compatability. + */ + if (hostname = index(buf, '#')) + separator = '#'; + else { + hostname = index(buf, '.'); + if ((cp = index(buf, ':')) && + ( (hostname && cp < hostname) || (hostname == 0))) { + hostname = cp; + separator = ':'; + } + } + if (hostname) + *hostname++ = 0; + Field(buf, addr.x_net.c_net, 4); + if (hostname == 0) + return (addr); /* No separator means net only */ + + socketname = index(hostname, separator); + if (socketname) { + *socketname++ = 0; + Field(socketname, (u_char *)&addr.x_port, 2); + } + + Field(hostname, addr.x_host.c_host, 6); + + return (addr); +} + +static +Field(buf, out, len) +char *buf; +u_char *out; +int len; +{ + register char *bp = buf; + int i, ibase, base16 = 0, base10 = 0, clen = 0; + int hb[6], *hp; + char *fmt; + + /* + * first try 2-273#2-852-151-014#socket + */ + if ((*buf != '-') && + (1 < (i = sscanf(buf, "%d-%d-%d-%d-%d", + &hb[0], &hb[1], &hb[2], &hb[3], &hb[4])))) { + cvtbase(1000L, 256, hb, i, out, len); + return; + } + /* + * try form 8E1#0.0.AA.0.5E.E6#socket + */ + if (1 < (i = sscanf(buf,"%x.%x.%x.%x.%x.%x", + &hb[0], &hb[1], &hb[2], &hb[3], &hb[4], &hb[5]))) { + cvtbase(256L, 256, hb, i, out, len); + return; + } + /* + * try form 8E1#0:0:AA:0:5E:E6#socket + */ + if (1 < (i = sscanf(buf,"%x:%x:%x:%x:%x:%x", + &hb[0], &hb[1], &hb[2], &hb[3], &hb[4], &hb[5]))) { + cvtbase(256L, 256, hb, i, out, len); + return; + } + /* + * This is REALLY stretching it but there was a + * comma notation separting shorts -- definitely non standard + */ + if (1 < (i = sscanf(buf,"%x,%x,%x", + &hb[0], &hb[1], &hb[2]))) { + hb[0] = htons(hb[0]); hb[1] = htons(hb[1]); + hb[2] = htons(hb[2]); + cvtbase(65536L, 256, hb, i, out, len); + return; + } + + /* Need to decide if base 10, 16 or 8 */ + while (*bp) switch (*bp++) { + + case '0': case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '-': + break; + + case '8': case '9': + base10 = 1; + break; + + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + base16 = 1; + break; + + case 'x': case 'X': + *--bp = '0'; + base16 = 1; + break; + + case 'h': case 'H': + base16 = 1; + /* fall into */ + + default: + *--bp = 0; /* Ends Loop */ + } + if (base16) { + fmt = "%3x"; + ibase = 4096; + } else if (base10 == 0 && *buf == '0') { + fmt = "%3o"; + ibase = 512; + } else { + fmt = "%3d"; + ibase = 1000; + } + + for (bp = buf; *bp++; ) clen++; + if (clen == 0) clen++; + if (clen > 18) clen = 18; + i = ((clen - 1) / 3) + 1; + bp = clen + buf - 3; + hp = hb + i - 1; + + while (hp > hb) { + (void)sscanf(bp, fmt, hp); + bp[0] = 0; + hp--; + bp -= 3; + } + (void)sscanf(buf, fmt, hp); + cvtbase((long)ibase, 256, hb, i, out, len); +} + +static +cvtbase(oldbase,newbase,input,inlen,result,reslen) + long oldbase; + int newbase; + int input[]; + int inlen; + unsigned char result[]; + int reslen; +{ + int d, e; + long sum; + + e = 1; + while (e > 0 && reslen > 0) { + d = 0; e = 0; sum = 0; + /* long division: input=input/newbase */ + while (d < inlen) { + sum = sum*oldbase + (long) input[d]; + e += (sum > 0); + input[d++] = sum / newbase; + sum %= newbase; + } + result[--reslen] = sum; /* accumulate remainder */ + } + for (d=0; d < reslen; d++) + result[d] = 0; +} diff --git a/lib/libc4.3tahoe/ns/ns_ntoa.c b/lib/libc4.3tahoe/ns/ns_ntoa.c new file mode 100644 index 0000000..f72ca71 --- /dev/null +++ b/lib/libc4.3tahoe/ns/ns_ntoa.c @@ -0,0 +1,73 @@ +/* + * Copyright (c) 1986 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ns_ntoa.c 6.3 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include + +char * +ns_ntoa(addr) +struct ns_addr addr; +{ + static char obuf[40]; + char *spectHex(); + union { union ns_net net_e; u_long long_e; } net; + u_short port = htons(addr.x_port); + register char *cp; + char *cp2; + register u_char *up = addr.x_host.c_host; + u_char *uplim = up + 6; + + net.net_e = addr.x_net; + sprintf(obuf, "%lx", ntohl(net.long_e)); + cp = spectHex(obuf); + cp2 = cp + 1; + while (*up==0 && up < uplim) up++; + if (up == uplim) { + if (port) { + sprintf(cp, ".0"); + cp += 2; + } + } else { + sprintf(cp, ".%x", *up++); + while (up < uplim) { + while (*cp) cp++; + sprintf(cp, "%02x", *up++); + } + cp = spectHex(cp2); + } + if (port) { + sprintf(cp, ".%x", port); + spectHex(cp + 1); + } + return (obuf); +} + +static char * +spectHex(p0) +char *p0; +{ + int ok = 0; + int nonzero = 0; + register char *p = p0; + for (; *p; p++) switch (*p) { + + case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': + *p += ('A' - 'a'); + /* fall into . . . */ + case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': + ok = 1; + case '1': case '2': case '3': case '4': case '5': + case '6': case '7': case '8': case '9': + nonzero = 1; + } + if (nonzero && !ok) { *p++ = 'H'; *p = 0; } + return (p); +} diff --git a/lib/libc4.3tahoe/ns/profiled/.MAP b/lib/libc4.3tahoe/ns/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/stdio/.MAP b/lib/libc4.3tahoe/stdio/.MAP new file mode 100644 index 0000000..e99e885 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/.MAP @@ -0,0 +1,41 @@ +F CLRERR.C;1 clrerr.c +F DOPRNT.C;1 doprnt.c +F DOSCAN.C;1 doscan.c +F EXIT.C;1 exit.c +F FDOPEN.C;1 fdopen.c +F FGETC.C;1 fgetc.c +F FGETS.C;1 fgets.c +F FILBUF.C;1 filbuf.c +F FINDIOP.C;1 findiop.c +F FLSBUF.C;1 flsbuf.c +F FOPEN.C;1 fopen.c +F FPRINTF.C;1 fprintf.c +F FPUTC.C;1 fputc.c +F FPUTS.C;1 fputs.c +F FREAD.4;1 fread.4.2 +F FREAD.C;1 fread.c +F FREOPEN.C;1 freopen.c +F FSEEK.C;1 fseek.c +F FTELL.C;1 ftell.c +F FWRITE.4;1 fwrite.4.2 +F FWRITE.C;1 fwrite.c +F GETCHAR.C;1 getchar.c +F GETS.C;1 gets.c +F GETW.C;1 getw.c +F MAKEFILE.;1 Makefile +F PRINTF.C;1 printf.c +D PROFILED profiled +F PUTCHAR.C;1 putchar.c +F PUTS.C;1 puts.c +F PUTW.C;1 putw.c +F REW.C;1 rew.c +F SCANF.C;1 scanf.c +F SETBUF.C;1 setbuf.c +F SETBUFFE.C;1 setbuffer.c +F SPRINTF.C;1 sprintf.c +D STDIO.TAH stdio.tahoe +D STDIO.VAX stdio.vax +F UNGETC.C;1 ungetc.c +F VFPRINTF.C;1 vfprintf.c +F VPRINTF.C;1 vprintf.c +F VSPRINTF.C;1 vsprintf.c diff --git a/lib/libc4.3tahoe/stdio/Makefile b/lib/libc4.3tahoe/stdio/Makefile new file mode 100644 index 0000000..c5b9d49 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/Makefile @@ -0,0 +1,145 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.9 (Berkeley) 6/27/88 +# +# Many of these routines have been rewritten in assembly. The assembly +# source can be found in the directory stdio.${MACHINE}. The macro +# ${STDSRC} lists the files needed by all current implementations. The +# macros ${VAXSRC} and ${TAHOESRC} are the supplemental files needed by +# the VAX and the TAHOE. ${PORTSRC} is a list of all of the supplemental +# files. + +DEFS= -DLIBC_SCCS +CFLAGS= -O ${DEFS} +STDSRC= clrerr.c doprnt.c doscan.c exit.c fdopen.c fgetc.c filbuf.c \ + findiop.c flsbuf.c fopen.c fprintf.c fputc.c fread.c freopen.c \ + fseek.c ftell.c fwrite.c getchar.c getw.c printf.c putchar.c \ + putw.c rew.c scanf.c setbuf.c setbuffer.c sprintf.c ungetc.c \ + vfprintf.c vprintf.c vsprintf.c +STDOBJ= clrerr.o doprnt.o doscan.o exit.o fdopen.o fgetc.o filbuf.o \ + findiop.o flsbuf.o fopen.o fprintf.o fputc.o fread.o freopen.o \ + fseek.o ftell.o fwrite.o getchar.o getw.o printf.o putchar.o \ + putw.o rew.o scanf.o setbuf.o setbuffer.o sprintf.o ungetc.o \ + vfprintf.o vprintf.o vsprintf.o +VAXSRC= +VAXOBJ= +TAHOESRC= fgets.c fputs.c gets.c puts.c +TAHOEOBJ= fgets.o fputs.o gets.o puts.o +PORTSRC= fgets.c fputs.c gets.c puts.c +PORTOBJ= fgets.o fputs.o gets.o puts.o +TAGSFILE=tags + +.c.o: + @${CC} -p ${CFLAGS} -c $*.c + @-ld -X -o profiled/$*.o -r $*.o + ${CC} ${CFLAGS} -c $*.c + @-ld -x -r $*.o + @mv a.out $*.o + +all: lib.${MACHINE} + +link: lib.${MACHINE} link.${MACHINE} + +link.vax: + (cd ../library; rm -f ${STDOBJ} ${VAXOBJ}) + (cd ../profiled; rm -f ${STDOBJ} ${VAXOBJ}) + ln ${STDOBJ} ${VAXOBJ} ../library + (cd profiled; ln ${STDOBJ} ${VAXOBJ} ../../profiled) + +link.tahoe: + (cd ../library; rm -f ${STDOBJ} ${TAHOEOBJ}) + (cd ../profiled; rm -f ${STDOBJ} ${TAHOEOBJ}) + ln ${STDOBJ} ${TAHOEOBJ} ../library + (cd profiled; ln ${STDOBJ} ${TAHOEOBJ} ../../profiled) + + +lib.vax: ${STDOBJ} ${VAXOBJ} + +lib.tahoe: ${STDOBJ} ${TAHOEOBJ} + +tags: tags.${MACHINE} + +tags.vax: + cwd=`pwd`; \ + for i in ${STDSRC} ${VAXSRC}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +tags.tahoe: + cwd=`pwd`; \ + for i in ${STDSRC} ${TAHOESRC}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: depend.${MACHINE} + +depend.vax: ${STDSRC} ${VAXSRC} + mkdep ${CFLAGS} ${STDSRC} ${VAXSRC} + +depend.tahoe: ${STDSRC} ${TAHOESRC} + mkdep ${CFLAGS} ${STDSRC} ${TAHOESRC} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +clrerr.o: clrerr.c /usr/include/stdio.h +doprnt.o: doprnt.c /usr/include/sys/types.h /usr/include/varargs.h +doprnt.o: /usr/include/stdio.h /usr/include/ctype.h +doscan.o: doscan.c /usr/include/stdio.h /usr/include/ctype.h +exit.o: exit.c +fdopen.o: fdopen.c /usr/include/sys/types.h /usr/include/sys/file.h +fdopen.o: /usr/include/stdio.h +fgetc.o: fgetc.c /usr/include/stdio.h +filbuf.o: filbuf.c /usr/include/stdio.h /usr/include/sys/types.h +filbuf.o: /usr/include/sys/stat.h +findiop.o: findiop.c /usr/include/stdio.h /usr/include/errno.h +flsbuf.o: flsbuf.c /usr/include/stdio.h /usr/include/sys/types.h +flsbuf.o: /usr/include/sys/stat.h +fopen.o: fopen.c /usr/include/sys/types.h /usr/include/sys/file.h +fopen.o: /usr/include/stdio.h +fprintf.o: fprintf.c /usr/include/stdio.h +fputc.o: fputc.c /usr/include/stdio.h +fread.o: fread.c /usr/include/stdio.h +freopen.o: freopen.c /usr/include/sys/types.h /usr/include/sys/file.h +freopen.o: /usr/include/stdio.h +fseek.o: fseek.c /usr/include/stdio.h +ftell.o: ftell.c /usr/include/stdio.h +fwrite.o: fwrite.c /usr/include/stdio.h +getchar.o: getchar.c /usr/include/stdio.h +getw.o: getw.c /usr/include/stdio.h +printf.o: printf.c /usr/include/stdio.h +putchar.o: putchar.c /usr/include/stdio.h +putw.o: putw.c /usr/include/stdio.h +rew.o: rew.c /usr/include/sys/types.h /usr/include/sys/file.h +rew.o: /usr/include/stdio.h +scanf.o: scanf.c /usr/include/stdio.h +setbuf.o: setbuf.c /usr/include/stdio.h +setbuffer.o: setbuffer.c /usr/include/stdio.h +sprintf.o: sprintf.c /usr/include/stdio.h +ungetc.o: ungetc.c /usr/include/stdio.h +vfprintf.o: vfprintf.c /usr/include/stdio.h /usr/include/varargs.h +vprintf.o: vprintf.c /usr/include/stdio.h /usr/include/varargs.h +vsprintf.o: vsprintf.c /usr/include/stdio.h /usr/include/varargs.h +fgets.o: fgets.c /usr/include/stdio.h +fputs.o: fputs.c /usr/include/stdio.h +gets.o: gets.c /usr/include/stdio.h +puts.o: puts.c /usr/include/stdio.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/stdio/clrerr.c b/lib/libc4.3tahoe/stdio/clrerr.c new file mode 100644 index 0000000..baaede2 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/clrerr.c @@ -0,0 +1,12 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)clrerr.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#undef clearerr + +clearerr(iop) + register FILE *iop; +{ + iop->_flag &= ~(_IOERR|_IOEOF); +} diff --git a/lib/libc4.3tahoe/stdio/doprnt.c b/lib/libc4.3tahoe/stdio/doprnt.c new file mode 100644 index 0000000..fb26796 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/doprnt.c @@ -0,0 +1,665 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)doprnt.c 5.35 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include +#include + +/* 11-bit exponent (VAX G floating point) is 308 decimal digits */ +#define MAXEXP 308 +/* 128 bit fraction takes up 39 decimal digits; max reasonable precision */ +#define MAXFRACT 39 + +#define DEFPREC 6 + +#define BUF (MAXEXP+MAXFRACT+1) /* + decimal point */ + +#define PUTC(ch) (void) putc(ch, fp) + +#define ARG() \ + _ulong = flags&LONGINT ? va_arg(argp, long) : \ + flags&SHORTINT ? va_arg(argp, short) : va_arg(argp, int); + +#define todigit(c) ((c) - '0') +#define tochar(n) ((n) + '0') + +/* have to deal with the negative buffer count kludge */ +#define NEGATIVE_COUNT_KLUDGE + +#define LONGINT 0x01 /* long integer */ +#define LONGDBL 0x02 /* long double; unimplemented */ +#define SHORTINT 0x04 /* short integer */ +#define ALT 0x08 /* alternate form */ +#define LADJUST 0x10 /* left adjustment */ +#define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ +#define HEXPREFIX 0x40 /* add 0x or 0X prefix */ + +_doprnt(fmt0, argp, fp) + u_char *fmt0; + va_list argp; + register FILE *fp; +{ + register u_char *fmt; /* format string */ + register int ch; /* character from fmt */ + register int cnt; /* return value accumulator */ + register int n; /* random handy integer */ + register char *t; /* buffer pointer */ + double _double; /* double precision arguments %[eEfgG] */ + u_long _ulong; /* integer arguments %[diouxX] */ + int base; /* base for [diouxX] conversion */ + int dprec; /* decimal precision in [diouxX] */ + int fieldsz; /* field size expanded by sign, etc */ + int flags; /* flags as above */ + int fpprec; /* `extra' floating precision in [eEfgG] */ + int prec; /* precision from format (%.3d), or -1 */ + int realsz; /* field size expanded by decimal precision */ + int size; /* size of converted field or string */ + int width; /* width from format (%8d), or 0 */ + char sign; /* sign prefix (' ', '+', '-', or \0) */ + char softsign; /* temporary negative sign for floats */ + char *digs; /* digits for [diouxX] conversion */ + char buf[BUF]; /* space for %c, %[diouxX], %[eEfgG] */ + + if (fp->_flag & _IORW) { + fp->_flag |= _IOWRT; + fp->_flag &= ~(_IOEOF|_IOREAD); + } + if ((fp->_flag & _IOWRT) == 0) + return (EOF); + + fmt = fmt0; + digs = "0123456789abcdef"; + for (cnt = 0;; ++fmt) { + n = fp->_cnt; + for (t = (char *)fp->_ptr; (ch = *fmt) && ch != '%'; + ++cnt, ++fmt) + if (--n < 0 +#ifdef NEGATIVE_COUNT_KLUDGE + && (!(fp->_flag & _IOLBF) || -n >= fp->_bufsiz) +#endif + || ch == '\n' && fp->_flag & _IOLBF) { + fp->_cnt = n; + fp->_ptr = t; + (void) _flsbuf((u_char)ch, fp); + n = fp->_cnt; + t = (char *)fp->_ptr; + } else + *t++ = ch; + fp->_cnt = n; + fp->_ptr = t; + if (!ch) + return (cnt); + + flags = 0; dprec = 0; fpprec = 0; width = 0; + prec = -1; + sign = '\0'; + +rflag: switch (*++fmt) { + case ' ': + /* + * ``If the space and + flags both appear, the space + * flag will be ignored.'' + * -- ANSI X3J11 + */ + if (!sign) + sign = ' '; + goto rflag; + case '#': + flags |= ALT; + goto rflag; + case '*': + /* + * ``A negative field width argument is taken as a + * - flag followed by a positive field width.'' + * -- ANSI X3J11 + * They don't exclude field widths read from args. + */ + if ((width = va_arg(argp, int)) >= 0) + goto rflag; + width = -width; + /* FALLTHROUGH */ + case '-': + flags |= LADJUST; + goto rflag; + case '+': + sign = '+'; + goto rflag; + case '.': + if (*++fmt == '*') + n = va_arg(argp, int); + else { + n = 0; + while (isascii(*fmt) && isdigit(*fmt)) + n = 10 * n + todigit(*fmt++); + --fmt; + } + prec = n < 0 ? -1 : n; + goto rflag; + case '0': + /* + * ``Note that 0 is taken as a flag, not as the + * beginning of a field width.'' + * -- ANSI X3J11 + */ + flags |= ZEROPAD; + goto rflag; + case '1': case '2': case '3': case '4': + case '5': case '6': case '7': case '8': case '9': + n = 0; + do { + n = 10 * n + todigit(*fmt); + } while (isascii(*++fmt) && isdigit(*fmt)); + width = n; + --fmt; + goto rflag; + case 'L': + flags |= LONGDBL; + goto rflag; + case 'h': + flags |= SHORTINT; + goto rflag; + case 'l': + flags |= LONGINT; + goto rflag; + case 'c': + *(t = buf) = va_arg(argp, int); + size = 1; + sign = '\0'; + goto pforw; + case 'D': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'd': + case 'i': + ARG(); + if ((long)_ulong < 0) { + _ulong = -_ulong; + sign = '-'; + } + base = 10; + goto number; + case 'e': + case 'E': + case 'f': + case 'g': + case 'G': + _double = va_arg(argp, double); + /* + * don't do unrealistic precision; just pad it with + * zeroes later, so buffer size stays rational. + */ + if (prec > MAXFRACT) { + if (*fmt != 'g' && *fmt != 'G' || (flags&ALT)) + fpprec = prec - MAXFRACT; + prec = MAXFRACT; + } + else if (prec == -1) + prec = DEFPREC; + /* + * softsign avoids negative 0 if _double is < 0 and + * no significant digits will be shown + */ + if (_double < 0) { + softsign = '-'; + _double = -_double; + } + else + softsign = 0; + /* + * cvt may have to round up past the "start" of the + * buffer, i.e. ``intf("%.2f", (double)9.999);''; + * if the first char isn't NULL, it did. + */ + *buf = NULL; + size = cvt(_double, prec, flags, &softsign, *fmt, buf, + buf + sizeof(buf)); + if (softsign) + sign = '-'; + t = *buf ? buf : buf + 1; + goto pforw; + case 'n': + if (flags & LONGINT) + *va_arg(argp, long *) = cnt; + else if (flags & SHORTINT) + *va_arg(argp, short *) = cnt; + else + *va_arg(argp, int *) = cnt; + break; + case 'O': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'o': + ARG(); + base = 8; + goto nosign; + case 'p': + /* + * ``The argument shall be a pointer to void. The + * value of the pointer is converted to a sequence + * of printable characters, in an implementation- + * defined manner.'' + * -- ANSI X3J11 + */ + /* NOSTRICT */ + _ulong = (u_long)va_arg(argp, void *); + base = 16; + goto nosign; + case 's': + if (!(t = va_arg(argp, char *))) + t = "(null)"; + if (prec >= 0) { + /* + * can't use strlen; can only look for the + * NUL in the first `prec' characters, and + * strlen() will go further. + */ + char *p, *memchr(); + + if (p = memchr(t, 0, prec)) { + size = p - t; + if (size > prec) + size = prec; + } else + size = prec; + } else + size = strlen(t); + sign = '\0'; + goto pforw; + case 'U': + flags |= LONGINT; + /*FALLTHROUGH*/ + case 'u': + ARG(); + base = 10; + goto nosign; + case 'X': + digs = "0123456789ABCDEF"; + /* FALLTHROUGH */ + case 'x': + ARG(); + base = 16; + /* leading 0x/X only if non-zero */ + if (flags & ALT && _ulong != 0) + flags |= HEXPREFIX; + + /* unsigned conversions */ +nosign: sign = '\0'; + /* + * ``... diouXx conversions ... if a precision is + * specified, the 0 flag will be ignored.'' + * -- ANSI X3J11 + */ +number: if ((dprec = prec) >= 0) + flags &= ~ZEROPAD; + + /* + * ``The result of converting a zero value with an + * explicit precision of zero is no characters.'' + * -- ANSI X3J11 + */ + t = buf + BUF; + if (_ulong != 0 || prec != 0) { + do { + *--t = digs[_ulong % base]; + _ulong /= base; + } while (_ulong); + digs = "0123456789abcdef"; + if (flags & ALT && base == 8 && *t != '0') + *--t = '0'; /* octal leading 0 */ + } + size = buf + BUF - t; + +pforw: + /* + * All reasonable formats wind up here. At this point, + * `t' points to a string which (if not flags&LADJUST) + * should be padded out to `width' places. If + * flags&ZEROPAD, it should first be prefixed by any + * sign or other prefix; otherwise, it should be blank + * padded before the prefix is emitted. After any + * left-hand padding and prefixing, emit zeroes + * required by a decimal [diouxX] precision, then print + * the string proper, then emit zeroes required by any + * leftover floating precision; finally, if LADJUST, + * pad with blanks. + */ + + /* + * compute actual size, so we know how much to pad + * fieldsz excludes decimal prec; realsz includes it + */ + fieldsz = size + fpprec; + if (sign) + fieldsz++; + if (flags & HEXPREFIX) + fieldsz += 2; + realsz = dprec > fieldsz ? dprec : fieldsz; + + /* right-adjusting blank padding */ + if ((flags & (LADJUST|ZEROPAD)) == 0 && width) + for (n = realsz; n < width; n++) + PUTC(' '); + /* prefix */ + if (sign) + PUTC(sign); + if (flags & HEXPREFIX) { + PUTC('0'); + PUTC((char)*fmt); + } + /* right-adjusting zero padding */ + if ((flags & (LADJUST|ZEROPAD)) == ZEROPAD) + for (n = realsz; n < width; n++) + PUTC('0'); + /* leading zeroes from decimal precision */ + for (n = fieldsz; n < dprec; n++) + PUTC('0'); + + /* the string or number proper */ + if (fp->_cnt - (n = size) >= 0 && + (fp->_flag & _IOLBF) == 0) { + fp->_cnt -= n; + bcopy(t, (char *)fp->_ptr, n); + fp->_ptr += n; + } else + while (--n >= 0) + PUTC(*t++); + /* trailing f.p. zeroes */ + while (--fpprec >= 0) + PUTC('0'); + /* left-adjusting padding (always blank) */ + if (flags & LADJUST) + for (n = realsz; n < width; n++) + PUTC(' '); + /* finally, adjust cnt */ + cnt += width > realsz ? width : realsz; + break; + case '\0': /* "%?" prints ?, unless ? is NULL */ + return (cnt); + default: + PUTC((char)*fmt); + cnt++; + } + } + /* NOTREACHED */ +} + +static +cvt(number, prec, flags, signp, fmtch, startp, endp) + double number; + register int prec; + int flags; + u_char fmtch; + char *signp, *startp, *endp; +{ + register char *p, *t; + register double fract; + int dotrim, expcnt, gformat; + double integer, tmp, modf(); + char *exponent(), *round(); + + dotrim = expcnt = gformat = 0; + fract = modf(number, &integer); + + /* get an extra slot for rounding. */ + t = ++startp; + + /* + * get integer portion of number; put into the end of the buffer; the + * .01 is added for modf(356.0 / 10, &integer) returning .59999999... + */ + for (p = endp - 1; integer; ++expcnt) { + tmp = modf(integer / 10, &integer); + *p-- = tochar((int)((tmp + .01) * 10)); + } + switch(fmtch) { + case 'f': + /* reverse integer into beginning of buffer */ + if (expcnt) + for (; ++p < endp; *t++ = *p); + else + *t++ = '0'; + /* + * if precision required or alternate flag set, add in a + * decimal point. + */ + if (prec || flags&ALT) + *t++ = '.'; + /* if requires more precision and some fraction left */ + if (fract) { + if (prec) + do { + fract = modf(fract * 10, &tmp); + *t++ = tochar((int)tmp); + } while (--prec && fract); + if (fract) + startp = round(fract, (int *)NULL, startp, + t - 1, (char)0, signp); + } + for (; prec--; *t++ = '0'); + break; + case 'e': + case 'E': +eformat: if (expcnt) { + *t++ = *++p; + if (prec || flags&ALT) + *t++ = '.'; + /* if requires more precision and some integer left */ + for (; prec && ++p < endp; --prec) + *t++ = *p; + /* + * if done precision and more of the integer component, + * round using it; adjust fract so we don't re-round + * later. + */ + if (!prec && ++p < endp) { + fract = 0; + startp = round((double)0, &expcnt, startp, + t - 1, *p, signp); + } + /* adjust expcnt for digit in front of decimal */ + --expcnt; + } + /* until first fractional digit, decrement exponent */ + else if (fract) { + /* adjust expcnt for digit in front of decimal */ + for (expcnt = -1;; --expcnt) { + fract = modf(fract * 10, &tmp); + if (tmp) + break; + } + *t++ = tochar((int)tmp); + if (prec || flags&ALT) + *t++ = '.'; + } + else { + *t++ = '0'; + if (prec || flags&ALT) + *t++ = '.'; + } + /* if requires more precision and some fraction left */ + if (fract) { + if (prec) + do { + fract = modf(fract * 10, &tmp); + *t++ = tochar((int)tmp); + } while (--prec && fract); + if (fract) + startp = round(fract, &expcnt, startp, + t - 1, (char)0, signp); + } + /* if requires more precision */ + for (; prec--; *t++ = '0'); + + /* unless alternate flag, trim any g/G format trailing 0's */ + if (gformat && !(flags&ALT)) { + while (t > startp && *--t == '0'); + if (*t == '.') + --t; + ++t; + } + t = exponent(t, expcnt, fmtch); + break; + case 'g': + case 'G': + /* a precision of 0 is treated as a precision of 1. */ + if (!prec) + ++prec; + /* + * ``The style used depends on the value converted; style e + * will be used only if the exponent resulting from the + * conversion is less than -4 or greater than the precision.'' + * -- ANSI X3J11 + */ + if (expcnt > prec || !expcnt && fract && fract < .0001) { + /* + * g/G format counts "significant digits, not digits of + * precision; for the e/E format, this just causes an + * off-by-one problem, i.e. g/G considers the digit + * before the decimal point significant and e/E doesn't + * count it as precision. + */ + --prec; + fmtch -= 2; /* G->E, g->e */ + gformat = 1; + goto eformat; + } + /* + * reverse integer into beginning of buffer, + * note, decrement precision + */ + if (expcnt) + for (; ++p < endp; *t++ = *p, --prec); + else + *t++ = '0'; + /* + * if precision required or alternate flag set, add in a + * decimal point. If no digits yet, add in leading 0. + */ + if (prec || flags&ALT) { + dotrim = 1; + *t++ = '.'; + } + else + dotrim = 0; + /* if requires more precision and some fraction left */ + if (fract) { + if (prec) { + do { + fract = modf(fract * 10, &tmp); + *t++ = tochar((int)tmp); + } while(!tmp); + while (--prec && fract) { + fract = modf(fract * 10, &tmp); + *t++ = tochar((int)tmp); + } + } + if (fract) + startp = round(fract, (int *)NULL, startp, + t - 1, (char)0, signp); + } + /* alternate format, adds 0's for precision, else trim 0's */ + if (flags&ALT) + for (; prec--; *t++ = '0'); + else if (dotrim) { + while (t > startp && *--t == '0'); + if (*t != '.') + ++t; + } + } + return(t - startp); +} + +static char * +round(fract, exp, start, end, ch, signp) + double fract; + int *exp; + register char *start, *end; + char ch, *signp; +{ + double tmp; + + if (fract) + (void)modf(fract * 10, &tmp); + else + tmp = todigit(ch); + if (tmp > 4) + for (;; --end) { + if (*end == '.') + --end; + if (++*end <= '9') + break; + *end = '0'; + if (end == start) { + if (exp) { /* e/E; increment exponent */ + *end = '1'; + ++*exp; + } + else { /* f; add extra digit */ + *--end = '1'; + --start; + } + break; + } + } + /* ``"%.3f", (double)-0.0004'' gives you a negative 0. */ + else if (*signp == '-') + for (;; --end) { + if (*end == '.') + --end; + if (*end != '0') + break; + if (end == start) + *signp = 0; + } + return(start); +} + +static char * +exponent(p, exp, fmtch) + register char *p; + register int exp; + u_char fmtch; +{ + register char *t; + char expbuf[MAXEXP]; + + *p++ = fmtch; + if (exp < 0) { + exp = -exp; + *p++ = '-'; + } + else + *p++ = '+'; + t = expbuf + MAXEXP; + if (exp > 9) { + do { + *--t = tochar(exp % 10); + } while ((exp /= 10) > 9); + *--t = tochar(exp); + for (; t < expbuf + MAXEXP; *p++ = *t++); + } + else { + *p++ = '0'; + *p++ = tochar(exp); + } + return(p); +} diff --git a/lib/libc4.3tahoe/stdio/doscan.c b/lib/libc4.3tahoe/stdio/doscan.c new file mode 100644 index 0000000..85fd7ad --- /dev/null +++ b/lib/libc4.3tahoe/stdio/doscan.c @@ -0,0 +1,293 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)doscan.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include + +#define SPC 01 +#define STP 02 + +#define SHORT 0 +#define REGULAR 1 +#define LONG 2 +#define INT 0 +#define FLOAT 1 + +static char *_getccl(); + +static char _sctab[256] = { + 0,0,0,0,0,0,0,0, + 0,SPC,SPC,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + SPC,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, +}; + +_doscan(iop, fmt, argp) +FILE *iop; +register char *fmt; +register int **argp; +{ + register int ch; + int nmatch, len, ch1; + int **ptr, fileended, size; + + nmatch = 0; + fileended = 0; + for (;;) switch (ch = *fmt++) { + case '\0': + return (nmatch); + case '%': + if ((ch = *fmt++) == '%') + goto def; + ptr = 0; + if (ch != '*') + ptr = argp++; + else + ch = *fmt++; + len = 0; + size = REGULAR; + while (isdigit(ch)) { + len = len*10 + ch - '0'; + ch = *fmt++; + } + if (len == 0) + len = 30000; + if (ch=='l') { + size = LONG; + ch = *fmt++; + } else if (ch=='h') { + size = SHORT; + ch = *fmt++; + } else if (ch=='[') + fmt = _getccl(fmt); + if (isupper(ch)) { + ch = tolower(ch); + size = LONG; + } + if (ch == '\0') + return(-1); + if (_innum(ptr, ch, len, size, iop, &fileended) && ptr) + nmatch++; + if (fileended) + return(nmatch? nmatch: -1); + break; + + case ' ': + case '\n': + case '\t': + while ((ch1 = getc(iop))==' ' || ch1=='\t' || ch1=='\n') + ; + if (ch1 != EOF) + ungetc(ch1, iop); + break; + + default: + def: + ch1 = getc(iop); + if (ch1 != ch) { + if (ch1==EOF) + return(-1); + ungetc(ch1, iop); + return(nmatch); + } + } +} + +static +_innum(ptr, type, len, size, iop, eofptr) +int **ptr, *eofptr; +FILE *iop; +{ + extern double atof(); + register char *np; + char numbuf[64]; + register c, base; + int expseen, scale, negflg, c1, ndigit; + long lcval; + + if (type=='c' || type=='s' || type=='[') + return(_instr(ptr? *(char **)ptr: (char *)NULL, type, len, iop, eofptr)); + lcval = 0; + ndigit = 0; + scale = INT; + if (type=='e'||type=='f') + scale = FLOAT; + base = 10; + if (type=='o') + base = 8; + else if (type=='x') + base = 16; + np = numbuf; + expseen = 0; + negflg = 0; + while ((c = getc(iop))==' ' || c=='\t' || c=='\n'); + if (c=='-') { + negflg++; + *np++ = c; + c = getc(iop); + len--; + } else if (c=='+') { + len--; + c = getc(iop); + } + for ( ; --len>=0; *np++ = c, c = getc(iop)) { + if (isdigit(c) + || base==16 && ('a'<=c && c<='f' || 'A'<=c && c<='F')) { + ndigit++; + if (base==8) + lcval <<=3; + else if (base==10) + lcval = ((lcval<<2) + lcval)<<1; + else + lcval <<= 4; + c1 = c; + if (isdigit(c)) + c -= '0'; + else if ('a'<=c && c<='f') + c -= 'a'-10; + else + c -= 'A'-10; + lcval += c; + c = c1; + continue; + } else if (c=='.') { + if (base!=10 || scale==INT) + break; + ndigit++; + continue; + } else if ((c=='e'||c=='E') && expseen==0) { + if (base!=10 || scale==INT || ndigit==0) + break; + expseen++; + *np++ = c; + c = getc(iop); + if (c!='+'&&c!='-'&&('0'>c||c>'9')) + break; + } else + break; + } + if (negflg) + lcval = -lcval; + if (c != EOF) { + ungetc(c, iop); + *eofptr = 0; + } else + *eofptr = 1; + if (ptr==NULL || np==numbuf || (negflg && np==numbuf+1) )/* gene dykes*/ + return(0); + *np++ = 0; + switch((scale<<4) | size) { + + case (FLOAT<<4) | SHORT: + case (FLOAT<<4) | REGULAR: + **(float **)ptr = atof(numbuf); + break; + + case (FLOAT<<4) | LONG: + **(double **)ptr = atof(numbuf); + break; + + case (INT<<4) | SHORT: + **(short **)ptr = lcval; + break; + + case (INT<<4) | REGULAR: + **(int **)ptr = lcval; + break; + + case (INT<<4) | LONG: + **(long **)ptr = lcval; + break; + } + return(1); +} + +static +_instr(ptr, type, len, iop, eofptr) +register char *ptr; +register FILE *iop; +int *eofptr; +{ + register ch; + register char *optr; + int ignstp; + + *eofptr = 0; + optr = ptr; + if (type=='c' && len==30000) + len = 1; + ignstp = 0; + if (type=='s') + ignstp = SPC; + while ((ch = getc(iop)) != EOF && _sctab[ch] & ignstp) + ; + ignstp = SPC; + if (type=='c') + ignstp = 0; + else if (type=='[') + ignstp = STP; + while (ch!=EOF && (_sctab[ch]&ignstp)==0) { + if (ptr) + *ptr++ = ch; + if (--len <= 0) + break; + ch = getc(iop); + } + if (ch != EOF) { + if (len > 0) + ungetc(ch, iop); + *eofptr = 0; + } else + *eofptr = 1; + if (ptr && ptr!=optr) { + if (type!='c') + *ptr++ = '\0'; + return(1); + } + return(0); +} + +static char * +_getccl(s) +register unsigned char *s; +{ + register c, t; + + t = 0; + if (*s == '^') { + t++; + s++; + } + for (c = 0; c < (sizeof _sctab / sizeof _sctab[0]); c++) + if (t) + _sctab[c] &= ~STP; + else + _sctab[c] |= STP; + if ((c = *s) == ']' || c == '-') { /* first char is special */ + if (t) + _sctab[c] |= STP; + else + _sctab[c] &= ~STP; + s++; + } + while ((c = *s++) != ']') { + if (c==0) + return((char *)--s); + else if (c == '-' && *s != ']' && s[-2] < *s) { + for (c = s[-2] + 1; c < *s; c++) + if (t) + _sctab[c] |= STP; + else + _sctab[c] &= ~STP; + } else if (t) + _sctab[c] |= STP; + else + _sctab[c] &= ~STP; + } + return((char *)s); +} diff --git a/lib/libc4.3tahoe/stdio/exit.c b/lib/libc4.3tahoe/stdio/exit.c new file mode 100644 index 0000000..aa9949c --- /dev/null +++ b/lib/libc4.3tahoe/stdio/exit.c @@ -0,0 +1,11 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)exit.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +exit(code) + int code; +{ + + _cleanup(); + _exit(code); +} diff --git a/lib/libc4.3tahoe/stdio/fdopen.c b/lib/libc4.3tahoe/stdio/fdopen.c new file mode 100644 index 0000000..04032b7 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/fdopen.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fdopen.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Unix routine to do an "fopen" on file descriptor + * The mode has to be repeated because you can't query its + * status + */ + +#include +#include +#include + +FILE * +fdopen(fd, mode) + register char *mode; +{ + extern FILE *_findiop(); + static int nofile = -1; + register FILE *iop; + + if (nofile < 0) + nofile = getdtablesize(); + + if (fd < 0 || fd >= nofile) + return (NULL); + + iop = _findiop(); + if (iop == NULL) + return (NULL); + + iop->_cnt = 0; + iop->_file = fd; + iop->_bufsiz = 0; + iop->_base = iop->_ptr = NULL; + + switch (*mode) { + case 'r': + iop->_flag = _IOREAD; + break; + case 'a': + lseek(fd, (off_t)0, L_XTND); + /* fall into ... */ + case 'w': + iop->_flag = _IOWRT; + break; + default: + return (NULL); + } + + if (mode[1] == '+') + iop->_flag = _IORW; + + return (iop); +} diff --git a/lib/libc4.3tahoe/stdio/fgetc.c b/lib/libc4.3tahoe/stdio/fgetc.c new file mode 100644 index 0000000..4fa4e8e --- /dev/null +++ b/lib/libc4.3tahoe/stdio/fgetc.c @@ -0,0 +1,11 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fgetc.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +fgetc(fp) +FILE *fp; +{ + return(getc(fp)); +} diff --git a/lib/libc4.3tahoe/stdio/fgets.c b/lib/libc4.3tahoe/stdio/fgets.c new file mode 100644 index 0000000..e232c47 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/fgets.c @@ -0,0 +1,25 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fgets.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +char * +fgets(s, n, iop) +char *s; +register FILE *iop; +{ + register c; + register char *cs; + + cs = s; + while (--n>0 && (c = getc(iop)) != EOF) { + *cs++ = c; + if (c=='\n') + break; + } + if (c == EOF && cs==s) + return(NULL); + *cs++ = '\0'; + return(s); +} diff --git a/lib/libc4.3tahoe/stdio/filbuf.c b/lib/libc4.3tahoe/stdio/filbuf.c new file mode 100644 index 0000000..9b497f9 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/filbuf.c @@ -0,0 +1,70 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)filbuf.c 5.3 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include +#include +char *malloc(); + +_filbuf(iop) +register FILE *iop; +{ + int size; + struct stat stbuf; + extern char *_smallbuf; + char c; + + if (iop->_flag & _IORW) + iop->_flag |= _IOREAD; + + if ((iop->_flag&_IOREAD) == 0) + return(EOF); + if (iop->_flag&(_IOSTRG|_IOEOF)) + return(EOF); +tryagain: + if (iop->_base==NULL) { + if (iop->_flag&_IONBF) { + iop->_base = _smallbuf ? &_smallbuf[fileno(iop)] : &c; + goto tryagain; + } + if (fstat(fileno(iop), &stbuf) < 0 || stbuf.st_blksize <= NULL) + size = BUFSIZ; + else + size = stbuf.st_blksize; + if ((iop->_base = malloc(size)) == NULL) { + iop->_flag |= _IONBF; + goto tryagain; + } + iop->_flag |= _IOMYBUF; + iop->_bufsiz = size; + } + if (iop == stdin) { + if (stdout->_flag&_IOLBF) + fflush(stdout); + if (stderr->_flag&_IOLBF) + fflush(stderr); + } + iop->_cnt = read(fileno(iop), iop->_base, + iop->_flag & _IONBF ? 1 : iop->_bufsiz); + iop->_ptr = iop->_base; + if (iop->_flag & _IONBF && iop->_base == &c) + iop->_base = NULL; + if (--iop->_cnt < 0) { + if (iop->_cnt == -1) { + iop->_flag |= _IOEOF; + if (iop->_flag & _IORW) + iop->_flag &= ~_IOREAD; + } else + iop->_flag |= _IOERR; + iop->_cnt = 0; + return(EOF); + } + return(*iop->_ptr++&0377); +} diff --git a/lib/libc4.3tahoe/stdio/findiop.c b/lib/libc4.3tahoe/stdio/findiop.c new file mode 100644 index 0000000..5c9e93d --- /dev/null +++ b/lib/libc4.3tahoe/stdio/findiop.c @@ -0,0 +1,129 @@ +/* + * Copyright (c) 1983, 1985 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)findiop.c 5.6 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include + +extern int errno; + +#define active(iop) ((iop)->_flag & (_IOREAD|_IOWRT|_IORW)) + +#define NSTATIC 20 /* stdin + stdout + stderr + the usual */ + +FILE _iob[NSTATIC] = { + { 0, NULL, NULL, 0, _IOREAD, 0 }, /* stdin */ + { 0, NULL, NULL, 0, _IOWRT, 1 }, /* stdout */ + { 0, NULL, NULL, 0, _IOWRT|_IONBF, 2 }, /* stderr */ +}; + +extern char *calloc(); + +static char sbuf[NSTATIC]; +char *_smallbuf = sbuf; +static FILE **iobglue; +static FILE **endglue; + +/* + * Find a free FILE for fopen et al. + * We have a fixed static array of entries, and in addition + * may allocate additional entries dynamically, up to the kernel + * limit on the number of open files. + * At first just check for a free slot in the fixed static array. + * If none are available, then we allocate a structure to glue together + * the old and new FILE entries, which are then no longer contiguous. + */ +FILE * +_findiop() +{ + register FILE **iov, *iop; + register FILE *fp; + + if (iobglue == 0) { + for (iop = _iob; iop < _iob + NSTATIC; iop++) + if (!active(iop)) + return (iop); + + if (_f_morefiles() == 0) { + errno = ENOMEM; + return (NULL); + } + } + + iov = iobglue; + while (*iov != NULL && active(*iov)) + if (++iov >= endglue) { + errno = EMFILE; + return (NULL); + } + + if (*iov == NULL) + *iov = (FILE *)calloc(1, sizeof **iov); + + return (*iov); +} + +_f_morefiles() +{ + register FILE **iov; + register FILE *fp; + register char *cp; + int nfiles; + + nfiles = getdtablesize(); + + iobglue = (FILE **)calloc(nfiles, sizeof *iobglue); + if (iobglue == NULL) + return (0); + + endglue = iobglue + nfiles; + + for (fp = _iob, iov = iobglue; fp < &_iob[NSTATIC]; /* void */) + *iov++ = fp++; + + _smallbuf = calloc(nfiles, sizeof(*_smallbuf)); + return (1); +} + +f_prealloc() +{ + register FILE **iov; + register FILE *fp; + + if (iobglue == NULL && _f_morefiles() == 0) + return; + + for (iov = iobglue; iov < endglue; iov++) + if (*iov == NULL) + *iov = (FILE *)calloc(1, sizeof **iov); +} + +_fwalk(function) + register int (*function)(); +{ + register FILE **iov; + register FILE *fp; + + if (iobglue == NULL) { + for (fp = _iob; fp < &_iob[NSTATIC]; fp++) + if (active(fp)) + (*function)(fp); + } else { + for (iov = iobglue; iov < endglue; iov++) + if (*iov && active(*iov)) + (*function)(*iov); + } +} + +_cleanup() +{ + extern int fclose(); + + _fwalk(fclose); +} diff --git a/lib/libc4.3tahoe/stdio/flsbuf.c b/lib/libc4.3tahoe/stdio/flsbuf.c new file mode 100644 index 0000000..e2996cc --- /dev/null +++ b/lib/libc4.3tahoe/stdio/flsbuf.c @@ -0,0 +1,121 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)flsbuf.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include +#include + +char *malloc(); + +_flsbuf(c, iop) +unsigned char c; +register FILE *iop; +{ + register char *base; + register n, rn; + char c1; + int size; + struct stat stbuf; + + if (iop->_flag & _IORW) { + iop->_flag |= _IOWRT; + iop->_flag &= ~(_IOEOF|_IOREAD); + } + + if ((iop->_flag&_IOWRT)==0) + return(EOF); +tryagain: + if (iop->_flag&_IOLBF) { + base = iop->_base; + *iop->_ptr++ = c; + if (iop->_ptr >= base+iop->_bufsiz || c == '\n') { + n = write(fileno(iop), base, rn = iop->_ptr - base); + iop->_ptr = base; + iop->_cnt = 0; + } else + rn = n = 0; + } else if (iop->_flag&_IONBF) { + c1 = c; + rn = 1; + n = write(fileno(iop), &c1, rn); + iop->_cnt = 0; + } else { + if ((base=iop->_base)==NULL) { + if (fstat(fileno(iop), &stbuf) < 0 || + stbuf.st_blksize <= NULL) + size = BUFSIZ; + else + size = stbuf.st_blksize; + if ((iop->_base=base=malloc(size)) == NULL) { + iop->_flag |= _IONBF; + goto tryagain; + } + iop->_flag |= _IOMYBUF; + iop->_bufsiz = size; + if (iop==stdout && isatty(fileno(stdout))) { + iop->_flag |= _IOLBF; + iop->_ptr = base; + goto tryagain; + } + rn = n = 0; + } else if ((rn = n = iop->_ptr - base) > 0) { + iop->_ptr = base; + n = write(fileno(iop), base, n); + } + iop->_cnt = iop->_bufsiz-1; + *base++ = c; + iop->_ptr = base; + } + if (rn != n) { + iop->_flag |= _IOERR; + return(EOF); + } + return(c); +} + +fflush(iop) +register FILE *iop; +{ + register char *base; + register n; + + if ((iop->_flag&(_IONBF|_IOWRT))==_IOWRT + && (base=iop->_base)!=NULL && (n=iop->_ptr-base)>0) { + iop->_ptr = base; + iop->_cnt = (iop->_flag&(_IOLBF|_IONBF)) ? 0 : iop->_bufsiz; + if (write(fileno(iop), base, n)!=n) { + iop->_flag |= _IOERR; + return(EOF); + } + } + return(0); +} + +fclose(iop) + register FILE *iop; +{ + register int r; + + r = EOF; + if (iop->_flag&(_IOREAD|_IOWRT|_IORW) && (iop->_flag&_IOSTRG)==0) { + r = fflush(iop); + if (close(fileno(iop)) < 0) + r = EOF; + if (iop->_flag&_IOMYBUF) + free(iop->_base); + } + iop->_cnt = 0; + iop->_base = (char *)NULL; + iop->_ptr = (char *)NULL; + iop->_bufsiz = 0; + iop->_flag = 0; + iop->_file = 0; + return(r); +} diff --git a/lib/libc4.3tahoe/stdio/fopen.c b/lib/libc4.3tahoe/stdio/fopen.c new file mode 100644 index 0000000..6eda99a --- /dev/null +++ b/lib/libc4.3tahoe/stdio/fopen.c @@ -0,0 +1,62 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fopen.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include +#include + +FILE * +fopen(file, mode) + char *file; + register char *mode; +{ + register FILE *iop; + register f, rw, oflags; + extern FILE *_findiop(); + + iop = _findiop(); + if (iop == NULL) + return (NULL); + + rw = (mode[1] == '+'); + + switch (*mode) { + case 'a': + oflags = O_CREAT | (rw ? O_RDWR : O_WRONLY); + break; + case 'r': + oflags = rw ? O_RDWR : O_RDONLY; + break; + case 'w': + oflags = O_TRUNC | O_CREAT | (rw ? O_RDWR : O_WRONLY); + break; + default: + return (NULL); + } + + f = open(file, oflags, 0666); + if (f < 0) + return (NULL); + + if (*mode == 'a') + lseek(f, (off_t)0, L_XTND); + + iop->_cnt = 0; + iop->_file = f; + iop->_bufsiz = 0; + if (rw) + iop->_flag = _IORW; + else if (*mode == 'r') + iop->_flag = _IOREAD; + else + iop->_flag = _IOWRT; + iop->_base = iop->_ptr = NULL; + return (iop); +} diff --git a/lib/libc4.3tahoe/stdio/fprintf.c b/lib/libc4.3tahoe/stdio/fprintf.c new file mode 100644 index 0000000..9cdad00 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/fprintf.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fprintf.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +fprintf(iop, fmt, args) + register FILE *iop; + char *fmt; + int args; +{ + int len; + char localbuf[BUFSIZ]; + + if (iop->_flag & _IONBF) { + iop->_flag &= ~_IONBF; + iop->_ptr = iop->_base = localbuf; + iop->_bufsiz = BUFSIZ; + len = _doprnt(fmt, &args, iop); + fflush(iop); + iop->_flag |= _IONBF; + iop->_base = NULL; + iop->_bufsiz = NULL; + iop->_cnt = 0; + } else + len = _doprnt(fmt, &args, iop); + return(ferror(iop) ? EOF : len); +} diff --git a/lib/libc4.3tahoe/stdio/fputc.c b/lib/libc4.3tahoe/stdio/fputc.c new file mode 100644 index 0000000..2bd5999 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/fputc.c @@ -0,0 +1,11 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fputc.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +fputc(c, fp) +register FILE *fp; +{ + return(putc(c, fp)); +} diff --git a/lib/libc4.3tahoe/stdio/fputs.c b/lib/libc4.3tahoe/stdio/fputs.c new file mode 100644 index 0000000..3aa913e --- /dev/null +++ b/lib/libc4.3tahoe/stdio/fputs.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1984 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fputs.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +fputs(s, iop) +register char *s; +register FILE *iop; +{ + register r = 0; + register c; + int unbuffered; + char localbuf[BUFSIZ]; + + unbuffered = iop->_flag & _IONBF; + if (unbuffered) { + iop->_flag &= ~_IONBF; + iop->_ptr = iop->_base = localbuf; + iop->_bufsiz = BUFSIZ; + } + + while (c = *s++) + r = putc(c, iop); + + if (unbuffered) { + fflush(iop); + iop->_flag |= _IONBF; + iop->_base = NULL; + iop->_bufsiz = NULL; + iop->_cnt = 0; + } + + return(r); +} diff --git a/lib/libc4.3tahoe/stdio/fread.4.2 b/lib/libc4.3tahoe/stdio/fread.4.2 new file mode 100644 index 0000000..447dbc1 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/fread.4.2 @@ -0,0 +1,23 @@ +#include + +fread(ptr, size, count, iop) +unsigned size, count; +register char *ptr; +register FILE *iop; +{ + register c; + unsigned ndone, s; + + ndone = 0; + if (size) + for (; ndone= 0) + *ptr++ = c; + else + return(ndone); + } while (--s); + } + return(ndone); +} diff --git a/lib/libc4.3tahoe/stdio/fread.c b/lib/libc4.3tahoe/stdio/fread.c new file mode 100644 index 0000000..b78d7d0 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/fread.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fread.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +fread(ptr, size, count, iop) + register char *ptr; + unsigned size, count; + register FILE *iop; +{ + register int s; + int c; + + s = size * count; + while (s > 0) { + if (iop->_cnt < s) { + if (iop->_cnt > 0) { + bcopy(iop->_ptr, ptr, iop->_cnt); + ptr += iop->_cnt; + s -= iop->_cnt; + } + /* + * filbuf clobbers _cnt & _ptr, + * so don't waste time setting them. + */ + if ((c = _filbuf(iop)) == EOF) + break; + *ptr++ = c; + s--; + } + if (iop->_cnt >= s) { + bcopy(iop->_ptr, ptr, s); + iop->_ptr += s; + iop->_cnt -= s; + return (count); + } + } + return (size != 0 ? count - ((s + size - 1) / size) : 0); +} diff --git a/lib/libc4.3tahoe/stdio/freopen.c b/lib/libc4.3tahoe/stdio/freopen.c new file mode 100644 index 0000000..e81db9b --- /dev/null +++ b/lib/libc4.3tahoe/stdio/freopen.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)freopen.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include +#include +#include + +FILE * +freopen(file, mode, iop) + char *file; + register char *mode; + register FILE *iop; +{ + register f, rw, oflags; + + rw = (mode[1] == '+'); + + fclose(iop); + + switch (*mode) { + case 'a': + oflags = O_CREAT | (rw ? O_RDWR : O_WRONLY); + break; + case 'r': + oflags = rw ? O_RDWR : O_RDONLY; + break; + case 'w': + oflags = O_TRUNC | O_CREAT | (rw ? O_RDWR : O_WRONLY); + break; + default: + return (NULL); + } + + f = open(file, oflags, 0666); + if (f < 0) + return (NULL); + + if (*mode == 'a') + lseek(f, (off_t)0, L_XTND); + + iop->_cnt = 0; + iop->_file = f; + iop->_bufsiz = 0; + if (rw) + iop->_flag = _IORW; + else if (*mode == 'r') + iop->_flag = _IOREAD; + else + iop->_flag = _IOWRT; + iop->_base = iop->_ptr = NULL; + return (iop); +} diff --git a/lib/libc4.3tahoe/stdio/fseek.c b/lib/libc4.3tahoe/stdio/fseek.c new file mode 100644 index 0000000..12dda67 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/fseek.c @@ -0,0 +1,64 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)fseek.c 5.3 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Seek for standard library. Coordinates with buffering. + */ + +#include + +long lseek(); + +fseek(iop, offset, ptrname) + register FILE *iop; + long offset; +{ + register resync, c; + long p = -1; /* can't happen? */ + + iop->_flag &= ~_IOEOF; + if (iop->_flag&_IOREAD) { + if (ptrname<2 && iop->_base && + !(iop->_flag&_IONBF)) { + c = iop->_cnt; + p = offset; + if (ptrname==0) { + long curpos = lseek(fileno(iop), 0L, 1); + if (curpos == -1) + return (-1); + p += c - curpos; + } else + offset -= c; + if(!(iop->_flag&_IORW) && c>0&&p<=c + && p>=iop->_base-iop->_ptr){ + iop->_ptr += (int)p; + iop->_cnt -= (int)p; + return(0); + } + resync = offset&01; + } else + resync = 0; + if (iop->_flag & _IORW) { + iop->_ptr = iop->_base; + iop->_flag &= ~_IOREAD; + resync = 0; + } + p = lseek(fileno(iop), offset-resync, ptrname); + iop->_cnt = 0; + if (resync && p != -1) + if (getc(iop) == EOF) + p = -1; + } + else if (iop->_flag & (_IOWRT|_IORW)) { + p = fflush(iop); + if (iop->_flag & _IORW) { + iop->_cnt = 0; + iop->_flag &= ~_IOWRT; + iop->_ptr = iop->_base; + } + return(lseek(fileno(iop), offset, ptrname) == -1 || p == EOF ? + -1 : 0); + } + return(p==-1?-1:0); +} diff --git a/lib/libc4.3tahoe/stdio/ftell.c b/lib/libc4.3tahoe/stdio/ftell.c new file mode 100644 index 0000000..04c15a8 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/ftell.c @@ -0,0 +1,35 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ftell.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * Return file offset. + * Coordinates with buffering. + */ + +#include +long lseek(); + + +long ftell(iop) +register FILE *iop; +{ + register long tres; + register adjust; + + if (iop->_cnt < 0) + iop->_cnt = 0; + if (iop->_flag&_IOREAD) + adjust = - iop->_cnt; + else if (iop->_flag&(_IOWRT|_IORW)) { + adjust = 0; + if (iop->_flag&_IOWRT && iop->_base && (iop->_flag&_IONBF)==0) + adjust = iop->_ptr - iop->_base; + } else + return(-1); + tres = lseek(fileno(iop), 0L, 1); + if (tres<0) + return(tres); + tres += adjust; + return(tres); +} diff --git a/lib/libc4.3tahoe/stdio/fwrite.4.2 b/lib/libc4.3tahoe/stdio/fwrite.4.2 new file mode 100644 index 0000000..ba0660b --- /dev/null +++ b/lib/libc4.3tahoe/stdio/fwrite.4.2 @@ -0,0 +1,20 @@ +fwrite(ptr, size, count, iop) +unsigned size, count; +register char *ptr; +register FILE *iop; +{ + register unsigned s; + unsigned ndone; + + ndone = 0; + if (size) + for (; ndone + +fwrite(ptr, size, count, iop) + register char *ptr; + unsigned size, count; + register FILE *iop; +{ + register int s; + + s = size * count; + if (iop->_flag & _IOLBF) + while (s > 0) { + if (--iop->_cnt > -iop->_bufsiz && *ptr != '\n') + *iop->_ptr++ = *ptr++; + else if (_flsbuf(*(unsigned char *)ptr++, iop) == EOF) + break; + s--; + } + else while (s > 0) { + if (iop->_cnt < s) { + if (iop->_cnt > 0) { + bcopy(ptr, iop->_ptr, iop->_cnt); + ptr += iop->_cnt; + iop->_ptr += iop->_cnt; + s -= iop->_cnt; + } + if (_flsbuf(*(unsigned char *)ptr++, iop) == EOF) + break; + s--; + } + if (iop->_cnt >= s) { + bcopy(ptr, iop->_ptr, s); + iop->_ptr += s; + iop->_cnt -= s; + return (count); + } + } + return (size != 0 ? count - ((s + size - 1) / size) : 0); +} diff --git a/lib/libc4.3tahoe/stdio/getchar.c b/lib/libc4.3tahoe/stdio/getchar.c new file mode 100644 index 0000000..f85e8dd --- /dev/null +++ b/lib/libc4.3tahoe/stdio/getchar.c @@ -0,0 +1,15 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getchar.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * A subroutine version of the macro getchar. + */ +#include + +#undef getchar + +getchar() +{ + return(getc(stdin)); +} diff --git a/lib/libc4.3tahoe/stdio/gets.c b/lib/libc4.3tahoe/stdio/gets.c new file mode 100644 index 0000000..edd0432 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/gets.c @@ -0,0 +1,21 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)gets.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +char * +gets(s) +char *s; +{ + register c; + register char *cs; + + cs = s; + while ((c = getchar()) != '\n' && c != EOF) + *cs++ = c; + if (c == EOF && cs==s) + return(NULL); + *cs++ = '\0'; + return(s); +} diff --git a/lib/libc4.3tahoe/stdio/getw.c b/lib/libc4.3tahoe/stdio/getw.c new file mode 100644 index 0000000..f307e1b --- /dev/null +++ b/lib/libc4.3tahoe/stdio/getw.c @@ -0,0 +1,20 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)getw.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +getw(iop) +register FILE *iop; +{ + register i; + register char *p; + int w; + + p = (char *)&w; + for (i=sizeof(int); --i>=0;) + *p++ = getc(iop); + if (feof(iop)) + return(EOF); + return(w); +} diff --git a/lib/libc4.3tahoe/stdio/printf.c b/lib/libc4.3tahoe/stdio/printf.c new file mode 100644 index 0000000..cb3c469 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/printf.c @@ -0,0 +1,32 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)printf.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +printf(fmt, args) + char *fmt; + int args; +{ + int len; + + len = _doprnt(fmt, &args, stdout); + return(ferror(stdout) ? EOF : len); +} diff --git a/lib/libc4.3tahoe/stdio/profiled/.MAP b/lib/libc4.3tahoe/stdio/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/stdio/putchar.c b/lib/libc4.3tahoe/stdio/putchar.c new file mode 100644 index 0000000..5aa3cee --- /dev/null +++ b/lib/libc4.3tahoe/stdio/putchar.c @@ -0,0 +1,16 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)putchar.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +/* + * A subroutine version of the macro putchar + */ +#include + +#undef putchar + +putchar(c) +register c; +{ + putc(c, stdout); +} diff --git a/lib/libc4.3tahoe/stdio/puts.c b/lib/libc4.3tahoe/stdio/puts.c new file mode 100644 index 0000000..bffc619 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/puts.c @@ -0,0 +1,15 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)puts.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +puts(s) +register char *s; +{ + register c; + + while (c = *s++) + putchar(c); + return(putchar('\n')); +} diff --git a/lib/libc4.3tahoe/stdio/putw.c b/lib/libc4.3tahoe/stdio/putw.c new file mode 100644 index 0000000..d56868b --- /dev/null +++ b/lib/libc4.3tahoe/stdio/putw.c @@ -0,0 +1,17 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)putw.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +putw(w, iop) +register FILE *iop; +{ + register char *p; + register i; + + p = (char *)&w; + for (i=sizeof(int); --i>=0;) + putc(*p++, iop); + return(ferror(iop)); +} diff --git a/lib/libc4.3tahoe/stdio/rew.c b/lib/libc4.3tahoe/stdio/rew.c new file mode 100644 index 0000000..1c49179 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/rew.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)rew.c 5.4 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include +#include + +rewind(iop) + register FILE *iop; +{ + off_t lseek(); + + (void)fflush(iop); + (void)lseek(fileno(iop), 0L, L_SET); + iop->_cnt = 0; + iop->_ptr = iop->_base; + iop->_flag &= ~(_IOERR|_IOEOF); + if (iop->_flag & _IORW) + iop->_flag &= ~(_IOREAD|_IOWRT); +} diff --git a/lib/libc4.3tahoe/stdio/scanf.c b/lib/libc4.3tahoe/stdio/scanf.c new file mode 100644 index 0000000..9f1cab6 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/scanf.c @@ -0,0 +1,33 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)scanf.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +scanf(fmt, args) +char *fmt; +{ + return(_doscan(stdin, fmt, &args)); +} + +fscanf(iop, fmt, args) +FILE *iop; +char *fmt; +{ + return(_doscan(iop, fmt, &args)); +} + +sscanf(str, fmt, args) +register char *str; +char *fmt; +{ + FILE _strbuf; + + _strbuf._flag = _IOREAD|_IOSTRG; + _strbuf._ptr = _strbuf._base = str; + _strbuf._cnt = 0; + while (*str++) + _strbuf._cnt++; + _strbuf._bufsiz = _strbuf._cnt; + return(_doscan(&_strbuf, fmt, &args)); +} diff --git a/lib/libc4.3tahoe/stdio/setbuf.c b/lib/libc4.3tahoe/stdio/setbuf.c new file mode 100644 index 0000000..4b5b59b --- /dev/null +++ b/lib/libc4.3tahoe/stdio/setbuf.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setbuf.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +setbuf(iop, buf) +register FILE *iop; +char *buf; +{ + if (iop->_base != NULL && iop->_flag&_IOMYBUF) + free(iop->_base); + iop->_flag &= ~(_IOMYBUF|_IONBF|_IOLBF); + if ((iop->_base = buf) == NULL) { + iop->_flag |= _IONBF; + iop->_bufsiz = NULL; + } else { + iop->_ptr = iop->_base; + iop->_bufsiz = BUFSIZ; + } + iop->_cnt = 0; +} diff --git a/lib/libc4.3tahoe/stdio/setbuffer.c b/lib/libc4.3tahoe/stdio/setbuffer.c new file mode 100644 index 0000000..7b3c1fc --- /dev/null +++ b/lib/libc4.3tahoe/stdio/setbuffer.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)setbuffer.c 5.2 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#include + +setbuffer(iop, buf, size) + register FILE *iop; + char *buf; + int size; +{ + if (iop->_base != NULL && iop->_flag&_IOMYBUF) + free(iop->_base); + iop->_flag &= ~(_IOMYBUF|_IONBF|_IOLBF); + if ((iop->_base = buf) == NULL) { + iop->_flag |= _IONBF; + iop->_bufsiz = NULL; + } else { + iop->_ptr = iop->_base; + iop->_bufsiz = size; + } + iop->_cnt = 0; +} + +/* + * set line buffering for either stdout or stderr + */ +setlinebuf(iop) + register FILE *iop; +{ + char *buf; + extern char *malloc(); + + fflush(iop); + setbuffer(iop, NULL, 0); + buf = malloc(BUFSIZ); + if (buf != NULL) { + setbuffer(iop, buf, BUFSIZ); + iop->_flag |= _IOLBF|_IOMYBUF; + } +} diff --git a/lib/libc4.3tahoe/stdio/sprintf.c b/lib/libc4.3tahoe/stdio/sprintf.c new file mode 100644 index 0000000..49f859c --- /dev/null +++ b/lib/libc4.3tahoe/stdio/sprintf.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1987 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)sprintf.c 5.5 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include + +sprintf(str, fmt, args) + char *str, *fmt; + int args; +{ + FILE _strbuf; + int len; + + _strbuf._flag = _IOWRT+_IOSTRG; + _strbuf._ptr = str; + _strbuf._cnt = 32767; + len = _doprnt(fmt, &args, &_strbuf); + *_strbuf._ptr = 0; + return(len); +} diff --git a/lib/libc4.3tahoe/stdio/stdio.tahoe/.MAP b/lib/libc4.3tahoe/stdio/stdio.tahoe/.MAP new file mode 100644 index 0000000..c3bea24 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/stdio.tahoe/.MAP @@ -0,0 +1 @@ +F MAKEFILE.;1 Makefile diff --git a/lib/libc4.3tahoe/stdio/stdio.tahoe/Makefile b/lib/libc4.3tahoe/stdio/stdio.tahoe/Makefile new file mode 100644 index 0000000..c88eb1f --- /dev/null +++ b/lib/libc4.3tahoe/stdio/stdio.tahoe/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.3 (Berkeley) 7/9/88 +# +DEFS= -DLIBC_SCCS +CFLAGS= -O ${DEFS} +OBJS= +SRCS= +TAGSFILE=tags + +.c.o: + @${CC} -E -DPROF ${CFLAGS} $*.c | as -o $*.o + @-ld -x -o profiled/$*.o -r $*.o + ${CC} -E ${CFLAGS} $*.c | as -o $*.o + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} +# (cd ../../library; rm -f ${OBJS}) +# (cd ../../profiled; rm -f ${OBJS}) +# ln ${OBJS} ../../library +# (cd profiled; ln ${OBJS} ../../../profiled) + +tags: +# (P=`pwd`; \ +# egrep "^ENTRY(.*)|^SYSCALL(.*)" ${SRCS} | /bin/sed \ +#"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ +# >> ${TAGSFILE}) + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: +# mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + diff --git a/lib/libc4.3tahoe/stdio/stdio.vax/.MAP b/lib/libc4.3tahoe/stdio/stdio.vax/.MAP new file mode 100644 index 0000000..a5e0793 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/stdio.vax/.MAP @@ -0,0 +1,6 @@ +F FGETS.S;1 fgets.s +F FPUTS.S;1 fputs.s +F GETS.S;1 gets.s +F MAKEFILE.;1 Makefile +D PROFILED profiled +F PUTS.S;1 puts.s diff --git a/lib/libc4.3tahoe/stdio/stdio.vax/Makefile b/lib/libc4.3tahoe/stdio/stdio.vax/Makefile new file mode 100644 index 0000000..a7b0da1 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/stdio.vax/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.11 (Berkeley) 6/27/88 +# +DEFS= -DLIBC_SCCS +CFLAGS= -I../../vax ${DEFS} +SRCS= fputs.s fgets.s puts.s gets.s +OBJS= fputs.o fgets.o puts.o gets.o +TAGSFILE=tags + +.s.o: + @/lib/cpp -DPROF ${CFLAGS} $*.s | as -o $*.o + @-ld -x -o profiled/$*.o -r $*.o + /lib/cpp ${CFLAGS} $*.s | as -o $*.o + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + (P=`pwd`; \ + egrep "^ENTRY(.*)|^SYSCALL(.*)" ${SRCS} | sed \ +"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ + >> ${TAGSFILE}) + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + diff --git a/lib/libc4.3tahoe/stdio/stdio.vax/fgets.s b/lib/libc4.3tahoe/stdio/stdio.vax/fgets.s new file mode 100644 index 0000000..39fa212 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/stdio.vax/fgets.s @@ -0,0 +1,138 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)fgets.s 5.5 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * char *fgets(s, n, iptr); + * char *s; + * int n; + * FILE *iptr; + * + * arguments: a target string, a length, and a file pointer. + * side effects: reads up to and including a newline, or up to n-1 bytes, + * whichever is less, from the file indicated by iptr into the target + * string and null terminates. + * result: the target string if successful, 0 otherwise. + */ + +#include "DEFS.h" + +#define NL 0xa + +ENTRY(fgets, R11|R10|R9) + +#define OLD_S 4(ap) +#define S r11 + movl OLD_S,S + +#define N 8(ap) + +#define IPTR r10 +#define _CNT +#define _PTR 4 +#define _BASE 8 + movl 12(ap),IPTR + +#define COUNT r9 + + /* + * Sanity check -- is the buffer big enough? + */ + cmpl N,$1 + jleq Lerror + + subl3 $1,N,COUNT /* We scan at most COUNT chars */ + + /* + * If no characters, call _filbuf() to get some. + */ + tstl _CNT(IPTR) + jgtr Lscan + +Lloop: + pushl IPTR + calls $1,__filbuf + tstl r0 + jlss Leof + movb r0,(S)+ /* Save the returned character */ + decl N + decl COUNT + jleq 1f + cmpb r0,$NL /* If it was a newline, we're done */ + jneq 2f +1: + clrb (S) + jbr Lret +2: + tstl _BASE(IPTR) /* Is the input buffered? */ + jeql Lloop /* If not, loop inefficiently */ + + /* + * Look for a newline in the buffer. + */ +Lscan: + cmpl _CNT(IPTR),COUNT /* Is buffer bigger than N-1? */ + jgeq 1f + movl _CNT(IPTR),COUNT /* If not, don't read off the end */ +1: + locc $NL,COUNT,*_PTR(IPTR) /* Scan the buffer */ + jeql Lagain + + /* + * Success -- copy the data and return. + */ + decl r0 /* How many characters did we read? */ + subl2 r0,COUNT + movc3 COUNT,*_PTR(IPTR),(S) /* Copy the data */ + clrb (r3) + subl2 COUNT,_CNT(IPTR) /* Fix up the I/O buffer */ + movl r1,_PTR(IPTR) + +Lret: + movl OLD_S,r0 + ret + + /* + * If we run out of characters, copy the buffer and loop if needed. + */ +Lagain: + movc3 COUNT,*_PTR(IPTR),(S) /* Copy the data */ + subl2 COUNT,_CNT(IPTR) /* Adjust the buffers and counts */ + movl r1,_PTR(IPTR) + subl2 COUNT,N + movl r3,S + subl3 $1,N,COUNT + jgtr Lloop + + /* + * End of file? Check to see if we copied any data. + */ +Leof: + cmpl S,OLD_S + jeql Lerror + clrb (S) + jbr Lret + + /* + * Error return -- null pointer. + */ +Lerror: + clrl r0 + ret diff --git a/lib/libc4.3tahoe/stdio/stdio.vax/fputs.s b/lib/libc4.3tahoe/stdio/stdio.vax/fputs.s new file mode 100644 index 0000000..79b5f8c --- /dev/null +++ b/lib/libc4.3tahoe/stdio/stdio.vax/fputs.s @@ -0,0 +1,151 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)fputs.s 5.6 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * fputs(s, iop); + * char *s; + * FILE *iop; + * + * arguments: a source string and a file pointer. + * side effects: writes to the file indicated by iop using the data in + * the null-terminated source string. + * result: technically void; for compatibility we return 0 for the null + * string, non-zero otherwise. We return zero for errors too. + */ + +#include "DEFS.h" + +#define NBF 04 +#define LBF 0200 + +#define NL 012 + +ENTRY(fputs, R11|R10|R9) + +#define S r11 + movl 4(ap),S +#define IOP r10 +#define _CNT +#define _PTR 4 +#define _BASE 8 +#define _BUFSIZ 12 +#define _FLAG 16 + movl 8(ap),IOP + +#define UNBUF -4(fp) + +#define COUNT r9 + + /* + * For compatibility (sigh). + */ + tstb (S) + jeql Lerror + + /* + * For unbuffered I/O, line buffer the output line. + * Ugly but fast -- and doesn't CURRENTLY break anything (sigh). + */ + movab -1028(sp),sp + bicw3 $~NBF,_FLAG(IOP),UNBUF + jeql 1f + + bicw2 $NBF,_FLAG(IOP) /* Clear no-buffering flag */ + movl sp,_BASE(IOP) /* Create a buffer */ + movl sp,_PTR(IOP) + cvtwl $1024,_BUFSIZ(IOP) + jbr 2f + +1: + tstl _CNT(IOP) /* Has a buffer been allocated? */ + jgtr 2f + pushl IOP /* Get _flsbuf() to do the work */ + pushl $0 + calls $2,__flsbuf + tstl r0 + jlss Lerror + incl _CNT(IOP) /* Unput the char we sent */ + decl _PTR(IOP) +2: + + /* + * Search for the terminating null. + * We only need to look at _BUFSIZ bytes or less on each pass. + */ +Lloop: + addl3 _BASE(IOP),_BUFSIZ(IOP),COUNT /* How many bytes? */ + subl2 _PTR(IOP),COUNT + locc $0,COUNT,(S) /* Look for a null */ + jeql Lagain + + subl2 r0,COUNT /* Copy the data */ + movc3 COUNT,(S),*_PTR(IOP) + movl r3,_PTR(IOP) /* Fix up IOP */ + subl2 COUNT,_CNT(IOP) + bitw $LBF,_FLAG(IOP) /* If line buffered... */ + jneq 1f + tstw UNBUF /* or unbuffered... */ + jneq 1f + tstl _CNT(IOP) /* or a full buffer... */ + jgtr 2f +1: + pushl IOP /* ... flush the buffer */ + calls $1,_fflush + tstl r0 + jlss Lerror +2: + + /* + * Fix up buffering again. + */ +Lfixup: + tstw UNBUF + jeql 1f + bisw2 $NBF,_FLAG(IOP) /* Reset flag */ + clrl _BASE(IOP) /* Clear data structure */ + clrl _BUFSIZ(IOP) + clrl _CNT(IOP) +1: + cvtbl $NL,r0 /* Compatibility hack */ + ret + + /* + * We didn't find the null -- loop. + */ +Lagain: + movc3 COUNT,(S),*_PTR(IOP) /* Copy the data */ + movl r1,S + movl r3,_PTR(IOP) /* Fix up IOP */ + subl2 COUNT,_CNT(IOP) + pushl IOP /* The buffer is full -- flush it */ + calls $1,_fflush + tstl r0 + jlss Lerror + tstb (S) /* More data? */ + jneq Lloop + jbr Lfixup + + /* + * Bomb out. Return 0 (why not? that's what the old one did). + */ +Lerror: + clrl r0 + ret diff --git a/lib/libc4.3tahoe/stdio/stdio.vax/gets.s b/lib/libc4.3tahoe/stdio/stdio.vax/gets.s new file mode 100644 index 0000000..d0db215 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/stdio.vax/gets.s @@ -0,0 +1,120 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)gets.s 5.4 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * char *gets(s); + * char *s; + * + * argument: a target string + * side effects: reads bytes up to and including a newline from the + * standard input into the target string and replaces the newline + * with a null to null-terminate the string. + * result: the target string if successful, 0 otherwise. + */ + +#include "DEFS.h" + +#define NL 0xa + +ENTRY(gets, R11|R10) + +#define S r11 + movl 4(ap),S +#define IPTR r10 +#define _CNT +#define _PTR 4 +#define _BASE 8 +#define _BUFSIZ 12 +#define _FLAG 16 + movab __iob,IPTR + +#define OLD_S 4(ap) + + /* + * If no characters, call _filbuf() to get some. + */ + tstl _CNT(IPTR) + jgtr Lscan + +Lloop: + pushl IPTR + calls $1,__filbuf + tstl r0 /* What did _filbuf() return? */ + jlss Leof + cmpb r0,$NL + jneq 1f + clrb (S) + jbr Lret +1: + movb r0,(S)+ /* Save the returned character */ + tstl _BASE(IPTR) /* Is input buffered? */ + jeql Lloop + + /* + * Look for a newline in the buffer. + */ +Lscan: + locc $NL,_CNT(IPTR),*_PTR(IPTR) + jeql Lagain + + /* + * Success -- copy the data and return. + */ + subl3 r0,_CNT(IPTR),r2 + subl2 r2,_CNT(IPTR) + movc3 r2,*_PTR(IPTR),(S) /* Copy the data */ + clrb (r3) + movl r1,_PTR(IPTR) + decl _CNT(IPTR) /* Skip the newline */ + incl _PTR(IPTR) + + /* + * Normal return. + */ +Lret: + movl OLD_S,r0 + ret + + /* + * If we run out of characters, copy the buffer and loop. + */ +Lagain: + movc3 _CNT(IPTR),*_PTR(IPTR),(S) /* Copy the data */ + movl r3,S + movl _BASE(IPTR),_PTR(IPTR) /* Reset stdio */ + clrl _CNT(IPTR) + jbr Lloop + + /* + * End of file? Check to see if we copied any data. + */ +Leof: + cmpl S,OLD_S + jeql Lerror + clrb (S) + jbr Lret + + /* + * Error/eof return -- null pointer. + */ +Lerror: + clrl r0 + ret diff --git a/lib/libc4.3tahoe/stdio/stdio.vax/profiled/.MAP b/lib/libc4.3tahoe/stdio/stdio.vax/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/stdio/stdio.vax/puts.s b/lib/libc4.3tahoe/stdio/stdio.vax/puts.s new file mode 100644 index 0000000..82958a1 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/stdio.vax/puts.s @@ -0,0 +1,148 @@ +/* + * Copyright (c) 1985 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) + .asciz "@(#)puts.s 5.6 (Berkeley) 6/27/88" +#endif /* LIBC_SCCS and not lint */ + +/* + * puts(s); + * char *s; + * + * argument: a source string. + * side effects: writes to the standard output using the data in + * the null-terminated source string; a newline is appended. + * result: technically void; for compatibility we return 0 for the null + * string, non-zero otherwise. We return zero for errors too. + */ + +#include "DEFS.h" + +#define NBF 04 +#define LBF 0200 + +#define NL 012 + +ENTRY(puts, R11|R10|R9) + +#define S r11 + movl 4(ap),S +#define IOP r10 +#define _CNT +#define _PTR 4 +#define _BASE 8 +#define _BUFSIZ 12 +#define _FLAG 16 + movab __iob+20,IOP + +#define UNBUF -4(fp) + +#define COUNT r9 + + /* + * For unbuffered I/O, line buffer the output line. + * Ugly but fast -- and doesn't CURRENTLY break anything (sigh). + */ + movab -1028(sp),sp + bicw3 $~NBF,_FLAG(IOP),UNBUF + jeql 1f + + bicw2 $NBF,_FLAG(IOP) /* Clear no-buffering flag */ + movl sp,_BASE(IOP) /* Create a buffer */ + movl sp,_PTR(IOP) + cvtwl $1024,_BUFSIZ(IOP) + jbr 2f + +1: + tstl _CNT(IOP) /* Has a buffer been allocated? */ + jgtr 2f + pushl IOP /* Get _flsbuf() to make one */ + pushl $0 + calls $2,__flsbuf + tstl r0 + jlss Lerror + incl _CNT(IOP) /* Unput the char we sent */ + decl _PTR(IOP) +2: + + /* + * Search for the terminating null. + */ +Lloop: + addl3 _BASE(IOP),_BUFSIZ(IOP),COUNT /* How many bytes? */ + subl2 _PTR(IOP),COUNT + locc $0,COUNT,(S) /* Look for a null */ + jeql Lagain + + subl2 r0,COUNT /* Copy the data */ + movc3 COUNT,(S),*_PTR(IOP) + movl r3,_PTR(IOP) /* Fix up IOP */ + subl2 COUNT,_CNT(IOP) + +Lnl: + movb $NL,*_PTR(IOP) /* Append a newline */ + incl _PTR(IOP) + decl _CNT(IOP) + + bitw $LBF,_FLAG(IOP) /* If line buffered... */ + jneq 1f + tstw UNBUF /* or unbuffered... */ + jneq 1f + tstl _CNT(IOP) /* or a full buffer... */ + jgtr 2f +1: + pushl IOP /* ... flush the buffer */ + calls $1,_fflush + tstl r0 + jlss Lerror +2: + + /* + * Fix up buffering again. + */ + tstw UNBUF + jeql 1f + bisw2 $NBF,_FLAG(IOP) /* Reset flag */ + clrl _BASE(IOP) /* Clear data structure */ + clrl _BUFSIZ(IOP) + clrl _CNT(IOP) +1: + cvtbl $NL,r0 /* Compatibility hack */ + ret + + /* + * We didn't find the null -- loop. + */ +Lagain: + movc3 COUNT,(S),*_PTR(IOP) /* Copy the data */ + movl r1,S + movl r3,_PTR(IOP) /* Fix up IOP */ + subl2 COUNT,_CNT(IOP) + pushl IOP /* The buffer is full -- flush it */ + calls $1,_fflush + tstl r0 + jlss Lerror + tstb (S) /* More data? */ + jneq Lloop + jbr Lnl + + /* + * Bomb out. Return 0 (why not? that's what the old one did). + */ +Lerror: + clrl r0 + ret diff --git a/lib/libc4.3tahoe/stdio/ungetc.c b/lib/libc4.3tahoe/stdio/ungetc.c new file mode 100644 index 0000000..286734c --- /dev/null +++ b/lib/libc4.3tahoe/stdio/ungetc.c @@ -0,0 +1,24 @@ +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)ungetc.c 5.3 (Berkeley) 3/26/86"; +#endif LIBC_SCCS and not lint + +#include + +ungetc(c, iop) + register FILE *iop; +{ + if (c == EOF || (iop->_flag & (_IOREAD|_IORW)) == 0 || + iop->_ptr == NULL || iop->_base == NULL) + return (EOF); + + if (iop->_ptr == iop->_base) + if (iop->_cnt == 0) + iop->_ptr++; + else + return (EOF); + + iop->_cnt++; + *--iop->_ptr = c; + + return (c); +} diff --git a/lib/libc4.3tahoe/stdio/vfprintf.c b/lib/libc4.3tahoe/stdio/vfprintf.c new file mode 100644 index 0000000..94f0fb5 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/vfprintf.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +int +vfprintf(iop, fmt, ap) + FILE *iop; + char *fmt; + va_list ap; +{ + int len; + char localbuf[BUFSIZ]; + + if (iop->_flag & _IONBF) { + iop->_flag &= ~_IONBF; + iop->_ptr = iop->_base = localbuf; + len = _doprnt(fmt, ap, iop); + (void) fflush(iop); + iop->_flag |= _IONBF; + iop->_base = NULL; + iop->_bufsiz = 0; + iop->_cnt = 0; + } else + len = _doprnt(fmt, ap, iop); + + return (ferror(iop) ? EOF : len); +} diff --git a/lib/libc4.3tahoe/stdio/vprintf.c b/lib/libc4.3tahoe/stdio/vprintf.c new file mode 100644 index 0000000..ff99f39 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/vprintf.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vprintf.c 5.2 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +int +vprintf(fmt, ap) + char *fmt; + va_list ap; +{ + int len; + + len = _doprnt(fmt, ap, stdout); + return (ferror(stdout) ? EOF : len); +} diff --git a/lib/libc4.3tahoe/stdio/vsprintf.c b/lib/libc4.3tahoe/stdio/vsprintf.c new file mode 100644 index 0000000..7f43f90 --- /dev/null +++ b/lib/libc4.3tahoe/stdio/vsprintf.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vsprintf.c 5.2 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include +#include + +int +vsprintf(str, fmt, ap) + char *str, *fmt; + va_list ap; +{ + FILE f; + int len; + + f._flag = _IOWRT+_IOSTRG; + f._ptr = str; + f._cnt = 32767; + len = _doprnt(fmt, ap, &f); + *f._ptr = 0; + return (len); +} diff --git a/lib/libc4.3tahoe/tahoe/.MAP b/lib/libc4.3tahoe/tahoe/.MAP new file mode 100644 index 0000000..d9de710 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/.MAP @@ -0,0 +1,5 @@ +D CSU csu +F DEFS.H;1 DEFS.h +D FPE fpe +F MAKEFILE.;1 Makefile +D SYS sys diff --git a/lib/libc4.3tahoe/tahoe/DEFS.h b/lib/libc4.3tahoe/tahoe/DEFS.h new file mode 100644 index 0000000..587824d --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/DEFS.h @@ -0,0 +1,42 @@ +/* DEFS.h 1.3 86/08/01 */ + +/* + * Macros used to define entry points + * in assembly language routines. + */ +#if defined(GPROF) || defined(PROF) +#define ENTRY(name, regs) \ + .globl _/**/name; .align 2; _/**/name: .word regs; \ + .data; .align 2; 1: .long 0; .text; \ + pushal 1b; callf $8,mcount; +#define ASENTRY(name, regs) \ + .globl name; .align 2; name: .word regs; \ + .data; .align 2; 1: .long 0; .text; \ + pushal 1b; callf $8,mcount; +#define XENTRY(name, regs) \ + .globl _/**/name; .globl X/**/name; .align 2; \ + _/**/name: X/**/name: .word regs; \ + .data; .align 2; 1: .long 0; .text; \ + pushal 1b; callf $8,mcount +#else +#define ENTRY(name, regs) \ + .globl _/**/name; .align 2; _/**/name: .word regs +#define ASENTRY(name, regs) \ + .globl name; .align 2; name: .word regs +#define XENTRY(name, regs) \ + .globl _/**/name; .globl X/**/name; .align 2; \ + _/**/name: X/**/name: .word regs; +#endif +#define R0 0x0001 +#define R1 0x0002 +#define R2 0x0004 +#define R3 0x0008 +#define R4 0x0010 +#define R5 0x0020 +#define R6 0x0040 +#define R7 0x0080 +#define R8 0x0100 +#define R9 0x0200 +#define R10 0x0400 +#define R11 0x0800 +#define R12 0x1000 diff --git a/lib/libc4.3tahoe/tahoe/Makefile b/lib/libc4.3tahoe/tahoe/Makefile new file mode 100644 index 0000000..29aecf4 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# %W% (Berkeley) %G% +# +DEFS= -DLIBC_SCCS -DSYSLIBC_SCCS +TAGSFILE=tags + +# include this for floating point emulation code +#FPE= fpe +ALL= sys ${FPE} + +all: ${ALL} + for i in ${ALL}; do (cd $$i; make ${MFLAGS} DEFS=${DEFS}); done + +clean: + for i in ${ALL} fpe; do (cd $$i; make ${MFLAGS} clean); done + +depend: + for i in ${ALL}; do \ + (cd $$i; make ${MFLAGS} DEFS=${DEFS} depend); done + +tags: + for i in ${ALL}; do \ + (cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \ + done + +FRC: + diff --git a/lib/libc4.3tahoe/tahoe/csu/.MAP b/lib/libc4.3tahoe/tahoe/csu/.MAP new file mode 100644 index 0000000..0b17a25 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/csu/.MAP @@ -0,0 +1,9 @@ +F CRT0.S;1 crt0.s +F GCRT0.H;1 gcrt0.h +F GMON.C;1 gmon.c +L GMON.EX;1 gmon.ex mon.ex +F GMON.H;1 gmon.h +F MAKEFILE.;1 Makefile +F MCRT0.S;1 mcrt0.s +F MON.C;1 mon.c +F MON.EX;1 mon.ex diff --git a/lib/libc4.3tahoe/tahoe/csu/Makefile b/lib/libc4.3tahoe/tahoe/csu/Makefile new file mode 100644 index 0000000..9985517 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/csu/Makefile @@ -0,0 +1,70 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.6 (Berkeley) 7/9/88 +# +DEFS= -DLIBC_SCCS +CFLAGS= -O ${DEFS} +CSRCS= gmon.c mon.c +ASRCS= crt0.s mcrt0.s +OBJS= crt0.o mcrt0.o gcrt0.o +TAGSFILE=tags + +.s.o: + ${AS} -o $*.o $*.s + ld -x -r $*.o + mv a.out $*.o + +all link: ${OBJS} + +mcrt0.o: moncrt0.o mon.o + ld -x -r -o $@ moncrt0.o mon.o + +gcrt0.o: moncrt0.o gmon.o + ld -x -r -o $@ moncrt0.o gmon.o + +moncrt0.o: mcrt0.s + ${AS} -o $@ mcrt0.s + +mon.o: mon.c + ${CC} -S ${CFLAGS} mon.c + ex - mon.s < mon.ex + ${AS} -o $@ mon.s + +gmon.o: gmon.c + ${CC} -S ${CFLAGS} gmon.c + ex - gmon.s < mon.ex + ${AS} -o $@ gmon.s + +install: + install -o bin -g bin -m 444 crt0.o ${DESTDIR}/lib/crt0.o + install -o bin -g bin -m 444 mcrt0.o ${DESTDIR}/lib/mcrt0.o + install -o bin -g bin -m 444 gcrt0.o ${DESTDIR}/usr/lib/gcrt0.o + +clean: + rm -f *.o *mon.s a.out core ${TAGSFILE} + +tags: + cwd=`pwd`; \ + for i in ${CSRCS}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + (P=`pwd`; \ + egrep "^ENTRY(.*)|^SYSCALL(.*)" ${ASRCS} | sed \ +"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ + >> ${TAGSFILE}) + +depend: diff --git a/lib/libc4.3tahoe/tahoe/csu/crt0.s b/lib/libc4.3tahoe/tahoe/csu/crt0.s new file mode 100644 index 0000000..5366306 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/csu/crt0.s @@ -0,0 +1,39 @@ +# @(#)crt0.s 4.1 (Berkeley) 12/21/80 +# C runtime startoff +# TAHOE 3/83 + + .set exit,1 +.globl _exit +.globl start +.globl _main +.globl _environ + +# +# C language startup routine + +start: + .word 0x0000 + movab -8(sp),sp + movl 8(sp),(sp) # argc + movab 12(sp),r0 + movl r0,4(sp) # argv + jmp L3 +L1: + addl2 $4,r0 +L3: + tstl (r0) # null args term ? + jneq L1 + addl2 $4,r0 + cmpl r0,*4(sp) # end of 'env' or 'argv' ? + jlss L2 + subl2 $4,r0 # envp's are in list +L2: + movl r0,8(sp) # env + movl r0,_environ # indir is 0 if no env ; not 0 if env + callf $4*3+4,_main + pushl r0 + callf $4*1+4,_exit + kcall $exit +# + .data +_environ: .space 4 diff --git a/lib/libc4.3tahoe/tahoe/csu/gcrt0.h b/lib/libc4.3tahoe/tahoe/csu/gcrt0.h new file mode 100644 index 0000000..9f4ecea --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/csu/gcrt0.h @@ -0,0 +1,24 @@ + /* @(#)gcrt0.h 1.1 (Tahoe) 3/21/85 */ + +struct phdr { + char *lpc; + char *hpc; + int ncnt; +}; + +struct tostruct { + char *selfpc; + long count; + unsigned short link; +}; + + /* + * a raw arc, + * with pointers to the calling site and the called site + * and a count. + */ +struct rawarc { + unsigned long raw_frompc; + unsigned long raw_selfpc; + long raw_count; +}; diff --git a/lib/libc4.3tahoe/tahoe/csu/gmon.c b/lib/libc4.3tahoe/tahoe/csu/gmon.c new file mode 100644 index 0000000..471b72d --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/csu/gmon.c @@ -0,0 +1,285 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)gmon.c 5.1 (Berkeley) 8/27/87"; +#endif LIBC_SCCS and not lint + +#include "gmon.h" + + /* + * froms is actually a bunch of unsigned shorts indexing tos + */ +static int profiling = 3; +static unsigned short *froms; +static struct tostruct *tos = 0; +static long tolimit = 0; +static char *s_lowpc = 0; +static char *s_highpc = 0; +static unsigned long s_textsize = 0; + +static int ssiz; +static char *sbuf; +static int s_scale; + /* see profil(2) where this is describe (incorrectly) */ +#define SCALE_1_TO_1 0x10000L + +#define MSG "No space for monitor buffer(s)\n" + +monstartup(lowpc, highpc) + char *lowpc; + char *highpc; +{ + int monsize; + char *buffer; + char *sbrk(); + extern char *minbrk; + + /* + * round lowpc and highpc to multiples of the density we're using + * so the rest of the scaling (here and in gprof) stays in ints. + */ + lowpc = (char *) + ROUNDDOWN((unsigned)lowpc, HISTFRACTION*sizeof(HISTCOUNTER)); + s_lowpc = lowpc; + highpc = (char *) + ROUNDUP((unsigned)highpc, HISTFRACTION*sizeof(HISTCOUNTER)); + s_highpc = highpc; + s_textsize = highpc - lowpc; + monsize = (s_textsize / HISTFRACTION) + sizeof(struct phdr); + monsize = (monsize + 3) & ~3; + buffer = sbrk( monsize ); + if ( buffer == (char *) -1 ) { + write( 2 , MSG , sizeof(MSG) - 1 ); + return; + } + froms = (unsigned short *) sbrk( s_textsize / HASHFRACTION ); + if ( froms == (unsigned short *) -1 ) { + write( 2 , MSG , sizeof(MSG) - 1 ); + froms = 0; + return; + } + tolimit = s_textsize * ARCDENSITY / 100; + if ( tolimit < MINARCS ) { + tolimit = MINARCS; + } else if ( tolimit > 65534 ) { + tolimit = 65534; + } + tos = (struct tostruct *) sbrk( (tolimit*sizeof(struct tostruct)+3)&~3 ); + if ( tos == (struct tostruct *) -1 ) { + write( 2 , MSG , sizeof(MSG) - 1 ); + froms = 0; + tos = 0; + return; + } + minbrk = sbrk(0); + tos[0].link = 0; + monitor( lowpc , highpc , buffer , monsize , tolimit ); +} + +_mcleanup() +{ + int fd; + int fromindex; + int endfrom; + char *frompc; + int toindex; + struct rawarc rawarc; + + fd = creat( "gmon.out" , 0666 ); + if ( fd < 0 ) { + perror( "mcount: gmon.out" ); + return; + } +# ifdef DEBUG + fprintf( stderr , "[mcleanup] sbuf 0x%x ssiz %d\n" , sbuf , ssiz ); +# endif DEBUG + write( fd , sbuf , ssiz ); + endfrom = s_textsize / (HASHFRACTION * sizeof(*froms)); + for ( fromindex = 0 ; fromindex < endfrom ; fromindex++ ) { + if ( froms[fromindex] == 0 ) { + continue; + } + frompc = s_lowpc + (fromindex * HASHFRACTION * sizeof(*froms)); + for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) { +# ifdef DEBUG + fprintf( stderr , + "[mcleanup] frompc 0x%x selfpc 0x%x count %d\n" , + frompc , tos[toindex].selfpc , tos[toindex].count ); +# endif DEBUG + rawarc.raw_frompc = (unsigned long) frompc; + rawarc.raw_selfpc = (unsigned long) tos[toindex].selfpc; + rawarc.raw_count = tos[toindex].count; + write( fd , &rawarc , sizeof rawarc ); + } + } + close( fd ); +} + +mcount(cntpa) + long **cntpa; +{ + register char *selfpc; + register unsigned short *frompcindex; + register struct tostruct *top; + register struct tostruct *prevtop; + register long toindex; + + /* + * find the return address for mcount, + * and address of counter pointer + */ + selfpc = *((char **)&cntpa-3); /* -8(fp) */ + frompcindex = (unsigned short *)(*((((long *)*((char **)&cntpa-1)))-2)); + /* + * check that we are profiling + * and that we aren't recursively invoked. + */ + if (profiling) { + goto out; + } + profiling++; + /* + * check that frompcindex is a reasonable pc value. + * for example: signal catchers get called from the stack, + * not from text space. too bad. + */ + frompcindex = (unsigned short *)((long)frompcindex - (long)s_lowpc); + if ((unsigned long)frompcindex > s_textsize) { + goto done; + } + frompcindex = + &froms[((long)frompcindex) / (HASHFRACTION * sizeof(*froms))]; + toindex = *frompcindex; + if (toindex == 0) { + /* + * first time traversing this arc + */ + toindex = ++tos[0].link; + if (toindex >= tolimit) { + goto overflow; + } + *frompcindex = toindex; + top = &tos[toindex]; + top->selfpc = selfpc; + top->count = 1; + top->link = 0; + goto done; + } + top = &tos[toindex]; + if (top->selfpc == selfpc) { + /* + * arc at front of chain; usual case. + */ + top->count++; + goto done; + } + /* + * have to go looking down chain for it. + * top points to what we are looking at, + * prevtop points to previous top. + * we know it is not at the head of the chain. + */ + for (; /* goto done */; ) { + if (top->link == 0) { + /* + * top is end of the chain and none of the chain + * had top->selfpc == selfpc. + * so we allocate a new tostruct + * and link it to the head of the chain. + */ + toindex = ++tos[0].link; + if (toindex >= tolimit) { + goto overflow; + } + top = &tos[toindex]; + top->selfpc = selfpc; + top->count = 1; + top->link = *frompcindex; + *frompcindex = toindex; + goto done; + } + /* + * otherwise, check the next arc on the chain. + */ + prevtop = top; + top = &tos[top->link]; + if (top->selfpc == selfpc) { + /* + * there it is. + * increment its count + * move it to the head of the chain. + */ + top->count++; + toindex = prevtop->link; + prevtop->link = top->link; + top->link = *frompcindex; + *frompcindex = toindex; + goto done; + } + + } +done: + profiling--; +out: + return; + +overflow: +# define TOLIMIT "mcount: tos overflow\n" + write(2, TOLIMIT, sizeof(TOLIMIT) - 1); + goto out; +} + +/*VARARGS1*/ +monitor( lowpc , highpc , buf , bufsiz , nfunc ) + char *lowpc; + char *highpc; + char *buf; /* declared ``short buffer[]'' in monitor(3) */ + int bufsiz; + int nfunc; /* not used, available for compatability only */ +{ + register o; + + if ( lowpc == 0 ) { + moncontrol(0); + _mcleanup(); + return; + } + sbuf = buf; + ssiz = bufsiz; + ( (struct phdr *) buf ) -> lpc = lowpc; + ( (struct phdr *) buf ) -> hpc = highpc; + ( (struct phdr *) buf ) -> ncnt = ssiz; + bufsiz -= sizeof(struct phdr); + if ( bufsiz <= 0 ) + return; + o = highpc - lowpc; + if( bufsiz < o ) + s_scale = ( (float) bufsiz / o ) * SCALE_1_TO_1; + else + s_scale = SCALE_1_TO_1; + moncontrol(1); +} + +/* + * Control profiling + * profiling is what mcount checks to see if + * all the data structures are ready. + */ +moncontrol(mode) + int mode; +{ + if (mode) { + /* start */ + profil(sbuf + sizeof(struct phdr), ssiz - sizeof(struct phdr), + s_lowpc, s_scale); + profiling = 0; + } else { + /* stop */ + profil((char *)0, 0, 0, 0); + profiling = 3; + } +} diff --git a/lib/libc4.3tahoe/tahoe/csu/gmon.ex b/lib/libc4.3tahoe/tahoe/csu/gmon.ex new file mode 120000 index 0000000..a20617d --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/csu/gmon.ex @@ -0,0 +1 @@ +mon.ex \ No newline at end of file diff --git a/lib/libc4.3tahoe/tahoe/csu/gmon.h b/lib/libc4.3tahoe/tahoe/csu/gmon.h new file mode 100644 index 0000000..680565b --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/csu/gmon.h @@ -0,0 +1,72 @@ +/* @(#)gmon.h 2.0 (Tahoe) 3/20/85 */ + +struct phdr { + char *lpc; + char *hpc; + int ncnt; +}; + + /* + * histogram counters are unsigned shorts (according to the kernel). + */ +#define HISTCOUNTER unsigned short + + /* + * fraction of text space to allocate for histogram counters + * here, 1/2 + */ +#define HISTFRACTION 2 + + /* + * Fraction of text space to allocate for from hash buckets. + * The value of HASHFRACTION is based on the minimum number of bytes + * of separation between two subroutine call points in the object code. + * Given MIN_SUBR_SEPARATION bytes of separation the value of + * HASHFRACTION is calculated as: + * + * HASHFRACTION = MIN_SUBR_SEPARATION / (2 * sizeof(short) - 1); + * + * For the Tahoe, the shortest two call sequence is: + * + * calls $0,(r0) + * calls $0,(r0) + * + * which is separated by only three bytes, thus HASHFRACTION is + * calculated as: + * + * HASHFRACTION = 3 / (2 * 2 - 1) = 1 + * + * Note that the division above rounds down, thus if MIN_SUBR_FRACTION + * is less than three, this algorithm will not work! + */ +#define HASHFRACTION 1 + + /* + * percent of text space to allocate for tostructs + * with a minimum. + */ +#define ARCDENSITY 2 +#define MINARCS 50 + +struct tostruct { + char *selfpc; + long count; + unsigned short link; +}; + + /* + * a raw arc, + * with pointers to the calling site and the called site + * and a count. + */ +struct rawarc { + unsigned long raw_frompc; + unsigned long raw_selfpc; + long raw_count; +}; + + /* + * general rounding functions. + */ +#define ROUNDDOWN(x,y) (((x)/(y))*(y)) +#define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y)) diff --git a/lib/libc4.3tahoe/tahoe/csu/mcrt0.s b/lib/libc4.3tahoe/tahoe/csu/mcrt0.s new file mode 100644 index 0000000..7bfa3f9 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/csu/mcrt0.s @@ -0,0 +1,59 @@ +# @(#)mcrt0.s 4.1 (Berkeley) 12/21/80 +# C runtime startoff including monitoring +# TAHOE 3/83 + + .set exit,1 + .set cbufs,300 + +.globl start +.globl _monitor +.globl _monstartup +.globl _main +.globl _exit +.globl _etext +.globl _environ +.globl __cleanup +.comm countbase,4 + + +start: + .word 0x0000 + movab -8(sp),sp + movl 8(sp),(sp) # argc + movab 12(sp),r0 + movl r0,4(sp) # argv + jmp L3 +L1: + addl2 $4,r0 +L3: + tstl (r0) # null args term ? + jneq L1 + addl2 $4,r0 + cmpl r0,*4(sp) # end of 'env' or 'argv' ? + jlss L2 + subl2 $4,r0 # envp's are in list +L2: + movl r0,8(sp) # env + movl r0,_environ # indir is 0 if no env ; not 0 if env + + pushab _etext + pushab eprol + callf $4*2+4,_monstartup + callf $4*3+4,_main + pushl r0 + callf $4*1+4,_exit + + .data +_environ: .space 4 + + .text +_exit: + .word 0x0000 + callf $4,__cleanup + pushl $0 + callf $4*1+4,_monitor + movl 4(fp),r0 + kcall $exit +eprol: + + diff --git a/lib/libc4.3tahoe/tahoe/csu/mon.c b/lib/libc4.3tahoe/tahoe/csu/mon.c new file mode 100644 index 0000000..cdb26fc --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/csu/mon.c @@ -0,0 +1,157 @@ +static char *sccsid = "@(#)mon.c 2.0 (Tahoe) 5/7/84"; + +#define ARCDENSITY 5 /* density of routines */ +#define MINARCS 50 /* minimum number of counters */ +#define HISTFRACTION 2 /* fraction of text space for histograms */ + + +struct phdr { + char *lpc; + char *hpc; + int ncnt; +}; + +struct cnt { + char *pc; + long ncall; +} *countbase; + +static int cntrs = 0; +static int profiling = 3; +static char *s_sbuf; +static int s_bufsiz; +static int s_scale; +static char *s_lowpc; + +int numctrs; + +#define MSG "No space for monitor buffer(s)\n" + +monstartup(lowpc, highpc) + char *lowpc; + char *highpc; +{ + int monsize; + char *buffer; + int cntsiz; + extern char *sbrk(); + extern char *minbrk; + + + cntsiz = (highpc - lowpc) * ARCDENSITY / 100; + if (cntsiz < MINARCS) + cntsiz = MINARCS; + monsize = (highpc - lowpc + HISTFRACTION - 1) / HISTFRACTION + + sizeof(struct phdr) + cntsiz * sizeof(struct cnt); + monsize = (monsize + 1) & ~1; + buffer = sbrk(monsize); + if (buffer == (char *)-1) { + write(2, MSG, sizeof(MSG)); + return; + } + minbrk = sbrk(0); + monitor(lowpc, highpc, buffer, monsize, cntsiz); +} + +mcount(cntpa) + long **cntpa; +{ + register long **cntp; + register char *selfpc; + + /* + * find the return address for mcount, + * and address of counter pointer + */ + selfpc = *((char **)&cntpa-3); /* -8(fp) */ + cntp = cntpa; + /* + * check that we aren't recursively invoked. + */ + if (profiling) + goto out; + profiling++; + /* + * check that counter is allocated + */ + if (*cntp == 0) { + /* + * check that a counter is available + */ + if (cntrs++ == numctrs) + goto overflow; + countbase->pc = selfpc; + *cntp = &countbase->ncall; + countbase++; + } + (**cntp)++; + profiling--; +out: + return; + +overflow: +# define TOLIMIT "mcount: counter overflow\n" + write( 2 , TOLIMIT , sizeof( TOLIMIT ) ); + goto out; +} + +monitor(lowpc, highpc, buf, bufsiz, cntsiz) + char *lowpc, *highpc; + char *buf; + int bufsiz, cntsiz; +{ + register int o; + struct phdr *php; + static int ssiz; + static char *sbuf; + + if (lowpc == 0) { + moncontrol(0); + o = creat("mon.out", 0666); + write(o, sbuf, ssiz); + close(o); + return; + } + sbuf = buf; + ssiz = bufsiz; + php = (struct phdr *)&buf[0]; + php->lpc = lowpc; + php->hpc = highpc; + php->ncnt = cntsiz; + numctrs = cntsiz; + countbase = (struct cnt *)(buf + sizeof(struct phdr)); + o = sizeof(struct phdr) + cntsiz * sizeof(struct cnt); + buf += o; + bufsiz -= o; + if (bufsiz <= 0) + return; + o = (highpc - lowpc); + if(bufsiz < o) + o = ((float) bufsiz / o) * 65536; + else + o = 65536; + s_scale = o; + s_sbuf = buf; + s_bufsiz = bufsiz; + s_lowpc = lowpc; + moncontrol(1); +} + +/* + * Control profiling + * profiling is what mcount checks to see if + * all the data structures are ready. + */ +moncontrol(mode) + int mode; +{ + if (mode) { + /* start */ + profil(s_sbuf, s_bufsiz, s_lowpc, s_scale); + profiling = 0; + } else { + /* stop */ + profil((char *)0, 0, 0, 0); + profiling = 3; + } +} diff --git a/lib/libc4.3tahoe/tahoe/csu/mon.ex b/lib/libc4.3tahoe/tahoe/csu/mon.ex new file mode 100644 index 0000000..c1932db --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/csu/mon.ex @@ -0,0 +1,7 @@ +" fix funny things done by mcount()" +" fix its name +g/_mcount/s//mcount/g +" fix funny name for minbrk used by monstartup() to limit brk()" +g/_minbrk/s//minbrk/g +w +q diff --git a/lib/libc4.3tahoe/tahoe/fpe/.MAP b/lib/libc4.3tahoe/tahoe/fpe/.MAP new file mode 100644 index 0000000..1d682e9 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/.MAP @@ -0,0 +1,25 @@ +F ADDD.S;1 addd.s +F ADDF.S;1 addf.s +F CMPD.S;1 cmpd.s +F CMPF.S;1 cmpf.s +F CVTDL.S;1 cvtdl.s +F CVTFL.S;1 cvtfl.s +F CVTLD.S;1 cvtld.s +F CVTLF.S;1 cvtlf.s +F CVTUD.S;1 cvtud.s +F CVTUF.S;1 cvtuf.s +F DIVD.S;1 divd.s +F DIVF.S;1 divf.s +F FNORM.S;1 fnorm.s +F FP_EXP.S;1 fp_exp.s +F MAKEFILE.;1 Makefile +F MODF.S;1 modf.s +F MULD.S;1 muld.s +F MULF.S;1 mulf.s +F NEGD.S;1 negd.s +F NEGF.S;1 negf.s +D PROFILED profiled +F SFNORM.S;1 sfnorm.s +F SFP_EXP.S;1 sfp_exp.s +F SUBD.S;1 subd.s +F SUBF.S;1 subf.s diff --git a/lib/libc4.3tahoe/tahoe/fpe/Makefile b/lib/libc4.3tahoe/tahoe/fpe/Makefile new file mode 100644 index 0000000..9e75d79 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/Makefile @@ -0,0 +1,81 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.8 (Berkeley) 7/9/88 +# +DEFS= -DLIBC_SCCS +FLAGS= -I.. ${DEFS} +CFLAGS= -O ${FLAGS} +SRCS= addd.s addf.s cmpd.s cmpf.s cvtdl.s cvtfl.s cvtld.s cvtlf.s cvtud.s \ + cvtuf.s divd.s divf.s fnorm.s fp_exp.s modf.s muld.s mulf.s negd.s \ + negf.s sfnorm.s sfp_exp.s subd.s subf.s +OBJS= addd.o addf.o cmpd.o cmpf.o cvtdl.o cvtfl.o cvtld.o cvtlf.o cvtud.o \ + cvtuf.o divd.o divf.o fnorm.o fp_exp.o modf.o muld.o mulf.o negd.o \ + negf.o sfnorm.o sfp_exp.o subd.o subf.o +TAGSFILE=tags + +.s.o: + @/lib/cpp -E ${FLAGS} -DPROF $*.s | ${AS} -o $*.o + @ld -X -o profiled/$*.o -r $*.o + /lib/cpp -E ${FLAGS} $*.s | ${AS} -o $*.o + @ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + echo "no tags here" + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +addd.o: addd.s /usr/include/tahoemath/fp.h ../DEFS.h +addf.o: addf.s /usr/include/tahoemath//fp.h ../DEFS.h +cmpd.o: cmpd.s ../DEFS.h +cmpf.o: cmpf.s ../DEFS.h +cvtdl.o: cvtdl.s /usr/include/tahoemath/fp.h ../DEFS.h +cvtfl.o: cvtfl.s /usr/include/tahoemath/fp.h ../DEFS.h +cvtld.o: cvtld.s /usr/include/tahoemath/fp.h ../DEFS.h +cvtlf.o: cvtlf.s /usr/include/tahoemath/fp.h ../DEFS.h +cvtud.o: cvtud.s /usr/include/tahoemath/fp.h ../DEFS.h +cvtuf.o: cvtuf.s /usr/include/tahoemath/fp.h ../DEFS.h +divd.o: divd.s /usr/include/tahoemath/fp.h ../DEFS.h +divf.o: divf.s /usr/include/tahoemath/fp.h ../DEFS.h +fnorm.o: fnorm.s /usr/include/tahoemath/fp.h ../DEFS.h +fp_exp.o: fp_exp.s /usr/include/tahoemath/fp.h ../DEFS.h +modf.o: modf.s /usr/include/tahoemath/fp.h ../DEFS.h +muld.o: muld.s /usr/include/tahoemath/fp.h ../DEFS.h +mulf.o: mulf.s /usr/include/tahoemath/fp.h ../DEFS.h +negd.o: negd.s /usr/include/tahoemath/fp.h ../DEFS.h +negf.o: negf.s /usr/include/tahoemath/fp.h ../DEFS.h +sfnorm.o: sfnorm.s /usr/include/tahoemath/fp.h ../DEFS.h +sfp_exp.o: sfp_exp.s /usr/include/tahoemath/fp.h ../DEFS.h +subd.o: subd.s /usr/include/tahoemath/fp.h ../DEFS.h +subf.o: subf.s /usr/include/tahoemath/fp.h ../DEFS.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/tahoe/fpe/addd.s b/lib/libc4.3tahoe/tahoe/fpe/addd.s new file mode 100644 index 0000000..5071519 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/addd.s @@ -0,0 +1,162 @@ +#ifdef LIBC_SCCS + .asciz "@(#)addd.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(addd, R2|R3|R4|R5|R6|R7|R8|R9|R10) +/* + * see which operand has a greater exponent + * The greater one will be fetched into r0,r1,r2,r3. + * r0,r1 - 'pure' fraction, r2 - exponent, r3 - sign). + * The smaller operand will be fetched into r4,r5,r6,r7. + */ + andl3 $EXPMASK,4(fp),r0 + andl3 $EXPMASK,12(fp),r1 + cmpl r0,r1 + jgtr first_greater + + movl 12(fp),r0 # bigger operand to r0,r1 + movl 16(fp),r1 + + movl 4(fp),r4 # smaller operand to r4,r5 + movl 8(fp),r5 + jmp expo + +first_greater: + movl 4(fp),r0 # bigger operand to r0,r1 + movl 8(fp),r1 + + movl 12(fp),r4 # smaller operand to r4,r5 + movl 16(fp),r5 + +/* + * compute exponents: + */ +expo: + andl3 $EXPMASK,r0,r2 # r2 will hold the exponent. + jeql is_res1 # check for reserved operand. + shrl $EXPSHIFT,r2,r2 + + + andl3 $EXPMASK,r4,r6 # r6 will hold the exponent. + jeql is_res2 # check for reserved operand. + shrl $EXPSHIFT,r6,r6 +/* + * compare the exponents: + */ + subl3 r6,r2,r8 + jeql signs + cmpl r8,$MAX_EXP_DIF + jlss signs + ret # return the bigger number. + +/* + * remember the signs: + */ +signs: + clrl r3 + bbc $31,r0,sign2 # if negative remember it. + incl r3 +sign2: + clrl r7 + bbc $31,r4,frac # if negative remember it. + incl r7 +/* + * compute 'pure' fraction: + */ +frac: + # clear the non fraction parts. + andl2 $(0!(EXPMASK | SIGNBIT)),r0 + # add the hidden bit. + orl2 $(0!CLEARHID),r0 + # clear the non fraction parts. + andl2 $(0!(EXPMASK | SIGNBIT)),r4 + # add the hidden bit. + orl2 $(0!CLEARHID),r4 + +/* + * shift the smaller operand: + */ + shrq r8,r4,r4 +eql_exps: + cmpl r3,r7 + jeql add + bbc $0,r3,negr4r5 +/* + * negate the pair r0,r1: + */ + clrl r3 + mcoml r1,r1 + clrl r9 # r9 - carry flag. + incl r1 + bcc comr0 + incl r9 # remember the carry. +comr0: mcoml r0,r0 + bbc $0,r9,add + incl r0 + +/* + * add the fractions: + */ +add: + clrl r10 # to remember the sign of the result. + addl2 r5,r1 + adwc r4,r0 + jgeq norm # if positive go to normelize. + incl r10 # else remember it and negate the result. +/* + * negate the pair r0,r1: + */ + clrl r3 + mcoml r1,r1 + clrl r9 # r9 - carry flag. + incl r1 + bcc comr00 + incl r9 # remember the carry. +comr00: mcoml r0,r0 + bbc $0,r9,norm + incl r0 +norm: callf $4,fnorm + +/* + * add the sign bit + */ + bbs $0,r10,negative + bbs $0,r3,negative + ret +negative: + orl2 $SIGNBIT,r0 + ret + + +/* + * negate the pair r4,r5: + */ +negr4r5: + clrl r7 + mcoml r5,r5 + clrl r9 # r9 - carry flag. + incl r5 + bcc comr4 + incl r9 # remember the carry. +comr4: mcoml r4,r4 + bbc $0,r9,add + incl r4 + jmp add + + +is_res1: + bbs $31,r0,res_op + movl r4,r0 # return the smaller operand. + movl r5,r1 + ret + +is_res2: + bbs $31,r4,res_op + ret # we allready have the 'result' in r0,r1. + +res_op: + callf $4,fpresop + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/addf.s b/lib/libc4.3tahoe/tahoe/fpe/addf.s new file mode 100644 index 0000000..97623b7 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/addf.s @@ -0,0 +1,135 @@ +#ifdef LIBC_SCCS + .asciz "@(#)addf.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(addf, R2|R3|R4|R5|R6|R7|R8|R9|R10) +/* + * see which operand has a greater exponent + * The greater one will be fetched into r0,r2,r3. + * r0- 'pure' fraction, r2 - exponent, r3 - sign). + * The smaller operand will be fetched into r4,r6,r7. + */ + clrl r1 + andl3 $EXPMASK,4(fp),r0 + andl3 $EXPMASK,12(fp),r1 + cmpl r0,r1 + jgtr first_greater + + movl 12(fp),r0 # bigger operand to r0 + + movl 4(fp),r4 # smaller operand to r4 + jmp expo + +first_greater: + movl 4(fp),r0 # bigger operand to r0 + + movl 12(fp),r4 # smaller operand to r4 + + +/* + *compute exponents: + */ +expo: + andl3 $EXPMASK,r0,r2 # r2 will hold the exponent of greater operand. + jeql is_res1 # check for reserved operand. + shrl $EXPSHIFT,r2,r2 + + + andl3 $EXPMASK,r4,r6 # r6 will hold the exponent of smaller operand. + jeql is_res2 # check for reserved operand. + shrl $EXPSHIFT,r6,r6 +/* + *compare the exponents: + */ + subl3 r6,r2,r8 + jeql signs + cmpl r8,$MAX_EXP_DIF + jlss signs + ret # return the bigger number. + +/* + *remember the signs: + */ +signs: + clrl r3 + bbc $31,r0,sign2 # if negative remember it.(R3=1) + incl r3 +sign2: + clrl r7 + bbc $31,r4,frac # if negative remember it.(R7=1) + incl r7 +/* + *compute 'pure' fraction: + */ +frac: + # clear the non fraction parts. + andl2 $(0!(EXPMASK | SIGNBIT)),r0 + # add the hidden bit. + orl2 $(0!CLEARHID),r0 + # clear the non fraction parts. + andl2 $(0!(EXPMASK | SIGNBIT)),r4 + # add the hidden bit. + orl2 $(0!CLEARHID),r4 + +/* + *shift the smaller operand: + */ + shar r8,r4,r4 +eql_exps: + cmpl r3,r7 + jeql add + bbc $0,r3,negr4 +/* + *negate r0: + */ + clrl r3 + mnegl r0,r0 + +/* + *add the fractions: + */ +add: + clrl r10 + addl2 r4,r0 + jgeq norm + incl r10 +/* + *negate the pair r0,r1: + */ + mnegl r0,r0 +norm: callf $4,sfnorm + +/* + *add the sign bit + */ + bbs $0,r10,negative + bbs $0,r3,negative # the bigger operand was negative. + ret +negative: + orl2 $SIGNBIT,r0 + ret + + +/* + *negate r4: + */ +negr4: + mnegl r4,r4 + jmp add + + +is_res1: + bbs $31,r0,res_op + movl r4,r0 # return the smaller operand. + ret + +is_res2: + bbs $31,r4,res_op + ret # we allready have the 'result' in r0,r1. + +res_op: + callf $4,sfpresop + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/cmpd.s b/lib/libc4.3tahoe/tahoe/fpe/cmpd.s new file mode 100644 index 0000000..c13f220 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/cmpd.s @@ -0,0 +1,47 @@ +#ifdef LIBC_SCCS + .asciz "@(#)cmpd.s 1.2 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include "DEFS.h" + +XENTRY(cmpd, R12|R11|R10|R9) + movl 4(fp),r12 + movl 8(fp),r10 + movl 12(fp),r11 + movl 16(fp),r9 + tstl r12 + jgeq L16 + xorl2 $-2147483648,r12 + tstl r10 + jeql L17 + mnegl r10,r10 + mcoml r12,r12 + jbr L16 +L17: mnegl r12,r12 +L16: tstl r11 + jgeq L19 + xorl2 $-2147483648,r11 + tstl r9 + jeql L20 + mnegl r9,r9 + mcoml r11,r11 + jbr L19 +L20: mnegl r11,r11 +L19: cmpl r12,r11 + jeql L22 + cmpl r12,r11 + jleq L9999 + movl $1,r0 + jbr L9998 +L9999: mnegl $1,r0 +L9998: ret +L22: cmpl r10,r9 + jeql L23 + cmpl r10,r9 + jlequ L9997 + movl $1,r0 + jbr L9996 +L9997: mnegl $1,r0 +L9996: ret +L23: clrl r0 + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/cmpf.s b/lib/libc4.3tahoe/tahoe/fpe/cmpf.s new file mode 100644 index 0000000..ee3ee71 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/cmpf.s @@ -0,0 +1,34 @@ +#ifdef LIBC_SCCS + .asciz "@(#)cmpf.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +/* + * cmpf(f1, f2) + * float f1, f2; + * return -1, 0, 1 as f1 <, ==, > f2 + */ +#include "DEFS.h" + +XENTRY(cmpf, 0) + cmpl 4(fp),12(fp) + jneq 1f + clrl r0 + ret +1: + movl 4(fp),r0 + jgeq 1f + xorl2 $0x80000000,r0 + mnegl r0,r0 +1: + movl 12(fp),r1 + jgeq 1f + xorl2 $0x80000000,r1 + mnegl r1,r1 +1: + cmpl r0,r1 + jleq 1f + movl $1,r0 + ret +1: + mnegl $1,r0 + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/cvtdl.s b/lib/libc4.3tahoe/tahoe/fpe/cvtdl.s new file mode 100644 index 0000000..5c55e76 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/cvtdl.s @@ -0,0 +1,64 @@ +#ifdef LIBC_SCCS + .asciz "@(#)cvtdl.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(cvtdu, R2|R3|R4|R5) + jbr 1f + +XENTRY(cvtdl, R2|R3|R4|R5) + # + #Some initializations: + # +1: + movl 4(fp),r0 # fetch operand. + movl 8(fp),r1 + clrl r3 # r3 - negative flag. + # + #get exponent + # + andl3 $EXPMASK,r0,r2 # r2 will hold the exponent. + jeql is_reserved # check for reserved operand. + cmpl $ONE_EXP,r2 # if exponent is less then 1,return zero. + jgtr retzero + andl2 $0!EXPSIGN,r2 # turn off biased exponent sign + shrl $EXPSHIFT,r2,r2 + # + #get fraction + # + bbc $31,r0,positive # if negative remember it. + incl r3 +positive: + # clear the non fraction parts. + andl2 $(0!(EXPMASK | SIGNBIT)),r0 + # add the hidden bit. + orl2 $(0!CLEARHID),r0 + subl2 $24,r2 # compute the shift. + jgtr shift_left + mnegl r2,r2 + shrl r2,r0,r0 # shift right. + jmp shifted +shift_left: + cmpl r2,$7 + jgtr overflow +go_on: shlq r2,r0,r0 # shift right. +shifted: + bbc $0,r3,done # check for negative + mnegl r0,r0 +done: + ret + +retzero: + clrl r0 + ret +overflow: + callf $4,fpover + jmp go_on + +is_reserved: + bbc $31,r0,retzero + + callf $4,fpresop + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/cvtfl.s b/lib/libc4.3tahoe/tahoe/fpe/cvtfl.s new file mode 100644 index 0000000..d5f32a4 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/cvtfl.s @@ -0,0 +1,63 @@ +#ifdef LIBC_SCCS + .asciz "@(#)cvtfl.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(cvtfu, R2|R3|R4|R5) + jbr 1f + +XENTRY(cvtfl, R2|R3|R4|R5) + # + #Some initializations: + # +1: + movl 4(fp),r0 # fetch operand. + clrl r3 # r3 - negative flag. + # + #get exponent + # + andl3 $EXPMASK,r0,r2 # r2 will hold the exponent. + jeql is_reserved # check for reserved operand. + cmpl $ONE_EXP,r2 # if exponent is less then 1,return zero. + jgtr retzero + andl2 $0!EXPSIGN,r2 # turn off biased exponent sign + shrl $EXPSHIFT,r2,r2 + # + #get fraction + # + bbc $31,r0,positive # if negative remember it. + incl r3 +positive: + # clear the non fraction parts. + andl2 $(0!(EXPMASK | SIGNBIT)),r0 + # add the hidden bit. + orl2 $(0!CLEARHID),r0 + subl2 $24,r2 # compute the shift. + jgtr shift_left + mnegl r2,r2 + shrl r2,r0,r0 # shift right. + jmp shifted +shift_left: + cmpl r2,$7 + jgtr overflow +go_on: shll r2,r0,r0 # shift right. +shifted: + bbc $0,r3,done # check for negative + mnegl r0,r0 +done: + ret + +retzero: + clrl r0 + ret +overflow: + callf $4,sfpover + jmp go_on + +is_reserved: + bbc $31,r0,retzero + + callf $4,sfpresop + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/cvtld.s b/lib/libc4.3tahoe/tahoe/fpe/cvtld.s new file mode 100644 index 0000000..4686cef --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/cvtld.s @@ -0,0 +1,67 @@ +#ifdef LIBC_SCCS + .asciz "@(#)cvtld.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(cvtld, R2|R3|R4|R5) + # + #Some initializations: + # + clrl r4 # r4 - negative flag. + clrl r2 # r2 - exponent. + movl 4(fp),r0 # fetch operand. + movl r0,r5 # need another copy. + jeql retzero # return zero. + jgtr positive + mnegl r0,r0 + jvs retmin # return minimum integer. + incl r4 # remember it was negative. + movl r0,r5 # remember the negated value. + # + #Compute exponent: + # +positive: + ffs r0,r1 + incl r1 + addl2 r1,r2 + shrl r1,r0,r0 + jneq positive # look for more set bits. + # + #we have the exponent in r2. + # + movl r5,r0 # r0,r1 will hold the resulting f.p. number. + clrl r1 + # + #Shift the fraction part to its proper place: + # + subl3 r2,$HID_POS,r3 + jlss shiftr # if less then zero we have to shift right. + shll r3,r0,r0 # else we shift left. + jmp shifted +shiftr: + mnegl r3,r3 + shrq r3,r0,r0 +shifted: + andl2 $CLEARHID,r0 # clear the hidden bit. + shal $EXPSHIFT,r2,r2 # shift the exponent to its proper place. + orl2 $EXPSIGN,r2 # set the exponent sign bit(to bias it). + orl2 r2,r0 # combine exponent & fraction. + bbc $0,r4,sign_ok # do we have to set the sign bit? + orl2 $SIGNBIT,r0 # yes... +sign_ok: + ret + +retzero: + clrl r0 + clrl r1 + ret + +retmin: + movl $0xd0000000,r0 + clrl r1 + ret + + + diff --git a/lib/libc4.3tahoe/tahoe/fpe/cvtlf.s b/lib/libc4.3tahoe/tahoe/fpe/cvtlf.s new file mode 100644 index 0000000..11511ce --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/cvtlf.s @@ -0,0 +1,65 @@ +#ifdef LIBC_SCCS + .asciz "@(#)cvtlf.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(cvtlf, R2|R3|R4|R5) + # + #Some initializations: + # + clrl r1 + clrl r4 # r4 - negative flag. + clrl r2 # r2 - exponent. + movl 4(fp),r0 # fetch operand. + movl r0,r5 # need another copy. + jeql retzero # return zero. + jgtr positive + mnegl r0,r0 + jvs retmin # return minimum integer. + incl r4 # remember it was negative. + movl r0,r5 # remember the negated value. + # + #Compute exponent: + # +positive: + ffs r0,r1 + incl r1 + addl2 r1,r2 + shrl r1,r0,r0 + jneq positive # look for more set bits. + # + #we have the exponent in r2. + # + movl r5,r0 # r0 will hold the resulting f.p. number. + # + #Shift the fraction part to its proper place: + # + subl3 r2,$HID_POS,r3 + jlss shiftr # if less then zero we have to shift right. + shll r3,r0,r0 # else we shift left. + jmp shifted +shiftr: + mnegl r3,r3 + shrl r3,r0,r0 +shifted: + andl2 $CLEARHID,r0 # clear the hidden bit. + shal $EXPSHIFT,r2,r2 # shift the exponent to its proper place. + orl2 $EXPSIGN,r2 # set the exponent sign bit(to bias it). + orl2 r2,r0 # combine exponent & fraction. + bbc $0,r4,sign_ok # do we have to set the sign bit? + orl2 $SIGNBIT,r0 # yes... +sign_ok: + ret + +retzero: + clrl r0 + ret + +retmin: + movl $0xd0000000,r0 + ret + + + diff --git a/lib/libc4.3tahoe/tahoe/fpe/cvtud.s b/lib/libc4.3tahoe/tahoe/fpe/cvtud.s new file mode 100644 index 0000000..8109eb5 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/cvtud.s @@ -0,0 +1,52 @@ +#ifdef LIBC_SCCS + .asciz "@(#)cvtud.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(cvtud, R2|R3|R4|R5) + # + # Some initializations: + # + clrl r2 # r2 - exponent. + movl 4(fp),r0 # fetch operand. + jeql retzero # return zero. + # + # Compute exponent: + # +positive: + ffs r0,r1 + incl r1 + addl2 r1,r2 + shrl r1,r0,r0 + jneq positive # look for more set bits. + # + # we have the exponent in r2. + # + movl 4(fp),r0 # r0,r1 will hold the resulting f.p. number. + clrl r1 + # + # Shift the fraction part to its proper place: + # + subl3 r2,$HID_POS,r3 + jlss shiftr # if less then zero we have to shift right. + shll r3,r0,r0 # else we shift left. + jmp shifted +shiftr: + mnegl r3,r3 + shrq r3,r0,r0 +shifted: + andl2 $CLEARHID,r0 # clear the hidden bit. + shal $EXPSHIFT,r2,r2 # shift the exponent to its proper place. + orl2 $EXPSIGN,r2 # set the exponent sign bit(to bias it). + orl2 r2,r0 # combine exponent & fraction. +sign_ok: + ret + +retzero: + clrl r0 + clrl r1 + ret + + diff --git a/lib/libc4.3tahoe/tahoe/fpe/cvtuf.s b/lib/libc4.3tahoe/tahoe/fpe/cvtuf.s new file mode 100644 index 0000000..4103ad9 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/cvtuf.s @@ -0,0 +1,51 @@ +#ifdef LIBC_SCCS + .asciz "@(#)cvtuf.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(cvtuf, R2|R3|R4|R5) + # + # Some initializations: + # + clrl r1 + clrl r2 # r2 - exponent. + movl 4(fp),r0 # fetch operand. + jeql retzero # return zero. + # + # Compute exponent: + # +positive: + ffs r0,r1 + incl r1 + addl2 r1,r2 + shrl r1,r0,r0 + jneq positive # look for more set bits. + # + # we have the exponent in r2. + # + movl 4(fp),r0 # r0 will hold the resulting f.p. number. + # + # Shift the fraction part to its proper place: + # + subl3 r2,$HID_POS,r3 + jlss shiftr # if less then zero we have to shift right. + shll r3,r0,r0 # else we shift left. + jmp shifted +shiftr: + mnegl r3,r3 + shrl r3,r0,r0 +shifted: + andl2 $CLEARHID,r0 # clear the hidden bit. + shal $EXPSHIFT,r2,r2 # shift the exponent to its proper place. + orl2 $EXPSIGN,r2 # set the exponent sign bit(to bias it). + orl2 r2,r0 # combine exponent & fraction. +sign_ok: + ret + +retzero: + clrl r0 + ret + + diff --git a/lib/libc4.3tahoe/tahoe/fpe/divd.s b/lib/libc4.3tahoe/tahoe/fpe/divd.s new file mode 100644 index 0000000..2a2fc1d --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/divd.s @@ -0,0 +1,95 @@ +#ifdef LIBC_SCCS + .asciz "@(#)divd.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +#define HIDDEN 23 /* here we count from 0 not from 1 as in fp.h */ + +XENTRY(divd, R2|R3|R4|R5|R6|R7|R8|R9) + clrl r3 # r3 - sign: 0 for positive,1 for negative. + movl 4(fp),r0 + jgeq 1f + movl $1,r3 +1: movl 12(fp),r2 + jgeq 2f + bbc $0,r3,1f # seconed operand is negative. + clrl r3 # if first was negative, make result positive. + jmp 2f +1: movl $1,r3 # if first was positive, make result negative. +2: andl2 $EXPMASK,r0 # compute first 'pure'exponent. + jeql is_res1 + shrl $EXPSHIFT,r0,r0 + subl2 $BIAS,r0 + andl2 $EXPMASK,r2 # compute seconed 'pure'exponent. + jeql is_res2 + shrl $EXPSHIFT,r2,r2 + subl2 $BIAS,r2 + subl3 r2,r0,r2 # subtruct the exponents. + addl2 $BIAS,r2 + jleq underf + # normalization can make the exp. smaller. + # + # We have the sign in r3,the exponent in r2,now is the time to + # perform the division... + # + # fetch dividend. (r4,r5) + andl3 $(0!(EXPMASK | SIGNBIT)),4(fp),r4 + orl2 $(0!CLEARHID),r4 + movl 8(fp),r5 + + # fetch divisor : (r6,r7) + andl3 $(0!(EXPMASK | SIGNBIT)),12(fp),r6 + orl2 $(0!CLEARHID),r6 + movl 16(fp),r7 + + movl $0,r0 # init r0,r1 to be zeros + movl $0,r1 + movl $(0!CLEARHID),r8# r8 first bit to set (if). + shll $1,r8,r8 # to have one more bit,because we might + # have to shift left to normelize. + movl $0,r9 + +2: + subl2 r7,r5 + sbwc r6,r4 + jgeq 1f + addl2 r7,r5 + adwc r6,r4 + shlq $1,r4,r4 + shrq $1,r8,r8 + jeql over + jmp 2b +1: + orl2 r8,r0 + orl2 r9,r1 + shlq $1,r4,r4 + shrq $1,r8,r8 + jneq 2b + +over: + callf $4,fnorm +sign: +1: bbc $0,r3,done + orl2 $SIGNBIT,r0 +done: ret + +is_res1: + bbc $31,4(fp),retz + callf $4,fpresop + ret +is_res2: + bbc $31,12(fp),z_div + callf $4,fpresop + ret +retz: + clrl r0 + clrl r1 + ret +underf: + callf $4,fpunder + ret +z_div: + callf $4,fpzdiv + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/divf.s b/lib/libc4.3tahoe/tahoe/fpe/divf.s new file mode 100644 index 0000000..93be317 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/divf.s @@ -0,0 +1,78 @@ +#ifdef LIBC_SCCS + .asciz "@(#)divf.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +#define HIDDEN 23 /* here we count from 0 not from 1 as in fp.h */ + +XENTRY(divf, R2|R3|R4|R5|R6|R7|R8|R9) + clrl r1 + clrl r3 # r3 - sign: 0 for positive,1 for negative. + movl 4(fp),r0 + jgeq 1f + movl $1,r3 +1: movl 12(fp),r2 + jgeq 2f + bbc $0,r3,1f # seconed operand is negative. + clrl r3 # if first was negative, make result positive. + jmp 2f +1: movl $1,r3 # if first was positive, make result negative. +2: andl2 $EXPMASK,r0 # compute first 'pure'exponent. + jeql is_res1 + shrl $EXPSHIFT,r0,r0 + subl2 $BIAS,r0 + andl2 $EXPMASK,r2 # compute seconed 'pure'exponent. + jeql is_res2 + shrl $EXPSHIFT,r2,r2 + subl2 $BIAS,r2 + subl3 r2,r0,r2 # subtruct the exponents. + addl2 $BIAS,r2 + jleq underf + # normalization can make the exp. smaller. + # + # We have the sign in r3,the exponent in r2,now is the time to + # perform the division... + # + # fetch dividend. (r0) + andl3 $(0!(EXPMASK | SIGNBIT)),4(fp),r0 + orl2 $(0!CLEARHID),r0 + clrl r1 + + # fetch divisor : (r6) + andl3 $(0!(EXPMASK | SIGNBIT)),12(fp),r6 + orl2 $(0!CLEARHID),r6 + + shll $2,r6,r6 # make the divisor bigger so we will not + # get overflow at the divission. + ediv r6,r0,r0,r7 # quo to r0, rem to r7 + subl2 $6,r2 # to compensate for: normalization (-24), + # ediv (+32), shifting r6 (-2). + +over: + callf $4,fnorm # we can use fnorm because we have data + # at r1 as well.(sfnorm takes care only + # of r0). +sign: +1: bbc $0,r3,done + orl2 $SIGNBIT,r0 +done: ret + +is_res1: + bbc $31,4(fp),retz + callf $4,sfpresop + ret +is_res2: + bbc $31,12(fp),z_div + callf $4,sfpresop + ret +retz: + clrl r0 + ret +underf: + callf $4,sfpunder + ret +z_div: + callf $4,sfpzdiv + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/fnorm.s b/lib/libc4.3tahoe/tahoe/fpe/fnorm.s new file mode 100644 index 0000000..cc1faea --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/fnorm.s @@ -0,0 +1,58 @@ +#ifdef LIBC_SCCS + .asciz "@(#)fnorm.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +ENTRY(fnorm, R2|R3|R4|R5|R6) + movl r0,r4 # copy to temporary. + jneq inr0 + movl r1,r5 + clrl r3 # r3 - pos of m.s.b +inr1: ffs r5,r6 + incl r6 + addl2 r6,r3 + shrl r6,r5,r5 + jneq inr1 + cmpl $0,r3 + jeql retzero + jmp cmpshift +inr0: movl $32,r3 +inr00: ffs r4,r6 + incl r6 + addl2 r6,r3 + shrl r6,r4,r4 + jneq inr00 + +cmpshift: + # compute the shift (r4). + subl3 r3,$HID_R0R1,r4 + jlss shiftr # if less then zero we shift right. + shlq r4,r0,r0 # else we shift left. + subl2 r4,r2 # uodate exponent. + jleq underflow # if less then 0 (biased) it is underflow. + jmp combine # go to combine exponent and fraction. +shiftr: + mnegl r4,r4 + shrq r4,r0,r0 # shift right. + addl2 r4,r2 # update exponent + cmpl r2,$256 + jgeq overflow # check for overflow. +combine: + andl2 $CLEARHID,r0 # clear the hidden bit. + shal $EXPSHIFT,r2,r2 # shift the exponent to its proper place. + orl2 r2,r0 + ret + +underflow: + callf $4,fpunder + ret + +overflow: + callf $4,fpover + ret +retzero: + clrl r0 + clrl r1 + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/fp_exp.s b/lib/libc4.3tahoe/tahoe/fpe/fp_exp.s new file mode 100644 index 0000000..f00d55a --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/fp_exp.s @@ -0,0 +1,37 @@ +#ifdef LIBC_SCCS + .asciz "@(#)fp_exp.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +/* + * Reserved floating point operand. + */ +ASENTRY(fpresop, 0) + movl $0xaaaaaaaa,r0 + movl $0xaaaaaaaa,r1 + ret + +/* + * Floating point overflow. + */ +ASENTRY(fpover, 0) + movl $HUGE0,r0 + movl $HUGE1,r1 + ret + +/* + * Floating point underflow. + */ +ASENTRY(fpunder, 0) + clrl r0 + clrl r1 + ret + +/* + * Floating point division by zero. + */ +ASENTRY(fpzdiv, 0) + divl2 $0,r1 # force division by zero. + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/modf.s b/lib/libc4.3tahoe/tahoe/fpe/modf.s new file mode 100644 index 0000000..527e55c --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/modf.s @@ -0,0 +1,136 @@ +#ifdef LIBC_SCCS + .asciz "@(#)modf.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +/* + * double modf (value, iptr) + * double value, *iptr; + * + * Modf returns the fractional part of "value", + * and stores the integer part indirectly through "iptr". + */ +#include +#include "DEFS.h" + +ENTRY(modf, R2|R3|R4|R5) + /* + * Some initializations: + */ + ldd 4(fp) /* load accumulator, for converison */ + cvdl r2 /* to an integer. */ + bvs gsb /* iff too big grunt it out */ + cvld r2 /* float the integer part */ + std r2 + ldd 4(fp) /* isolate the fraction */ + subd r2 + std r0 + movl 12(fp),r6 /* get int return address */ + movl r2,(r6) + movl r3,4(r6) + ret +gsb: clrl r3 + movl 4(fp),r0 /* fetch operand to r0,r1. */ + movl 8(fp),r1 + movl 12(fp),r6 /* fetch addr of int to r6. */ + /* + * get exponent + */ + andl3 $EXPMASK,r0,r2 /* r2 will hold the exponent. */ + jeql is_reserved /* check for reserved operand. */ + shrl $EXPSHIFT,r2,r2 + subl2 $BIAS,r2 /* unbias it. */ + jleq allfrac /* it's int part is zero. */ + cmpl r2,$56 + jgeq allint /* it's fraction part is zero. */ + /* + * get fraction + */ + movl r0,r4 /* remember the original number. */ + movl r1,r5 + bbc $31,r0,positive /* if negative remember it. */ + incl r3 +positive: + /* clear the non fraction parts. */ + andl2 $(0!(EXPMASK | SIGNBIT)),r0 + /* add the hidden bit. */ + orl2 $(0!CLEARHID),r0 + + cmpl r2,$HID_POS /* see if there are bits to clear only in r0 */ + /* or r1 has to be taken care of. */ + /* ( for fraction calculation) */ + + jgtr in_r1 /* some bytes in r1. */ + + jeql onlyallr0 /* all r0 must be cleared,r1 unchanged. */ + + /* only r0 must be canged. */ + mnegl r2,r7 /* r7 - loop counter. */ + movl $CLEARHID,r8 /* first bit to clear. */ +1: + andl2 r8,r0 /* clear int. bits from fraction part. */ + shar $1,r8,r8 + aoblss $0,r7,1b +1: + andl2 r8,r4 /* clear frac bits for int calculation: */ + shar $1,r8,r8 + cmpl $0xffffffff,r8 + jneq 1b + clrl r5 + jmp norm + +onlyallr0: + clrl r0 + clrl r5 + jmp norm + +in_r1: + clrl r0 /* clear int part for frac. calculation. */ + subl3 r2,$HID_POS,r7 + movl $0x7fffffff,r8 +1: + andl2 r8,r1 + shar $1,r8,r8 + orl2 $0x80000000,r8 /* force the 'sign' bit to be on. */ + aoblss $0,r7,1b +1: + andl2 r8,r5 + shar $1,r8,r8 + cmpl $0xffffffff,r8 + jneq 1b + +norm: + addl2 $BIAS,r2 /* fnorm expects it biased. */ + callf $4,fnorm /* normelize fraction part. */ + cmpl $0,r0 + jeql 1f + bbc $0,r3,1f + orl2 $0x80000000,r0 +1: + movl r4,(r6) /* put int part in place. */ + movl r5,4(r6) + ret + +allint: + movl r0,(r6) /* copy the argument to the int addr. */ + movl r1,4(r6) + clrl r0 /* clear the fraction part. */ + clrl r1 + ret + +allfrac: + /* the fraction is ready in r0,r1. */ + clrl (r6) /* zero the int part. */ + clrl 4(r6) + ret + +ret_zero: + clrl (r6) + clrl 4(r6) + clrl r0 + clrl r1 + ret + +is_reserved: + bbc $31,r0,ret_zero + callf $4,fpresop + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/muld.s b/lib/libc4.3tahoe/tahoe/fpe/muld.s new file mode 100644 index 0000000..b149e38 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/muld.s @@ -0,0 +1,116 @@ +#ifdef LIBC_SCCS + .asciz "@(#)muld.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +#define HIDDEN 23 /* here we count from 0 not from 1 as in fp.h */ + +XENTRY(muld, R2|R3|R4|R5|R6|R7|R8|R9) + clrl r3 /* r3 - sign: 0 for positive,1 for negative. */ + movl 4(fp),r0 + jgeq 1f + movl $1,r3 +1: movl 12(fp),r2 + jgeq 2f + bbc $0,r3,1f /* seconed operand is negative. */ + clrl r3 /* if first was negative, make result positive. */ + jmp 2f +1: movl $1,r3 /* if first was positive, make result negative. */ +2: andl2 $EXPMASK,r0 /* compute first 'pure'exponent. */ + jeql is_res1 + shrl $EXPSHIFT,r0,r0 + subl2 $BIASP1,r0 + andl2 $EXPMASK,r2 /* compute seconed 'pure'exponent. */ + jeql is_res2 + shrl $EXPSHIFT,r2,r2 + subl2 $BIASP1,r2 + addl2 r0,r2 /* add the exponents. */ + addl2 $(BIASP1+2),r2 + jleq underflow + cmpl r2,$258 /* normalization can make the exp. smaller. */ + jgeq overflow + /* + * We have the sign in r3,the exponent in r2,now is the time to + * perform the multiplication... + */ + /* fetch first fraction: (r0,r1) */ + andl3 $(0!(EXPMASK | SIGNBIT)),4(fp),r0 + orl2 $(0!CLEARHID),r0 + movl 8(fp),r1 + shlq $7,r0,r0 /* leave the sign bit cleared. */ + + /* fetch seconed fraction: (r4,r5) */ + andl3 $(0!(EXPMASK | SIGNBIT)),12(fp),r4 + orl2 $(0!CLEARHID),r4 + movl 16(fp),r5 + shlq $7,r4,r4 /* leave the sign bit cleared. */ + + /* in the following lp1 stands for least significant part of operand 1, + * lp2 for least significant part of operand 2, + * mp1 for most significant part of operand 1, + * mp2 for most significant part of operand 2. + */ + + clrl r6 + shrl $1,r1,r1 /* clear the sign bit of the lp1. */ + jeql 1f + emul r1,r4,$0,r6 /* r6,r7 <-- lp1*mp2 */ + shlq $1,r6,r6 /* to compensate for the shift we did to clear the sign bit. */ +1: shrl $1,r5,r5 /* clear the sign bit of the lp2. */ + jeql 1f + emul r0,r5,$0,r8 /* r8,r9 <-- mp1*lp2 */ + shlq $1,r8,r8 + addl2 r9,r7 /* r6,r7 <-- the sum of the products. */ + adwc r8,r6 +1: emul r0,r4,$0,r0 /* r0,r1 <-- mp1*mp2 */ + addl2 r6,r1 /* add the most sig. part of the sum. */ + adwc $0,r0 + movl r0,r4 /* to see how much we realy need to shift. */ + movl $6,r5 /* r5 - shift counter. */ + shrl $7,r4,r4 /* dummy shift. */ +1: bbs $HIDDEN,r4,realshift + shll $1,r4,r4 + decl r2 /* update exponent. */ + jeql underflow + decl r5 /* update shift counter. */ + jmp 1b +realshift: + shrq r5,r0,r0 + bbc $0,r1,shiftmore + incl r1 /* rounding. */ +shiftmore: + shrq $1,r0,r0 +comb: + andl2 $CLEARHID,r0 + shll $EXPSHIFT,r2,r4 + orl2 r4,r0 + cmpl r2,$256 + jlss 1f + callf $4,fpover +sign: +1: bbc $0,r3,done + orl2 $SIGNBIT,r0 +done: ret + + + +is_res1: + bbc $31,4(fp),retzero + callf $4,fpresop + ret +is_res2: + bbc $31,12(fp),retzero + callf $4,fpresop + ret + retzero: + clrl r0 + clrl r1 + ret + overflow: + callf $4,fpover + jmp sign + underflow: + callf $4,fpunder + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/mulf.s b/lib/libc4.3tahoe/tahoe/fpe/mulf.s new file mode 100644 index 0000000..c479c70 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/mulf.s @@ -0,0 +1,98 @@ +#ifdef LIBC_SCCS + .asciz "@(#)mulf.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +#define HIDDEN 23 /* here we count from 0 not from 1 as in fp.h */ + +XENTRY(mulf, R2|R3|R4|R5|R6|R7|R8|R9) + clrl r3 /* r3 - sign: 0 for positive,1 for negative. */ + movl 4(fp),r0 + jgeq 1f + movl $1,r3 +1: movl 12(fp),r2 + jgeq 2f + bbc $0,r3,1f /* seconed operand is negative. */ + clrl r3 /* if first was negative, make result positive. */ + jmp 2f +1: movl $1,r3 /* if first was positive, make result negative. */ +2: andl2 $EXPMASK,r0 /* compute first 'pure'exponent. */ + jeql is_res1 + shrl $EXPSHIFT,r0,r0 + subl2 $BIASP1,r0 + andl2 $EXPMASK,r2 /* compute seconed 'pure'exponent. */ + jeql is_res2 + shrl $EXPSHIFT,r2,r2 + subl2 $BIASP1,r2 + addl2 r0,r2 /* add the exponents. */ + addl2 $(BIASP1+2),r2 + jleq underflow + cmpl r2,$258 /* normalization can make the exp. smaller. */ + jgeq overflow + /* + * We have the sign in r3,the exponent in r2,now is the time to + * perform the multiplication... + */ + /* fetch first fraction: (r0) */ + andl3 $(0!(EXPMASK | SIGNBIT)),4(fp),r0 + orl2 $(0!CLEARHID),r0 + shll $7,r0,r0 /* leave the sign bit cleared. */ + + /* fetch seconed fraction: (r4) */ + andl3 $(0!(EXPMASK | SIGNBIT)),12(fp),r4 + orl2 $(0!CLEARHID),r4 + shll $7,r4,r4 /* leave the sign bit cleared. */ + + + emul r4,r0,$0,r0 + movl r0,r4 /* to see how much we realy need to shift. */ + movl $6,r5 /* r5 - shift counter. */ + shrl $7,r4,r4 /* dummy shift. */ +1: bbs $HIDDEN,r4,realshift + shll $1,r4,r4 + decl r2 /* update exponent. */ + jeql underflow + decl r5 /* update shift counter. */ + jmp 1b +realshift: + shrl r5,r0,r0 + bbc $0,r1,shiftmore + incl r1 /* rounding. */ +shiftmore: + shrl $1,r0,r0 +comb: + andl2 $CLEARHID,r0 + shll $EXPSHIFT,r2,r4 + orl2 r4,r0 + cmpl r2,$256 + jlss 1f + callf $4,sfpover +sign: +1: bbc $0,r3,done + orl2 $SIGNBIT,r0 +done: ret + + + +is_res1: + bbc $31,4(fp),retzero + callf $4,sfpresop + ret +is_res2: + bbc $31,12(fp),retzero + callf $4,sfpresop + ret + retzero: + clrl r0 + ret + overflow: + callf $4,sfpover + jmp sign + underflow: + callf $4,sfpunder + ret + + + diff --git a/lib/libc4.3tahoe/tahoe/fpe/negd.s b/lib/libc4.3tahoe/tahoe/fpe/negd.s new file mode 100644 index 0000000..2b8139e --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/negd.s @@ -0,0 +1,25 @@ +#ifdef LIBC_SCCS + .asciz "@(#)negd.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(negd, 0) + andl3 $EXPMASK,4(fp),r0 /* check for reserved operand,zero. */ + beql isreserved + movl 4(fp),r0 /* fetch operand. */ + movl 8(fp),r1 + bbc $31,r0,seton + andl2 $(0!SIGNBIT),r0 /* turn it off. */ + ret +seton: orl2 $SIGNBIT,r0 /* turn it on. */ + ret +isreserved: + bbc $31,4(fp),retzero + callf $4,fpresop + ret +retzero: + clrl r0 + clrl r1 + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/negf.s b/lib/libc4.3tahoe/tahoe/fpe/negf.s new file mode 100644 index 0000000..120e5b4 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/negf.s @@ -0,0 +1,24 @@ +#ifdef LIBC_SCCS + .asciz "@(#)negf.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(negf, 0) + clrl r1 + andl3 $EXPMASK,4(fp),r0 /* check for reserved operand,zero. */ + beql isreserved + movl 4(fp),r0 /* fetch operand. */ + bbc $31,r0,seton + andl2 $(0!SIGNBIT),r0 /* turn it off. */ + ret +seton: orl2 $SIGNBIT,r0 /* turn it on. */ + ret +isreserved: + bbc $31,4(fp),retzero + callf $4,sfpresop + ret +retzero: + clrl r0 + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/profiled/.MAP b/lib/libc4.3tahoe/tahoe/fpe/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/tahoe/fpe/sfnorm.s b/lib/libc4.3tahoe/tahoe/fpe/sfnorm.s new file mode 100644 index 0000000..023f3f3 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/sfnorm.s @@ -0,0 +1,48 @@ +#ifdef LIBC_SCCS + .asciz "@(#)sfnorm.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(sfnorm, R2|R3|R4|R5|R6) + clrl r1 + movl r0,r4 /* copy to temporary. */ + jeql retzero + clrl r3 /* r3 - pos of m.s.b */ +inr00: ffs r4,r6 + incl r6 + addl2 r6,r3 + shrl r6,r4,r4 + jneq inr00 + +cmpshift: + /* compute the shift (r4). */ + subl3 r3,$HID_POS,r4 + jlss shiftr /* if less then zero we shift right. */ + shll r4,r0,r0 /* else we shift left. */ + subl2 r4,r2 /* uodate exponent. */ + jleq underflow /* if less then 0 (biased) it is underflow. */ + jmp combine /* go to combine exponent and fraction. */ +shiftr: + mnegl r4,r4 + shrl r4,r0,r0 /* shift right. */ + addl2 r4,r2 /* update exponent */ + cmpl r2,$256 + jgeq overflow /* check for overflow. */ +combine: + andl2 $CLEARHID,r0 /* clear the hidden bit. */ + shal $EXPSHIFT,r2,r2 /* shift the exponent to its proper place. */ + orl2 r2,r0 + ret + +underflow: + callf $4,sfpunder + ret + +overflow: + callf $4,sfpover + ret +retzero: + clrl r0 + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/sfp_exp.s b/lib/libc4.3tahoe/tahoe/fpe/sfp_exp.s new file mode 100644 index 0000000..143e3ae --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/sfp_exp.s @@ -0,0 +1,37 @@ +#ifdef LIBC_SCCS + .asciz "@(#)sfp_exp.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +/* + * Reserved floating point operand. + */ +ASENTRY(sfpresop, 0) + movl $0xaaaaaaaa,r0 + clrl r1 + ret + +/* + * Floating point overflow. + */ +ASENTRY(sfpover, 0) + movl $HUGE0,r0 + clrl r1 + ret + +/* + * Floating point underflow. + */ +ASENTRY(sfpunder, 0) + clrl r0 + clrl r1 + ret + +/* + * Floating point division by zero. + */ +ASENTRY(sfpzdiv, 0) + divl2 $0,r0 # force division by zero. + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/subd.s b/lib/libc4.3tahoe/tahoe/fpe/subd.s new file mode 100644 index 0000000..a99f9a0 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/subd.s @@ -0,0 +1,17 @@ +#ifdef LIBC_SCCS + .asciz "@(#)subd.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(subd, 0) + pushl 16(fp) + pushl 12(fp) + callf $12,Xnegd + pushl r1 + pushl r0 + pushl 8(fp) + pushl 4(fp) + callf $20,Xaddd + ret diff --git a/lib/libc4.3tahoe/tahoe/fpe/subf.s b/lib/libc4.3tahoe/tahoe/fpe/subf.s new file mode 100644 index 0000000..5b2b5a5 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/fpe/subf.s @@ -0,0 +1,17 @@ +#ifdef LIBC_SCCS + .asciz "@(#)subf.s 1.1 (Berkeley/CCI) 7/2/86" +#endif LIBC_SCCS + +#include +#include "DEFS.h" + +XENTRY(subf, R2|R3|R4|R5|R6|R7|R8|R9) + clrl r1 + pushl 12(fp) + callf $8,Xnegf + pushl r1 + pushl r0 + pushl 8(fp) + pushl 4(fp) + callf $20,Xaddf + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/.MAP b/lib/libc4.3tahoe/tahoe/sys/.MAP new file mode 100644 index 0000000..6d1e453 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/.MAP @@ -0,0 +1,121 @@ +F ACCEPT.S;1 accept.s +F ACCESS.S;1 access.s +F ACCT.S;1 acct.s +F ADJTIME.S;1 adjtime.s +F BIND.S;1 bind.s +F BRK.S;1 brk.s +F CERROR.S;1 cerror.s +F CHDIR.S;1 chdir.s +F CHMOD.S;1 chmod.s +F CHOWN.S;1 chown.s +F CHROOT.S;1 chroot.s +F CLOSE.S;1 close.s +F CONNECT.S;1 connect.s +F CREAT.S;1 creat.s +F DUP.S;1 dup.s +F DUP2.S;1 dup2.s +F EXECL.S;1 execl.s +F EXECLE.S;1 execle.s +F EXECT.S;1 exect.s +F EXECV.S;1 execv.s +F EXECVE.S;1 execve.s +F FCHMOD.S;1 fchmod.s +F FCHOWN.S;1 fchown.s +F FCNTL.S;1 fcntl.s +F FLOCK.S;1 flock.s +F FORK.S;1 fork.s +F FSTAT.S;1 fstat.s +F FSYNC.S;1 fsync.s +F FTRUNCAT.S;1 ftruncate.s +F GETDTABL.S;1 getdtablesize.s +F GETEGID.S;1 getegid.s +F GETEUID.S;1 geteuid.s +F GETGID.S;1 getgid.s +F GETGROUP.S;1 getgroups.s +F GETHOSTI.S;1 gethostid.s +F GETHOSTN.S;1 gethostname.s +F GETITIME.S;1 getitimer.s +F GETPAGES.S;1 getpagesize.s +F GETPEERN.S;1 getpeername.s +F GETPGRP.S;1 getpgrp.s +F GETPID.S;1 getpid.s +F GETPPID.S;1 getppid.s +F GETPRIOR.S;1 getpriority.s +F GETRLIMI.S;1 getrlimit.s +F GETRUSAG.S;1 getrusage.s +F GETSOCKN.S;1 getsockname.s +F GETSOCKO.S;1 getsockopt.s +F GETTIMEO.S;1 gettimeofday.s +F GETUID.S;1 getuid.s +F IOCTL.S;1 ioctl.s +F KILL.S;1 kill.s +F KILLPG.S;1 killpg.s +F LINK.S;1 link.s +F LISTEN.S;1 listen.s +F LSEEK.S;1 lseek.s +F LSTAT.S;1 lstat.s +F MAKEFILE.;1 Makefile +F MKDIR.S;1 mkdir.s +F MKNOD.S;1 mknod.s +F MMAP.S;1 mmap.s +F MOUNT.S;1 mount.s +F OPEN.S;1 open.s +F OVADVISE.S;1 Ovadvise.s +F OVFORK.S;1 Ovfork.s +F PIPE.S;1 pipe.s +F PROFIL.S;1 profil.s +D PROFILED profiled +F PTRACE.S;1 ptrace.s +F QUOTA.S;1 quota.s +F READ.S;1 read.s +F READLINK.S;1 readlink.s +F READV.S;1 readv.s +F REBOOT.S;1 reboot.s +F RECV.S;1 recv.s +F RECVFROM.S;1 recvfrom.s +F RECVMSG.S;1 recvmsg.s +F RENAME.S;1 rename.s +F RMDIR.S;1 rmdir.s +F SBRK.S;1 sbrk.s +F SELECT.S;1 select.s +F SEND.S;1 send.s +F SENDMSG.S;1 sendmsg.s +F SENDTO.S;1 sendto.s +F SETGROUP.S;1 setgroups.s +F SETHOSTI.S;1 sethostid.s +F SETHOSTN.S;1 sethostname.s +F SETITIME.S;1 setitimer.s +F SETPGRP.S;1 setpgrp.s +F SETPRIOR.S;1 setpriority.s +F SETQUOTA.S;1 setquota.s +F SETREGID.S;1 setregid.s +F SETREUID.S;1 setreuid.s +F SETRLIMI.S;1 setrlimit.s +F SETSOCKO.S;1 setsockopt.s +F SETTIMEO.S;1 settimeofday.s +F SHUTDOWN.S;1 shutdown.s +F SIGBLOCK.S;1 sigblock.s +F SIGPAUSE.S;1 sigpause.s +F SIGRETUR.S;1 sigreturn.s +F SIGSETMA.S;1 sigsetmask.s +F SIGSTACK.S;1 sigstack.s +F SIGVEC.S;1 sigvec.s +F SOCKET.S;1 socket.s +F SOCKETPA.S;1 socketpair.s +F STAT.S;1 stat.s +F SWAPON.S;1 swapon.s +F SYMLINK.S;1 symlink.s +F SYNC.S;1 sync.s +F SYS.H;1 SYS.h +F SYSCALL.S;1 syscall.s +F TRUNCATE.S;1 truncate.s +F UMASK.S;1 umask.s +F UMOUNT.S;1 umount.s +F UNLINK.S;1 unlink.s +F UTIMES.S;1 utimes.s +F VHANGUP.S;1 vhangup.s +F WAIT.S;1 wait.s +F WAIT3.S;1 wait3.s +F WRITE.S;1 write.s +F WRITEV.S;1 writev.s +F _EXIT.S;1 _exit.s diff --git a/lib/libc4.3tahoe/tahoe/sys/Makefile b/lib/libc4.3tahoe/tahoe/sys/Makefile new file mode 100644 index 0000000..3e2bf6a --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/Makefile @@ -0,0 +1,207 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.8 (Berkeley) 6/27/88 +# +DEFS= -DSYSLIBC_SCCS +SRCS= Ovadvise.s Ovfork.s _exit.s accept.s access.s acct.s adjtime.s \ + bind.s brk.s cerror.s chdir.s chmod.s chown.s chroot.s close.s \ + connect.s creat.s dup.s dup2.s execl.s execle.s exect.s execv.s \ + execve.s fchmod.s fchown.s fcntl.s flock.s fork.s fstat.s fsync.s \ + ftruncate.s getdtablesize.s getegid.s geteuid.s getgid.s getgroups.s \ + gethostid.s gethostname.s getitimer.s getpagesize.s getpeername.s \ + getpgrp.s getpid.s getppid.s getpriority.s getrlimit.s getrusage.s \ + getsockname.s getsockopt.s gettimeofday.s getuid.s ioctl.s kill.s \ + killpg.s link.s listen.s lseek.s lstat.s mkdir.s mknod.s mmap.s \ + mount.s open.s pipe.s profil.s ptrace.s quota.s read.s readlink.s \ + readv.s reboot.s recv.s recvfrom.s recvmsg.s rename.s rmdir.s sbrk.s \ + select.s send.s sendmsg.s sendto.s setgroups.s sethostid.s \ + sethostname.s setitimer.s setpgrp.s setpriority.s setquota.s \ + setregid.s setreuid.s setrlimit.s setsockopt.s settimeofday.s \ + shutdown.s sigblock.s sigpause.s sigreturn.s sigsetmask.s sigstack.s \ + sigvec.s socket.s socketpair.s stat.s swapon.s symlink.s sync.s \ + syscall.s truncate.s umask.s umount.s unlink.s utimes.s vhangup.s \ + wait.s wait3.s write.s writev.s +OBJS= Ovadvise.o Ovfork.o _exit.o accept.o access.o acct.o adjtime.o \ + bind.o brk.o cerror.o chdir.o chmod.o chown.o chroot.o close.o \ + connect.o creat.o dup.o dup2.o execl.o execle.o exect.o execv.o \ + execve.o fchmod.o fchown.o fcntl.o flock.o fork.o fstat.o fsync.o \ + ftruncate.o getdtablesize.o getegid.o geteuid.o getgid.o getgroups.o \ + gethostid.o gethostname.o getitimer.o getpagesize.o getpeername.o \ + getpgrp.o getpid.o getppid.o getpriority.o getrlimit.o getrusage.o \ + getsockname.o getsockopt.o gettimeofday.o getuid.o ioctl.o kill.o \ + killpg.o link.o listen.o lseek.o lstat.o mkdir.o mknod.o mmap.o \ + mount.o open.o pipe.o profil.o ptrace.o quota.o read.o readlink.o \ + readv.o reboot.o recv.o recvfrom.o recvmsg.o rename.o rmdir.o sbrk.o \ + select.o send.o sendmsg.o sendto.o setgroups.o sethostid.o \ + sethostname.o setitimer.o setpgrp.o setpriority.o setquota.o \ + setregid.o setreuid.o setrlimit.o setsockopt.o settimeofday.o \ + shutdown.o sigblock.o sigpause.o sigreturn.o sigsetmask.o sigstack.o \ + sigvec.o socket.o socketpair.o stat.o swapon.o symlink.o sync.o \ + syscall.o truncate.o umask.o umount.o unlink.o utimes.o vhangup.o \ + wait.o wait3.o write.o writev.o +TAGSFILE=tags + +.s.o: + @/lib/cpp ${DEFS} -DPROF $*.s | ${AS} -o $*.o + @-ld -x -o profiled/$*.o -r $*.o + /lib/cpp ${DEFS} $*.s | ${AS} -o $*.o + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + (P=`pwd`; \ + egrep "^ENTRY(.*)|^SYSCALL(.*)" ${SRCS} | /bin/sed \ +"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ + >> ${TAGSFILE}) + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +Ovadvise.o: Ovadvise.s SYS.h /usr/include/sys/syscall.h +Ovfork.o: Ovfork.s +_exit.o: _exit.s SYS.h /usr/include/sys/syscall.h +accept.o: accept.s SYS.h /usr/include/sys/syscall.h +access.o: access.s SYS.h /usr/include/sys/syscall.h +acct.o: acct.s SYS.h /usr/include/sys/syscall.h +adjtime.o: adjtime.s SYS.h /usr/include/sys/syscall.h +bind.o: bind.s SYS.h /usr/include/sys/syscall.h +brk.o: brk.s SYS.h /usr/include/sys/syscall.h +cerror.o: cerror.s SYS.h /usr/include/sys/syscall.h +chdir.o: chdir.s SYS.h /usr/include/sys/syscall.h +chmod.o: chmod.s SYS.h /usr/include/sys/syscall.h +chown.o: chown.s SYS.h /usr/include/sys/syscall.h +chroot.o: chroot.s SYS.h /usr/include/sys/syscall.h +close.o: close.s SYS.h /usr/include/sys/syscall.h +connect.o: connect.s SYS.h /usr/include/sys/syscall.h +creat.o: creat.s SYS.h /usr/include/sys/syscall.h +dup.o: dup.s SYS.h /usr/include/sys/syscall.h +dup2.o: dup2.s SYS.h /usr/include/sys/syscall.h +execl.o: execl.s SYS.h /usr/include/sys/syscall.h +execle.o: execle.s SYS.h /usr/include/sys/syscall.h +exect.o: exect.s SYS.h /usr/include/sys/syscall.h /usr/include/machine/psl.h +execv.o: execv.s SYS.h /usr/include/sys/syscall.h +execve.o: execve.s SYS.h /usr/include/sys/syscall.h +fchmod.o: fchmod.s SYS.h /usr/include/sys/syscall.h +fchown.o: fchown.s SYS.h /usr/include/sys/syscall.h +fcntl.o: fcntl.s SYS.h /usr/include/sys/syscall.h +flock.o: flock.s SYS.h /usr/include/sys/syscall.h +fork.o: fork.s SYS.h /usr/include/sys/syscall.h +fstat.o: fstat.s SYS.h /usr/include/sys/syscall.h +fsync.o: fsync.s SYS.h /usr/include/sys/syscall.h +ftruncate.o: ftruncate.s SYS.h /usr/include/sys/syscall.h +getdtablesize.o: getdtablesize.s SYS.h /usr/include/sys/syscall.h +getegid.o: getegid.s SYS.h /usr/include/sys/syscall.h +geteuid.o: geteuid.s SYS.h /usr/include/sys/syscall.h +getgid.o: getgid.s SYS.h /usr/include/sys/syscall.h +getgroups.o: getgroups.s SYS.h /usr/include/sys/syscall.h +gethostid.o: gethostid.s SYS.h /usr/include/sys/syscall.h +gethostname.o: gethostname.s SYS.h /usr/include/sys/syscall.h +getitimer.o: getitimer.s SYS.h /usr/include/sys/syscall.h +getpagesize.o: getpagesize.s SYS.h /usr/include/sys/syscall.h +getpeername.o: getpeername.s SYS.h /usr/include/sys/syscall.h +getpgrp.o: getpgrp.s SYS.h /usr/include/sys/syscall.h +getpid.o: getpid.s SYS.h /usr/include/sys/syscall.h +getppid.o: getppid.s SYS.h /usr/include/sys/syscall.h +getpriority.o: getpriority.s SYS.h /usr/include/sys/syscall.h +getrlimit.o: getrlimit.s SYS.h /usr/include/sys/syscall.h +getrusage.o: getrusage.s SYS.h /usr/include/sys/syscall.h +getsockname.o: getsockname.s SYS.h /usr/include/sys/syscall.h +getsockopt.o: getsockopt.s SYS.h /usr/include/sys/syscall.h +gettimeofday.o: gettimeofday.s SYS.h /usr/include/sys/syscall.h +getuid.o: getuid.s SYS.h /usr/include/sys/syscall.h +ioctl.o: ioctl.s SYS.h /usr/include/sys/syscall.h +kill.o: kill.s SYS.h /usr/include/sys/syscall.h +killpg.o: killpg.s SYS.h /usr/include/sys/syscall.h +link.o: link.s SYS.h /usr/include/sys/syscall.h +listen.o: listen.s SYS.h /usr/include/sys/syscall.h +lseek.o: lseek.s SYS.h /usr/include/sys/syscall.h +lstat.o: lstat.s SYS.h /usr/include/sys/syscall.h +mkdir.o: mkdir.s SYS.h /usr/include/sys/syscall.h +mknod.o: mknod.s SYS.h /usr/include/sys/syscall.h +mmap.o: mmap.s SYS.h /usr/include/sys/syscall.h +mount.o: mount.s SYS.h /usr/include/sys/syscall.h +open.o: open.s SYS.h /usr/include/sys/syscall.h +pipe.o: pipe.s SYS.h /usr/include/sys/syscall.h +profil.o: profil.s SYS.h /usr/include/sys/syscall.h +ptrace.o: ptrace.s SYS.h /usr/include/sys/syscall.h +quota.o: quota.s SYS.h /usr/include/sys/syscall.h +read.o: read.s SYS.h /usr/include/sys/syscall.h +readlink.o: readlink.s SYS.h /usr/include/sys/syscall.h +readv.o: readv.s SYS.h /usr/include/sys/syscall.h +reboot.o: reboot.s SYS.h /usr/include/sys/syscall.h +recv.o: recv.s SYS.h /usr/include/sys/syscall.h +recvfrom.o: recvfrom.s SYS.h /usr/include/sys/syscall.h +recvmsg.o: recvmsg.s SYS.h /usr/include/sys/syscall.h +rename.o: rename.s SYS.h /usr/include/sys/syscall.h +rmdir.o: rmdir.s SYS.h /usr/include/sys/syscall.h +sbrk.o: sbrk.s SYS.h /usr/include/sys/syscall.h +select.o: select.s SYS.h /usr/include/sys/syscall.h +send.o: send.s SYS.h /usr/include/sys/syscall.h +sendmsg.o: sendmsg.s SYS.h /usr/include/sys/syscall.h +sendto.o: sendto.s SYS.h /usr/include/sys/syscall.h +setgroups.o: setgroups.s SYS.h /usr/include/sys/syscall.h +sethostid.o: sethostid.s SYS.h /usr/include/sys/syscall.h +sethostname.o: sethostname.s SYS.h /usr/include/sys/syscall.h +setitimer.o: setitimer.s SYS.h /usr/include/sys/syscall.h +setpgrp.o: setpgrp.s SYS.h /usr/include/sys/syscall.h +setpriority.o: setpriority.s SYS.h /usr/include/sys/syscall.h +setquota.o: setquota.s SYS.h /usr/include/sys/syscall.h +setregid.o: setregid.s SYS.h /usr/include/sys/syscall.h +setreuid.o: setreuid.s SYS.h /usr/include/sys/syscall.h +setrlimit.o: setrlimit.s SYS.h /usr/include/sys/syscall.h +setsockopt.o: setsockopt.s SYS.h /usr/include/sys/syscall.h +settimeofday.o: settimeofday.s SYS.h /usr/include/sys/syscall.h +shutdown.o: shutdown.s SYS.h /usr/include/sys/syscall.h +sigblock.o: sigblock.s SYS.h /usr/include/sys/syscall.h +sigpause.o: sigpause.s SYS.h /usr/include/sys/syscall.h +sigreturn.o: sigreturn.s SYS.h /usr/include/sys/syscall.h +sigsetmask.o: sigsetmask.s SYS.h /usr/include/sys/syscall.h +sigstack.o: sigstack.s SYS.h /usr/include/sys/syscall.h +sigvec.o: sigvec.s SYS.h /usr/include/sys/syscall.h +socket.o: socket.s SYS.h /usr/include/sys/syscall.h +socketpair.o: socketpair.s SYS.h /usr/include/sys/syscall.h +stat.o: stat.s SYS.h /usr/include/sys/syscall.h +swapon.o: swapon.s SYS.h /usr/include/sys/syscall.h +symlink.o: symlink.s SYS.h /usr/include/sys/syscall.h +sync.o: sync.s SYS.h /usr/include/sys/syscall.h +syscall.o: syscall.s SYS.h /usr/include/sys/syscall.h +truncate.o: truncate.s SYS.h /usr/include/sys/syscall.h +umask.o: umask.s SYS.h /usr/include/sys/syscall.h +umount.o: umount.s SYS.h /usr/include/sys/syscall.h +unlink.o: unlink.s SYS.h /usr/include/sys/syscall.h +utimes.o: utimes.s SYS.h /usr/include/sys/syscall.h +vhangup.o: vhangup.s SYS.h /usr/include/sys/syscall.h +wait.o: wait.s SYS.h /usr/include/sys/syscall.h +wait3.o: wait3.s SYS.h /usr/include/sys/syscall.h +write.o: write.s SYS.h /usr/include/sys/syscall.h +writev.o: writev.s SYS.h /usr/include/sys/syscall.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/tahoe/sys/Ovadvise.s b/lib/libc4.3tahoe/tahoe/sys/Ovadvise.s new file mode 100644 index 0000000..25e4d92 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/Ovadvise.s @@ -0,0 +1,27 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)Ovadvise.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +#define SYS_vadvise 72 + +SYSCALL(vadvise) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/Ovfork.s b/lib/libc4.3tahoe/tahoe/sys/Ovfork.s new file mode 100644 index 0000000..2b0479c --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/Ovfork.s @@ -0,0 +1,59 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)Ovfork.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +/* + * C library -- vfork + * pid = vfork(); + * + * r1 == 0 in parent process, r1 == 1 in child process. + * r0 == pid of child in parent, r0 == pid of parent in child. + * + * trickery here, due to keith sklower, uses ret to clear the stack, + * and then returns with a jump indirect, since only one person can return + * with a ret off this stack... we do the ret before we vfork! + * + */ + + .set vfork,66 +.globl _vfork + +_vfork: + .word 0x0000 + movl -8(fp),r2 + movab here,-8(fp) + ret +here: + kcall $vfork + bcc vforkok + jmp verror +vforkok: + tstl r1 # child process ? + bneq child # yes + jbr parent +.globl _errno +verror: + movl r0,_errno + mnegl $1,r0 + jmp (r2) +child: + clrl r0 +parent: + jmp (r2) diff --git a/lib/libc4.3tahoe/tahoe/sys/SYS.h b/lib/libc4.3tahoe/tahoe/sys/SYS.h new file mode 100644 index 0000000..850ac3b --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/SYS.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * @(#)SYS.h 5.4 (Berkeley) 6/27/88 + */ + +#include + +#ifdef PROF +#define ENTRY(x) .globl _/**/x; .align 2; _/**/x: .word 0; \ + .data; 1:; .long 0; .text; pushl $1b; callf $8,mcount +#else +#define ENTRY(x) .globl _/**/x; .align 2; _/**/x: .word 0 +#endif PROF +#define SYSCALL(x) err: jmp cerror; ENTRY(x); kcall $SYS_/**/x; jcs err +#define PSEUDO(x,y) ENTRY(x); kcall $SYS_/**/y +#define CALL(x,y) calls $x, _/**/y + + .globl cerror diff --git a/lib/libc4.3tahoe/tahoe/sys/_exit.s b/lib/libc4.3tahoe/tahoe/sys/_exit.s new file mode 100644 index 0000000..60f8149 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/_exit.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)_exit.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + + .align 1 +PSEUDO(_exit,exit) + # _exit(status) diff --git a/lib/libc4.3tahoe/tahoe/sys/accept.s b/lib/libc4.3tahoe/tahoe/sys/accept.s new file mode 100644 index 0000000..88a73ef --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/accept.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)accept.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(accept) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/access.s b/lib/libc4.3tahoe/tahoe/sys/access.s new file mode 100644 index 0000000..dd3256d --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/access.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)access.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(access) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/acct.s b/lib/libc4.3tahoe/tahoe/sys/acct.s new file mode 100644 index 0000000..51b4cc1 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/acct.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)acct.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(acct) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/adjtime.s b/lib/libc4.3tahoe/tahoe/sys/adjtime.s new file mode 100644 index 0000000..4531fc1 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/adjtime.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)adjtime.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(adjtime) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/bind.s b/lib/libc4.3tahoe/tahoe/sys/bind.s new file mode 100644 index 0000000..a7550f3 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/bind.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)bind.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(bind) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/brk.s b/lib/libc4.3tahoe/tahoe/sys/brk.s new file mode 100644 index 0000000..21339de --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/brk.s @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)brk.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +#define SYS_brk 17 + + .globl curbrk + .globl minbrk + +ENTRY(brk) + cmpl 4(fp),minbrk + bgeq ok + movl minbrk,4(fp) +ok: + kcall $SYS_brk + jcs err + movl 4(fp),curbrk + clrl r0 + ret +err: + jmp cerror diff --git a/lib/libc4.3tahoe/tahoe/sys/cerror.s b/lib/libc4.3tahoe/tahoe/sys/cerror.s new file mode 100644 index 0000000..7b891be --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/cerror.s @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)cerror.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + + .globl _errno +cerror: + movl r0,_errno + mnegl $1,r0 + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/chdir.s b/lib/libc4.3tahoe/tahoe/sys/chdir.s new file mode 100644 index 0000000..6deaa6f --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/chdir.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)chdir.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(chdir) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/chmod.s b/lib/libc4.3tahoe/tahoe/sys/chmod.s new file mode 100644 index 0000000..d104efd --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/chmod.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)chmod.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(chmod) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/chown.s b/lib/libc4.3tahoe/tahoe/sys/chown.s new file mode 100644 index 0000000..43c7d81 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/chown.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)chown.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(chown) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/chroot.s b/lib/libc4.3tahoe/tahoe/sys/chroot.s new file mode 100644 index 0000000..d4e592d --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/chroot.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)chroot.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(chroot) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/close.s b/lib/libc4.3tahoe/tahoe/sys/close.s new file mode 100644 index 0000000..eae0e4d --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/close.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)close.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(close) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/connect.s b/lib/libc4.3tahoe/tahoe/sys/connect.s new file mode 100644 index 0000000..697ea75 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/connect.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)connect.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(connect) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/creat.s b/lib/libc4.3tahoe/tahoe/sys/creat.s new file mode 100644 index 0000000..1bd5a10 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/creat.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)creat.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(creat) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/dup.s b/lib/libc4.3tahoe/tahoe/sys/dup.s new file mode 100644 index 0000000..5d44b6f --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/dup.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)dup.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(dup) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/dup2.s b/lib/libc4.3tahoe/tahoe/sys/dup2.s new file mode 100644 index 0000000..8505991 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/dup2.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)dup2.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(dup2) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/execl.s b/lib/libc4.3tahoe/tahoe/sys/execl.s new file mode 100644 index 0000000..eb54a4f --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/execl.s @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)execl.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(execl) + pushab 8(fp) + pushl 4(fp) + calls $12,_execv + ret # execl(file, arg1, arg2, ..., 0); diff --git a/lib/libc4.3tahoe/tahoe/sys/execle.s b/lib/libc4.3tahoe/tahoe/sys/execle.s new file mode 100644 index 0000000..09caf83 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/execle.s @@ -0,0 +1,32 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)execle.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(execle) + movw -2(fp),r0 # removed word. + subw2 $4,r0 + shar $2,r0,r0 # num. of args. + pushl (fp)[r0] + pushab 8(fp) + pushl 4(fp) + calls $16,_execve + ret # execle(file, arg1, arg2, ..., env); diff --git a/lib/libc4.3tahoe/tahoe/sys/exect.s b/lib/libc4.3tahoe/tahoe/sys/exect.s new file mode 100644 index 0000000..8985ce2 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/exect.s @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)exect.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" +#include + +ENTRY(exect) + bispsw $PSL_T + kcall $SYS_execve + jmp cerror # exect(file, argv, env) diff --git a/lib/libc4.3tahoe/tahoe/sys/execv.s b/lib/libc4.3tahoe/tahoe/sys/execv.s new file mode 100644 index 0000000..376c8bc --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/execv.s @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)execv.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(execv) + .globl _environ + pushl _environ + pushl 8(fp) + pushl 4(fp) + calls $16,_execve + ret # execv(file, argv) diff --git a/lib/libc4.3tahoe/tahoe/sys/execve.s b/lib/libc4.3tahoe/tahoe/sys/execve.s new file mode 100644 index 0000000..0549c35 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/execve.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)execve.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(execve) + ret # execve(file, argv, arge) diff --git a/lib/libc4.3tahoe/tahoe/sys/fchmod.s b/lib/libc4.3tahoe/tahoe/sys/fchmod.s new file mode 100644 index 0000000..8f03cf5 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/fchmod.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)fchmod.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(fchmod) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/fchown.s b/lib/libc4.3tahoe/tahoe/sys/fchown.s new file mode 100644 index 0000000..0515f78 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/fchown.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)fchown.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(fchown) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/fcntl.s b/lib/libc4.3tahoe/tahoe/sys/fcntl.s new file mode 100644 index 0000000..52301af --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/fcntl.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)fcntl.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(fcntl) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/flock.s b/lib/libc4.3tahoe/tahoe/sys/flock.s new file mode 100644 index 0000000..0bb166b --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/flock.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)flock.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(flock) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/fork.s b/lib/libc4.3tahoe/tahoe/sys/fork.s new file mode 100644 index 0000000..18b33e6 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/fork.s @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)fork.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(fork) + bitl $1,r1 + beql 1f # parent, since r1 == 0 in parent, 1 in child + clrl r0 +1: + ret # pid = fork() diff --git a/lib/libc4.3tahoe/tahoe/sys/fstat.s b/lib/libc4.3tahoe/tahoe/sys/fstat.s new file mode 100644 index 0000000..88014e8 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/fstat.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)fstat.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(fstat) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/fsync.s b/lib/libc4.3tahoe/tahoe/sys/fsync.s new file mode 100644 index 0000000..a6275f9 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/fsync.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)fsync.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(fsync) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/ftruncate.s b/lib/libc4.3tahoe/tahoe/sys/ftruncate.s new file mode 100644 index 0000000..3d07e97 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/ftruncate.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)ftruncate.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(ftruncate) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/getdtablesize.s b/lib/libc4.3tahoe/tahoe/sys/getdtablesize.s new file mode 100644 index 0000000..93376bb --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getdtablesize.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getdtablesize.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getdtablesize) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/getegid.s b/lib/libc4.3tahoe/tahoe/sys/getegid.s new file mode 100644 index 0000000..ed84687 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getegid.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getegid.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +PSEUDO(getegid,getgid) + movl r1,r0 + ret # egid = getegid(); diff --git a/lib/libc4.3tahoe/tahoe/sys/geteuid.s b/lib/libc4.3tahoe/tahoe/sys/geteuid.s new file mode 100644 index 0000000..2f2a9a7 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/geteuid.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)geteuid.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +PSEUDO(geteuid,getuid) + movl r1,r0 + ret # euid = geteuid(); diff --git a/lib/libc4.3tahoe/tahoe/sys/getgid.s b/lib/libc4.3tahoe/tahoe/sys/getgid.s new file mode 100644 index 0000000..045a48c --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getgid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getgid.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getgid) + ret # gid = getgid(); diff --git a/lib/libc4.3tahoe/tahoe/sys/getgroups.s b/lib/libc4.3tahoe/tahoe/sys/getgroups.s new file mode 100644 index 0000000..fdf3af0 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getgroups.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getgroups.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getgroups) + ret # ngroups = getgroups(gidsetsize, gidset) diff --git a/lib/libc4.3tahoe/tahoe/sys/gethostid.s b/lib/libc4.3tahoe/tahoe/sys/gethostid.s new file mode 100644 index 0000000..3c47275 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/gethostid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)gethostid.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(gethostid) + ret # hostid = gethostid() diff --git a/lib/libc4.3tahoe/tahoe/sys/gethostname.s b/lib/libc4.3tahoe/tahoe/sys/gethostname.s new file mode 100644 index 0000000..72826af --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/gethostname.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)gethostname.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(gethostname) + ret # len = gethostname(buf, buflen) diff --git a/lib/libc4.3tahoe/tahoe/sys/getitimer.s b/lib/libc4.3tahoe/tahoe/sys/getitimer.s new file mode 100644 index 0000000..203000c --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getitimer.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getitimer.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getitimer) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/getpagesize.s b/lib/libc4.3tahoe/tahoe/sys/getpagesize.s new file mode 100644 index 0000000..33010cd --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getpagesize.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getpagesize.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getpagesize) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/getpeername.s b/lib/libc4.3tahoe/tahoe/sys/getpeername.s new file mode 100644 index 0000000..034ed27 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getpeername.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getpeername.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getpeername) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/getpgrp.s b/lib/libc4.3tahoe/tahoe/sys/getpgrp.s new file mode 100644 index 0000000..07eba2e --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getpgrp.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getpgrp.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getpgrp) + ret # pgrp = getpgrp(pid); diff --git a/lib/libc4.3tahoe/tahoe/sys/getpid.s b/lib/libc4.3tahoe/tahoe/sys/getpid.s new file mode 100644 index 0000000..5d52417 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getpid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getpid.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getpid) + ret # pid = getpid(); diff --git a/lib/libc4.3tahoe/tahoe/sys/getppid.s b/lib/libc4.3tahoe/tahoe/sys/getppid.s new file mode 100644 index 0000000..ccf90a5 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getppid.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getppid.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +PSEUDO(getppid,getpid) + movl r1,r0 + ret # ppid = getppid(); diff --git a/lib/libc4.3tahoe/tahoe/sys/getpriority.s b/lib/libc4.3tahoe/tahoe/sys/getpriority.s new file mode 100644 index 0000000..e8ca832 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getpriority.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getpriority.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getpriority) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/getrlimit.s b/lib/libc4.3tahoe/tahoe/sys/getrlimit.s new file mode 100644 index 0000000..4c4f415 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getrlimit.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getrlimit.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getrlimit) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/getrusage.s b/lib/libc4.3tahoe/tahoe/sys/getrusage.s new file mode 100644 index 0000000..ba1aff3 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getrusage.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getrusage.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getrusage) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/getsockname.s b/lib/libc4.3tahoe/tahoe/sys/getsockname.s new file mode 100644 index 0000000..c2f853e --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getsockname.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getsockname.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getsockname) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/getsockopt.s b/lib/libc4.3tahoe/tahoe/sys/getsockopt.s new file mode 100644 index 0000000..98fdefe --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getsockopt.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getsockopt.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getsockopt) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/gettimeofday.s b/lib/libc4.3tahoe/tahoe/sys/gettimeofday.s new file mode 100644 index 0000000..065a853 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/gettimeofday.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)gettimeofday.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(gettimeofday) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/getuid.s b/lib/libc4.3tahoe/tahoe/sys/getuid.s new file mode 100644 index 0000000..f5cbe03 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/getuid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getuid.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getuid) + ret # uid = getuid(); diff --git a/lib/libc4.3tahoe/tahoe/sys/ioctl.s b/lib/libc4.3tahoe/tahoe/sys/ioctl.s new file mode 100644 index 0000000..1cb87e6 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/ioctl.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)ioctl.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(ioctl) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/kill.s b/lib/libc4.3tahoe/tahoe/sys/kill.s new file mode 100644 index 0000000..eab0cd0 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/kill.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)kill.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(kill) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/killpg.s b/lib/libc4.3tahoe/tahoe/sys/killpg.s new file mode 100644 index 0000000..8ee61be --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/killpg.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)killpg.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(killpg) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/link.s b/lib/libc4.3tahoe/tahoe/sys/link.s new file mode 100644 index 0000000..de7eda4 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/link.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)link.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(link) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/listen.s b/lib/libc4.3tahoe/tahoe/sys/listen.s new file mode 100644 index 0000000..38aa507 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/listen.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)listen.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(listen) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/lseek.s b/lib/libc4.3tahoe/tahoe/sys/lseek.s new file mode 100644 index 0000000..bd17710 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/lseek.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)lseek.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(lseek) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/lstat.s b/lib/libc4.3tahoe/tahoe/sys/lstat.s new file mode 100644 index 0000000..baa79ea --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/lstat.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)lstat.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(lstat) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/mkdir.s b/lib/libc4.3tahoe/tahoe/sys/mkdir.s new file mode 100644 index 0000000..fe7d697 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/mkdir.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)mkdir.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(mkdir) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/mknod.s b/lib/libc4.3tahoe/tahoe/sys/mknod.s new file mode 100644 index 0000000..15382b1 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/mknod.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)mknod.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(mknod) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/mmap.s b/lib/libc4.3tahoe/tahoe/sys/mmap.s new file mode 100644 index 0000000..49360bd --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/mmap.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)mmap.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(mmap) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/mount.s b/lib/libc4.3tahoe/tahoe/sys/mount.s new file mode 100644 index 0000000..9bcc610 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/mount.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)mount.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(mount) + clrl r0 + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/open.s b/lib/libc4.3tahoe/tahoe/sys/open.s new file mode 100644 index 0000000..19765b0 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/open.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)open.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(open) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/pipe.s b/lib/libc4.3tahoe/tahoe/sys/pipe.s new file mode 100644 index 0000000..3c8a90d --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/pipe.s @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)pipe.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(pipe) + movl 4(fp),r2 + movl r0,(r2) + movl r1,4(r2) + clrl r0 + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/profil.s b/lib/libc4.3tahoe/tahoe/sys/profil.s new file mode 100644 index 0000000..fc3f502 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/profil.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)profil.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(profil) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/profiled/.MAP b/lib/libc4.3tahoe/tahoe/sys/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/tahoe/sys/ptrace.s b/lib/libc4.3tahoe/tahoe/sys/ptrace.s new file mode 100644 index 0000000..a444383 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/ptrace.s @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)ptrace.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(ptrace) + clrl _errno + kcall $SYS_ptrace + jcs err + ret +err: + jmp cerror diff --git a/lib/libc4.3tahoe/tahoe/sys/quota.s b/lib/libc4.3tahoe/tahoe/sys/quota.s new file mode 100644 index 0000000..740df3b --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/quota.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)quota.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(quota) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/read.s b/lib/libc4.3tahoe/tahoe/sys/read.s new file mode 100644 index 0000000..e95e6b2 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/read.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)read.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(read) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/readlink.s b/lib/libc4.3tahoe/tahoe/sys/readlink.s new file mode 100644 index 0000000..87fa8f3 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/readlink.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)readlink.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(readlink) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/readv.s b/lib/libc4.3tahoe/tahoe/sys/readv.s new file mode 100644 index 0000000..32f25f2 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/readv.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)readv.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(readv) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/reboot.s b/lib/libc4.3tahoe/tahoe/sys/reboot.s new file mode 100644 index 0000000..09abda8 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/reboot.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)reboot.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(reboot) + halt diff --git a/lib/libc4.3tahoe/tahoe/sys/recv.s b/lib/libc4.3tahoe/tahoe/sys/recv.s new file mode 100644 index 0000000..5102707 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/recv.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)recv.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(recv) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/recvfrom.s b/lib/libc4.3tahoe/tahoe/sys/recvfrom.s new file mode 100644 index 0000000..73ca012 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/recvfrom.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)recvfrom.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(recvfrom) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/recvmsg.s b/lib/libc4.3tahoe/tahoe/sys/recvmsg.s new file mode 100644 index 0000000..c6b83e2 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/recvmsg.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)recvmsg.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(recvmsg) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/rename.s b/lib/libc4.3tahoe/tahoe/sys/rename.s new file mode 100644 index 0000000..b6ae145 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/rename.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)rename.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(rename) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/rmdir.s b/lib/libc4.3tahoe/tahoe/sys/rmdir.s new file mode 100644 index 0000000..b6c9690 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/rmdir.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)rmdir.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(rmdir) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/sbrk.s b/lib/libc4.3tahoe/tahoe/sys/sbrk.s new file mode 100644 index 0000000..247f83f --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/sbrk.s @@ -0,0 +1,48 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sbrk.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +#define SYS_brk 17 + + .globl _end + .globl minbrk + .globl curbrk + + .data +minbrk: .long _end +curbrk: .long _end + .text + +ENTRY(sbrk) + addl3 curbrk,4(fp),-(sp) + pushl $1 + movl fp,r3 + moval (sp),fp + kcall $SYS_brk + jcs err + movl curbrk,r0 + addl2 4(r3),curbrk + movl r3,fp + ret +err: + movl r3,fp + jmp cerror diff --git a/lib/libc4.3tahoe/tahoe/sys/select.s b/lib/libc4.3tahoe/tahoe/sys/select.s new file mode 100644 index 0000000..a5a140b --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/select.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)select.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(select) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/send.s b/lib/libc4.3tahoe/tahoe/sys/send.s new file mode 100644 index 0000000..60cfa68 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/send.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)send.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(send) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/sendmsg.s b/lib/libc4.3tahoe/tahoe/sys/sendmsg.s new file mode 100644 index 0000000..62e8b84 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/sendmsg.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sendmsg.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sendmsg) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/sendto.s b/lib/libc4.3tahoe/tahoe/sys/sendto.s new file mode 100644 index 0000000..577f186 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/sendto.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sendto.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sendto) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/setgroups.s b/lib/libc4.3tahoe/tahoe/sys/setgroups.s new file mode 100644 index 0000000..ba6e66d --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/setgroups.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setgroups.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setgroups) + ret # setgroups(gidsetsize, gidset) diff --git a/lib/libc4.3tahoe/tahoe/sys/sethostid.s b/lib/libc4.3tahoe/tahoe/sys/sethostid.s new file mode 100644 index 0000000..c738270 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/sethostid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sethostid.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sethostid) + ret # sethostid(hostid) diff --git a/lib/libc4.3tahoe/tahoe/sys/sethostname.s b/lib/libc4.3tahoe/tahoe/sys/sethostname.s new file mode 100644 index 0000000..bb71675 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/sethostname.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sethostname.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sethostname) + ret # sethostname(name, len) diff --git a/lib/libc4.3tahoe/tahoe/sys/setitimer.s b/lib/libc4.3tahoe/tahoe/sys/setitimer.s new file mode 100644 index 0000000..00e908c --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/setitimer.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setitimer.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setitimer) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/setpgrp.s b/lib/libc4.3tahoe/tahoe/sys/setpgrp.s new file mode 100644 index 0000000..deb95ec --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/setpgrp.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setpgrp.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setpgrp) + ret # setpgrp(pid, pgrp); diff --git a/lib/libc4.3tahoe/tahoe/sys/setpriority.s b/lib/libc4.3tahoe/tahoe/sys/setpriority.s new file mode 100644 index 0000000..8c1ebdc --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/setpriority.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setpriority.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setpriority) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/setquota.s b/lib/libc4.3tahoe/tahoe/sys/setquota.s new file mode 100644 index 0000000..59e354a --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/setquota.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setquota.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setquota) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/setregid.s b/lib/libc4.3tahoe/tahoe/sys/setregid.s new file mode 100644 index 0000000..968141c --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/setregid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setregid.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setregid) + ret # setregid(rgid, egid) diff --git a/lib/libc4.3tahoe/tahoe/sys/setreuid.s b/lib/libc4.3tahoe/tahoe/sys/setreuid.s new file mode 100644 index 0000000..756c5fb --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/setreuid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setreuid.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setreuid) + ret # setreuid(ruid, euid) diff --git a/lib/libc4.3tahoe/tahoe/sys/setrlimit.s b/lib/libc4.3tahoe/tahoe/sys/setrlimit.s new file mode 100644 index 0000000..c9b79af --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/setrlimit.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setrlimit.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setrlimit) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/setsockopt.s b/lib/libc4.3tahoe/tahoe/sys/setsockopt.s new file mode 100644 index 0000000..234e3c1 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/setsockopt.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setsockopt.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setsockopt) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/settimeofday.s b/lib/libc4.3tahoe/tahoe/sys/settimeofday.s new file mode 100644 index 0000000..b276207 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/settimeofday.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)settimeofday.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(settimeofday) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/shutdown.s b/lib/libc4.3tahoe/tahoe/sys/shutdown.s new file mode 100644 index 0000000..84bc09a --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/shutdown.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)shutdown.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(shutdown) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/sigblock.s b/lib/libc4.3tahoe/tahoe/sys/sigblock.s new file mode 100644 index 0000000..f1e918a --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/sigblock.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sigblock.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sigblock) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/sigpause.s b/lib/libc4.3tahoe/tahoe/sys/sigpause.s new file mode 100644 index 0000000..10a22e6 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/sigpause.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sigpause.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sigpause) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/sigreturn.s b/lib/libc4.3tahoe/tahoe/sys/sigreturn.s new file mode 100644 index 0000000..f004f5c --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/sigreturn.s @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sigreturn.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +/* + * We must preserve the state of the registers as the user has set them up. + */ +#ifdef PROF +#define POPR(r) movl (sp)+,r +#undef ENTRY +#define ENTRY(x) \ + .globl _/**/x; .align 2; _/**/x: .word 0; \ + pushl r0; pushl r1; pushl r2; pushl r3; pushl r4; pushl r5; \ + .data; 1:; .long 0; .text; pushl $1b; callf $8,mcount; \ + POPR(r5); POPR(r4); POPR(r3); POPR(r2); POPR(r1); POPR(r0); +#endif PROF + +SYSCALL(sigreturn) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/sigsetmask.s b/lib/libc4.3tahoe/tahoe/sys/sigsetmask.s new file mode 100644 index 0000000..d054a3a --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/sigsetmask.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sigsetmask.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sigsetmask) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/sigstack.s b/lib/libc4.3tahoe/tahoe/sys/sigstack.s new file mode 100644 index 0000000..8eb4261 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/sigstack.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sigstack.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sigstack) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/sigvec.s b/lib/libc4.3tahoe/tahoe/sys/sigvec.s new file mode 100644 index 0000000..5fd3adf --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/sigvec.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sigvec.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sigvec) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/socket.s b/lib/libc4.3tahoe/tahoe/sys/socket.s new file mode 100644 index 0000000..3e6dd39 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/socket.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)socket.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(socket) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/socketpair.s b/lib/libc4.3tahoe/tahoe/sys/socketpair.s new file mode 100644 index 0000000..70c3553 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/socketpair.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)socketpair.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(socketpair) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/stat.s b/lib/libc4.3tahoe/tahoe/sys/stat.s new file mode 100644 index 0000000..8bda57b --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/stat.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)stat.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(stat) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/swapon.s b/lib/libc4.3tahoe/tahoe/sys/swapon.s new file mode 100644 index 0000000..0141213 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/swapon.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)swapon.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(swapon) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/symlink.s b/lib/libc4.3tahoe/tahoe/sys/symlink.s new file mode 100644 index 0000000..f9f2bf1 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/symlink.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)symlink.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(symlink) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/sync.s b/lib/libc4.3tahoe/tahoe/sys/sync.s new file mode 100644 index 0000000..db6ca92 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/sync.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sync.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sync) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/syscall.s b/lib/libc4.3tahoe/tahoe/sys/syscall.s new file mode 100644 index 0000000..c983ee3 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/syscall.s @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)syscall.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(syscall) + pushl 4(fp) # syscall number + movl fp,r0 # point to the arg list + movl -4(fp),r1 # (arg_count + 1) (bytes) | mask + andl2 $0xFFFF,r1 # clear the mask bits + shrl $2,r1,r1 # convert to words + subl2 $2,r1 # don't count the first arg +1: + addl2 $4,r0 # point to the next arg + movl 4(r0),(r0) # move an arg down + decl r1 # count it + jgtr 1b # any more? + movl (sp)+,r0 # no, get the syscall number back + kcall r0 + jcs 1f + ret +1: + jmp cerror diff --git a/lib/libc4.3tahoe/tahoe/sys/truncate.s b/lib/libc4.3tahoe/tahoe/sys/truncate.s new file mode 100644 index 0000000..b56ae66 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/truncate.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)truncate.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(truncate) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/umask.s b/lib/libc4.3tahoe/tahoe/sys/umask.s new file mode 100644 index 0000000..fe0c388 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/umask.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)umask.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(umask) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/umount.s b/lib/libc4.3tahoe/tahoe/sys/umount.s new file mode 100644 index 0000000..05745dc --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/umount.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)umount.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(umount) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/unlink.s b/lib/libc4.3tahoe/tahoe/sys/unlink.s new file mode 100644 index 0000000..1bdfe92 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/unlink.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)unlink.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(unlink) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/utimes.s b/lib/libc4.3tahoe/tahoe/sys/utimes.s new file mode 100644 index 0000000..cec46be --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/utimes.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)utimes.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(utimes) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/vhangup.s b/lib/libc4.3tahoe/tahoe/sys/vhangup.s new file mode 100644 index 0000000..4d99015 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/vhangup.s @@ -0,0 +1,27 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)vhangup.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +#define SYS_vhangup 76 + +SYSCALL(vhangup) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/wait.s b/lib/libc4.3tahoe/tahoe/sys/wait.s new file mode 100644 index 0000000..9e3c73f --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/wait.s @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)wait.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(wait) + tstl 4(fp) + jeql 1f + movl r1,*4(fp) +1: + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/wait3.s b/lib/libc4.3tahoe/tahoe/sys/wait3.s new file mode 100644 index 0000000..78e8007 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/wait3.s @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)wait3.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +/* + * C library -- wait3 + * + * pid = wait3(&status, flags, &rusage); + * + * pid == -1 if error + * status indicates fate of process, if given + * flags may indicate process is not to hang or + * that untraced stopped children are to be reported. + * rusage optionally returns detailed resource usage information + */ +#include "SYS.h" + +#define SYS_wait3 SYS_wait + +ENTRY(wait3) + movl 8(fp),r0 /* make it easy for system to get */ + movl 12(fp),r1 /* these extra arguments */ + bispsw $0xf /* flags wait3() (N,Z,V,C)*/ + kcall $SYS_wait3 + bcc noerror + movl r0,_errno + mnegl $1,r0 + ret +noerror: + tstl 4(fp) /* status desired? */ + beql nostatus /* no */ + movl r1,*4(fp) /* store child's status */ +nostatus: + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/write.s b/lib/libc4.3tahoe/tahoe/sys/write.s new file mode 100644 index 0000000..3adec98 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/write.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)write.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(write) + ret diff --git a/lib/libc4.3tahoe/tahoe/sys/writev.s b/lib/libc4.3tahoe/tahoe/sys/writev.s new file mode 100644 index 0000000..3709507 --- /dev/null +++ b/lib/libc4.3tahoe/tahoe/sys/writev.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)writev.s 5.3 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(writev) + ret diff --git a/lib/libc4.3tahoe/vax/.MAP b/lib/libc4.3tahoe/vax/.MAP new file mode 100644 index 0000000..0bb2216 --- /dev/null +++ b/lib/libc4.3tahoe/vax/.MAP @@ -0,0 +1,4 @@ +D CSU csu +F DEFS.H;1 DEFS.h +F MAKEFILE.;1 Makefile +D SYS sys diff --git a/lib/libc4.3tahoe/vax/DEFS.h b/lib/libc4.3tahoe/vax/DEFS.h new file mode 100644 index 0000000..ae56d3d --- /dev/null +++ b/lib/libc4.3tahoe/vax/DEFS.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)DEFS.h 5.1 (Berkeley) 5/30/85 + */ + +#define R0 0x001 +#define R1 0x002 +#define R2 0x004 +#define R3 0x008 +#define R4 0x010 +#define R5 0x020 +#define R6 0x040 +#define R7 0x080 +#define R8 0x100 +#define R9 0x200 +#define R10 0x400 +#define R11 0x800 + +#ifdef PROF +#define ENTRY(x, regs) \ + .globl _/**/x; .align 2; _/**/x: .word regs; \ + .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount +#define ASENTRY(x, regs) \ + .globl x; .align 2; x: .word regs; \ + .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount +#else +#define ENTRY(x, regs) \ + .globl _/**/x; .align 2; _/**/x: .word regs +#define ASENTRY(x, regs) \ + .globl x; .align 2; x: .word regs +#endif diff --git a/lib/libc4.3tahoe/vax/Makefile b/lib/libc4.3tahoe/vax/Makefile new file mode 100644 index 0000000..5e0c51e --- /dev/null +++ b/lib/libc4.3tahoe/vax/Makefile @@ -0,0 +1,38 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.8 (Berkeley) 7/9/88 +# +DEFS= -DLIBC_SCCS -DSYSLIBC_SCCS +ALL= sys +TAGSFILE=tags + +${ALL}: + for i in ${ALL}; do (cd $$i; make ${MFLAGS} DEFS=${DEFS}); done + +clean: + for i in ${ALL}; do (cd $$i; make ${MFLAGS} clean); done + +depend: + for i in ${ALL}; do \ + (cd $$i; make ${MFLAGS} DEFS=${DEFS} depend); done + +tags: + for i in ${ALL}; do \ + (cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \ + done + +FRC: diff --git a/lib/libc4.3tahoe/vax/csu/.MAP b/lib/libc4.3tahoe/vax/csu/.MAP new file mode 100644 index 0000000..93e89d9 --- /dev/null +++ b/lib/libc4.3tahoe/vax/csu/.MAP @@ -0,0 +1,7 @@ +F CRT0.C;1 crt0.c +F GMON.C;1 gmon.c +F GMON.EX;1 gmon.ex +F GMON.H;1 gmon.h +F MAKEFILE.;1 Makefile +F MON.C;1 mon.c +F MON.EX;1 mon.ex diff --git a/lib/libc4.3tahoe/vax/csu/Makefile b/lib/libc4.3tahoe/vax/csu/Makefile new file mode 100644 index 0000000..72b5e59 --- /dev/null +++ b/lib/libc4.3tahoe/vax/csu/Makefile @@ -0,0 +1,94 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.8 (Berkeley) 7/9/88 +# +# crt0 Normal C run time startoff +# mcrt0 C run time start off for profiling, ``prof'' conventions +# gcrt0 C run time start off for profiling, ``gprof'' conventions +# +DEFS=-DLIBC_SCCS +SRCS= crt0.c mon.c gmon.c +OBJS= crt0.o mcrt0.o gcrt0.o mon.o gmon.o +TAGSFILE=tags + +all link: ${OBJS} + +install: + install -o bin -g bin -m 444 crt0.o ${DESTDIR}/lib/crt0.o + install -o bin -g bin -m 444 mcrt0.o ${DESTDIR}/lib/mcrt0.o + install -o bin -g bin -m 444 gcrt0.o ${DESTDIR}/usr/lib/gcrt0.o + +crt0.o: crt0.c + ${CC} -S ${DFLAGS} -DCRT0 crt0.c + /lib/cpp crt0.s > x.s + as -o x.o x.s + ld -x -r -o crt0.o x.o + rm -f x.s x.o crt0.s + +moncrt0.o: crt0.c + ${CC} -S ${DFLAGS} -DMCRT0 crt0.c + /lib/cpp crt0.s > x.s + as -o x.o x.s + ld -x -r -o moncrt0.o x.o + rm -f x.s x.o crt0.s + +gcrt0.o: moncrt0.o gmon.o + ld -x -r -o gcrt0.o moncrt0.o gmon.o + +mcrt0.o: moncrt0.o mon.o + ld -x -r -o mcrt0.o moncrt0.o mon.o + +mon.o: mon.c mon.ex + ${CC} -S ${DEFS} ${DFLAGS} mon.c + ex - mon.s < mon.ex + as -o x.o mon.s + ld -x -r -o mon.o x.o + rm -f x.o mon.s + +gmon.o: gmon.c gmon.h gmon.ex + ${CC} -S ${DEFS} ${DFLAGS} gmon.c + ex - gmon.s < gmon.ex + as -o x.o gmon.s + ld -x -r -o gmon.o x.o + rm -f x.o gmon.s + +tags: + cwd=`pwd`; \ + for i in ${SRCS}; do \ + ctags -a -f ${TAGSFILE} $$cwd/$$i; \ + done + +clean: + rm -f *.o a.out core ${TAGSFILE} + +lint: crt0.c + lint crt0.c -DMCRT0 + lint crt0.c -DGCRT0 + lint crt0.c -DCRT0 + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +crt0.o: crt0.c +mon.o: mon.c +gmon.o: gmon.c +gmon.o:gmon.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/vax/csu/crt0.c b/lib/libc4.3tahoe/vax/csu/crt0.c new file mode 100644 index 0000000..1c687a4 --- /dev/null +++ b/lib/libc4.3tahoe/vax/csu/crt0.c @@ -0,0 +1,115 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)crt0.c 5.4 (Berkeley) 1/18/88"; +#endif LIBC_SCCS and not lint + +/* + * C start up routine. + * Robert Henry, UCB, 20 Oct 81 + * + * We make the following (true) assumptions: + * 1) when the kernel calls start, it does a jump to location 2, + * and thus avoids the register save mask. We are NOT called + * with a calls! see sys1.c:setregs(). + * 2) The only register variable that we can trust is sp, + * which points to the base of the kernel calling frame. + * Do NOT believe the documentation in exec(2) regarding the + * values of fp and ap. + * 3) We can allocate as many register variables as we want, + * and don't have to save them for anybody. + * 4) Because of the ways that asm's work, we can't have + * any automatic variables allocated on the stack, because + * we must catch the value of sp before any automatics are + * allocated. + */ + +char **environ = (char **)0; +static int fd; + +asm("#define _start start"); +asm("#define _eprol eprol"); +extern unsigned char etext; +extern unsigned char eprol; +start() +{ + struct kframe { + int kargc; + char *kargv[1]; /* size depends on kargc */ + char kargstr[1]; /* size varies */ + char kenvstr[1]; /* size varies */ + }; + /* + * ALL REGISTER VARIABLES!!! + */ + register int r11; /* needed for init */ + register struct kframe *kfp; /* r10 */ + register char **targv; + register char **argv; + extern int errno; + +#ifdef lint + kfp = 0; + initcode = initcode = 0; +#else not lint + asm(" movl sp,r10"); /* catch it quick */ +#endif not lint + for (argv = targv = &kfp->kargv[0]; *targv++; /* void */) + /* void */ ; + if (targv >= (char **)(*argv)) + --targv; + environ = targv; +asm("eprol:"); + +#ifdef paranoid + /* + * The standard I/O library assumes that file descriptors 0, 1, and 2 + * are open. If one of these descriptors is closed prior to the start + * of the process, I/O gets very confused. To avoid this problem, we + * insure that the first three file descriptors are open before calling + * main(). Normally this is undefined, as it adds two unnecessary + * system calls. + */ + do { + fd = open("/dev/null", 2); + } while (fd >= 0 && fd < 3); + close(fd); +#endif paranoid + +#ifdef MCRT0 + monstartup(&eprol, &etext); +#endif MCRT0 + errno = 0; + exit(main(kfp->kargc, argv, environ)); +} +asm("#undef _start"); +asm("#undef _eprol"); + +#ifdef MCRT0 +/*ARGSUSED*/ +exit(code) + register int code; /* r11 */ +{ + monitor(0); + _cleanup(); + _exit(code); +} +#endif MCRT0 + +#ifdef CRT0 +/* + * null mcount and moncontrol, + * just in case some routine is compiled for profiling + */ +moncontrol(val) + int val; +{ + +} +asm(" .globl mcount"); +asm("mcount: rsb"); +#endif CRT0 diff --git a/lib/libc4.3tahoe/vax/csu/gmon.c b/lib/libc4.3tahoe/vax/csu/gmon.c new file mode 100644 index 0000000..f7b1a59 --- /dev/null +++ b/lib/libc4.3tahoe/vax/csu/gmon.c @@ -0,0 +1,297 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)gmon.c 5.4 (Berkeley) 8/27/87"; +#endif LIBC_SCCS and not lint + +#ifdef DEBUG +#include +#endif DEBUG + +#include "gmon.h" + + /* + * froms is actually a bunch of unsigned shorts indexing tos + */ +static int profiling = 3; +static unsigned short *froms; +static struct tostruct *tos = 0; +static long tolimit = 0; +static char *s_lowpc = 0; +static char *s_highpc = 0; +static unsigned long s_textsize = 0; + +static int ssiz; +static char *sbuf; +static int s_scale; + /* see profil(2) where this is describe (incorrectly) */ +#define SCALE_1_TO_1 0x10000L + +#define MSG "No space for monitor buffer(s)\n" + +monstartup(lowpc, highpc) + char *lowpc; + char *highpc; +{ + int monsize; + char *buffer; + char *sbrk(); + extern char *minbrk; + + /* + * round lowpc and highpc to multiples of the density we're using + * so the rest of the scaling (here and in gprof) stays in ints. + */ + lowpc = (char *) + ROUNDDOWN((unsigned)lowpc, HISTFRACTION*sizeof(HISTCOUNTER)); + s_lowpc = lowpc; + highpc = (char *) + ROUNDUP((unsigned)highpc, HISTFRACTION*sizeof(HISTCOUNTER)); + s_highpc = highpc; + s_textsize = highpc - lowpc; + monsize = (s_textsize / HISTFRACTION) + sizeof(struct phdr); + buffer = sbrk( monsize ); + if ( buffer == (char *) -1 ) { + write( 2 , MSG , sizeof(MSG) - 1 ); + return; + } + froms = (unsigned short *) sbrk( s_textsize / HASHFRACTION ); + if ( froms == (unsigned short *) -1 ) { + write( 2 , MSG , sizeof(MSG) - 1 ); + froms = 0; + return; + } + tolimit = s_textsize * ARCDENSITY / 100; + if ( tolimit < MINARCS ) { + tolimit = MINARCS; + } else if ( tolimit > 65534 ) { + tolimit = 65534; + } + tos = (struct tostruct *) sbrk( tolimit * sizeof( struct tostruct ) ); + if ( tos == (struct tostruct *) -1 ) { + write( 2 , MSG , sizeof(MSG) - 1 ); + froms = 0; + tos = 0; + return; + } + minbrk = sbrk(0); + tos[0].link = 0; + monitor( lowpc , highpc , buffer , monsize , tolimit ); +} + +_mcleanup() +{ + int fd; + int fromindex; + int endfrom; + char *frompc; + int toindex; + struct rawarc rawarc; + + fd = creat( "gmon.out" , 0666 ); + if ( fd < 0 ) { + perror( "mcount: gmon.out" ); + return; + } +# ifdef DEBUG + fprintf( stderr , "[mcleanup] sbuf 0x%x ssiz %d\n" , sbuf , ssiz ); +# endif DEBUG + write( fd , sbuf , ssiz ); + endfrom = s_textsize / (HASHFRACTION * sizeof(*froms)); + for ( fromindex = 0 ; fromindex < endfrom ; fromindex++ ) { + if ( froms[fromindex] == 0 ) { + continue; + } + frompc = s_lowpc + (fromindex * HASHFRACTION * sizeof(*froms)); + for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) { +# ifdef DEBUG + fprintf( stderr , + "[mcleanup] frompc 0x%x selfpc 0x%x count %d\n" , + frompc , tos[toindex].selfpc , tos[toindex].count ); +# endif DEBUG + rawarc.raw_frompc = (unsigned long) frompc; + rawarc.raw_selfpc = (unsigned long) tos[toindex].selfpc; + rawarc.raw_count = tos[toindex].count; + write( fd , &rawarc , sizeof rawarc ); + } + } + close( fd ); +} + +asm(".text"); +asm(".align 2"); +asm("#the beginning of mcount()"); +asm(".data"); +mcount() +{ + register char *selfpc; /* r11 => r5 */ + register unsigned short *frompcindex; /* r10 => r4 */ + register struct tostruct *top; /* r9 => r3 */ + register struct tostruct *prevtop; /* r8 => r2 */ + register long toindex; /* r7 => r1 */ + + /* + * find the return address for mcount, + * and the return address for mcount's caller. + */ + asm(" .text"); /* make sure we're in text space */ + asm(" movl (sp), r11"); /* selfpc = ... (jsb frame) */ + asm(" movl 16(fp), r10"); /* frompcindex = (calls frame) */ + /* + * check that we are profiling + * and that we aren't recursively invoked. + */ + if (profiling) { + goto out; + } + profiling++; + /* + * check that frompcindex is a reasonable pc value. + * for example: signal catchers get called from the stack, + * not from text space. too bad. + */ + frompcindex = (unsigned short *)((long)frompcindex - (long)s_lowpc); + if ((unsigned long)frompcindex > s_textsize) { + goto done; + } + frompcindex = + &froms[((long)frompcindex) / (HASHFRACTION * sizeof(*froms))]; + toindex = *frompcindex; + if (toindex == 0) { + /* + * first time traversing this arc + */ + toindex = ++tos[0].link; + if (toindex >= tolimit) { + goto overflow; + } + *frompcindex = toindex; + top = &tos[toindex]; + top->selfpc = selfpc; + top->count = 1; + top->link = 0; + goto done; + } + top = &tos[toindex]; + if (top->selfpc == selfpc) { + /* + * arc at front of chain; usual case. + */ + top->count++; + goto done; + } + /* + * have to go looking down chain for it. + * top points to what we are looking at, + * prevtop points to previous top. + * we know it is not at the head of the chain. + */ + for (; /* goto done */; ) { + if (top->link == 0) { + /* + * top is end of the chain and none of the chain + * had top->selfpc == selfpc. + * so we allocate a new tostruct + * and link it to the head of the chain. + */ + toindex = ++tos[0].link; + if (toindex >= tolimit) { + goto overflow; + } + top = &tos[toindex]; + top->selfpc = selfpc; + top->count = 1; + top->link = *frompcindex; + *frompcindex = toindex; + goto done; + } + /* + * otherwise, check the next arc on the chain. + */ + prevtop = top; + top = &tos[top->link]; + if (top->selfpc == selfpc) { + /* + * there it is. + * increment its count + * move it to the head of the chain. + */ + top->count++; + toindex = prevtop->link; + prevtop->link = top->link; + top->link = *frompcindex; + *frompcindex = toindex; + goto done; + } + + } +done: + profiling--; + /* and fall through */ +out: + asm(" rsb"); + +overflow: + profiling++; /* halt further profiling */ +# define TOLIMIT "mcount: tos overflow\n" + write(2, TOLIMIT, sizeof(TOLIMIT) - 1); + goto out; +} +asm(".text"); +asm("#the end of mcount()"); +asm(".data"); + +/*VARARGS1*/ +monitor( lowpc , highpc , buf , bufsiz , nfunc ) + char *lowpc; + char *highpc; + char *buf; /* declared ``short buffer[]'' in monitor(3) */ + int bufsiz; + int nfunc; /* not used, available for compatability only */ +{ + register o; + + if ( lowpc == 0 ) { + moncontrol(0); + _mcleanup(); + return; + } + sbuf = buf; + ssiz = bufsiz; + ( (struct phdr *) buf ) -> lpc = lowpc; + ( (struct phdr *) buf ) -> hpc = highpc; + ( (struct phdr *) buf ) -> ncnt = ssiz; + bufsiz -= sizeof(struct phdr); + if ( bufsiz <= 0 ) + return; + o = highpc - lowpc; + if( bufsiz < o ) + s_scale = ( (float) bufsiz / o ) * SCALE_1_TO_1; + else + s_scale = SCALE_1_TO_1; + moncontrol(1); +} + +/* + * Control profiling + * profiling is what mcount checks to see if + * all the data structures are ready. + */ +moncontrol(mode) + int mode; +{ + if (mode) { + /* start */ + profil(sbuf + sizeof(struct phdr), ssiz - sizeof(struct phdr), + s_lowpc, s_scale); + profiling = 0; + } else { + /* stop */ + profil((char *)0, 0, 0, 0); + profiling = 3; + } +} diff --git a/lib/libc4.3tahoe/vax/csu/gmon.ex b/lib/libc4.3tahoe/vax/csu/gmon.ex new file mode 100644 index 0000000..d5347cc --- /dev/null +++ b/lib/libc4.3tahoe/vax/csu/gmon.ex @@ -0,0 +1,18 @@ +" @(#)gmon.ex 4.2 (Berkeley) 7/26/83" +" fix funny things done by mcount()" +" fix its name, make it jsb'able, change registers to protect the caller" +g/_mcount/s//mcount/g +/mcount:/- +/.word/s/.word.*// +/the beginning of mcount()/mark a +/the end of mcount()/mark b +'a,'bs/r11/r5/g +'a,'bs/r10/r4/g +'a,'bs/r9/r3/g +'a,'bs/r8/r2/g +'a,'bs/r7/r1/g +"" +" fix funny name for minbrk used by monstartup() to limit brk()" +g/_minbrk/s//minbrk/g +w +q diff --git a/lib/libc4.3tahoe/vax/csu/gmon.h b/lib/libc4.3tahoe/vax/csu/gmon.h new file mode 100644 index 0000000..15dc5a6 --- /dev/null +++ b/lib/libc4.3tahoe/vax/csu/gmon.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)gmon.h 5.1 (Berkeley) 5/30/85 + */ + +struct phdr { + char *lpc; + char *hpc; + int ncnt; +}; + + /* + * histogram counters are unsigned shorts (according to the kernel). + */ +#define HISTCOUNTER unsigned short + + /* + * fraction of text space to allocate for histogram counters + * here, 1/2 + */ +#define HISTFRACTION 2 + + /* + * Fraction of text space to allocate for from hash buckets. + * The value of HASHFRACTION is based on the minimum number of bytes + * of separation between two subroutine call points in the object code. + * Given MIN_SUBR_SEPARATION bytes of separation the value of + * HASHFRACTION is calculated as: + * + * HASHFRACTION = MIN_SUBR_SEPARATION / (2 * sizeof(short) - 1); + * + * For the VAX, the shortest two call sequence is: + * + * calls $0,(r0) + * calls $0,(r0) + * + * which is separated by only three bytes, thus HASHFRACTION is + * calculated as: + * + * HASHFRACTION = 3 / (2 * 2 - 1) = 1 + * + * Note that the division above rounds down, thus if MIN_SUBR_FRACTION + * is less than three, this algorithm will not work! + */ +#define HASHFRACTION 1 + + /* + * percent of text space to allocate for tostructs + * with a minimum. + */ +#define ARCDENSITY 2 +#define MINARCS 50 + +struct tostruct { + char *selfpc; + long count; + unsigned short link; +}; + + /* + * a raw arc, + * with pointers to the calling site and the called site + * and a count. + */ +struct rawarc { + unsigned long raw_frompc; + unsigned long raw_selfpc; + long raw_count; +}; + + /* + * general rounding functions. + */ +#define ROUNDDOWN(x,y) (((x)/(y))*(y)) +#define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y)) diff --git a/lib/libc4.3tahoe/vax/csu/mon.c b/lib/libc4.3tahoe/vax/csu/mon.c new file mode 100644 index 0000000..60ab793 --- /dev/null +++ b/lib/libc4.3tahoe/vax/csu/mon.c @@ -0,0 +1,173 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)mon.c 5.3 (Berkeley) 3/9/86"; +#endif LIBC_SCCS and not lint + +#define ARCDENSITY 5 /* density of routines */ +#define MINARCS 50 /* minimum number of counters */ +#define HISTFRACTION 2 /* fraction of text space for histograms */ + + +struct phdr { + int *lpc; + int *hpc; + int ncnt; +}; + +struct cnt { + int *pc; + long ncall; +} *countbase; + +static int cntrs = 0; +static int profiling = 3; +static char *s_sbuf; +static int s_bufsiz; +static int s_scale; +static char *s_lowpc; + +int numctrs; + +#define MSG "No space for monitor buffer(s)\n" + +monstartup(lowpc, highpc) + char *lowpc; + char *highpc; +{ + int monsize; + char *buffer; + int cntsiz; + extern char *sbrk(); + extern char *minbrk; + + + cntsiz = (highpc - lowpc) * ARCDENSITY / 100; + if (cntsiz < MINARCS) + cntsiz = MINARCS; + monsize = (highpc - lowpc + HISTFRACTION - 1) / HISTFRACTION + + sizeof(struct phdr) + cntsiz * sizeof(struct cnt); + monsize = (monsize + 1) & ~1; + buffer = sbrk(monsize); + if (buffer == (char *)-1) { + write(2, MSG, sizeof(MSG)); + return; + } + minbrk = sbrk(0); + monitor(lowpc, highpc, buffer, monsize, cntsiz); +} + +/* + * This routine is massaged so that it may be jsb'ed to + */ +asm(".text"); +asm("#the beginning of mcount()"); +asm(".data"); +mcount() +{ + register int *selfpc; /* r11 */ + register long **cntp; /* r10 */ + + /* + * find the return address for mcount, + * and address of counter pointer + */ + asm(" movl (sp),r11"); /* selfpc = ... (jsb frame) */ + asm(" movl r0,r10"); /* address of count local */ + /* + * check that we aren't recursively invoked. + */ + if (profiling) + goto out; + profiling++; + /* + * check that counter is allocated + */ + if (*cntp == 0) { + /* + * check that a counter is available + */ + if (cntrs++ == numctrs) + goto overflow; + countbase->pc = selfpc; + *cntp = &countbase->ncall; + countbase++; + } + (**cntp)++; + profiling--; +out: + asm( " rsb" ); + +overflow: +# define TOLIMIT "mcount: counter overflow\n" + write( 2 , TOLIMIT , sizeof( TOLIMIT ) ); + goto out; +} +asm(".text"); +asm("#the end of mcount()"); +asm(".data"); + +monitor(lowpc, highpc, buf, bufsiz, cntsiz) + char *lowpc, *highpc; + char *buf; + int bufsiz, cntsiz; +{ + register int o; + struct phdr *php; + static int ssiz; + static char *sbuf; + + if (lowpc == 0) { + moncontrol(0); + o = creat("mon.out", 0666); + write(o, sbuf, ssiz); + close(o); + return; + } + sbuf = buf; + ssiz = bufsiz; + php = (struct phdr *)&buf[0]; + php->lpc = (int *)lowpc; + php->hpc = (int *)highpc; + php->ncnt = cntsiz; + numctrs = cntsiz; + countbase = (struct cnt *)(buf + sizeof(struct phdr)); + o = sizeof(struct phdr) + cntsiz * sizeof(struct cnt); + buf += o; + bufsiz -= o; + if (bufsiz <= 0) + return; + o = (highpc - lowpc); + if(bufsiz < o) + o = ((float) bufsiz / o) * 65536; + else + o = 65536; + s_scale = o; + s_sbuf = buf; + s_bufsiz = bufsiz; + s_lowpc = lowpc; + moncontrol(1); +} + +/* + * Control profiling + * profiling is what mcount checks to see if + * all the data structures are ready. + */ +moncontrol(mode) + int mode; +{ + if (mode) { + /* start */ + profil(s_sbuf, s_bufsiz, s_lowpc, s_scale); + profiling = 0; + } else { + /* stop */ + profil((char *)0, 0, 0, 0); + profiling = 3; + } +} diff --git a/lib/libc4.3tahoe/vax/csu/mon.ex b/lib/libc4.3tahoe/vax/csu/mon.ex new file mode 100644 index 0000000..58effc3 --- /dev/null +++ b/lib/libc4.3tahoe/vax/csu/mon.ex @@ -0,0 +1,15 @@ +" @(#)mon.ex 4.4 (Berkeley) 7/26/83" +" fix funny things done by mcount()" +" fix its name, make it jsb'able, change registers to protect the caller" +g/_mcount/s//mcount/g +/mcount:/- +/.word/s/.word.*// +/the beginning of mcount()/mark a +/the end of mcount()/mark b +'a,'bs/r11/r5/g +'a,'bs/r10/r4/g +"" +" fix funny name for minbrk used by monstartup() to limit brk()" +g/_minbrk/s//minbrk/g +w +q diff --git a/lib/libc4.3tahoe/vax/sys/.MAP b/lib/libc4.3tahoe/vax/sys/.MAP new file mode 100644 index 0000000..1028ec8 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/.MAP @@ -0,0 +1,121 @@ +F ACCEPT.S;1 accept.s +F ACCESS.S;1 access.s +F ACCT.S;1 acct.s +F ADJTIME.S;1 adjtime.s +F BIND.S;1 bind.s +F BRK.S;1 brk.s +F CERROR.S;1 cerror.s +F CHDIR.S;1 chdir.s +F CHMOD.S;1 chmod.s +F CHOWN.S;1 chown.s +F CHROOT.S;1 chroot.s +F CLOSE.S;1 close.s +F CONNECT.S;1 connect.s +F CREAT.S;1 creat.s +F DUP.S;1 dup.s +F DUP2.S;1 dup2.s +F EXECL.S;1 execl.s +F EXECLE.S;1 execle.s +F EXECT.S;1 exect.s +F EXECV.S;1 execv.s +F EXECVE.S;1 execve.s +F FCHMOD.S;1 fchmod.s +F FCHOWN.S;1 fchown.s +F FCNTL.S;1 fcntl.s +F FLOCK.S;1 flock.s +F FORK.S;1 fork.s +F FSTAT.S;1 fstat.s +F FSYNC.S;1 fsync.s +F FTRUNCAT.S;1 ftruncate.s +F GETDTABL.S;1 getdtablesize.s +F GETEGID.S;1 getegid.s +F GETEUID.S;1 geteuid.s +F GETGID.S;1 getgid.s +F GETGROUP.S;1 getgroups.s +F GETHOSTI.S;1 gethostid.s +F GETHOSTN.S;1 gethostname.s +F GETITIME.S;1 getitimer.s +F GETPAGES.S;1 getpagesize.s +F GETPEERN.S;1 getpeername.s +F GETPGRP.S;1 getpgrp.s +F GETPID.S;1 getpid.s +F GETPPID.S;1 getppid.s +F GETPRIOR.S;1 getpriority.s +F GETRLIMI.S;1 getrlimit.s +F GETRUSAG.S;1 getrusage.s +F GETSOCKN.S;1 getsockname.s +F GETSOCKO.S;1 getsockopt.s +F GETTIMEO.S;1 gettimeofday.s +F GETUID.S;1 getuid.s +F IOCTL.S;1 ioctl.s +F KILL.S;1 kill.s +F KILLPG.S;1 killpg.s +F LINK.S;1 link.s +F LISTEN.S;1 listen.s +F LSEEK.S;1 lseek.s +F LSTAT.S;1 lstat.s +F MAKEFILE.;1 Makefile +F MKDIR.S;1 mkdir.s +F MKNOD.S;1 mknod.s +F MOUNT.S;1 mount.s +F OPEN.S;1 open.s +F OVADVISE.S;1 Ovadvise.s +F OVFORK.S;1 Ovfork.s +F PIPE.S;1 pipe.s +F PROFIL.S;1 profil.s +D PROFILED profiled +F PTRACE.S;1 ptrace.s +F QUOTA.S;1 quota.s +F READ.S;1 read.s +F READLINK.S;1 readlink.s +F READV.S;1 readv.s +F REBOOT.S;1 reboot.s +F RECV.S;1 recv.s +F RECVFROM.S;1 recvfrom.s +F RECVMSG.S;1 recvmsg.s +F RENAME.S;1 rename.s +F RMDIR.S;1 rmdir.s +F SBRK.S;1 sbrk.s +F SELECT.S;1 select.s +F SEND.S;1 send.s +F SENDMSG.S;1 sendmsg.s +F SENDTO.S;1 sendto.s +F SETGROUP.S;1 setgroups.s +F SETHOSTI.S;1 sethostid.s +F SETHOSTN.S;1 sethostname.s +F SETITIME.S;1 setitimer.s +F SETPGRP.S;1 setpgrp.s +F SETPRIOR.S;1 setpriority.s +F SETQUOTA.S;1 setquota.s +F SETREGID.S;1 setregid.s +F SETREUID.S;1 setreuid.s +F SETRLIMI.S;1 setrlimit.s +F SETSOCKO.S;1 setsockopt.s +F SETTIMEO.S;1 settimeofday.s +F SHUTDOWN.S;1 shutdown.s +F SIGBLOCK.S;1 sigblock.s +F SIGNAL.S;1 signal.s +F SIGPAUSE.S;1 sigpause.s +F SIGRETUR.S;1 sigreturn.s +F SIGSETMA.S;1 sigsetmask.s +F SIGSTACK.S;1 sigstack.s +F SIGVEC.S;1 sigvec.s +F SOCKET.S;1 socket.s +F SOCKETPA.S;1 socketpair.s +F STAT.S;1 stat.s +F SWAPON.S;1 swapon.s +F SYMLINK.S;1 symlink.s +F SYNC.S;1 sync.s +F SYS.H;1 SYS.h +F SYSCALL.S;1 syscall.s +F TRUNCATE.S;1 truncate.s +F UMASK.S;1 umask.s +F UMOUNT.S;1 umount.s +F UNLINK.S;1 unlink.s +F UTIMES.S;1 utimes.s +F VHANGUP.S;1 vhangup.s +F WAIT.S;1 wait.s +F WAIT3.S;1 wait3.s +F WRITE.S;1 write.s +F WRITEV.S;1 writev.s +F _EXIT.S;1 _exit.s diff --git a/lib/libc4.3tahoe/vax/sys/Makefile b/lib/libc4.3tahoe/vax/sys/Makefile new file mode 100644 index 0000000..1698c79 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/Makefile @@ -0,0 +1,206 @@ +# +# Copyright (c) 1988 Regents of the University of California. +# All rights reserved. +# +# Redistribution and use in source and binary forms are permitted +# provided that the above copyright notice and this paragraph are +# duplicated in all such forms and that any documentation, +# advertising materials, and other materials related to such +# distribution and use acknowledge that the software was developed +# by the University of California, Berkeley. The name of the +# University may not be used to endorse or promote products derived +# from this software without specific prior written permission. +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED +# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. +# +# @(#)Makefile 5.10 (Berkeley) 7/9/88 +# +DEFS= -DSYSLIBC_SCCS +SRCS= Ovadvise.s Ovfork.s _exit.s accept.s access.s acct.s adjtime.s \ + bind.s brk.s cerror.s chdir.s chmod.s chown.s chroot.s close.s \ + connect.s creat.s dup.s dup2.s execl.s execle.s exect.s execv.s \ + execve.s fchmod.s fchown.s fcntl.s flock.s fork.s fstat.s fsync.s \ + ftruncate.s getdtablesize.s getegid.s geteuid.s getgid.s getgroups.s \ + gethostid.s gethostname.s getitimer.s getpagesize.s getpeername.s \ + getpgrp.s getpid.s getppid.s getpriority.s getrlimit.s getrusage.s \ + getsockname.s getsockopt.s gettimeofday.s getuid.s ioctl.s kill.s \ + killpg.s link.s listen.s lseek.s lstat.s mkdir.s mknod.s mount.s \ + open.s pipe.s profil.s ptrace.s quota.s read.s readlink.s readv.s \ + reboot.s recv.s recvfrom.s recvmsg.s rename.s rmdir.s sbrk.s select.s \ + send.s sendmsg.s sendto.s setgroups.s sethostid.s sethostname.s \ + setitimer.s setpgrp.s setpriority.s setquota.s setregid.s setreuid.s \ + setrlimit.s setsockopt.s settimeofday.s shutdown.s sigblock.s \ + sigpause.s sigreturn.s sigsetmask.s sigstack.s sigvec.s socket.s \ + socketpair.s stat.s swapon.s symlink.s sync.s syscall.s truncate.s \ + umask.s umount.s unlink.s utimes.s vhangup.s wait.s wait3.s write.s \ + writev.s +OBJS= Ovadvise.o Ovfork.o _exit.o accept.o access.o acct.o adjtime.o \ + bind.o brk.o cerror.o chdir.o chmod.o chown.o chroot.o close.o \ + connect.o creat.o dup.o dup2.o execl.o execle.o exect.o execv.o \ + execve.o fchmod.o fchown.o fcntl.o flock.o fork.o fstat.o fsync.o \ + ftruncate.o getdtablesize.o getegid.o geteuid.o getgid.o getgroups.o \ + gethostid.o gethostname.o getitimer.o getpagesize.o getpeername.o \ + getpgrp.o getpid.o getppid.o getpriority.o getrlimit.o getrusage.o \ + getsockname.o getsockopt.o gettimeofday.o getuid.o ioctl.o kill.o \ + killpg.o link.o listen.o lseek.o lstat.o mkdir.o mknod.o mount.o \ + open.o pipe.o profil.o ptrace.o quota.o read.o readlink.o readv.o \ + reboot.o recv.o recvfrom.o recvmsg.o rename.o rmdir.o sbrk.o select.o \ + send.o sendmsg.o sendto.o setgroups.o sethostid.o sethostname.o \ + setitimer.o setpgrp.o setpriority.o setquota.o setregid.o setreuid.o \ + setrlimit.o setsockopt.o settimeofday.o shutdown.o sigblock.o \ + sigpause.o sigreturn.o sigsetmask.o sigstack.o sigvec.o socket.o \ + socketpair.o stat.o swapon.o symlink.o sync.o syscall.o truncate.o \ + umask.o umount.o unlink.o utimes.o vhangup.o wait.o wait3.o write.o \ + writev.o +TAGSFILE=tags + +.s.o: + @/lib/cpp ${DEFS} -DPROF $*.s | ${AS} -o $*.o + @-ld -x -o profiled/$*.o -r $*.o + /lib/cpp ${DEFS} $*.s | ${AS} -o $*.o + @-ld -x -r $*.o + @mv a.out $*.o + +all: ${OBJS} + +link: ${OBJS} + (cd ../../library; rm -f ${OBJS}) + (cd ../../profiled; rm -f ${OBJS}) + ln ${OBJS} ../../library + (cd profiled; ln ${OBJS} ../../../profiled) + +tags: + (P=`pwd`; \ + egrep "^ENTRY(.*)|^SYSCALL(.*)" ${SRCS} | /bin/sed \ +"s;\([^:]*\):\([^(]*\)(\([^, )]*\)\(.*\);\3 $$P/\1 /^\2(\3\4$$/;" \ + >> ${TAGSFILE}) + +clean: + rm -f *.o profiled/* a.out core ${TAGSFILE} + +depend: + mkdep ${CFLAGS} ${SRCS} + +# DO NOT DELETE THIS LINE -- mkdep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +Ovadvise.o: Ovadvise.s SYS.h /usr/include/sys/syscall.h +Ovfork.o: Ovfork.s +_exit.o: _exit.s SYS.h /usr/include/sys/syscall.h +accept.o: accept.s SYS.h /usr/include/sys/syscall.h +access.o: access.s SYS.h /usr/include/sys/syscall.h +acct.o: acct.s SYS.h /usr/include/sys/syscall.h +adjtime.o: adjtime.s SYS.h /usr/include/sys/syscall.h +bind.o: bind.s SYS.h /usr/include/sys/syscall.h +brk.o: brk.s SYS.h /usr/include/sys/syscall.h +cerror.o: cerror.s SYS.h /usr/include/sys/syscall.h +chdir.o: chdir.s SYS.h /usr/include/sys/syscall.h +chmod.o: chmod.s SYS.h /usr/include/sys/syscall.h +chown.o: chown.s SYS.h /usr/include/sys/syscall.h +chroot.o: chroot.s SYS.h /usr/include/sys/syscall.h +close.o: close.s SYS.h /usr/include/sys/syscall.h +connect.o: connect.s SYS.h /usr/include/sys/syscall.h +creat.o: creat.s SYS.h /usr/include/sys/syscall.h +dup.o: dup.s SYS.h /usr/include/sys/syscall.h +dup2.o: dup2.s SYS.h /usr/include/sys/syscall.h +execl.o: execl.s SYS.h /usr/include/sys/syscall.h +execle.o: execle.s SYS.h /usr/include/sys/syscall.h +exect.o: exect.s SYS.h /usr/include/sys/syscall.h /usr/include/machine/psl.h +execv.o: execv.s SYS.h /usr/include/sys/syscall.h +execve.o: execve.s SYS.h /usr/include/sys/syscall.h +fchmod.o: fchmod.s SYS.h /usr/include/sys/syscall.h +fchown.o: fchown.s SYS.h /usr/include/sys/syscall.h +fcntl.o: fcntl.s SYS.h /usr/include/sys/syscall.h +flock.o: flock.s SYS.h /usr/include/sys/syscall.h +fork.o: fork.s SYS.h /usr/include/sys/syscall.h +fstat.o: fstat.s SYS.h /usr/include/sys/syscall.h +fsync.o: fsync.s SYS.h /usr/include/sys/syscall.h +ftruncate.o: ftruncate.s SYS.h /usr/include/sys/syscall.h +getdtablesize.o: getdtablesize.s SYS.h /usr/include/sys/syscall.h +getegid.o: getegid.s SYS.h /usr/include/sys/syscall.h +geteuid.o: geteuid.s SYS.h /usr/include/sys/syscall.h +getgid.o: getgid.s SYS.h /usr/include/sys/syscall.h +getgroups.o: getgroups.s SYS.h /usr/include/sys/syscall.h +gethostid.o: gethostid.s SYS.h /usr/include/sys/syscall.h +gethostname.o: gethostname.s SYS.h /usr/include/sys/syscall.h +getitimer.o: getitimer.s SYS.h /usr/include/sys/syscall.h +getpagesize.o: getpagesize.s SYS.h /usr/include/sys/syscall.h +getpeername.o: getpeername.s SYS.h /usr/include/sys/syscall.h +getpgrp.o: getpgrp.s SYS.h +getpid.o: getpid.s SYS.h /usr/include/sys/syscall.h +getppid.o: getppid.s SYS.h /usr/include/sys/syscall.h +getpriority.o: getpriority.s SYS.h /usr/include/sys/syscall.h +getrlimit.o: getrlimit.s SYS.h /usr/include/sys/syscall.h +getrusage.o: getrusage.s SYS.h /usr/include/sys/syscall.h +getsockname.o: getsockname.s SYS.h /usr/include/sys/syscall.h +getsockopt.o: getsockopt.s SYS.h /usr/include/sys/syscall.h +gettimeofday.o: gettimeofday.s SYS.h /usr/include/sys/syscall.h +getuid.o: getuid.s SYS.h /usr/include/sys/syscall.h +ioctl.o: ioctl.s SYS.h /usr/include/sys/syscall.h +kill.o: kill.s SYS.h /usr/include/sys/syscall.h +killpg.o: killpg.s SYS.h /usr/include/sys/syscall.h +link.o: link.s SYS.h /usr/include/sys/syscall.h +listen.o: listen.s SYS.h /usr/include/sys/syscall.h +lseek.o: lseek.s SYS.h /usr/include/sys/syscall.h +lstat.o: lstat.s SYS.h /usr/include/sys/syscall.h +mkdir.o: mkdir.s SYS.h /usr/include/sys/syscall.h +mknod.o: mknod.s SYS.h /usr/include/sys/syscall.h +mount.o: mount.s SYS.h /usr/include/sys/syscall.h +open.o: open.s SYS.h /usr/include/sys/syscall.h +pipe.o: pipe.s SYS.h /usr/include/sys/syscall.h +profil.o: profil.s SYS.h /usr/include/sys/syscall.h +ptrace.o: ptrace.s SYS.h /usr/include/sys/syscall.h +quota.o: quota.s SYS.h /usr/include/sys/syscall.h +read.o: read.s SYS.h /usr/include/sys/syscall.h +readlink.o: readlink.s SYS.h /usr/include/sys/syscall.h +readv.o: readv.s SYS.h /usr/include/sys/syscall.h +reboot.o: reboot.s SYS.h /usr/include/sys/syscall.h +recv.o: recv.s SYS.h /usr/include/sys/syscall.h +recvfrom.o: recvfrom.s SYS.h /usr/include/sys/syscall.h +recvmsg.o: recvmsg.s SYS.h /usr/include/sys/syscall.h +rename.o: rename.s SYS.h /usr/include/sys/syscall.h +rmdir.o: rmdir.s SYS.h /usr/include/sys/syscall.h +sbrk.o: sbrk.s SYS.h /usr/include/sys/syscall.h +select.o: select.s SYS.h /usr/include/sys/syscall.h +send.o: send.s SYS.h /usr/include/sys/syscall.h +sendmsg.o: sendmsg.s SYS.h /usr/include/sys/syscall.h +sendto.o: sendto.s SYS.h /usr/include/sys/syscall.h +setgroups.o: setgroups.s SYS.h /usr/include/sys/syscall.h +sethostid.o: sethostid.s SYS.h /usr/include/sys/syscall.h +sethostname.o: sethostname.s SYS.h /usr/include/sys/syscall.h +setitimer.o: setitimer.s SYS.h /usr/include/sys/syscall.h +setpgrp.o: setpgrp.s SYS.h /usr/include/sys/syscall.h +setpriority.o: setpriority.s SYS.h /usr/include/sys/syscall.h +setquota.o: setquota.s SYS.h /usr/include/sys/syscall.h +setregid.o: setregid.s SYS.h /usr/include/sys/syscall.h +setreuid.o: setreuid.s SYS.h /usr/include/sys/syscall.h +setrlimit.o: setrlimit.s SYS.h /usr/include/sys/syscall.h +setsockopt.o: setsockopt.s SYS.h /usr/include/sys/syscall.h +settimeofday.o: settimeofday.s SYS.h /usr/include/sys/syscall.h +shutdown.o: shutdown.s SYS.h /usr/include/sys/syscall.h +sigblock.o: sigblock.s SYS.h /usr/include/sys/syscall.h +sigpause.o: sigpause.s SYS.h /usr/include/sys/syscall.h +sigreturn.o: sigreturn.s SYS.h /usr/include/sys/syscall.h +sigsetmask.o: sigsetmask.s SYS.h /usr/include/sys/syscall.h +sigstack.o: sigstack.s SYS.h /usr/include/sys/syscall.h +sigvec.o: sigvec.s SYS.h /usr/include/sys/syscall.h +socket.o: socket.s SYS.h /usr/include/sys/syscall.h +socketpair.o: socketpair.s SYS.h /usr/include/sys/syscall.h +stat.o: stat.s SYS.h /usr/include/sys/syscall.h +swapon.o: swapon.s SYS.h /usr/include/sys/syscall.h +symlink.o: symlink.s SYS.h /usr/include/sys/syscall.h +sync.o: sync.s SYS.h /usr/include/sys/syscall.h +syscall.o: syscall.s SYS.h /usr/include/sys/syscall.h +truncate.o: truncate.s SYS.h /usr/include/sys/syscall.h +umask.o: umask.s SYS.h /usr/include/sys/syscall.h +umount.o: umount.s SYS.h /usr/include/sys/syscall.h +unlink.o: unlink.s SYS.h /usr/include/sys/syscall.h +utimes.o: utimes.s SYS.h /usr/include/sys/syscall.h +vhangup.o: vhangup.s SYS.h /usr/include/sys/syscall.h +wait.o: wait.s SYS.h /usr/include/sys/syscall.h +wait3.o: wait3.s SYS.h /usr/include/sys/syscall.h +write.o: write.s SYS.h /usr/include/sys/syscall.h +writev.o: writev.s SYS.h /usr/include/sys/syscall.h + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/lib/libc4.3tahoe/vax/sys/Ovadvise.s b/lib/libc4.3tahoe/vax/sys/Ovadvise.s new file mode 100644 index 0000000..eb3250d --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/Ovadvise.s @@ -0,0 +1,27 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)Ovadvise.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +#define SYS_vadvise 72 + +SYSCALL(vadvise) + ret diff --git a/lib/libc4.3tahoe/vax/sys/Ovfork.s b/lib/libc4.3tahoe/vax/sys/Ovfork.s new file mode 100644 index 0000000..443fe9a --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/Ovfork.s @@ -0,0 +1,62 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)Ovfork.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +/* + * @(#)vfork.s 4.1 (Berkeley) 12/21/80 + * C library -- vfork + */ + +/* + * pid = vfork(); + * + * r1 == 0 in parent process, r1 == 1 in child process. + * r0 == pid of child in parent, r0 == pid of parent in child. + * + * trickery here, due to keith sklower, uses ret to clear the stack, + * and then returns with a jump indirect, since only one person can return + * with a ret off this stack... we do the ret before we vfork! + */ + + .set vfork,66 +.globl _vfork + +_vfork: + .word 0x0000 + movl 16(fp),r2 + movab here,16(fp) + ret +here: + chmk $vfork + bcc vforkok + jmp verror +vforkok: + tstl r1 # child process ? + bneq child # yes + bcc parent # if c-bit not set, fork ok +.globl _errno +verror: + movl r0,_errno + mnegl $1,r0 + jmp (r2) +child: + clrl r0 +parent: + jmp (r2) diff --git a/lib/libc4.3tahoe/vax/sys/SYS.h b/lib/libc4.3tahoe/vax/sys/SYS.h new file mode 100644 index 0000000..babf5c1 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/SYS.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * @(#)SYS.h 5.4 (Berkeley) 6/27/88 + */ + +#include + +#ifdef PROF +#define ENTRY(x) .globl _/**/x; .align 2; _/**/x: .word 0; \ + .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount +#else +#define ENTRY(x) .globl _/**/x; .align 2; _/**/x: .word 0 +#endif PROF +#define SYSCALL(x) err: jmp cerror; ENTRY(x); chmk $SYS_/**/x; jcs err +#define PSEUDO(x,y) ENTRY(x); chmk $SYS_/**/y +#define CALL(x,y) calls $x, _/**/y + + .globl cerror diff --git a/lib/libc4.3tahoe/vax/sys/_exit.s b/lib/libc4.3tahoe/vax/sys/_exit.s new file mode 100644 index 0000000..046b518 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/_exit.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)_exit.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + + .align 1 +PSEUDO(_exit,exit) + # _exit(status) diff --git a/lib/libc4.3tahoe/vax/sys/accept.s b/lib/libc4.3tahoe/vax/sys/accept.s new file mode 100644 index 0000000..cc7f299 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/accept.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)accept.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(accept) + ret diff --git a/lib/libc4.3tahoe/vax/sys/access.s b/lib/libc4.3tahoe/vax/sys/access.s new file mode 100644 index 0000000..e9c5912 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/access.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)access.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(access) + ret diff --git a/lib/libc4.3tahoe/vax/sys/acct.s b/lib/libc4.3tahoe/vax/sys/acct.s new file mode 100644 index 0000000..d58ff90 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/acct.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)acct.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(acct) + ret diff --git a/lib/libc4.3tahoe/vax/sys/adjtime.s b/lib/libc4.3tahoe/vax/sys/adjtime.s new file mode 100644 index 0000000..bca0bb5 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/adjtime.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)adjtime.s 5.4 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(adjtime) + ret diff --git a/lib/libc4.3tahoe/vax/sys/bind.s b/lib/libc4.3tahoe/vax/sys/bind.s new file mode 100644 index 0000000..a910650 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/bind.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)bind.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(bind) + ret diff --git a/lib/libc4.3tahoe/vax/sys/brk.s b/lib/libc4.3tahoe/vax/sys/brk.s new file mode 100644 index 0000000..945e7d8 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/brk.s @@ -0,0 +1,42 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)brk.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +#define SYS_brk 17 + + .globl curbrk + .globl minbrk +ENTRY(_brk) + jbr ok + +ENTRY(brk) + cmpl 4(ap),minbrk + bgeq ok + movl minbrk,4(ap) +ok: + chmk $SYS_brk + jcs err + movl 4(ap),curbrk + clrl r0 + ret +err: + jmp cerror diff --git a/lib/libc4.3tahoe/vax/sys/cerror.s b/lib/libc4.3tahoe/vax/sys/cerror.s new file mode 100644 index 0000000..6b034b3 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/cerror.s @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)cerror.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + + .globl _errno +cerror: + movl r0,_errno + mnegl $1,r0 + ret diff --git a/lib/libc4.3tahoe/vax/sys/chdir.s b/lib/libc4.3tahoe/vax/sys/chdir.s new file mode 100644 index 0000000..864a723 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/chdir.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)chdir.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(chdir) + ret diff --git a/lib/libc4.3tahoe/vax/sys/chmod.s b/lib/libc4.3tahoe/vax/sys/chmod.s new file mode 100644 index 0000000..53865ed --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/chmod.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)chmod.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(chmod) + ret diff --git a/lib/libc4.3tahoe/vax/sys/chown.s b/lib/libc4.3tahoe/vax/sys/chown.s new file mode 100644 index 0000000..1d81328 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/chown.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)chown.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(chown) + ret diff --git a/lib/libc4.3tahoe/vax/sys/chroot.s b/lib/libc4.3tahoe/vax/sys/chroot.s new file mode 100644 index 0000000..29d6e60 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/chroot.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)chroot.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(chroot) + ret diff --git a/lib/libc4.3tahoe/vax/sys/close.s b/lib/libc4.3tahoe/vax/sys/close.s new file mode 100644 index 0000000..d67e460 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/close.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)close.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(close) + ret diff --git a/lib/libc4.3tahoe/vax/sys/connect.s b/lib/libc4.3tahoe/vax/sys/connect.s new file mode 100644 index 0000000..46dbad7 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/connect.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)connect.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(connect) + ret diff --git a/lib/libc4.3tahoe/vax/sys/creat.s b/lib/libc4.3tahoe/vax/sys/creat.s new file mode 100644 index 0000000..70d7d9e --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/creat.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)creat.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(creat) + ret diff --git a/lib/libc4.3tahoe/vax/sys/dup.s b/lib/libc4.3tahoe/vax/sys/dup.s new file mode 100644 index 0000000..e32b736 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/dup.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)dup.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(dup) + ret diff --git a/lib/libc4.3tahoe/vax/sys/dup2.s b/lib/libc4.3tahoe/vax/sys/dup2.s new file mode 100644 index 0000000..57578a4 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/dup2.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)dup2.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(dup2) + ret diff --git a/lib/libc4.3tahoe/vax/sys/execl.s b/lib/libc4.3tahoe/vax/sys/execl.s new file mode 100644 index 0000000..e050acc --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/execl.s @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)execl.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(execl) + pushab 8(ap) + pushl 4(ap) + calls $2,_execv + ret # execl(file, arg1, arg2, ..., 0); diff --git a/lib/libc4.3tahoe/vax/sys/execle.s b/lib/libc4.3tahoe/vax/sys/execle.s new file mode 100644 index 0000000..e51156a --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/execle.s @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)execle.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(execle) + movl (ap),r0 + pushl (ap)[r0] + pushab 8(ap) + pushl 4(ap) + calls $3,_execve + ret # execle(file, arg1, arg2, ..., env); diff --git a/lib/libc4.3tahoe/vax/sys/exect.s b/lib/libc4.3tahoe/vax/sys/exect.s new file mode 100644 index 0000000..b3d0c32 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/exect.s @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)exect.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" +#include + +ENTRY(exect) + bispsw $PSL_T + chmk $SYS_execve + jmp cerror # exect(file, argv, env) diff --git a/lib/libc4.3tahoe/vax/sys/execv.s b/lib/libc4.3tahoe/vax/sys/execv.s new file mode 100644 index 0000000..c988600 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/execv.s @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)execv.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(execv) + .globl _environ + pushl _environ + pushl 8(ap) + pushl 4(ap) + calls $3,_execve + ret # execv(file, argv) diff --git a/lib/libc4.3tahoe/vax/sys/execve.s b/lib/libc4.3tahoe/vax/sys/execve.s new file mode 100644 index 0000000..2cb4476 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/execve.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)execve.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(execve) + ret # execve(file, argv, arge) diff --git a/lib/libc4.3tahoe/vax/sys/fchmod.s b/lib/libc4.3tahoe/vax/sys/fchmod.s new file mode 100644 index 0000000..b5ea885 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/fchmod.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)fchmod.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(fchmod) + ret diff --git a/lib/libc4.3tahoe/vax/sys/fchown.s b/lib/libc4.3tahoe/vax/sys/fchown.s new file mode 100644 index 0000000..78fe945 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/fchown.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)fchown.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(fchown) + ret diff --git a/lib/libc4.3tahoe/vax/sys/fcntl.s b/lib/libc4.3tahoe/vax/sys/fcntl.s new file mode 100644 index 0000000..61b2f3d --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/fcntl.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)fcntl.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(fcntl) + ret diff --git a/lib/libc4.3tahoe/vax/sys/flock.s b/lib/libc4.3tahoe/vax/sys/flock.s new file mode 100644 index 0000000..0020cce --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/flock.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)flock.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(flock) + ret diff --git a/lib/libc4.3tahoe/vax/sys/fork.s b/lib/libc4.3tahoe/vax/sys/fork.s new file mode 100644 index 0000000..23a1aac --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/fork.s @@ -0,0 +1,28 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)fork.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(fork) + jlbc r1,1f # parent, since r1 == 0 in parent, 1 in child + clrl r0 +1: + ret # pid = fork() diff --git a/lib/libc4.3tahoe/vax/sys/fstat.s b/lib/libc4.3tahoe/vax/sys/fstat.s new file mode 100644 index 0000000..88a543d --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/fstat.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)fstat.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(fstat) + ret diff --git a/lib/libc4.3tahoe/vax/sys/fsync.s b/lib/libc4.3tahoe/vax/sys/fsync.s new file mode 100644 index 0000000..9ffc4fe --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/fsync.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)fsync.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + + +#include "SYS.h" + +SYSCALL(fsync) + ret diff --git a/lib/libc4.3tahoe/vax/sys/ftruncate.s b/lib/libc4.3tahoe/vax/sys/ftruncate.s new file mode 100644 index 0000000..c5b2b2b --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/ftruncate.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)ftruncate.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(ftruncate) + ret diff --git a/lib/libc4.3tahoe/vax/sys/getdtablesize.s b/lib/libc4.3tahoe/vax/sys/getdtablesize.s new file mode 100644 index 0000000..011ded6 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getdtablesize.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getdtablesize.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getdtablesize) + ret diff --git a/lib/libc4.3tahoe/vax/sys/getegid.s b/lib/libc4.3tahoe/vax/sys/getegid.s new file mode 100644 index 0000000..ef42466 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getegid.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getegid.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +PSEUDO(getegid,getgid) + movl r1,r0 + ret # egid = getegid(); diff --git a/lib/libc4.3tahoe/vax/sys/geteuid.s b/lib/libc4.3tahoe/vax/sys/geteuid.s new file mode 100644 index 0000000..eb63f04 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/geteuid.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)geteuid.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +PSEUDO(geteuid,getuid) + movl r1,r0 + ret # euid = geteuid(); diff --git a/lib/libc4.3tahoe/vax/sys/getgid.s b/lib/libc4.3tahoe/vax/sys/getgid.s new file mode 100644 index 0000000..39fd578 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getgid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getgid.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getgid) + ret # gid = getgid(); diff --git a/lib/libc4.3tahoe/vax/sys/getgroups.s b/lib/libc4.3tahoe/vax/sys/getgroups.s new file mode 100644 index 0000000..903fd39 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getgroups.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getgroups.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getgroups) + ret # ngroups = getgroups(gidsetsize, gidset) diff --git a/lib/libc4.3tahoe/vax/sys/gethostid.s b/lib/libc4.3tahoe/vax/sys/gethostid.s new file mode 100644 index 0000000..dcd09b8 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/gethostid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)gethostid.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(gethostid) + ret # hostid = gethostid() diff --git a/lib/libc4.3tahoe/vax/sys/gethostname.s b/lib/libc4.3tahoe/vax/sys/gethostname.s new file mode 100644 index 0000000..3a82607 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/gethostname.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)gethostname.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(gethostname) + ret # len = gethostname(buf, buflen) diff --git a/lib/libc4.3tahoe/vax/sys/getitimer.s b/lib/libc4.3tahoe/vax/sys/getitimer.s new file mode 100644 index 0000000..ccc9479 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getitimer.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getitimer.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getitimer) + ret diff --git a/lib/libc4.3tahoe/vax/sys/getpagesize.s b/lib/libc4.3tahoe/vax/sys/getpagesize.s new file mode 100644 index 0000000..5d08a94 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getpagesize.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getpagesize.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getpagesize) + ret diff --git a/lib/libc4.3tahoe/vax/sys/getpeername.s b/lib/libc4.3tahoe/vax/sys/getpeername.s new file mode 100644 index 0000000..0612dad --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getpeername.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getpeername.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getpeername) + ret diff --git a/lib/libc4.3tahoe/vax/sys/getpgrp.s b/lib/libc4.3tahoe/vax/sys/getpgrp.s new file mode 100644 index 0000000..1e9df39 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getpgrp.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getpgrp.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getpgrp) + ret # pgrp = getpgrp(pid); diff --git a/lib/libc4.3tahoe/vax/sys/getpid.s b/lib/libc4.3tahoe/vax/sys/getpid.s new file mode 100644 index 0000000..790cb6a --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getpid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getpid.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getpid) + ret # pid = getpid(); diff --git a/lib/libc4.3tahoe/vax/sys/getppid.s b/lib/libc4.3tahoe/vax/sys/getppid.s new file mode 100644 index 0000000..8bd443f --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getppid.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getppid.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +PSEUDO(getppid,getpid) + movl r1,r0 + ret # ppid = getppid(); diff --git a/lib/libc4.3tahoe/vax/sys/getpriority.s b/lib/libc4.3tahoe/vax/sys/getpriority.s new file mode 100644 index 0000000..58e1aa3 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getpriority.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getpriority.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getpriority) + ret diff --git a/lib/libc4.3tahoe/vax/sys/getrlimit.s b/lib/libc4.3tahoe/vax/sys/getrlimit.s new file mode 100644 index 0000000..b135a2a --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getrlimit.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getrlimit.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getrlimit) + ret diff --git a/lib/libc4.3tahoe/vax/sys/getrusage.s b/lib/libc4.3tahoe/vax/sys/getrusage.s new file mode 100644 index 0000000..cc64bfe --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getrusage.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getrusage.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getrusage) + ret diff --git a/lib/libc4.3tahoe/vax/sys/getsockname.s b/lib/libc4.3tahoe/vax/sys/getsockname.s new file mode 100644 index 0000000..018381d --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getsockname.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getsockname.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getsockname) + ret diff --git a/lib/libc4.3tahoe/vax/sys/getsockopt.s b/lib/libc4.3tahoe/vax/sys/getsockopt.s new file mode 100644 index 0000000..33a18c2 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getsockopt.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getsockopt.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getsockopt) + ret diff --git a/lib/libc4.3tahoe/vax/sys/gettimeofday.s b/lib/libc4.3tahoe/vax/sys/gettimeofday.s new file mode 100644 index 0000000..0dd0310 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/gettimeofday.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)gettimeofday.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(gettimeofday) + ret diff --git a/lib/libc4.3tahoe/vax/sys/getuid.s b/lib/libc4.3tahoe/vax/sys/getuid.s new file mode 100644 index 0000000..4d70fdb --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/getuid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)getuid.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(getuid) + ret # uid = getuid(); diff --git a/lib/libc4.3tahoe/vax/sys/ioctl.s b/lib/libc4.3tahoe/vax/sys/ioctl.s new file mode 100644 index 0000000..56ab8a6 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/ioctl.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)ioctl.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(ioctl) + ret diff --git a/lib/libc4.3tahoe/vax/sys/kill.s b/lib/libc4.3tahoe/vax/sys/kill.s new file mode 100644 index 0000000..5740630 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/kill.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)kill.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(kill) + ret diff --git a/lib/libc4.3tahoe/vax/sys/killpg.s b/lib/libc4.3tahoe/vax/sys/killpg.s new file mode 100644 index 0000000..43bfcce --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/killpg.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)killpg.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(killpg) + ret diff --git a/lib/libc4.3tahoe/vax/sys/link.s b/lib/libc4.3tahoe/vax/sys/link.s new file mode 100644 index 0000000..edb999a --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/link.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)link.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(link) + ret diff --git a/lib/libc4.3tahoe/vax/sys/listen.s b/lib/libc4.3tahoe/vax/sys/listen.s new file mode 100644 index 0000000..c1c3d1c --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/listen.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)listen.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(listen) + ret diff --git a/lib/libc4.3tahoe/vax/sys/lseek.s b/lib/libc4.3tahoe/vax/sys/lseek.s new file mode 100644 index 0000000..a60deb3 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/lseek.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)lseek.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(lseek) + ret diff --git a/lib/libc4.3tahoe/vax/sys/lstat.s b/lib/libc4.3tahoe/vax/sys/lstat.s new file mode 100644 index 0000000..900b7b5 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/lstat.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)lstat.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(lstat) + ret diff --git a/lib/libc4.3tahoe/vax/sys/mkdir.s b/lib/libc4.3tahoe/vax/sys/mkdir.s new file mode 100644 index 0000000..aa75cf9 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/mkdir.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)mkdir.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(mkdir) + ret diff --git a/lib/libc4.3tahoe/vax/sys/mknod.s b/lib/libc4.3tahoe/vax/sys/mknod.s new file mode 100644 index 0000000..b7f46c5 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/mknod.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)mknod.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(mknod) + ret diff --git a/lib/libc4.3tahoe/vax/sys/mount.s b/lib/libc4.3tahoe/vax/sys/mount.s new file mode 100644 index 0000000..f702939 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/mount.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)mount.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(mount) + clrl r0 + ret diff --git a/lib/libc4.3tahoe/vax/sys/open.s b/lib/libc4.3tahoe/vax/sys/open.s new file mode 100644 index 0000000..d7a636b --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/open.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)open.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(open) + ret diff --git a/lib/libc4.3tahoe/vax/sys/pipe.s b/lib/libc4.3tahoe/vax/sys/pipe.s new file mode 100644 index 0000000..3d767be --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/pipe.s @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)pipe.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(pipe) + movl 4(ap),r2 + movl r0,(r2)+ + movl r1,(r2) + clrl r0 + ret diff --git a/lib/libc4.3tahoe/vax/sys/profil.s b/lib/libc4.3tahoe/vax/sys/profil.s new file mode 100644 index 0000000..b252df9 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/profil.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)profil.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(profil) + ret diff --git a/lib/libc4.3tahoe/vax/sys/profiled/.MAP b/lib/libc4.3tahoe/vax/sys/profiled/.MAP new file mode 100644 index 0000000..e69de29 diff --git a/lib/libc4.3tahoe/vax/sys/ptrace.s b/lib/libc4.3tahoe/vax/sys/ptrace.s new file mode 100644 index 0000000..2634b23 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/ptrace.s @@ -0,0 +1,30 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)ptrace.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(ptrace) + clrl _errno + chmk $SYS_ptrace + jcs err + ret +err: + jmp cerror diff --git a/lib/libc4.3tahoe/vax/sys/quota.s b/lib/libc4.3tahoe/vax/sys/quota.s new file mode 100644 index 0000000..522c0e6 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/quota.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)quota.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(quota) + ret diff --git a/lib/libc4.3tahoe/vax/sys/read.s b/lib/libc4.3tahoe/vax/sys/read.s new file mode 100644 index 0000000..7e8e1d4 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/read.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)read.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(read) + ret diff --git a/lib/libc4.3tahoe/vax/sys/readlink.s b/lib/libc4.3tahoe/vax/sys/readlink.s new file mode 100644 index 0000000..57ffcf0 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/readlink.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)readlink.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(readlink) + ret diff --git a/lib/libc4.3tahoe/vax/sys/readv.s b/lib/libc4.3tahoe/vax/sys/readv.s new file mode 100644 index 0000000..db26017 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/readv.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)readv.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + + +#include "SYS.h" + +SYSCALL(readv) + ret diff --git a/lib/libc4.3tahoe/vax/sys/reboot.s b/lib/libc4.3tahoe/vax/sys/reboot.s new file mode 100644 index 0000000..e66a8a0 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/reboot.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)reboot.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(reboot) + halt diff --git a/lib/libc4.3tahoe/vax/sys/recv.s b/lib/libc4.3tahoe/vax/sys/recv.s new file mode 100644 index 0000000..cc6f6ad --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/recv.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)recv.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(recv) + ret diff --git a/lib/libc4.3tahoe/vax/sys/recvfrom.s b/lib/libc4.3tahoe/vax/sys/recvfrom.s new file mode 100644 index 0000000..7075223 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/recvfrom.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)recvfrom.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(recvfrom) + ret diff --git a/lib/libc4.3tahoe/vax/sys/recvmsg.s b/lib/libc4.3tahoe/vax/sys/recvmsg.s new file mode 100644 index 0000000..d16723c --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/recvmsg.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)recvmsg.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(recvmsg) + ret diff --git a/lib/libc4.3tahoe/vax/sys/rename.s b/lib/libc4.3tahoe/vax/sys/rename.s new file mode 100644 index 0000000..9c0d40c --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/rename.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)rename.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(rename) + ret diff --git a/lib/libc4.3tahoe/vax/sys/rmdir.s b/lib/libc4.3tahoe/vax/sys/rmdir.s new file mode 100644 index 0000000..581259e --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/rmdir.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)rmdir.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(rmdir) + ret diff --git a/lib/libc4.3tahoe/vax/sys/sbrk.s b/lib/libc4.3tahoe/vax/sys/sbrk.s new file mode 100644 index 0000000..3c8ae45 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/sbrk.s @@ -0,0 +1,46 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sbrk.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +#define SYS_brk 17 + + .globl _end + .globl minbrk + .globl curbrk + + .data +minbrk: .long _end +curbrk: .long _end + .text + +ENTRY(sbrk) + addl3 curbrk,4(ap),-(sp) + pushl $1 + movl ap,r3 + movl sp,ap + chmk $SYS_brk + jcs err + movl curbrk,r0 + addl2 4(r3),curbrk + ret +err: + jmp cerror diff --git a/lib/libc4.3tahoe/vax/sys/select.s b/lib/libc4.3tahoe/vax/sys/select.s new file mode 100644 index 0000000..442fd6d --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/select.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)select.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(select) + ret diff --git a/lib/libc4.3tahoe/vax/sys/send.s b/lib/libc4.3tahoe/vax/sys/send.s new file mode 100644 index 0000000..c34ad6a --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/send.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)send.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(send) + ret diff --git a/lib/libc4.3tahoe/vax/sys/sendmsg.s b/lib/libc4.3tahoe/vax/sys/sendmsg.s new file mode 100644 index 0000000..b3ea430 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/sendmsg.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sendmsg.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sendmsg) + ret diff --git a/lib/libc4.3tahoe/vax/sys/sendto.s b/lib/libc4.3tahoe/vax/sys/sendto.s new file mode 100644 index 0000000..689f7da --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/sendto.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sendto.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sendto) + ret diff --git a/lib/libc4.3tahoe/vax/sys/setgroups.s b/lib/libc4.3tahoe/vax/sys/setgroups.s new file mode 100644 index 0000000..29177b1 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/setgroups.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setgroups.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setgroups) + ret # setgroups(gidsetsize, gidset) diff --git a/lib/libc4.3tahoe/vax/sys/sethostid.s b/lib/libc4.3tahoe/vax/sys/sethostid.s new file mode 100644 index 0000000..9252c28 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/sethostid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sethostid.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sethostid) + ret # sethostid(hostid) diff --git a/lib/libc4.3tahoe/vax/sys/sethostname.s b/lib/libc4.3tahoe/vax/sys/sethostname.s new file mode 100644 index 0000000..7801f00 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/sethostname.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sethostname.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sethostname) + ret # sethostname(name, len) diff --git a/lib/libc4.3tahoe/vax/sys/setitimer.s b/lib/libc4.3tahoe/vax/sys/setitimer.s new file mode 100644 index 0000000..b7d67b6 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/setitimer.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setitimer.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setitimer) + ret diff --git a/lib/libc4.3tahoe/vax/sys/setpgrp.s b/lib/libc4.3tahoe/vax/sys/setpgrp.s new file mode 100644 index 0000000..cfeffea --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/setpgrp.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setpgrp.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setpgrp) + ret # setpgrp(pid, pgrp); diff --git a/lib/libc4.3tahoe/vax/sys/setpriority.s b/lib/libc4.3tahoe/vax/sys/setpriority.s new file mode 100644 index 0000000..eaf629e --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/setpriority.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setpriority.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setpriority) + ret diff --git a/lib/libc4.3tahoe/vax/sys/setquota.s b/lib/libc4.3tahoe/vax/sys/setquota.s new file mode 100644 index 0000000..90f8532 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/setquota.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setquota.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setquota) + ret diff --git a/lib/libc4.3tahoe/vax/sys/setregid.s b/lib/libc4.3tahoe/vax/sys/setregid.s new file mode 100644 index 0000000..f51c697 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/setregid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setregid.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setregid) + ret # setregid(rgid, egid) diff --git a/lib/libc4.3tahoe/vax/sys/setreuid.s b/lib/libc4.3tahoe/vax/sys/setreuid.s new file mode 100644 index 0000000..753c35b --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/setreuid.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setreuid.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setreuid) + ret # setreuid(ruid, euid) diff --git a/lib/libc4.3tahoe/vax/sys/setrlimit.s b/lib/libc4.3tahoe/vax/sys/setrlimit.s new file mode 100644 index 0000000..94f3298 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/setrlimit.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setrlimit.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setrlimit) + ret diff --git a/lib/libc4.3tahoe/vax/sys/setsockopt.s b/lib/libc4.3tahoe/vax/sys/setsockopt.s new file mode 100644 index 0000000..98a38c6 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/setsockopt.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)setsockopt.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(setsockopt) + ret diff --git a/lib/libc4.3tahoe/vax/sys/settimeofday.s b/lib/libc4.3tahoe/vax/sys/settimeofday.s new file mode 100644 index 0000000..9beb859 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/settimeofday.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)settimeofday.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(settimeofday) + ret diff --git a/lib/libc4.3tahoe/vax/sys/shutdown.s b/lib/libc4.3tahoe/vax/sys/shutdown.s new file mode 100644 index 0000000..55e65de --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/shutdown.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)shutdown.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(shutdown) + ret diff --git a/lib/libc4.3tahoe/vax/sys/sigblock.s b/lib/libc4.3tahoe/vax/sys/sigblock.s new file mode 100644 index 0000000..2e0df25 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/sigblock.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sigblock.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sigblock) + ret diff --git a/lib/libc4.3tahoe/vax/sys/signal.s b/lib/libc4.3tahoe/vax/sys/signal.s new file mode 100644 index 0000000..12ecf2a --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/signal.s @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)signal.s 5.4 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + + .globl __sigsim +ENTRY(signal) + blbs __sigsim,2f + chmk $SYS_signal + bcs 1f + ret +1: + jmp cerror + +/* + * Must simulate signal + */ +2: + movq 4(ap),-(sp) + calls $2,_signalsim + ret diff --git a/lib/libc4.3tahoe/vax/sys/sigpause.s b/lib/libc4.3tahoe/vax/sys/sigpause.s new file mode 100644 index 0000000..9902f95 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/sigpause.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sigpause.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sigpause) + ret diff --git a/lib/libc4.3tahoe/vax/sys/sigreturn.s b/lib/libc4.3tahoe/vax/sys/sigreturn.s new file mode 100644 index 0000000..869587e --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/sigreturn.s @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sigreturn.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +/* + * We must preserve the state of the registers as the user has set them up. + */ +#ifdef PROF +#undef ENTRY +#define ENTRY(x) \ + .globl _/**/x; .align 2; _/**/x: .word 0; pushr $0x3f; \ + .data; 1:; .long 0; .text; moval 1b,r0; jsb mcount; popr $0x3f +#endif PROF + +SYSCALL(sigreturn) + ret diff --git a/lib/libc4.3tahoe/vax/sys/sigsetmask.s b/lib/libc4.3tahoe/vax/sys/sigsetmask.s new file mode 100644 index 0000000..7aba704 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/sigsetmask.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sigsetmask.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sigsetmask) + ret diff --git a/lib/libc4.3tahoe/vax/sys/sigstack.s b/lib/libc4.3tahoe/vax/sys/sigstack.s new file mode 100644 index 0000000..a684a7d --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/sigstack.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sigstack.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sigstack) + ret diff --git a/lib/libc4.3tahoe/vax/sys/sigvec.s b/lib/libc4.3tahoe/vax/sys/sigvec.s new file mode 100644 index 0000000..b8d33f0 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/sigvec.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sigvec.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sigvec) + ret diff --git a/lib/libc4.3tahoe/vax/sys/socket.s b/lib/libc4.3tahoe/vax/sys/socket.s new file mode 100644 index 0000000..3df9f9b --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/socket.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)socket.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(socket) + ret diff --git a/lib/libc4.3tahoe/vax/sys/socketpair.s b/lib/libc4.3tahoe/vax/sys/socketpair.s new file mode 100644 index 0000000..b24d016 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/socketpair.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)socketpair.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(socketpair) + ret diff --git a/lib/libc4.3tahoe/vax/sys/stat.s b/lib/libc4.3tahoe/vax/sys/stat.s new file mode 100644 index 0000000..8ef209e --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/stat.s @@ -0,0 +1,26 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)stat.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + + +#include "SYS.h" + +SYSCALL(stat) + ret diff --git a/lib/libc4.3tahoe/vax/sys/swapon.s b/lib/libc4.3tahoe/vax/sys/swapon.s new file mode 100644 index 0000000..bfa11ef --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/swapon.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)swapon.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(swapon) + ret diff --git a/lib/libc4.3tahoe/vax/sys/symlink.s b/lib/libc4.3tahoe/vax/sys/symlink.s new file mode 100644 index 0000000..20a99e4 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/symlink.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)symlink.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(symlink) + ret diff --git a/lib/libc4.3tahoe/vax/sys/sync.s b/lib/libc4.3tahoe/vax/sys/sync.s new file mode 100644 index 0000000..4ad42b6 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/sync.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)sync.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(sync) + ret diff --git a/lib/libc4.3tahoe/vax/sys/syscall.s b/lib/libc4.3tahoe/vax/sys/syscall.s new file mode 100644 index 0000000..cc9e380 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/syscall.s @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)syscall.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +ENTRY(syscall) + movl 4(ap),r0 # syscall number + subl3 $1,(ap)+,(ap) # one fewer arguments + chmk r0 + jcs 1f + ret +1: + jmp cerror diff --git a/lib/libc4.3tahoe/vax/sys/truncate.s b/lib/libc4.3tahoe/vax/sys/truncate.s new file mode 100644 index 0000000..c5764d3 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/truncate.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)truncate.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(truncate) + ret diff --git a/lib/libc4.3tahoe/vax/sys/umask.s b/lib/libc4.3tahoe/vax/sys/umask.s new file mode 100644 index 0000000..5917a8d --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/umask.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)umask.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(umask) + ret diff --git a/lib/libc4.3tahoe/vax/sys/umount.s b/lib/libc4.3tahoe/vax/sys/umount.s new file mode 100644 index 0000000..a0d24c9 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/umount.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)umount.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(umount) + ret diff --git a/lib/libc4.3tahoe/vax/sys/unlink.s b/lib/libc4.3tahoe/vax/sys/unlink.s new file mode 100644 index 0000000..6e401c9 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/unlink.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)unlink.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(unlink) + ret diff --git a/lib/libc4.3tahoe/vax/sys/utimes.s b/lib/libc4.3tahoe/vax/sys/utimes.s new file mode 100644 index 0000000..53bede3 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/utimes.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)utimes.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(utimes) + ret diff --git a/lib/libc4.3tahoe/vax/sys/vhangup.s b/lib/libc4.3tahoe/vax/sys/vhangup.s new file mode 100644 index 0000000..bc2066f --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/vhangup.s @@ -0,0 +1,27 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)vhangup.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +#define SYS_vhangup 76 + +SYSCALL(vhangup) + ret diff --git a/lib/libc4.3tahoe/vax/sys/wait.s b/lib/libc4.3tahoe/vax/sys/wait.s new file mode 100644 index 0000000..95e676e --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/wait.s @@ -0,0 +1,29 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)wait.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(wait) + tstl 4(ap) + jeql 1f + movl r1,*4(ap) +1: + ret diff --git a/lib/libc4.3tahoe/vax/sys/wait3.s b/lib/libc4.3tahoe/vax/sys/wait3.s new file mode 100644 index 0000000..50c4253 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/wait3.s @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)wait3.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +/* @(#)wait3.s 5.5 (Berkeley) 6/27/88 */ + +/* + * C library -- wait3 + * + * pid = wait3(&status, flags, &rusage); + * + * pid == -1 if error + * status indicates fate of process, if given + * flags may indicate process is not to hang or + * that untraced stopped children are to be reported. + * rusage optionally returns detailed resource usage information + */ +#include "SYS.h" + +#define SYS_wait3 SYS_wait + +ENTRY(wait3) + movl 8(ap),r0 /* make it easy for system to get */ + movl 12(ap),r1 /* these extra arguments */ + bispsw $0xf /* flags wait3() */ + chmk $SYS_wait3 + bcc noerror + movl r0,_errno + mnegl $1,r0 + ret +noerror: + tstl 4(ap) /* status desired? */ + beql nostatus /* no */ + movl r1,*4(ap) /* store child's status */ +nostatus: + ret diff --git a/lib/libc4.3tahoe/vax/sys/write.s b/lib/libc4.3tahoe/vax/sys/write.s new file mode 100644 index 0000000..f58eeb5 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/write.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)write.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(write) + ret diff --git a/lib/libc4.3tahoe/vax/sys/writev.s b/lib/libc4.3tahoe/vax/sys/writev.s new file mode 100644 index 0000000..43f19b0 --- /dev/null +++ b/lib/libc4.3tahoe/vax/sys/writev.s @@ -0,0 +1,25 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(SYSLIBC_SCCS) && !defined(lint) + .asciz "@(#)writev.s 5.5 (Berkeley) 6/27/88" +#endif /* SYSLIBC_SCCS and not lint */ + +#include "SYS.h" + +SYSCALL(writev) + ret diff --git a/lib/libstdc/a.out.h b/lib/libstdc/a.out.h index aa9db2d..ee338c8 100644 --- a/lib/libstdc/a.out.h +++ b/lib/libstdc/a.out.h @@ -1,8 +1,3 @@ -#ifndef _A_OUT_H_ -#define _A_OUT_H_ - -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -16,7 +11,7 @@ * and magic numbers are shared with * the kernel. */ -/*#include */ +#include /* * Macros which take exec structures as arguments and tell whether @@ -44,6 +39,4 @@ unsigned int r_symbolnum:24, /* local symbol ordinal */ :4; /* nothing, yet */ }; -/*#include */ - -#endif +#include diff --git a/lib/libstdc/ar.h b/lib/libstdc/ar.h index 64dc4b0..8780c1f 100644 --- a/lib/libstdc/ar.h +++ b/lib/libstdc/ar.h @@ -1,7 +1,3 @@ -#ifndef _AR_H_ -#define _AR_H_ - - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -24,5 +20,3 @@ struct ar_hdr { char ar_size[10]; char ar_fmag[2]; }; - -#endif diff --git a/lib/libstdc/arpa/ftp.h b/lib/libstdc/arpa/ftp.h index bf070fc..187a875 100644 --- a/lib/libstdc/arpa/ftp.h +++ b/lib/libstdc/arpa/ftp.h @@ -1,7 +1,3 @@ -#ifndef _ARPA_FTP_H_ -#define _ARPA_FTP_H_ - - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -69,5 +65,3 @@ #define BLK_RESTART 0x10 /* Block is Restart Marker */ #define BLK_BYTECOUNT 2 /* Bytes in this block */ - -#endif diff --git a/lib/libstdc/arpa/inet.h b/lib/libstdc/arpa/inet.h index 0e3e7a8..af957ca 100644 --- a/lib/libstdc/arpa/inet.h +++ b/lib/libstdc/arpa/inet.h @@ -1,7 +1,3 @@ -#ifndef _ARPA_INET_H_ -#define _ARPA_INET_H_ - - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,9 +10,7 @@ * External definitions for * functions in inet(3N) */ -/*unsigned long inet_addr();*/ -/*char *inet_ntoa();*/ -/*struct in_addr inet_makeaddr();*/ -/*unsigned long inet_network();*/ - -#endif +unsigned long inet_addr(); +char *inet_ntoa(); +struct in_addr inet_makeaddr(); +unsigned long inet_network(); diff --git a/lib/libstdc/arpa/nameser.h b/lib/libstdc/arpa/nameser.h index 4835caa..2b85ac3 100644 --- a/lib/libstdc/arpa/nameser.h +++ b/lib/libstdc/arpa/nameser.h @@ -1,8 +1,3 @@ -#ifndef _ARPA_NAMESER_H_ -#define _ARPA_NAMESER_H_ - -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -157,7 +152,5 @@ struct rrec { char *r_data; /* pointer to data */ }; -/*extern u_short getshort();*/ -/*extern u_long getlong();*/ - -#endif +extern u_short getshort(); +extern u_long getlong(); diff --git a/lib/libstdc/arpa/telnet.h b/lib/libstdc/arpa/telnet.h index b0240af..1c5b435 100644 --- a/lib/libstdc/arpa/telnet.h +++ b/lib/libstdc/arpa/telnet.h @@ -1,7 +1,3 @@ -#ifndef _ARPA_TELNET_H_ -#define _ARPA_TELNET_H_ - - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -84,5 +80,3 @@ char *telopts[NTELOPTS] = { /* sub-option qualifiers */ #define TELQUAL_IS 0 /* option is... */ #define TELQUAL_SEND 1 /* send option */ - -#endif diff --git a/lib/libstdc/arpa/tftp.h b/lib/libstdc/arpa/tftp.h index f75941b..73c536c 100644 --- a/lib/libstdc/arpa/tftp.h +++ b/lib/libstdc/arpa/tftp.h @@ -1,7 +1,3 @@ -#ifndef _ARPA_TFTP_H_ -#define _ARPA_TFTP_H_ - - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -50,5 +46,3 @@ struct tftphdr { #define EBADID 5 /* unknown transfer ID */ #define EEXISTS 6 /* file already exists */ #define ENOUSER 7 /* no such user */ - -#endif diff --git a/lib/libstdc/assert.h b/lib/libstdc/assert.h index 35a6e88..1529b79 100644 --- a/lib/libstdc/assert.h +++ b/lib/libstdc/assert.h @@ -1,17 +1,9 @@ -#ifndef _ASSERT_H_ -#define _ASSERT_H_ - -#include -#include - /* assert.h 4.2 85/01/21 */ -/*# ifndef NDEBUG*/ +# ifndef NDEBUG # define _assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file \"%s\", line %d\n", __FILE__, __LINE__);exit(1);}} # define assert(ex) _assert(ex) # else # define _assert(ex) # define assert(ex) -/*# endif*/ - -#endif +# endif diff --git a/lib/libstdc/compat-4.1.h b/lib/libstdc/compat-4.1.h deleted file mode 100644 index cec222f..0000000 --- a/lib/libstdc/compat-4.1.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef _COMPAT_4_1_H_ -#define _COMPAT_4_1_H_ - -#include -#include -#include -#include -#include -#include -#include - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* compat-4.1/getpw.c */ -int getpw __P((int uid, char buf[])); - -/* compat-4.1/pause.c */ -int pause __P((void)); - -/* compat-4.1/rand.c */ -int srand __P((unsigned x)); -int rand __P((void)); - -/* compat-4.1/tell.c */ -long tell __P((int f)); - -#endif diff --git a/lib/libstdc/compat-4.1/ftime.c b/lib/libstdc/compat-4.1/ftime.c index dade494..243902d 100644 --- a/lib/libstdc/compat-4.1/ftime.c +++ b/lib/libstdc/compat-4.1/ftime.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,10 +6,10 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ftime.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * Backwards compatible ftime. @@ -27,7 +23,9 @@ struct timeb { short dstflag; }; -int ftime(tp) register struct timeb *tp; { +ftime(tp) + register struct timeb *tp; +{ struct timeval t; struct timezone tz; diff --git a/lib/libstdc/compat-4.1/getpw.c b/lib/libstdc/compat-4.1/getpw.c index e8f29d8..b80ec3e 100644 --- a/lib/libstdc/compat-4.1/getpw.c +++ b/lib/libstdc/compat-4.1/getpw.c @@ -1,6 +1,4 @@ -#include #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,11 +7,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getpw.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int getpw(uid, buf) int uid; char buf[]; { +getpw(uid, buf) +int uid; +char buf[]; +{ static FILE *pwf; register n, c; register char *bp; diff --git a/lib/libstdc/compat-4.1/gtty.c b/lib/libstdc/compat-4.1/gtty.c index 0793068..0122bab 100644 --- a/lib/libstdc/compat-4.1/gtty.c +++ b/lib/libstdc/compat-4.1/gtty.c @@ -1,5 +1,4 @@ #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,15 +7,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gtty.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Writearound to old gtty system call. */ -/*#include */ +#include -int gtty(fd, ap) int fd; struct sgttyb *ap; { +gtty(fd, ap) + struct sgttyb *ap; +{ return(ioctl(fd, TIOCGETP, ap)); } diff --git a/lib/libstdc/compat-4.1/nice.c b/lib/libstdc/compat-4.1/nice.c index 20b16d9..9a2fa22 100644 --- a/lib/libstdc/compat-4.1/nice.c +++ b/lib/libstdc/compat-4.1/nice.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,15 +6,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)nice.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * Backwards compatible nice. */ -int nice(incr) int incr; { +nice(incr) + int incr; +{ int prio; extern int errno; diff --git a/lib/libstdc/compat-4.1/pause.c b/lib/libstdc/compat-4.1/pause.c index 80a6428..24d80cf 100644 --- a/lib/libstdc/compat-4.1/pause.c +++ b/lib/libstdc/compat-4.1/pause.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,12 +6,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)pause.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Backwards compatible pause. */ -int pause() { +pause() +{ sigpause(sigblock(0)); } diff --git a/lib/libstdc/compat-4.1/rand.c b/lib/libstdc/compat-4.1/rand.c index c4494e5..009914c 100644 --- a/lib/libstdc/compat-4.1/rand.c +++ b/lib/libstdc/compat-4.1/rand.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,14 +6,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)rand.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint static long randx = 1; -int srand(x) unsigned x; { +srand(x) +unsigned x; +{ randx = x; } -int rand() { +rand() +{ return((randx = randx * 1103515245 + 12345) & 0x7fffffff); } diff --git a/lib/libstdc/compat-4.1/stty.c b/lib/libstdc/compat-4.1/stty.c index dabc3f2..f429cc6 100644 --- a/lib/libstdc/compat-4.1/stty.c +++ b/lib/libstdc/compat-4.1/stty.c @@ -1,5 +1,4 @@ #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,15 +7,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)stty.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Writearound to old stty system call. */ -/*#include */ +#include -int stty(fd, ap) int fd; struct sgttyb *ap; { +stty(fd, ap) + struct sgttyb *ap; +{ return(ioctl(fd, TIOCSETP, ap)); } diff --git a/lib/libstdc/compat-4.1/tell.c b/lib/libstdc/compat-4.1/tell.c index 67d866c..68a4ba1 100644 --- a/lib/libstdc/compat-4.1/tell.c +++ b/lib/libstdc/compat-4.1/tell.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,14 +6,15 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)tell.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * return offset in file. */ -/*long lseek();*/ +long lseek(); -long tell(f) int f; { +long tell(f) +{ return(lseek(f, 0L, 1)); } diff --git a/lib/libstdc/compat-4.1/times.c b/lib/libstdc/compat-4.1/times.c index 4a7e555..df9e088 100644 --- a/lib/libstdc/compat-4.1/times.c +++ b/lib/libstdc/compat-4.1/times.c @@ -1,7 +1,4 @@ -#include -#include #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,10 +7,10 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)times.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * Backwards compatible times. @@ -25,9 +22,9 @@ struct tms { int tms_cstime; /* system time, children */ }; -static scale60 __P((register struct timeval *tvp)); - -int times(tmsp) register struct tms *tmsp; { +times(tmsp) + register struct tms *tmsp; +{ struct rusage ru; if (getrusage(RUSAGE_SELF, &ru) < 0) @@ -41,7 +38,10 @@ int times(tmsp) register struct tms *tmsp; { return (0); } -static scale60(tvp) register struct timeval *tvp; { +static +scale60(tvp) + register struct timeval *tvp; +{ return (tvp->tv_sec * 60 + tvp->tv_usec / 16667); } diff --git a/lib/libstdc/compat-4.1/utime.c b/lib/libstdc/compat-4.1/utime.c index 8f80564..3e0b150 100644 --- a/lib/libstdc/compat-4.1/utime.c +++ b/lib/libstdc/compat-4.1/utime.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,14 +6,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)utime.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include /* * Backwards compatible utime. */ -int utime(name, otv) char *name; int otv[]; { +utime(name, otv) + char *name; + int otv[]; +{ struct timeval tv[2]; tv[0].tv_sec = otv[0]; tv[0].tv_usec = 0; diff --git a/lib/libstdc/compat-4.1/vlimit.c b/lib/libstdc/compat-4.1/vlimit.c index 52aafa3..ea853cc 100644 --- a/lib/libstdc/compat-4.1/vlimit.c +++ b/lib/libstdc/compat-4.1/vlimit.c @@ -1,7 +1,5 @@ #include -#include #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,14 +8,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vlimit.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * (Almost) backwards compatible vlimit. */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include /* LIM_NORAISE is not emulated */ #define LIM_NORAISE 0 /* if <> 0, can't raise limits */ @@ -30,7 +28,9 @@ static char sccsid[] = "@(#)vlimit.c 5.2 (Berkeley) 3/9/86"; #define NLIMITS 6 -int vlimit(limit, value) int limit; int value; { +vlimit(limit, value) + int limit, value; +{ struct rlimit rlim; if (limit <= 0 || limit > NLIMITS) diff --git a/lib/libstdc/compat-4.1/vtimes.c b/lib/libstdc/compat-4.1/vtimes.c index 4c85917..5c0c536 100644 --- a/lib/libstdc/compat-4.1/vtimes.c +++ b/lib/libstdc/compat-4.1/vtimes.c @@ -1,7 +1,4 @@ -#include -#include #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,10 +7,10 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vtimes.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * Backwards compatible vtimes. @@ -32,10 +29,9 @@ struct vtimes { int vm_oublk; /* block writes */ }; -static getvtimes __P((register struct rusage *aru, register struct vtimes *avt)); -static scale60 __P((register struct timeval *tvp)); - -int vtimes(par, chi) register struct vtimes *par; register struct vtimes *chi; { +vtimes(par, chi) + register struct vtimes *par, *chi; +{ struct rusage ru; if (par) { @@ -51,7 +47,11 @@ int vtimes(par, chi) register struct vtimes *par; register struct vtimes *chi; { return (0); } -static getvtimes(aru, avt) register struct rusage *aru; register struct vtimes *avt; { +static +getvtimes(aru, avt) + register struct rusage *aru; + register struct vtimes *avt; +{ avt->vm_utime = scale60(&aru->ru_utime); avt->vm_stime = scale60(&aru->ru_stime); @@ -65,7 +65,10 @@ static getvtimes(aru, avt) register struct rusage *aru; register struct vtimes * avt->vm_oublk = aru->ru_oublock; } -static scale60(tvp) register struct timeval *tvp; { +static +scale60(tvp) + register struct timeval *tvp; +{ return (tvp->tv_sec * 60 + tvp->tv_usec / 16667); } diff --git a/lib/libstdc/compat-sys5.h b/lib/libstdc/compat-sys5.h deleted file mode 100644 index b93b09b..0000000 --- a/lib/libstdc/compat-sys5.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef _COMPAT_SYS5_H_ -#define _COMPAT_SYS5_H_ - -#include -#include - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* compat-sys5/getopt.c */ -int getopt __P((int nargc, char **nargv, char *ostr)); - -/* compat-sys5/tmpnam.c */ -char *tmpnam __P((char *s)); - -#endif diff --git a/lib/libstdc/compat-sys5/getopt.c b/lib/libstdc/compat-sys5/getopt.c index 13f9512..6905a61 100644 --- a/lib/libstdc/compat-sys5/getopt.c +++ b/lib/libstdc/compat-sys5/getopt.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,9 +6,9 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getopt.c 4.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include /* * get option letter from argument vector @@ -27,7 +23,11 @@ char *optarg; /* argument associated with option */ #define tell(s) if (opterr) {fputs(*nargv,stderr);fputs(s,stderr); \ fputc(optopt,stderr);fputc('\n',stderr);return(BADCH);} -int getopt(nargc, nargv, ostr) int nargc; char **nargv; char *ostr; { +getopt(nargc,nargv,ostr) +int nargc; +char **nargv, + *ostr; +{ static char *place = EMSG; /* option letter processing */ register char *oli; /* option letter list index */ char *index(); diff --git a/lib/libstdc/compat-sys5/memccpy.c b/lib/libstdc/compat-sys5/memccpy.c index 58b0918..381a24f 100644 --- a/lib/libstdc/compat-sys5/memccpy.c +++ b/lib/libstdc/compat-sys5/memccpy.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,7 +12,11 @@ static char sccsid[] = "@(#)memccpy.c 5.2 (Berkeley) 86/03/09"; #endif -char *memccpy(t, f, c, n) register char *t; register char *f; register c; register n; { +char * +memccpy(t, f, c, n) + register char *t, *f; + register c, n; +{ while (--n >= 0) if ((*t++ = *f++) == c) return (t); diff --git a/lib/libstdc/compat-sys5/memchr.c b/lib/libstdc/compat-sys5/memchr.c index cfdc891..3093347 100644 --- a/lib/libstdc/compat-sys5/memchr.c +++ b/lib/libstdc/compat-sys5/memchr.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,7 +12,11 @@ static char sccsid[] = "@(#)memchr.c 5.2 (Berkeley) 86/03/09"; #endif -char *memchr(s, c, n) register char *s; register c; register n; { +char * +memchr(s, c, n) + register char *s; + register c, n; +{ while (--n >= 0) if (*s++ == c) return (--s); diff --git a/lib/libstdc/compat-sys5/memcmp.c b/lib/libstdc/compat-sys5/memcmp.c index 337e270..e6b2a50 100644 --- a/lib/libstdc/compat-sys5/memcmp.c +++ b/lib/libstdc/compat-sys5/memcmp.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,7 +12,10 @@ static char sccsid[] = "@(#)memcmp.c 5.2 (Berkeley) 86/03/09"; #endif -int memcmp(s1, s2, n) register char *s1; register char *s2; register n; { +memcmp(s1, s2, n) + register char *s1, *s2; + register n; +{ while (--n >= 0) if (*s1++ != *s2++) return (*--s1 - *--s2); diff --git a/lib/libstdc/compat-sys5/memcpy.c b/lib/libstdc/compat-sys5/memcpy.c index 5c196c4..487fd70 100644 --- a/lib/libstdc/compat-sys5/memcpy.c +++ b/lib/libstdc/compat-sys5/memcpy.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,7 +12,11 @@ static char sccsid[] = "@(#)memcpy.c 5.2 (Berkeley) 86/03/09"; #endif -char *memcpy(t, f, n) register char *t; register char *f; register n; { +char * +memcpy(t, f, n) + register char *t, *f; + register n; +{ register char *p = t; while (--n >= 0) diff --git a/lib/libstdc/compat-sys5/memset.c b/lib/libstdc/compat-sys5/memset.c index 2726efe..2600ed5 100644 --- a/lib/libstdc/compat-sys5/memset.c +++ b/lib/libstdc/compat-sys5/memset.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,7 +12,11 @@ static char sccsid[] = "@(#)memset.c 5.2 (Berkeley) 86/03/09"; #endif -char *memset(s, c, n) register char *s; register c; register n; { +char * +memset(s, c, n) + register char *s; + register c, n; +{ register char *p = s; while (--n >= 0) diff --git a/lib/libstdc/compat-sys5/strcatn.c b/lib/libstdc/compat-sys5/strcatn.c index 56120c1..8db783b 100644 --- a/lib/libstdc/compat-sys5/strcatn.c +++ b/lib/libstdc/compat-sys5/strcatn.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcatn.c 4.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Concatenate s2 on the end of s1. S1's space must be large enough. @@ -16,7 +14,11 @@ static char sccsid[] = "@(#)strcatn.c 4.3 (Berkeley) 3/9/86"; * Return s1. */ -char *strcatn(s1, s2, n) register char *s1; register char *s2; register n; { +char * +strcatn(s1, s2, n) +register char *s1, *s2; +register n; +{ register char *os1; os1 = s1; diff --git a/lib/libstdc/compat-sys5/strchr.c b/lib/libstdc/compat-sys5/strchr.c index 5fc2672..24c9b31 100644 --- a/lib/libstdc/compat-sys5/strchr.c +++ b/lib/libstdc/compat-sys5/strchr.c @@ -1,8 +1,6 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strchr.c 5.2 (Berkeley) 86/03/09"; -#endif +#endif LIBC_SCCS and not lint /* * Return the ptr in sp at which the character c appears; @@ -13,7 +11,10 @@ static char sccsid[] = "@(#)strchr.c 5.2 (Berkeley) 86/03/09"; #define NULL 0 -char *strchr(sp, c) register char *sp; int c; { +char * +strchr(sp, c) +register char *sp, c; +{ do { if (*sp == c) return(sp); diff --git a/lib/libstdc/compat-sys5/strcmpn.c b/lib/libstdc/compat-sys5/strcmpn.c index 182ad22..5e5d4f7 100644 --- a/lib/libstdc/compat-sys5/strcmpn.c +++ b/lib/libstdc/compat-sys5/strcmpn.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,13 +6,16 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcmpn.c 4.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Compare strings (at most n bytes): s1>s2: >0 s1==s2: 0 s1= 0 && *s1 == *s2++) if (*s1++ == '\0') diff --git a/lib/libstdc/compat-sys5/strcpyn.c b/lib/libstdc/compat-sys5/strcpyn.c index 83134b8..f791647 100644 --- a/lib/libstdc/compat-sys5/strcpyn.c +++ b/lib/libstdc/compat-sys5/strcpyn.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,14 +6,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcpyn.c 4.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Copy s2 to s1, truncating or null-padding to always copy n bytes * return s1 */ -char *strcpyn(s1, s2, n) register char *s1; register char *s2; int n; { +char * +strcpyn(s1, s2, n) +register char *s1, *s2; +{ register i; register char *os1; diff --git a/lib/libstdc/compat-sys5/strcspn.c b/lib/libstdc/compat-sys5/strcspn.c index 60867ff..f32fa1a 100644 --- a/lib/libstdc/compat-sys5/strcspn.c +++ b/lib/libstdc/compat-sys5/strcspn.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,7 +12,9 @@ static char sccsid[] = "@(#)strcspn.c 5.2 (Berkeley) 86/03/09"; #endif -int strcspn(s, set) register char *s; register char *set; { +strcspn(s, set) + register char *s, *set; +{ register n = 0; register char *p; register c; diff --git a/lib/libstdc/compat-sys5/strpbrk.c b/lib/libstdc/compat-sys5/strpbrk.c index 5d2462f..b1a2727 100644 --- a/lib/libstdc/compat-sys5/strpbrk.c +++ b/lib/libstdc/compat-sys5/strpbrk.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,7 +12,10 @@ static char sccsid[] = "@(#)strpbrk.c 5.2 (Berkeley) 86/03/09"; #endif -char *strpbrk(s, brk) register char *s; register char *brk; { +char * +strpbrk(s, brk) + register char *s, *brk; +{ register char *p; register c; diff --git a/lib/libstdc/compat-sys5/strrchr.c b/lib/libstdc/compat-sys5/strrchr.c index 07e8f05..ec71ac6 100644 --- a/lib/libstdc/compat-sys5/strrchr.c +++ b/lib/libstdc/compat-sys5/strrchr.c @@ -1,8 +1,6 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strrchr.c 5.2 (berkeley) 86/03/09"; -#endif +#endif LIBC_SCCS and not lint /* * Return the ptr in sp at which the character c last @@ -13,7 +11,10 @@ static char sccsid[] = "@(#)strrchr.c 5.2 (berkeley) 86/03/09"; #define NULL 0 -char *strrchr(sp, c) register char *sp; int c; { +char * +strrchr(sp, c) +register char *sp, c; +{ register char *r; r = NULL; diff --git a/lib/libstdc/compat-sys5/strspn.c b/lib/libstdc/compat-sys5/strspn.c index af60b4a..8185083 100644 --- a/lib/libstdc/compat-sys5/strspn.c +++ b/lib/libstdc/compat-sys5/strspn.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,7 +12,9 @@ static char sccsid[] = "@(#)strspn.c 5.2 (Berkeley) 86/03/09"; #endif -int strspn(s, set) register char *s; register char *set; { +strspn(s, set) + register char *s, *set; +{ register n = 0; register char *p; register c; diff --git a/lib/libstdc/compat-sys5/strtok.c b/lib/libstdc/compat-sys5/strtok.c index a4f8a77..e378a0a 100644 --- a/lib/libstdc/compat-sys5/strtok.c +++ b/lib/libstdc/compat-sys5/strtok.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -15,7 +12,10 @@ static char sccsid[] = "@(#)strtok.c 5.2 (Berkeley) 86/03/09"; #endif -char *strtok(s, sep) register char *s; register char *sep; { +char * +strtok(s, sep) + register char *s, *sep; +{ register char *p; register c; static char *lasts; diff --git a/lib/libstdc/compat-sys5/tmpnam.c b/lib/libstdc/compat-sys5/tmpnam.c index c276c79..7b42ba7 100644 --- a/lib/libstdc/compat-sys5/tmpnam.c +++ b/lib/libstdc/compat-sys5/tmpnam.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,9 +6,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)tmpnam.c 4.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -char *tmpnam(s) char *s; { +char *tmpnam(s) +char *s; +{ static seed; sprintf(s, "temp.%d.%d", getpid(), seed++); diff --git a/lib/libstdc/csu.h b/lib/libstdc/csu.h deleted file mode 100644 index fd35a4b..0000000 --- a/lib/libstdc/csu.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _CSU_H_ -#define _CSU_H_ - - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* csu/crt0.c */ -int start __P((void)); -int exit __P((register int code)); -int moncontrol __P((int val)); - -/* csu/gmon.c */ -int monstartup __P((char *lowpc, char *highpc)); -int _mcleanup __P((void)); -int mcount __P((void)); -int monitor __P((char *lowpc, char *highpc, char *buf, int bufsiz, int nfunc)); -int moncontrol __P((int mode)); - -/* csu/mon.c */ -int monstartup __P((char *lowpc, char *highpc)); -int mcount __P((void)); -int monitor __P((char *lowpc, char *highpc, char *buf, int bufsiz, int cntsiz)); -int moncontrol __P((int mode)); - -#endif diff --git a/lib/libstdc/csu/crt0.c b/lib/libstdc/csu/crt0.c index 3de54d2..5e54328 100644 --- a/lib/libstdc/csu/crt0.c +++ b/lib/libstdc/csu/crt0.c @@ -1,8 +1,3 @@ -#include -#include -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)crt0.c 5.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * C start up routine. @@ -40,7 +35,8 @@ asm("#define _start start"); asm("#define _eprol eprol"); extern unsigned char etext; extern unsigned char eprol; -int start() { +start() +{ struct kframe { int kargc; char *kargv[1]; /* size depends on kargc */ @@ -59,9 +55,9 @@ int start() { #ifdef lint kfp = 0; initcode = initcode = 0; -#else +#else not lint asm(" movl sp,r10"); /* catch it quick */ -#endif +#endif not lint for (argv = targv = &kfp->kargv[0]; *targv++; /* void */) /* void */ ; if (targv >= (char **)(*argv)) @@ -82,11 +78,11 @@ asm("eprol:"); fd = open("/dev/null", 2); } while (fd >= 0 && fd < 3); close(fd); -#endif +#endif paranoid #ifdef MCRT0 monstartup(&eprol, &etext); -#endif +#endif MCRT0 errno = 0; exit(main(kfp->kargc, argv, environ)); } @@ -95,22 +91,26 @@ asm("#undef _eprol"); #ifdef MCRT0 /*ARGSUSED*/ -int exit(code) register int code; /* r11 */ { +exit(code) + register int code; /* r11 */ +{ monitor(0); _cleanup(); asm(" movl r11,r0"); asm(" chmk $1"); } -#endif +#endif MCRT0 #ifdef CRT0 /* * null mcount and moncontrol, * just in case some routine is compiled for profiling */ -int moncontrol(val) int val; { +moncontrol(val) + int val; +{ } asm(" .globl mcount"); asm("mcount: rsb"); -#endif +#endif CRT0 diff --git a/lib/libstdc/csu/gmon.c b/lib/libstdc/csu/gmon.c index 9c0a657..cefa825 100644 --- a/lib/libstdc/csu/gmon.c +++ b/lib/libstdc/csu/gmon.c @@ -1,10 +1,3 @@ -#include -#include -#include -#include -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -13,13 +6,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gmon.c 5.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint #ifdef DEBUG -/*#include */ -#endif +#include +#endif DEBUG -/*#include "gmon.h"*/ +#include "gmon.h" /* * froms is actually a bunch of unsigned shorts indexing tos @@ -40,7 +33,10 @@ static int s_scale; #define MSG "No space for monitor buffer(s)\n" -int monstartup(lowpc, highpc) char *lowpc; char *highpc; { +monstartup(lowpc, highpc) + char *lowpc; + char *highpc; +{ int monsize; char *buffer; char *sbrk(); @@ -87,7 +83,8 @@ int monstartup(lowpc, highpc) char *lowpc; char *highpc; { monitor( lowpc , highpc , buffer , monsize , tolimit ); } -int _mcleanup() { +_mcleanup() +{ int fd; int fromindex; int endfrom; @@ -102,7 +99,7 @@ int _mcleanup() { } # ifdef DEBUG fprintf( stderr , "[mcleanup] sbuf 0x%x ssiz %d\n" , sbuf , ssiz ); -# endif +# endif DEBUG write( fd , sbuf , ssiz ); endfrom = s_textsize / (HASHFRACTION * sizeof(*froms)); for ( fromindex = 0 ; fromindex < endfrom ; fromindex++ ) { @@ -115,7 +112,7 @@ int _mcleanup() { fprintf( stderr , "[mcleanup] frompc 0x%x selfpc 0x%x count %d\n" , frompc , tos[toindex].selfpc , tos[toindex].count ); -# endif +# endif DEBUG rawarc.raw_frompc = (unsigned long) frompc; rawarc.raw_selfpc = (unsigned long) tos[toindex].selfpc; rawarc.raw_count = tos[toindex].count; @@ -129,7 +126,8 @@ asm(".text"); asm(".align 2"); asm("#the beginning of mcount()"); asm(".data"); -int mcount() { +mcount() +{ register char *selfpc; /* r11 => r5 */ register unsigned short *frompcindex; /* r10 => r4 */ register struct tostruct *top; /* r9 => r3 */ @@ -248,7 +246,13 @@ asm("#the end of mcount()"); asm(".data"); /*VARARGS1*/ -int monitor(lowpc, highpc, buf, bufsiz, nfunc) char *lowpc; char *highpc; char *buf; /* declared ``short buffer[]'' in monitor(3) */ int bufsiz; int nfunc; /* not used, available for compatability only */ { +monitor( lowpc , highpc , buf , bufsiz , nfunc ) + char *lowpc; + char *highpc; + char *buf; /* declared ``short buffer[]'' in monitor(3) */ + int bufsiz; + int nfunc; /* not used, available for compatability only */ +{ register o; if ( lowpc == 0 ) { @@ -277,7 +281,9 @@ int monitor(lowpc, highpc, buf, bufsiz, nfunc) char *lowpc; char *highpc; char * * profiling is what mcount checks to see if * all the data structures are ready. */ -int moncontrol(mode) int mode; { +moncontrol(mode) + int mode; +{ if (mode) { /* start */ profil(sbuf + sizeof(struct phdr), ssiz - sizeof(struct phdr), diff --git a/lib/libstdc/csu/mon.c b/lib/libstdc/csu/mon.c index 07b6405..60ab793 100644 --- a/lib/libstdc/csu/mon.c +++ b/lib/libstdc/csu/mon.c @@ -1,8 +1,3 @@ -#include -#include -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)mon.c 5.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint #define ARCDENSITY 5 /* density of routines */ #define MINARCS 50 /* minimum number of counters */ @@ -40,7 +35,10 @@ int numctrs; #define MSG "No space for monitor buffer(s)\n" -int monstartup(lowpc, highpc) char *lowpc; char *highpc; { +monstartup(lowpc, highpc) + char *lowpc; + char *highpc; +{ int monsize; char *buffer; int cntsiz; @@ -69,7 +67,8 @@ int monstartup(lowpc, highpc) char *lowpc; char *highpc; { asm(".text"); asm("#the beginning of mcount()"); asm(".data"); -int mcount() { +mcount() +{ register int *selfpc; /* r11 */ register long **cntp; /* r10 */ @@ -112,7 +111,11 @@ asm(".text"); asm("#the end of mcount()"); asm(".data"); -int monitor(lowpc, highpc, buf, bufsiz, cntsiz) char *lowpc; char *highpc; char *buf; int bufsiz; int cntsiz; { +monitor(lowpc, highpc, buf, bufsiz, cntsiz) + char *lowpc, *highpc; + char *buf; + int bufsiz, cntsiz; +{ register int o; struct phdr *php; static int ssiz; @@ -155,7 +158,9 @@ int monitor(lowpc, highpc, buf, bufsiz, cntsiz) char *lowpc; char *highpc; char * profiling is what mcount checks to see if * all the data structures are ready. */ -int moncontrol(mode) int mode; { +moncontrol(mode) + int mode; +{ if (mode) { /* start */ profil(s_sbuf, s_bufsiz, s_lowpc, s_scale); diff --git a/lib/libstdc/ctype.h b/lib/libstdc/ctype.h index fc64a35..83d853b 100644 --- a/lib/libstdc/ctype.h +++ b/lib/libstdc/ctype.h @@ -1,7 +1,3 @@ -#ifndef _CTYPE_H_ -#define _CTYPE_H_ - - /* ctype.h 4.2 85/09/04 */ #define _U 01 @@ -30,5 +26,3 @@ extern char _ctype_[]; #define toupper(c) ((c)-'a'+'A') #define tolower(c) ((c)-'A'+'a') #define toascii(c) ((c)&0177) - -#endif diff --git a/lib/libstdc/disktab.h b/lib/libstdc/disktab.h index 1b08928..060d15f 100644 --- a/lib/libstdc/disktab.h +++ b/lib/libstdc/disktab.h @@ -1,7 +1,3 @@ -#ifndef _DISKTAB_H_ -#define _DISKTAB_H_ - - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -32,17 +28,4 @@ struct disktab { } d_partitions[8]; }; -/*struct disktab *getdiskbyname();*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* gen/disktab.c */ -struct disktab *getdiskbyname __P((char *name)); - -#endif +struct disktab *getdiskbyname(); diff --git a/lib/libstdc/errno.h b/lib/libstdc/errno.h new file mode 120000 index 0000000..7280063 --- /dev/null +++ b/lib/libstdc/errno.h @@ -0,0 +1 @@ +sys/errno.h \ No newline at end of file diff --git a/lib/libstdc/fcntl.h b/lib/libstdc/fcntl.h new file mode 100644 index 0000000..5fd458f --- /dev/null +++ b/lib/libstdc/fcntl.h @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1983 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)fcntl.h 5.2 (Berkeley) 1/8/86 + */ + +/* + * Flag values accessible to open(2) and fcntl(2)-- copied from + * . (The first three can only be set by open.) + */ +#define O_RDONLY 000 /* open for reading */ +#define O_WRONLY 001 /* open for writing */ +#define O_RDWR 002 /* open for read & write */ +#define O_NDELAY FNDELAY /* non-blocking open */ + /* really non-blocking I/O for fcntl */ +#define O_APPEND FAPPEND /* append on each write */ +#define O_CREAT FCREAT /* open with file create */ +#define O_TRUNC FTRUNC /* open with truncation */ +#define O_EXCL FEXCL /* error on create if file exists */ + +#ifndef F_DUPFD +/* fcntl(2) requests */ +#define F_DUPFD 0 /* Duplicate fildes */ +#define F_GETFD 1 /* Get fildes flags */ +#define F_SETFD 2 /* Set fildes flags */ +#define F_GETFL 3 /* Get file flags */ +#define F_SETFL 4 /* Set file flags */ +#define F_GETOWN 5 /* Get owner */ +#define F_SETOWN 6 /* Set owner */ + +/* flags for F_GETFL, F_SETFL-- copied from */ +#define FNDELAY 00004 /* non-blocking reads */ +#define FAPPEND 00010 /* append on each write */ +#define FASYNC 00100 /* signal pgrp when data ready */ +#define FCREAT 01000 /* create if nonexistant */ +#define FTRUNC 02000 /* truncate to zero length */ +#define FEXCL 04000 /* error if already created */ +#endif diff --git a/lib/libstdc/fstab.h b/lib/libstdc/fstab.h index 2dc656e..c595c82 100644 --- a/lib/libstdc/fstab.h +++ b/lib/libstdc/fstab.h @@ -1,7 +1,3 @@ -#ifndef _FSTAB_H_ -#define _FSTAB_H_ - - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -38,27 +34,9 @@ struct fstab{ int fs_passno; /* pass number on parallel dump */ }; -/*struct fstab *getfsent();*/ -/*struct fstab *getfsspec();*/ -/*struct fstab *getfsfile();*/ -/*struct fstab *getfstype();*/ -/*int setfsent();*/ -/*int endfsent();*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* gen/fstab.c */ -int setfsent __P((void)); -int endfsent __P((void)); -struct fstab *getfsent __P((void)); -struct fstab *getfsspec __P((char *name)); -struct fstab *getfsfile __P((char *name)); -struct fstab *getfstype __P((char *type)); - -#endif +struct fstab *getfsent(); +struct fstab *getfsspec(); +struct fstab *getfsfile(); +struct fstab *getfstype(); +int setfsent(); +int endfsent(); diff --git a/lib/libstdc/gen.h b/lib/libstdc/gen.h index 71d1740..c0a77d9 100644 --- a/lib/libstdc/gen.h +++ b/lib/libstdc/gen.h @@ -1,143 +1,5 @@ -#ifndef _GEN_H_ -#define _GEN_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* gen/abort.c */ -int abort __P((void)); - -/* gen/abs.c */ -int abs __P((int i)); - -/* gen/atof.c */ -double atof __P((char *s)); - -/* gen/atoi.c */ -int atoi __P((register char *p)); - -/* gen/atol.c */ -long atol __P((register char *p)); - -/* gen/bcmp.c */ -int bcmp __P((register char *b1, register char *b2, register int length)); - -/* gen/bcopy.c */ -int bcopy __P((register char *src, register char *dst, register int length)); - -/* gen/bzero.c */ -int bzero __P((register char *b, register int length)); - -/* gen/calloc.c */ -char *calloc __P((register unsigned num, register unsigned size)); -int cfree __P((char *p, unsigned num, unsigned size)); - -/* gen/crypt.c */ -int setkey __P((char *key)); -int encrypt __P((char *block, int edflag)); -char *crypt __P((char *pw, char *salt)); - -/* gen/ecvt.c */ -char *ecvt __P((double arg, int ndigits, int *decpt, int *sign)); -char *fcvt __P((double arg, int ndigits, int *decpt, int *sign)); - -/* gen/fakcu.c */ -int _cleanup __P((void)); - -/* gen/ffs.c */ -int ffs __P((register long mask)); - -/* gen/frexp.c */ -double frexp __P((double x, int *i)); - -/* gen/gcvt.c */ -char *gcvt __P((double number, int ndigit, char *buf)); - -/* gen/getenv.c */ -char *getenv __P((register char *name)); - -/* gen/getpass.c */ -char *getpass __P((char *prompt)); - -/* gen/getusershell.c */ -char *getusershell __P((void)); -int endusershell __P((void)); -int setusershell __P((void)); - -/* gen/insque.c */ -int insque __P((register struct vaxque *e, register struct vaxque *prev)); - -/* gen/ldexp.c */ -double ldexp __P((double v, int e)); - -/* gen/malloc.c */ -char *malloc __P((unsigned nbytes)); -int morecore __P((int bucket)); -int free __P((char *cp)); -char *realloc __P((char *cp, unsigned nbytes)); -int mstats __P((char *s)); - -/* gen/mkstemp.c */ -int mkstemp __P((char *as)); - -/* gen/mktemp.c */ -char *mktemp __P((char *as)); - -/* gen/modf.c */ -double modf __P((double v, double *p)); - -/* gen/qsort.c */ -int qsort __P((char *base, int n, int size, int (*compar)(void))); - -/* gen/random.c */ -int srandom __P((unsigned x)); -char *initstate __P((unsigned seed, char *arg_state, int n)); -char *setstate __P((char *arg_state)); -long random __P((void)); - -/* gen/regex.c */ -char *re_comp __P((register char *sp)); -int re_exec __P((register char *p1)); -int backref __P((register int i, register char *lp)); -int cclass __P((register char *set, int c, int af)); - -/* gen/remque.c */ -int remque __P((register struct vaxque *e)); - -/* gen/swab.c */ -int swab __P((register char *from, register char *to, register int n)); - -/* gen/timezone.c */ -char *timezone __P((int zone, int dst)); - -/* gen/valloc.c */ -char *valloc __P((int i)); - -#endif +/* formerly duplicated in gen/insque.c and gen/remque.c */ +struct vaxque { /* queue format expected by VAX queue instructions */ + struct vaxque *vq_next; + struct vaxque *vq_prev; +}; diff --git a/lib/libstdc/gen/_setjmp.c b/lib/libstdc/gen/_setjmp.c index 05935e4..77a2a34 100644 --- a/lib/libstdc/gen/_setjmp.c +++ b/lib/libstdc/gen/_setjmp.c @@ -1,9 +1,7 @@ -#include #include - int _setjmp(e) jmp_buf e; { abort(); } -void _longjmp(e, v) jmp_buf e; int v; { +void _longjmp(e, v) jmp_buf e; { abort(); } diff --git a/lib/libstdc/gen/abort.c b/lib/libstdc/gen/abort.c index c3f8fd0..057f478 100644 --- a/lib/libstdc/gen/abort.c +++ b/lib/libstdc/gen/abort.c @@ -1,7 +1,5 @@ -#include -#include +#include #include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,13 +8,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)abort.c 5.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* C library -- abort */ -/*#include "signal.h"*/ +#include "signal.h" -int abort() { +abort() +{ sigblock(~0); signal(SIGILL, SIG_DFL); sigsetmask(~sigmask(SIGILL)); diff --git a/lib/libstdc/gen/abs.c b/lib/libstdc/gen/abs.c index 8cb6610..d2130ca 100644 --- a/lib/libstdc/gen/abs.c +++ b/lib/libstdc/gen/abs.c @@ -1,5 +1,3 @@ -#include - int abs(i) int i; { abort(); } diff --git a/lib/libstdc/gen/alarm.c b/lib/libstdc/gen/alarm.c index 2163d4c..81ed615 100644 --- a/lib/libstdc/gen/alarm.c +++ b/lib/libstdc/gen/alarm.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,14 +6,16 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)alarm.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Backwards compatible alarm. */ -/*#include */ +#include -int alarm(secs) int secs; { +alarm(secs) + int secs; +{ struct itimerval it, oitv; register struct itimerval *itp = ⁢ diff --git a/lib/libstdc/gen/atof.c b/lib/libstdc/gen/atof.c index 5d1d323..429843a 100644 --- a/lib/libstdc/gen/atof.c +++ b/lib/libstdc/gen/atof.c @@ -1,5 +1,3 @@ -#include - double atof(s) char *s; { abort(); } diff --git a/lib/libstdc/gen/atoi.c b/lib/libstdc/gen/atoi.c index e4f968f..e6f7be2 100644 --- a/lib/libstdc/gen/atoi.c +++ b/lib/libstdc/gen/atoi.c @@ -1,10 +1,10 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)atoi.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -int atoi(p) register char *p; { +atoi(p) +register char *p; +{ register int n; register int f; diff --git a/lib/libstdc/gen/atol.c b/lib/libstdc/gen/atol.c index 8259ae1..bbfab95 100644 --- a/lib/libstdc/gen/atol.c +++ b/lib/libstdc/gen/atol.c @@ -1,10 +1,11 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)atol.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -long atol(p) register char *p; { +long +atol(p) +register char *p; +{ long n; register int f; diff --git a/lib/libstdc/gen/bcmp.c b/lib/libstdc/gen/bcmp.c index a70579b..c914da9 100644 --- a/lib/libstdc/gen/bcmp.c +++ b/lib/libstdc/gen/bcmp.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,12 +6,15 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)bcmp.c 5.1 (Berkeley) 1/27/87"; -#endif +#endif LIBC_SCCS and not lint /* * bcmp -- vax cmpc3 instruction */ -int bcmp(b1, b2, length) register char *b1; register char *b2; register int length; { +bcmp(b1, b2, length) + register char *b1, *b2; + register int length; +{ if (length == 0) return (0); diff --git a/lib/libstdc/gen/bcopy.c b/lib/libstdc/gen/bcopy.c index 58d290f..4a974bc 100644 --- a/lib/libstdc/gen/bcopy.c +++ b/lib/libstdc/gen/bcopy.c @@ -1,6 +1,4 @@ -#include #include - /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,12 +7,15 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)bcopy.c 5.1 (Berkeley) 1/27/87"; -#endif +#endif LIBC_SCCS and not lint /* * bcopy -- vax movc3 instruction */ -int bcopy(src, dst, length) register char *src; register char *dst; register int length; { +bcopy(src, dst, length) + register char *src, *dst; + register int length; +{ if (length && src != dst) if ((u_int)dst < (u_int)src) if (((int)src | (int)dst | length) & 3) diff --git a/lib/libstdc/gen/bzero.c b/lib/libstdc/gen/bzero.c index 01dc1dd..748214a 100644 --- a/lib/libstdc/gen/bzero.c +++ b/lib/libstdc/gen/bzero.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,12 +6,15 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)bzero.c 5.1 (Berkeley) 1/27/87"; -#endif +#endif LIBC_SCCS and not lint /* * bzero -- vax movc5 instruction */ -int bzero(b, length) register char *b; register int length; { +bzero(b, length) + register char *b; + register int length; +{ if (length) do diff --git a/lib/libstdc/gen/calloc.c b/lib/libstdc/gen/calloc.c index 2b5b2b7..20e5422 100644 --- a/lib/libstdc/gen/calloc.c +++ b/lib/libstdc/gen/calloc.c @@ -1,13 +1,14 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)calloc.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Calloc - allocate and clear memory block */ -char *calloc(num, size) register unsigned num; register unsigned size; { +char * +calloc(num, size) + register unsigned num, size; +{ extern char *malloc(); register char *p; @@ -17,6 +18,10 @@ char *calloc(num, size) register unsigned num; register unsigned size; { return (p); } -int cfree(p, num, size) char *p; unsigned num; unsigned size; { +cfree(p, num, size) + char *p; + unsigned num; + unsigned size; +{ free(p); } diff --git a/lib/libstdc/gen/closedir.c b/lib/libstdc/gen/closedir.c index a6766a0..5b15e4d 100644 --- a/lib/libstdc/gen/closedir.c +++ b/lib/libstdc/gen/closedir.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,15 +6,18 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)closedir.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * close a directory. */ -void closedir(dirp) register DIR *dirp; { +void +closedir(dirp) + register DIR *dirp; +{ close(dirp->dd_fd); dirp->dd_fd = -1; dirp->dd_loc = 0; diff --git a/lib/libstdc/gen/crypt.c b/lib/libstdc/gen/crypt.c index 3ea5f87..6c17b88 100644 --- a/lib/libstdc/gen/crypt.c +++ b/lib/libstdc/gen/crypt.c @@ -1,8 +1,6 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)crypt.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * This program implements the @@ -115,7 +113,9 @@ static char e[] = { * Set up the key schedule from the key. */ -int setkey(key) char *key; { +setkey(key) +char *key; +{ register i, j, k; int t; @@ -239,7 +239,9 @@ static char preS[48]; * The payoff: encrypt a block. */ -int encrypt(block, edflag) char *block; int edflag; { +encrypt(block, edflag) +char *block; +{ int i, ii; register t, j, k; @@ -325,7 +327,11 @@ int encrypt(block, edflag) char *block; int edflag; { block[j] = L[FP[j]-1]; } -char *crypt(pw, salt) char *pw; char *salt; { +char * +crypt(pw,salt) +char *pw; +char *salt; +{ register i, j, c; int temp; static char block[66], iobuf[16]; diff --git a/lib/libstdc/gen/ctime.c b/lib/libstdc/gen/ctime.c index 7eb9b73..a60f7d7 100644 --- a/lib/libstdc/gen/ctime.c +++ b/lib/libstdc/gen/ctime.c @@ -1,7 +1,4 @@ -#include -#include #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,7 +7,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ctime.c 5.5 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * This routine converts time as follows. @@ -46,12 +43,13 @@ static char sccsid[] = "@(#)ctime.c 5.5 (Berkeley) 3/9/86"; * ctime(t) just calls localtime, then asctime. */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include static char cbuf[26]; -static int dmsize[12] = { +static int dmsize[12] = +{ 31, 28, 31, @@ -136,21 +134,24 @@ static struct dayrules { -1, }; -/*struct tm *gmtime();*/ -/*char *ct_numb();*/ -/*struct tm *localtime();*/ -/*char *ctime();*/ -/*char *ct_num();*/ -/*char *asctime();*/ - -static sunday __P((register struct tm *t, register int d)); -static char *ct_numb __P((register char *cp, int n)); +struct tm *gmtime(); +char *ct_numb(); +struct tm *localtime(); +char *ctime(); +char *ct_num(); +char *asctime(); -char *ctime(t) time_t *t; { +char * +ctime(t) +time_t *t; +{ return(asctime(localtime(t))); } -struct tm *localtime(tim) time_t *tim; { +struct tm * +localtime(tim) +time_t *tim; +{ register int dayno; register struct tm *ct; register dalybeg, daylend; @@ -211,13 +212,20 @@ struct tm *localtime(tim) time_t *tim; { * The value is the day number of the last * Sunday on or before the day. */ -static sunday(t, d) register struct tm *t; register int d; { +static +sunday(t, d) +register struct tm *t; +register int d; +{ if (d >= 58) d += dysize(t->tm_year) - 365; return(d - (d - t->tm_yday + t->tm_wday + 700) % 7); } -struct tm *gmtime(tim) time_t *tim; { +struct tm * +gmtime(tim) +time_t *tim; +{ register int d0, d1; long hms, day; register int *tp; @@ -276,7 +284,10 @@ struct tm *gmtime(tim) time_t *tim; { return(&xtime); } -char *asctime(t) struct tm *t; { +char * +asctime(t) +struct tm *t; +{ register char *cp, *ncp; register int *tp; @@ -306,13 +317,17 @@ char *asctime(t) struct tm *t; { return(cbuf); } -int dysize(y) int y; { +dysize(y) +{ if((y%4) == 0) return(366); return(365); } -static char *ct_numb(cp, n) register char *cp; int n; { +static char * +ct_numb(cp, n) +register char *cp; +{ cp++; if (n>=10) *cp++ = (n/10)%10 + '0'; diff --git a/lib/libstdc/gen/ctype_.c b/lib/libstdc/gen/ctype_.c index e981d94..d0cad2d 100644 --- a/lib/libstdc/gen/ctype_.c +++ b/lib/libstdc/gen/ctype_.c @@ -1,10 +1,9 @@ #include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ctype_.c 5.4 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include char _ctype_[1 + 256] = { 0, diff --git a/lib/libstdc/gen/disktab.c b/lib/libstdc/gen/disktab.c index 93916c5..4546c53 100644 --- a/lib/libstdc/gen/disktab.c +++ b/lib/libstdc/gen/disktab.c @@ -1,9 +1,3 @@ -#include -#include -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,22 +6,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)disktab.c 5.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ - -/*static char *dgetstr();*/ +#include +#include -static dgetent __P((char *bp, char *name)); -static dnamatch __P((char *np)); -static char *dskip __P((register char *bp)); -static dgetnum __P((char *id)); -static dgetflag __P((char *id)); -static char *dgetstr __P((char *id, char **area)); -static char *ddecode __P((register char *str, char **area)); +static char *dgetstr(); -struct disktab *getdiskbyname(name) char *name; { +struct disktab * +getdiskbyname(name) + char *name; +{ static struct disktab disk; static char localbuf[100], *cp = localbuf; register struct disktab *dp = &disk; @@ -65,18 +54,21 @@ struct disktab *getdiskbyname(name) char *name; { return (dp); } -/*#include */ +#include static char *tbuf; -/*static char *dskip();*/ -/*static char *ddecode();*/ +static char *dskip(); +static char *ddecode(); /* * Get an entry for disk name in buffer bp, * from the diskcap file. Parse is very rudimentary; * we just notice escaped newlines. */ -static dgetent(bp, name) char *bp; char *name; { +static +dgetent(bp, name) + char *bp, *name; +{ register char *cp; register int c; register int i = 0, cnt = 0; @@ -130,7 +122,10 @@ static dgetent(bp, name) char *bp; char *name; { * against each such name. The normal : terminator after the last * name (before the first field) stops us. */ -static dnamatch(np) char *np; { +static +dnamatch(np) + char *np; +{ register char *Np, *Bp; Bp = tbuf; @@ -154,7 +149,10 @@ static dnamatch(np) char *np; { * knowing about \: escapes or any such. If necessary, :'s can be put * into the diskcap file in octal. */ -static char *dskip(bp) register char *bp; { +static char * +dskip(bp) + register char *bp; +{ while (*bp && *bp != ':') bp++; @@ -171,7 +169,10 @@ static char *dskip(bp) register char *bp; { * a # character. If the option is not found we return -1. * Note that we handle octal numbers beginning with 0. */ -static dgetnum(id) char *id; { +static +dgetnum(id) + char *id; +{ register int i, base; register char *bp = tbuf; @@ -202,7 +203,10 @@ static dgetnum(id) char *id; { * of the buffer. Return 1 if we find the option, or 0 if it is * not given. */ -static dgetflag(id) char *id; { +static +dgetflag(id) + char *id; +{ register char *bp = tbuf; for (;;) { @@ -226,7 +230,10 @@ static dgetflag(id) char *id; { * placed in area, which is a ref parameter which is updated. * No checking on area overflow. */ -static char *dgetstr(id, area) char *id; char **area; { +static char * +dgetstr(id, area) + char *id, **area; +{ register char *bp = tbuf; for (;;) { @@ -248,7 +255,11 @@ static char *dgetstr(id, area) char *id; char **area; { * Tdecode does the grung work to decode the * string capability escapes. */ -static char *ddecode(str, area) register char *str; char **area; { +static char * +ddecode(str, area) + register char *str; + char **area; +{ register char *cp; register int c; register char *dp; diff --git a/lib/libstdc/gen/ecvt.c b/lib/libstdc/gen/ecvt.c index ec26e32..fd84d3b 100644 --- a/lib/libstdc/gen/ecvt.c +++ b/lib/libstdc/gen/ecvt.c @@ -1,8 +1,6 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ecvt.c 5.1 (Berkeley) 3/15/86"; -#endif +#endif LIBC_SCCS and not lint /* * ecvt converts to decimal @@ -11,20 +9,30 @@ static char sccsid[] = "@(#)ecvt.c 5.1 (Berkeley) 3/15/86"; * sign is set to 0 for positive, 1 for negative */ -/*char *cvt();*/ +char *cvt(); #define NDIG 80 -static char *cvt __P((double arg, int ndigits, int *decpt, int *sign, int eflag)); - -char *ecvt(arg, ndigits, decpt, sign) double arg; int ndigits; int *decpt; int *sign; { +char* +ecvt(arg, ndigits, decpt, sign) +double arg; +int ndigits, *decpt, *sign; +{ return(cvt(arg, ndigits, decpt, sign, 1)); } -char *fcvt(arg, ndigits, decpt, sign) double arg; int ndigits; int *decpt; int *sign; { +char* +fcvt(arg, ndigits, decpt, sign) +double arg; +int ndigits, *decpt, *sign; +{ return(cvt(arg, ndigits, decpt, sign, 0)); } -static char *cvt(arg, ndigits, decpt, sign, eflag) double arg; int ndigits; int *decpt; int *sign; int eflag; { +static char* +cvt(arg, ndigits, decpt, sign, eflag) +double arg; +int ndigits, *decpt, *sign; +{ register int r2; double fi, fj; register char *p, *p1; diff --git a/lib/libstdc/gen/errlst.c b/lib/libstdc/gen/errlst.c index 720fdc0..405d2c0 100644 --- a/lib/libstdc/gen/errlst.c +++ b/lib/libstdc/gen/errlst.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)errlst.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint char *sys_errlist[] = { "Error 0", diff --git a/lib/libstdc/gen/execvp.c b/lib/libstdc/gen/execvp.c index 6505267..7d1e92b 100644 --- a/lib/libstdc/gen/execvp.c +++ b/lib/libstdc/gen/execvp.c @@ -1,31 +1,28 @@ -#include -#include -#include -#include #include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)execvp.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * execlp(name, arg,...,0) (like execl, but does path search) * execvp(name, argv) (like execv, but does path search) */ -/*#include */ +#include #define NULL 0 static char shell[] = "/bin/sh"; -/*char *execat(), *getenv();*/ +char *execat(), *getenv(); extern errno; -static char *execat __P((register char *s1, register char *s2, char *si)); - -int execlp(name, argv) char *name; char *argv; { +execlp(name, argv) +char *name, *argv; +{ return(execvp(name, &argv)); } -int execvp(name, argv) char *name; char **argv; { +execvp(name, argv) +char *name, **argv; +{ char *pathstr; register char *cp; char fname[128]; @@ -72,7 +69,11 @@ int execvp(name, argv) char *name; char **argv; { return(-1); } -static char *execat(s1, s2, si) register char *s1; register char *s2; char *si; { +static char * +execat(s1, s2, si) +register char *s1, *s2; +char *si; +{ register char *s; s = si; diff --git a/lib/libstdc/gen/fakcu.c b/lib/libstdc/gen/fakcu.c index 88012ba..f69e296 100644 --- a/lib/libstdc/gen/fakcu.c +++ b/lib/libstdc/gen/fakcu.c @@ -1,13 +1,11 @@ -#include -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fakcu.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Null cleanup routine to resolve reference in exit() * if not using stdio. */ -int _cleanup() { +_cleanup() +{ } diff --git a/lib/libstdc/gen/ffs.c b/lib/libstdc/gen/ffs.c index e18dca5..9cdd64b 100644 --- a/lib/libstdc/gen/ffs.c +++ b/lib/libstdc/gen/ffs.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. @@ -19,12 +17,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ffs.c 5.2 (Berkeley) 6/27/88"; -#endif +#endif /* LIBC_SCCS and not lint */ /* * ffs -- vax ffs instruction */ -int ffs(mask) register long mask; { +ffs(mask) + register long mask; +{ register int cnt; if (mask == 0) diff --git a/lib/libstdc/gen/frexp.c b/lib/libstdc/gen/frexp.c index 1ffbb78..c1c727f 100644 --- a/lib/libstdc/gen/frexp.c +++ b/lib/libstdc/gen/frexp.c @@ -1,8 +1,6 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)frexp.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * the call @@ -14,7 +12,11 @@ static char sccsid[] = "@(#)frexp.c 5.2 (Berkeley) 3/9/86"; * if the argument is 0.0, return 0.0 mantissa and 0 exponent. */ -double frexp(x, i) double x; int *i; { +double +frexp(x,i) +double x; +int *i; +{ int neg; int j; j = 0; diff --git a/lib/libstdc/gen/fstab.c b/lib/libstdc/gen/fstab.c index c590602..fab4d13 100644 --- a/lib/libstdc/gen/fstab.c +++ b/lib/libstdc/gen/fstab.c @@ -1,8 +1,3 @@ -#include -#include -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,17 +6,20 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fstab.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include static struct fstab fs; static char line[BUFSIZ+1]; static FILE *fs_file = 0; -static char *fsskip(p) register char *p; { +static char * +fsskip(p) + register char *p; +{ while (*p && *p != ':') ++p; @@ -30,7 +28,11 @@ static char *fsskip(p) register char *p; { return (p); } -static char *fsdigit(backp, string, end) int *backp; char *string; int end; { +static char * +fsdigit(backp, string, end) + int *backp; + char *string, end; +{ register int value = 0; register char *cp; @@ -48,7 +50,10 @@ static char *fsdigit(backp, string, end) int *backp; char *string; int end; { return (cp+1); } -static fstabscan(fs) struct fstab *fs; { +static +fstabscan(fs) + struct fstab *fs; +{ register char *cp; cp = fgets(line, 256, fs_file); @@ -69,11 +74,8 @@ static fstabscan(fs) struct fstab *fs; { return (5); } -static char *fsskip __P((register char *p)); -static char *fsdigit __P((int *backp, char *string, int end)); -static fstabscan __P((struct fstab *fs)); - -int setfsent() { +setfsent() +{ if (fs_file) endfsent(); @@ -84,7 +86,8 @@ int setfsent() { return (1); } -int endfsent() { +endfsent() +{ if (fs_file) { fclose(fs_file); @@ -93,7 +96,9 @@ int endfsent() { return (1); } -struct fstab *getfsent() { +struct fstab * +getfsent() +{ int nfields; if ((fs_file == 0) && (setfsent() == 0)) @@ -104,7 +109,10 @@ struct fstab *getfsent() { return (&fs); } -struct fstab *getfsspec(name) char *name; { +struct fstab * +getfsspec(name) + char *name; +{ register struct fstab *fsp; if (setfsent() == 0) /* start from the beginning */ @@ -115,7 +123,10 @@ struct fstab *getfsspec(name) char *name; { return ((struct fstab *)0); } -struct fstab *getfsfile(name) char *name; { +struct fstab * +getfsfile(name) + char *name; +{ register struct fstab *fsp; if (setfsent() == 0) /* start from the beginning */ @@ -126,7 +137,10 @@ struct fstab *getfsfile(name) char *name; { return ((struct fstab *)0); } -struct fstab *getfstype(type) char *type; { +struct fstab * +getfstype(type) + char *type; +{ register struct fstab *fs; if (setfsent() == 0) diff --git a/lib/libstdc/gen/gcvt.c b/lib/libstdc/gen/gcvt.c index a2693be..e78925d 100644 --- a/lib/libstdc/gen/gcvt.c +++ b/lib/libstdc/gen/gcvt.c @@ -1,17 +1,19 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gcvt.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * gcvt - Floating output conversion to * minimal length string */ -/*char *ecvt();*/ +char *ecvt(); -char *gcvt(number, ndigit, buf) double number; int ndigit; char *buf; { +char * +gcvt(number, ndigit, buf) +double number; +char *buf; +{ int sign, decpt; register char *p1, *p2; register i; diff --git a/lib/libstdc/gen/getenv.c b/lib/libstdc/gen/getenv.c index f92d294..7da3627 100644 --- a/lib/libstdc/gen/getenv.c +++ b/lib/libstdc/gen/getenv.c @@ -1,8 +1,6 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getenv.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * getenv(name) @@ -10,11 +8,12 @@ static char sccsid[] = "@(#)getenv.c 5.2 (Berkeley) 3/9/86"; */ #define NULL 0 extern char **environ; -/*char *nvmatch();*/ - -static char *nvmatch __P((register char *s1, register char *s2)); +char *nvmatch(); -char *getenv(name) register char *name; { +char * +getenv(name) +register char *name; +{ register char **p = environ; register char *v; @@ -31,7 +30,10 @@ char *getenv(name) register char *name; { * used for environment searching: see getenv */ -static char *nvmatch(s1, s2) register char *s1; register char *s2; { +static char * +nvmatch(s1, s2) +register char *s1, *s2; +{ while (*s1 == *s2++) if (*s1++ == '=') diff --git a/lib/libstdc/gen/getgrent.c b/lib/libstdc/gen/getgrent.c index 626cf63..dbd487c 100644 --- a/lib/libstdc/gen/getgrent.c +++ b/lib/libstdc/gen/getgrent.c @@ -1,13 +1,9 @@ -#include -#include -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getgrent.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include #define MAXGRP 200 @@ -17,29 +13,35 @@ static char line[BUFSIZ+1]; static struct group group; static char *gr_mem[MAXGRP]; -static char *grskip __P((register char *p, register c)); - -int setgrent() { +setgrent() +{ if( !grf ) grf = fopen( GROUP, "r" ); else rewind( grf ); } -int endgrent() { +endgrent() +{ if( grf ){ fclose( grf ); grf = NULL; } } -static char *grskip(p, c) register char *p; register c; { +static char * +grskip(p,c) +register char *p; +register c; +{ while( *p && *p != c ) ++p; if( *p ) *p++ = 0; return( p ); } -struct group *getgrent() { +struct group * +getgrent() +{ register char *p, **q; if( !grf && !(grf = fopen( GROUP, "r" )) ) diff --git a/lib/libstdc/gen/getgrgid.c b/lib/libstdc/gen/getgrgid.c index ed5e853..d7c07fe 100644 --- a/lib/libstdc/gen/getgrgid.c +++ b/lib/libstdc/gen/getgrgid.c @@ -1,12 +1,13 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getgrgid.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -struct group *getgrgid(gid) register gid; { +struct group * +getgrgid(gid) +register gid; +{ register struct group *p; struct group *getgrent(); diff --git a/lib/libstdc/gen/getgrnam.c b/lib/libstdc/gen/getgrnam.c index b1cc220..5e12284 100644 --- a/lib/libstdc/gen/getgrnam.c +++ b/lib/libstdc/gen/getgrnam.c @@ -1,13 +1,13 @@ -#include -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getgrnam.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -struct group *getgrnam(name) register char *name; { +struct group * +getgrnam(name) +register char *name; +{ register struct group *p; struct group *getgrent(); diff --git a/lib/libstdc/gen/getlogin.c b/lib/libstdc/gen/getlogin.c index 2cc87f3..6988fba 100644 --- a/lib/libstdc/gen/getlogin.c +++ b/lib/libstdc/gen/getlogin.c @@ -1,16 +1,15 @@ -#include -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getlogin.c 5.3 (Berkeley) 5/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include static char UTMP[] = "/etc/utmp"; static struct utmp ubuf; -char *getlogin() { +char * +getlogin() +{ register int me, uf; register char *cp; diff --git a/lib/libstdc/gen/getpass.c b/lib/libstdc/gen/getpass.c index f096bf0..7382e71 100644 --- a/lib/libstdc/gen/getpass.c +++ b/lib/libstdc/gen/getpass.c @@ -1,18 +1,17 @@ -#include -#include -#include #include #include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getpass.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include -char *getpass(prompt) char *prompt; { +char * +getpass(prompt) +char *prompt; +{ struct sgttyb ttyb; int flags; register char *p; diff --git a/lib/libstdc/gen/getpwent.c b/lib/libstdc/gen/getpwent.c index d20a474..6ac2c73 100644 --- a/lib/libstdc/gen/getpwent.c +++ b/lib/libstdc/gen/getpwent.c @@ -1,8 +1,3 @@ -#include -#include -#include -#include - /* * Copyright (c) 1984 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,11 +6,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getpwent.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include static char EMPTY[] = ""; static FILE *pwf = NULL; @@ -29,16 +24,16 @@ char *_pw_file = "/etc/passwd"; DBM *_pw_db; int _pw_stayopen; -static char *pwskip __P((register char *p)); - -int setpwent() { +setpwent() +{ if (pwf == NULL) pwf = fopen(_pw_file, "r"); else rewind(pwf); } -int endpwent() { +endpwent() +{ if (pwf != NULL) { fclose(pwf); pwf = NULL; @@ -50,7 +45,10 @@ int endpwent() { } } -static char *pwskip(p) register char *p; { +static char * +pwskip(p) +register char *p; +{ while (*p && *p != ':' && *p != '\n') ++p; if (*p) @@ -58,7 +56,9 @@ static char *pwskip(p) register char *p; { return(p); } -struct passwd *getpwent() { +struct passwd * +getpwent() +{ register char *p; if (pwf == NULL) { @@ -89,6 +89,8 @@ struct passwd *getpwent() { return(&passwd); } -int setpwfile(file) char *file; { +setpwfile(file) + char *file; +{ _pw_file = file; } diff --git a/lib/libstdc/gen/getpwnamuid.c b/lib/libstdc/gen/getpwnamuid.c index 733cff6..de02299 100644 --- a/lib/libstdc/gen/getpwnamuid.c +++ b/lib/libstdc/gen/getpwnamuid.c @@ -1,10 +1,4 @@ -#include -#include -#include -#include -#include -#include - +#include /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -13,13 +7,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getpwnamuid.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include -/*#include */ +#include static char line[BUFSIZ+1]; static struct passwd passwd; @@ -31,7 +25,10 @@ extern char *_pw_file; DBM *_pw_db; int _pw_stayopen; -static struct passwd *fetchpw(key) datum key; { +static struct passwd * +fetchpw(key) + datum key; +{ register char *cp, *tp; if (key.dptr == 0) @@ -58,9 +55,10 @@ static struct passwd *fetchpw(key) datum key; { return (&passwd); } -static struct passwd *fetchpw __P((datum key)); - -struct passwd *getpwnam(nam) char *nam; { +struct passwd * +getpwnam(nam) + char *nam; +{ datum key; register struct passwd *pw; @@ -90,7 +88,10 @@ struct passwd *getpwnam(nam) char *nam; { return (pw); } -struct passwd *getpwuid(uid) int uid; { +struct passwd * +getpwuid(uid) + int uid; +{ datum key; register struct passwd *pw; diff --git a/lib/libstdc/gen/getttyent.c b/lib/libstdc/gen/getttyent.c index 14ca5df..164c6b3 100644 --- a/lib/libstdc/gen/getttyent.c +++ b/lib/libstdc/gen/getttyent.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,11 +6,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getttyent.c 5.4 (Berkeley) 5/19/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include static char TTYFILE[] = "/etc/ttys"; static char zapchar; @@ -23,17 +19,16 @@ static FILE *tf = NULL; static char line[LINE]; static struct ttyent tty; -static char *skip __P((register char *p)); -static char *value __P((register char *p)); - -int setttyent() { +setttyent() +{ if (tf == NULL) tf = fopen(TTYFILE, "r"); else rewind(tf); } -int endttyent() { +endttyent() +{ if (tf != NULL) { (void) fclose(tf); tf = NULL; @@ -46,7 +41,10 @@ int endttyent() { * Skip over the current field, removing quotes, * and return a pointer to the next field. */ -static char *skip(p) register char *p; { +static char * +skip(p) + register char *p; +{ register char *t = p; register int c; register int q = 0; @@ -78,14 +76,19 @@ static char *skip(p) register char *p; { return (p); } -static char *value(p) register char *p; { +static char * +value(p) + register char *p; +{ if ((p = index(p,'=')) == 0) return(NULL); p++; /* get past the = sign */ return(p); } -struct ttyent *getttyent() { +struct ttyent * +getttyent() +{ register char *p; register int c; diff --git a/lib/libstdc/gen/getttynam.c b/lib/libstdc/gen/getttynam.c index 2e499d0..f947abd 100644 --- a/lib/libstdc/gen/getttynam.c +++ b/lib/libstdc/gen/getttynam.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,11 +6,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getttynam.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -struct ttyent *getttynam(tty) char *tty; { +struct ttyent * +getttynam(tty) + char *tty; +{ register struct ttyent *t; setttyent(); diff --git a/lib/libstdc/gen/getusershell.c b/lib/libstdc/gen/getusershell.c index 6c57012..f9fe9ae 100644 --- a/lib/libstdc/gen/getusershell.c +++ b/lib/libstdc/gen/getusershell.c @@ -1,9 +1,3 @@ -#include -#include -#include -#include -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,13 +6,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getusershell.c 5.4 (Berkeley) 7/25/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include #define SHELLS "/etc/shells" @@ -30,14 +24,14 @@ static char *okshells[] = static char **shells, *strings; static char **curshell = NULL; -/*extern char **initshells();*/ +extern char **initshells(); /* * Get a list of shells from SHELLS, if it exists. */ -static char **initshells __P((void)); - -char *getusershell() { +char * +getusershell() +{ char *ret; if (curshell == NULL) @@ -48,7 +42,8 @@ char *getusershell() { return (ret); } -int endusershell() { +endusershell() +{ if (shells != NULL) free((char *)shells); @@ -59,12 +54,15 @@ int endusershell() { curshell = NULL; } -int setusershell() { +setusershell() +{ curshell = initshells(); } -static char **initshells() { +static char ** +initshells() +{ register char **sp, *cp; register FILE *fp; struct stat statb; diff --git a/lib/libstdc/gen/getwd.c b/lib/libstdc/gen/getwd.c index abc663d..8fd1680 100644 --- a/lib/libstdc/gen/getwd.c +++ b/lib/libstdc/gen/getwd.c @@ -1,9 +1,4 @@ -#include -#include #include -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,24 +7,25 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getwd.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * getwd() returns the pathname of the current working directory. On error * an error message is copied to pathname and null pointer is returned. */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include #define GETWDERR(s) strcpy(pathname, (s)); -/*char *strcpy();*/ +char *strcpy(); static int pathsize; /* pathname length */ -static char *prepend __P((register char *dirname, register char *pathname)); - -char *getwd(pathname) char *pathname; { +char * +getwd(pathname) + char *pathname; +{ char pathbuf[MAXPATHLEN]; /* temporary pathname buffer */ char *pnptr = &pathbuf[(sizeof pathbuf)-1]; /* pathname pointer */ char curdir[MAXPATHLEN]; /* current directory buffer */ @@ -103,7 +99,11 @@ char *getwd(pathname) char *pathname; { /* * prepend() tacks a directory name onto the front of a pathname. */ -static char *prepend(dirname, pathname) register char *dirname; register char *pathname; { +static char * +prepend(dirname, pathname) + register char *dirname; + register char *pathname; +{ register int i; /* directory name size counter */ for (i = 0; *dirname != '\0'; i++, dirname++) diff --git a/lib/libstdc/gen/index.c b/lib/libstdc/gen/index.c index 0720e4f..6a6871c 100644 --- a/lib/libstdc/gen/index.c +++ b/lib/libstdc/gen/index.c @@ -1,8 +1,6 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)index.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Return the ptr in sp at which the character c appears; @@ -11,7 +9,10 @@ static char sccsid[] = "@(#)index.c 5.2 (Berkeley) 3/9/86"; #define NULL 0 -char *index(sp, c) register char *sp; int c; { +char * +index(sp, c) +register char *sp, c; +{ do { if (*sp == c) return(sp); diff --git a/lib/libstdc/gen/initgroups.c b/lib/libstdc/gen/initgroups.c index d1214e4..362e3e6 100644 --- a/lib/libstdc/gen/initgroups.c +++ b/lib/libstdc/gen/initgroups.c @@ -1,10 +1,3 @@ -#include -#include -#include -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -13,18 +6,21 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)initgroups.c 5.3 (Berkeley) 4/27/86"; -#endif +#endif LIBC_SCCS and not lint /* * initgroups */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include -/*struct group *getgrent();*/ +struct group *getgrent(); -int initgroups(uname, agroup) char *uname; int agroup; { +initgroups(uname, agroup) + char *uname; + int agroup; +{ int groups[NGROUPS], ngroups = 0; register struct group *grp; register int i; diff --git a/lib/libstdc/gen/insque.c b/lib/libstdc/gen/insque.c index 90e952a..1babc64 100644 --- a/lib/libstdc/gen/insque.c +++ b/lib/libstdc/gen/insque.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)insque.c 5.1 (Berkeley) 1/27/87"; -#endif +#endif LIBC_SCCS and not lint /* * insque -- vax insque instruction @@ -16,12 +14,15 @@ static char sccsid[] = "@(#)insque.c 5.1 (Berkeley) 1/27/87"; * NOTE: this implementation is non-atomic!! */ -struct vaxque { /* queue format expected by VAX queue instructions */ - struct vaxque *vq_next; - struct vaxque *vq_prev; -}; +/* moved this to gen.h as it's shared by caller and by remque.c */ +/*struct vaxque {*/ /* queue format expected by VAX queue instructions */ +/* struct vaxque *vq_next;*/ +/* struct vaxque *vq_prev;*/ +/*};*/ -int insque(e, prev) register struct vaxque *e; register struct vaxque *prev; { +insque(e, prev) + register struct vaxque *e, *prev; +{ e->vq_prev = prev; e->vq_next = prev->vq_next; prev->vq_next->vq_prev = e; diff --git a/lib/libstdc/gen/isatty.c b/lib/libstdc/gen/isatty.c index 77fdcdb..5d34cf4 100644 --- a/lib/libstdc/gen/isatty.c +++ b/lib/libstdc/gen/isatty.c @@ -1,16 +1,16 @@ #include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)isatty.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Returns 1 iff file is a tty */ -/*#include */ +#include -int isatty(f) int f; { +isatty(f) +{ struct sgttyb ttyb; if (ioctl(f, TIOCGETP, &ttyb) < 0) diff --git a/lib/libstdc/gen/ldexp.c b/lib/libstdc/gen/ldexp.c index 6ef6837..89f638b 100644 --- a/lib/libstdc/gen/ldexp.c +++ b/lib/libstdc/gen/ldexp.c @@ -1,5 +1,3 @@ -#include - -double ldexp(v, e) double v; int e; { +double ldexp(v, e) double v; { abort(); } diff --git a/lib/libstdc/gen/malloc.c b/lib/libstdc/gen/malloc.c index 87ca723..4d200ed 100644 --- a/lib/libstdc/gen/malloc.c +++ b/lib/libstdc/gen/malloc.c @@ -1,9 +1,3 @@ -#include -#include -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)malloc.c 5.6 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * malloc.c (Caltech) 2/21/82 @@ -25,7 +19,7 @@ static char sccsid[] = "@(#)malloc.c 5.6 (Berkeley) 3/9/86"; * This is designed for use in a virtual memory environment. */ -/*#include */ +#include #define NULL 0 @@ -71,7 +65,7 @@ union overhead { */ #define NBUCKETS 30 static union overhead *nextf[NBUCKETS]; -/*extern char *sbrk();*/ +extern char *sbrk(); static int pagesz; /* page size */ static int pagebucket; /* page size bucket */ @@ -82,13 +76,16 @@ static int pagebucket; /* page size bucket */ * for a given block size. */ static u_int nmalloc[NBUCKETS]; -/*#include */ +#include #endif #if defined(DEBUG) || defined(RCHECK) #define ASSERT(p) if (!(p)) botch("p") -/*#include */ -static botch(s) char *s; { +#include +static +botch(s) + char *s; +{ fprintf(stderr, "\r\nassertion botched: %s\r\n", s); (void) fflush(stderr); /* just in case user buffered it */ abort(); @@ -97,10 +94,10 @@ static botch(s) char *s; { #define ASSERT(p) #endif -static botch __P((char *s)); -static findbucket __P((union overhead *freep, int srchlen)); - -char *malloc(nbytes) unsigned nbytes; { +char * +malloc(nbytes) + unsigned nbytes; +{ register union overhead *op; register int bucket; register unsigned amt, n; @@ -182,7 +179,9 @@ char *malloc(nbytes) unsigned nbytes; { /* * Allocate more memory to the indicated bucket. */ -int morecore(bucket) int bucket; { +morecore(bucket) + int bucket; +{ register union overhead *op; register int sz; /* size of desired block */ int amt; /* amount to allocate */ @@ -221,7 +220,9 @@ int morecore(bucket) int bucket; { } } -int free(cp) char *cp; { +free(cp) + char *cp; +{ register int size; register union overhead *op; @@ -260,7 +261,11 @@ int free(cp) char *cp; { */ int realloc_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */ -char *realloc(cp, nbytes) char *cp; unsigned nbytes; { +char * +realloc(cp, nbytes) + char *cp; + unsigned nbytes; +{ register u_int onb, i; union overhead *op; char *res; @@ -326,7 +331,11 @@ char *realloc(cp, nbytes) char *cp; unsigned nbytes; { * header starts at ``freep''. If srchlen is -1 search the whole list. * Return bucket number, or -1 if not found. */ -static findbucket(freep, srchlen) union overhead *freep; int srchlen; { +static +findbucket(freep, srchlen) + union overhead *freep; + int srchlen; +{ register union overhead *p; register int i, j; @@ -349,7 +358,9 @@ static findbucket(freep, srchlen) union overhead *freep; int srchlen; { * for each size category, the second showing the number of mallocs - * frees for each size category. */ -int mstats(s) char *s; { +mstats(s) + char *s; +{ register int i, j; register union overhead *p; int totfree = 0, diff --git a/lib/libstdc/gen/mkstemp.c b/lib/libstdc/gen/mkstemp.c index e7dc816..31b495a 100644 --- a/lib/libstdc/gen/mkstemp.c +++ b/lib/libstdc/gen/mkstemp.c @@ -1,7 +1,4 @@ -#include -#include -#include - +#include /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,11 +7,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)mkstemp.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int mkstemp(as) char *as; { +mkstemp(as) + char *as; +{ register char *s; register unsigned int pid; register int fd, i; diff --git a/lib/libstdc/gen/mktemp.c b/lib/libstdc/gen/mktemp.c index 7be3cbd..c3e2712 100644 --- a/lib/libstdc/gen/mktemp.c +++ b/lib/libstdc/gen/mktemp.c @@ -1,12 +1,11 @@ -#include -#include -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)mktemp.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -char *mktemp(as) char *as; { +char * +mktemp(as) +char *as; +{ register char *s; register unsigned pid; register i; diff --git a/lib/libstdc/gen/modf.c b/lib/libstdc/gen/modf.c index bf3809a..aa81ceb 100644 --- a/lib/libstdc/gen/modf.c +++ b/lib/libstdc/gen/modf.c @@ -1,5 +1,3 @@ -#include - -double modf(v, p) double v; double *p; { +double modf(v, p) double v, *p; { abort(); } diff --git a/lib/libstdc/gen/ndbm.c b/lib/libstdc/gen/ndbm.c index 33ac2e2..c698028 100644 --- a/lib/libstdc/gen/ndbm.c +++ b/lib/libstdc/gen/ndbm.c @@ -1,12 +1,6 @@ -#include -#include +#include #include #include -#include -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -15,35 +9,28 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ndbm.c 5.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include +#include #define BYTESIZ 8 #undef setbit -/*static datum makdatum();*/ -/*static long hashinc();*/ -/*static long dcalchash();*/ +static datum makdatum(); +static long hashinc(); +static long dcalchash(); extern int errno; -static dbm_access __P((register DBM *db, long hash)); -static getbit __P((register DBM *db)); -static setbit __P((register DBM *db)); -static datum makdatum __P((char buf[PBLKSIZ], int n)); -static finddatum __P((char buf[PBLKSIZ], datum item)); -static long hashinc __P((register DBM *db, long hash)); -static long dcalchash __P((datum item)); -static delitem __P((char buf[PBLKSIZ], int n)); -static additem __P((char buf[PBLKSIZ], datum item, datum item1)); -static chkblk __P((char buf[PBLKSIZ])); - -DBM *dbm_open(file, flags, mode) char *file; int flags; int mode; { +DBM * +dbm_open(file, flags, mode) + char *file; + int flags, mode; +{ struct stat statb; register DBM *db; @@ -75,14 +62,21 @@ bad: return ((DBM *)0); } -void dbm_close(db) DBM *db; { +void +dbm_close(db) + DBM *db; +{ (void) close(db->dbm_dirf); (void) close(db->dbm_pagf); free((char *)db); } -long dbm_forder(db, key) register DBM *db; datum key; { +long +dbm_forder(db, key) + register DBM *db; + datum key; +{ long hash; hash = dcalchash(key); @@ -95,7 +89,11 @@ long dbm_forder(db, key) register DBM *db; datum key; { return (db->dbm_blkno); } -datum dbm_fetch(db, key) register DBM *db; datum key; { +datum +dbm_fetch(db, key) + register DBM *db; + datum key; +{ register i; datum item; @@ -113,7 +111,10 @@ err: return (item); } -int dbm_delete(db, key) register DBM *db; datum key; { +dbm_delete(db, key) + register DBM *db; + datum key; +{ register i; datum item; @@ -138,7 +139,11 @@ int dbm_delete(db, key) register DBM *db; datum key; { return (0); } -int dbm_store(db, key, dat, replace) register DBM *db; datum key; datum dat; int replace; { +dbm_store(db, key, dat, replace) + register DBM *db; + datum key, dat; + int replace; +{ register i; datum item, item1; char ovfbuf[PBLKSIZ]; @@ -211,14 +216,20 @@ split: goto loop; } -datum dbm_firstkey(db) DBM *db; { +datum +dbm_firstkey(db) + DBM *db; +{ db->dbm_blkptr = 0L; db->dbm_keyptr = 0; return (dbm_nextkey(db)); } -datum dbm_nextkey(db) register DBM *db; { +datum +dbm_nextkey(db) + register DBM *db; +{ struct stat statb; datum item; @@ -253,7 +264,11 @@ err: return (item); } -static dbm_access(db, hash) register DBM *db; long hash; { +static +dbm_access(db, hash) + register DBM *db; + long hash; +{ for (db->dbm_hmask=0;; db->dbm_hmask=(db->dbm_hmask<<1)+1) { db->dbm_blkno = hash & db->dbm_hmask; @@ -273,7 +288,10 @@ static dbm_access(db, hash) register DBM *db; long hash; { } } -static getbit(db) register DBM *db; { +static +getbit(db) + register DBM *db; +{ long bn; register b, i, n; @@ -293,7 +311,10 @@ static getbit(db) register DBM *db; { return (db->dbm_dirbuf[i] & (1<dbm_flags |= _DBM_IOERR; } -static datum makdatum(buf, n) char buf[PBLKSIZ]; int n; { +static datum +makdatum(buf, n) + char buf[PBLKSIZ]; +{ register short *sp; register t; datum item; @@ -335,7 +359,11 @@ static datum makdatum(buf, n) char buf[PBLKSIZ]; int n; { return (item); } -static finddatum(buf, item) char buf[PBLKSIZ]; datum item; { +static +finddatum(buf, item) + char buf[PBLKSIZ]; + datum item; +{ register short *sp; register int i, n, j; @@ -352,7 +380,8 @@ static finddatum(buf, item) char buf[PBLKSIZ]; datum item; { } static int hitab[16] -/* ken's { +/* ken's +{ 055,043,036,054,063,014,004,005, 010,064,077,000,035,027,025,071, }; @@ -380,7 +409,11 @@ static long hltab[64] 04723077174L,03642763134L,05750130273L,03655541561L, }; -static long hashinc(db, hash) register DBM *db; long hash; { +static long +hashinc(db, hash) + register DBM *db; + long hash; +{ long bit; hash &= db->dbm_hmask; @@ -395,7 +428,10 @@ static long hashinc(db, hash) register DBM *db; long hash; { } } -static long dcalchash(item) datum item; { +static long +dcalchash(item) + datum item; +{ register int s, c, j; register char *cp; register long hashl; @@ -417,7 +453,10 @@ static long dcalchash(item) datum item; { /* * Delete pairs of items (n & n+1). */ -static delitem(buf, n) char buf[PBLKSIZ]; int n; { +static +delitem(buf, n) + char buf[PBLKSIZ]; +{ register short *sp, *sp1; register i1, i2; @@ -446,7 +485,11 @@ static delitem(buf, n) char buf[PBLKSIZ]; int n; { /* * Add pairs of items (item & item1). */ -static additem(buf, item, item1) char buf[PBLKSIZ]; datum item; datum item1; { +static +additem(buf, item, item1) + char buf[PBLKSIZ]; + datum item, item1; +{ register short *sp; register i1, i2; @@ -467,7 +510,10 @@ static additem(buf, item, item1) char buf[PBLKSIZ]; datum item; datum item1; { } #ifdef DEBUG -static chkblk(buf) char buf[PBLKSIZ]; { +static +chkblk(buf) + char buf[PBLKSIZ]; +{ register short *sp; register t, i; diff --git a/lib/libstdc/gen/nlist.c b/lib/libstdc/gen/nlist.c index 669bc06..e7d1831 100644 --- a/lib/libstdc/gen/nlist.c +++ b/lib/libstdc/gen/nlist.c @@ -1,10 +1,5 @@ -#include -#include -#include #include -#include -#include - +#include /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -13,16 +8,19 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)nlist.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include /* * nlist - retreive attributes from name list (string table version) */ -int nlist(name, list) char *name; struct nlist *list; { +nlist(name, list) + char *name; + struct nlist *list; +{ register struct nlist *p, *q; register char *s1, *s2; register n, m; diff --git a/lib/libstdc/gen/opendir.c b/lib/libstdc/gen/opendir.c index 382b5a8..6996007 100644 --- a/lib/libstdc/gen/opendir.c +++ b/lib/libstdc/gen/opendir.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,15 +6,18 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)opendir.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * open a directory. */ -DIR *opendir(name) char *name; { +DIR * +opendir(name) + char *name; +{ register DIR *dirp; register int fd; diff --git a/lib/libstdc/gen/perror.c b/lib/libstdc/gen/perror.c index 7a2d1d4..c3bec72 100644 --- a/lib/libstdc/gen/perror.c +++ b/lib/libstdc/gen/perror.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,19 +6,21 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)perror.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Print the error indicated * in the cerror cell. */ -/*#include */ -/*#include */ +#include +#include int errno; int sys_nerr; char *sys_errlist[]; -int perror(s) char *s; { +perror(s) + char *s; +{ struct iovec iov[4]; register struct iovec *v = iov; diff --git a/lib/libstdc/gen/psignal.c b/lib/libstdc/gen/psignal.c index 8d8573a..845db8c 100644 --- a/lib/libstdc/gen/psignal.c +++ b/lib/libstdc/gen/psignal.c @@ -1,7 +1,4 @@ -#include -#include #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,17 +7,20 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)psignal.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Print the name of the signal indicated * along with the supplied message. */ -/*#include */ +#include extern char *sys_siglist[]; -int psignal(sig, s) unsigned sig; char *s; { +psignal(sig, s) + unsigned sig; + char *s; +{ register char *c; register n; diff --git a/lib/libstdc/gen/qsort.c b/lib/libstdc/gen/qsort.c index e9b38c8..4e85c94 100644 --- a/lib/libstdc/gen/qsort.c +++ b/lib/libstdc/gen/qsort.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)qsort.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * qsort.c: @@ -34,9 +32,12 @@ static int mthresh; /* MTHRESHold in chars */ * It's not... */ -static qst __P((char *base, char *max)); - -int qsort(base, n, size, compar) char *base; int n; int size; int (*compar)(); { +qsort(base, n, size, compar) + char *base; + int n; + int size; + int (*compar)(); +{ register char c, *i, *j, *lo, *hi; char *min, *max; @@ -106,7 +107,10 @@ int qsort(base, n, size, compar) char *base; int n; int size; int (*compar)(); { * (And there are only three places where this is done). */ -static qst(base, max) char *base; char *max; { +static +qst(base, max) + char *base, *max; +{ register char c, *i, *j, *jj; register int ii; char *mid, *tmp; diff --git a/lib/libstdc/gen/random.c b/lib/libstdc/gen/random.c index 618bd20..a63cf46 100644 --- a/lib/libstdc/gen/random.c +++ b/lib/libstdc/gen/random.c @@ -1,6 +1,4 @@ -#include #include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,9 +7,9 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)random.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include /* * random.c: @@ -174,7 +172,10 @@ static long *end_ptr = &randtbl[ DEG_3 + 1 ]; * values produced by this routine. */ -int srandom(x) unsigned x; { +srandom( x ) + + unsigned x; +{ register int i, j; if( rand_type == TYPE_0 ) { @@ -210,7 +211,13 @@ int srandom(x) unsigned x; { * Returns a pointer to the old state. */ -char *initstate(seed, arg_state, n) unsigned seed; /* seed for R. N. G. */ char *arg_state; /* pointer to state array */ int n; /* # bytes of state info */ { +char * +initstate( seed, arg_state, n ) + + unsigned seed; /* seed for R. N. G. */ + char *arg_state; /* pointer to state array */ + int n; /* # bytes of state info */ +{ register char *ostate = (char *)( &state[ -1 ] ); if( rand_type == TYPE_0 ) state[ -1 ] = rand_type; @@ -272,7 +279,11 @@ char *initstate(seed, arg_state, n) unsigned seed; /* seed for R. N. G. */ cha * Returns a pointer to the old state information. */ -char *setstate(arg_state) char *arg_state; { +char * +setstate( arg_state ) + + 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; @@ -320,7 +331,9 @@ char *setstate(arg_state) char *arg_state; { * Returns a 31-bit random number. */ -long random() { +long +random() +{ long i; if( rand_type == TYPE_0 ) { diff --git a/lib/libstdc/gen/readdir.c b/lib/libstdc/gen/readdir.c index 7646d8f..34d43ba 100644 --- a/lib/libstdc/gen/readdir.c +++ b/lib/libstdc/gen/readdir.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,15 +6,18 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)readdir.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * get next entry in a directory. */ -struct direct *readdir(dirp) register DIR *dirp; { +struct direct * +readdir(dirp) + register DIR *dirp; +{ register struct direct *dp; for (;;) { diff --git a/lib/libstdc/gen/regex.c b/lib/libstdc/gen/regex.c index b723c9d..73c1e0c 100644 --- a/lib/libstdc/gen/regex.c +++ b/lib/libstdc/gen/regex.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)regex.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint # @@ -101,9 +99,10 @@ static char circf; /* * compile the regular expression argument into a dfa */ -static int advance __P((register char *lp, register char *ep)); - -char *re_comp(sp) register char *sp; { +char * +re_comp(sp) + register char *sp; +{ register int c; register char *ep = expbuf; int cclcnt, numbra = 0; @@ -224,7 +223,10 @@ char *re_comp(sp) register char *sp; { /* * match the argument string against the compiled re */ -int re_exec(p1) register char *p1; { +int +re_exec(p1) + register char *p1; +{ register char *p2 = expbuf; register int c; int rv; @@ -261,7 +263,10 @@ int re_exec(p1) register char *p1; { /* * try to match the next thing in the dfa */ -static int advance(lp, ep) register char *lp; register char *ep; { +static int +advance(lp, ep) + register char *lp, *ep; +{ register char *curlp; int ct, i; int rv; @@ -366,7 +371,10 @@ static int advance(lp, ep) register char *lp; register char *ep; { } } -int backref(i, lp) register int i; register char *lp; { +backref(i, lp) + register int i; + register char *lp; +{ register char *bp; bp = braslist[i]; @@ -376,7 +384,11 @@ int backref(i, lp) register int i; register char *lp; { return(0); } -int cclass(set, c, af) register char *set; int c; int af; { +int +cclass(set, c, af) + register char *set, c; + int af; +{ register int n; if (c == 0) diff --git a/lib/libstdc/gen/remque.c b/lib/libstdc/gen/remque.c index f6b804f..70bacac 100644 --- a/lib/libstdc/gen/remque.c +++ b/lib/libstdc/gen/remque.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)remque.c 5.1 (Berkeley) 1/27/87"; -#endif +#endif LIBC_SCCS and not lint /* * remque -- vax remque instruction @@ -16,12 +14,15 @@ static char sccsid[] = "@(#)remque.c 5.1 (Berkeley) 1/27/87"; * NOTE: this implementation is non-atomic!! */ -struct vaxque { /* queue format expected by VAX queue instructions */ - struct vaxque *vq_next; - struct vaxque *vq_prev; -}; +/* moved this to gen.h as it's shared by caller and by remque.c */ +/*struct vaxque {*/ /* queue format expected by VAX queue instructions */ +/* struct vaxque *vq_next;*/ +/* struct vaxque *vq_prev;*/ +/*};*/ -int remque(e) register struct vaxque *e; { +remque(e) + register struct vaxque *e; +{ e->vq_prev->vq_next = e->vq_next; e->vq_next->vq_prev = e->vq_prev; } diff --git a/lib/libstdc/gen/rindex.c b/lib/libstdc/gen/rindex.c index 7ac2bf9..ee93bd3 100644 --- a/lib/libstdc/gen/rindex.c +++ b/lib/libstdc/gen/rindex.c @@ -1,8 +1,6 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)rindex.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Return the ptr in sp at which the character c last @@ -11,7 +9,10 @@ static char sccsid[] = "@(#)rindex.c 5.2 (Berkeley) 3/9/86"; #define NULL 0 -char *rindex(sp, c) register char *sp; int c; { +char * +rindex(sp, c) +register char *sp, c; +{ register char *r; r = NULL; diff --git a/lib/libstdc/gen/scandir.c b/lib/libstdc/gen/scandir.c index 32087b0..1964c80 100644 --- a/lib/libstdc/gen/scandir.c +++ b/lib/libstdc/gen/scandir.c @@ -1,8 +1,3 @@ -#include -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)scandir.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Scan the directory dirname calling select to make a list of selected @@ -20,11 +15,15 @@ static char sccsid[] = "@(#)scandir.c 5.2 (Berkeley) 3/9/86"; * struct direct (through namelist). Returns -1 if there were any errors. */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include -int scandir(dirname, namelist, select, dcomp) char *dirname; struct direct *(*namelist[]); int (*select)(); int (*dcomp)(); { +scandir(dirname, namelist, select, dcomp) + char *dirname; + struct direct *(*namelist[]); + int (*select)(), (*dcomp)(); +{ register struct direct *d, *p, **names; register int nitems; register char *cp1, *cp2; @@ -85,6 +84,8 @@ int scandir(dirname, namelist, select, dcomp) char *dirname; struct direct *(*na /* * Alphabetic order comparison routine for those who want it. */ -int alphasort(d1, d2) struct direct **d1; struct direct **d2; { +alphasort(d1, d2) + struct direct **d1, **d2; +{ return(strcmp((*d1)->d_name, (*d2)->d_name)); } diff --git a/lib/libstdc/gen/seekdir.c b/lib/libstdc/gen/seekdir.c index 834d244..f1bc890 100644 --- a/lib/libstdc/gen/seekdir.c +++ b/lib/libstdc/gen/seekdir.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,16 +6,20 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)seekdir.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * seek to an entry in a directory. * Only values returned by "telldir" should be passed to seekdir. */ -void seekdir(dirp, loc) register DIR *dirp; long loc; { +void +seekdir(dirp, loc) + register DIR *dirp; + long loc; +{ long curloc, base, offset; struct direct *dp; extern long lseek(); diff --git a/lib/libstdc/gen/setegid.c b/lib/libstdc/gen/setegid.c index 0329fc8..cb332d0 100644 --- a/lib/libstdc/gen/setegid.c +++ b/lib/libstdc/gen/setegid.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,9 +6,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setegid.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -int setegid(egid) int egid; { +setegid(egid) + int egid; +{ return (setregid(-1, egid)); } diff --git a/lib/libstdc/gen/seteuid.c b/lib/libstdc/gen/seteuid.c index d2e8164..2c6096c 100644 --- a/lib/libstdc/gen/seteuid.c +++ b/lib/libstdc/gen/seteuid.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,9 +6,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)seteuid.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -int seteuid(euid) int euid; { +seteuid(euid) + int euid; +{ return (setreuid(-1, euid)); } diff --git a/lib/libstdc/gen/setgid.c b/lib/libstdc/gen/setgid.c index 29ed6f6..bed8d8a 100644 --- a/lib/libstdc/gen/setgid.c +++ b/lib/libstdc/gen/setgid.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,12 +6,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setgid.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Backwards compatible setgid. */ -int setgid(gid) int gid; { +setgid(gid) + int gid; +{ return (setregid(gid, gid)); } diff --git a/lib/libstdc/gen/setjmp.c b/lib/libstdc/gen/setjmp.c index dc75c5d..70c96d0 100644 --- a/lib/libstdc/gen/setjmp.c +++ b/lib/libstdc/gen/setjmp.c @@ -1,9 +1,7 @@ -#include #include - int setjmp(e) jmp_buf e; { abort(); } -void longjmp(e, v) jmp_buf e; int v; { +void longjmp(e, v) jmp_buf e; { abort(); } diff --git a/lib/libstdc/gen/setjmperr.c b/lib/libstdc/gen/setjmperr.c index 78fc95f..d46b7a6 100644 --- a/lib/libstdc/gen/setjmperr.c +++ b/lib/libstdc/gen/setjmperr.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setjmperr.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint #define ERRMSG "longjmp botch\n" @@ -19,7 +16,8 @@ static char sccsid[] = "@(#)setjmperr.c 5.2 (Berkeley) 3/9/86"; * write their own versions. * If this routine returns, the program is aborted. */ -int longjmperror() { +longjmperror() +{ write(2, ERRMSG, sizeof(ERRMSG)); } diff --git a/lib/libstdc/gen/setrgid.c b/lib/libstdc/gen/setrgid.c index 0bb3d1c..c5c38cf 100644 --- a/lib/libstdc/gen/setrgid.c +++ b/lib/libstdc/gen/setrgid.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,9 +6,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setrgid.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -int setrgid(rgid) int rgid; { +setrgid(rgid) + int rgid; +{ return (setregid(rgid, -1)); } diff --git a/lib/libstdc/gen/setruid.c b/lib/libstdc/gen/setruid.c index 53c1dba..49a4a79 100644 --- a/lib/libstdc/gen/setruid.c +++ b/lib/libstdc/gen/setruid.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,9 +6,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setruid.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -int setruid(ruid) int ruid; { +setruid(ruid) + int ruid; +{ return (setreuid(ruid, -1)); } diff --git a/lib/libstdc/gen/setuid.c b/lib/libstdc/gen/setuid.c index 880b813..3e33294 100644 --- a/lib/libstdc/gen/setuid.c +++ b/lib/libstdc/gen/setuid.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,12 +6,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setuid.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Backwards compatible setuid. */ -int setuid(uid) int uid; { +setuid(uid) + int uid; +{ return (setreuid(uid, uid)); } diff --git a/lib/libstdc/gen/siginterrupt.c b/lib/libstdc/gen/siginterrupt.c index 67df098..4cc7405 100644 --- a/lib/libstdc/gen/siginterrupt.c +++ b/lib/libstdc/gen/siginterrupt.c @@ -1,5 +1,4 @@ #include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,15 +7,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)siginterrupt.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include /* * Set signal state to prevent restart of system calls * after an instance of the indicated signal. */ -int siginterrupt(sig, flag) int sig; int flag; { +siginterrupt(sig, flag) + int sig, flag; +{ struct sigvec sv; int ret; diff --git a/lib/libstdc/gen/siglist.c b/lib/libstdc/gen/siglist.c index 102bef6..45714e0 100644 --- a/lib/libstdc/gen/siglist.c +++ b/lib/libstdc/gen/siglist.c @@ -1,5 +1,4 @@ #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,9 +7,9 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)siglist.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include char *sys_siglist[NSIG] = { "Signal 0", diff --git a/lib/libstdc/gen/signal.c b/lib/libstdc/gen/signal.c index a8a3d42..26b135b 100644 --- a/lib/libstdc/gen/signal.c +++ b/lib/libstdc/gen/signal.c @@ -1,5 +1,4 @@ #include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,14 +7,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)signal.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Almost backwards compatible signal. */ -/*#include */ +#include -int (*signal(s, a))() int s; int (*a)(); { +int (* +signal(s, a))() + int s, (*a)(); +{ struct sigvec osv, sv; static int mask[NSIG]; static int flags[NSIG]; diff --git a/lib/libstdc/gen/sleep.c b/lib/libstdc/gen/sleep.c index 467c417..e53fcfa 100644 --- a/lib/libstdc/gen/sleep.c +++ b/lib/libstdc/gen/sleep.c @@ -1,6 +1,4 @@ #include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,19 +7,19 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)sleep.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include #define setvec(vec, a) \ vec.sv_handler = a; vec.sv_mask = vec.sv_onstack = 0 static int ringring; -static sleepx __P((void)); - -int sleep(n) unsigned n; { +sleep(n) + unsigned n; +{ int sleepx(), omask; struct itimerval itv, oitv; register struct itimerval *itp = &itv; @@ -61,7 +59,9 @@ int sleep(n) unsigned n; { (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0); } -static sleepx() { +static +sleepx() +{ ringring = 1; } diff --git a/lib/libstdc/gen/strcat.c b/lib/libstdc/gen/strcat.c index aed1f8d..6030ccc 100644 --- a/lib/libstdc/gen/strcat.c +++ b/lib/libstdc/gen/strcat.c @@ -1,15 +1,16 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcat.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Concatenate s2 on the end of s1. S1's space must be large enough. * Return s1. */ -char *strcat(s1, s2) register char *s1; register char *s2; { +char * +strcat(s1, s2) +register char *s1, *s2; +{ register char *os1; os1 = s1; diff --git a/lib/libstdc/gen/strcmp.c b/lib/libstdc/gen/strcmp.c index 921f505..cd152f2 100644 --- a/lib/libstdc/gen/strcmp.c +++ b/lib/libstdc/gen/strcmp.c @@ -1,14 +1,14 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcmp.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Compare strings: s1>s2: >0 s1==s2: 0 s1 - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strcpy.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Copy string s2 to s1. s1 must be large enough. * return s1 */ -char *strcpy(s1, s2) register char *s1; register char *s2; { +char * +strcpy(s1, s2) +register char *s1, *s2; +{ register char *os1; os1 = s1; diff --git a/lib/libstdc/gen/strlen.c b/lib/libstdc/gen/strlen.c index d613ea7..55faed8 100644 --- a/lib/libstdc/gen/strlen.c +++ b/lib/libstdc/gen/strlen.c @@ -1,15 +1,15 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strlen.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Returns the number of * non-NULL bytes in string argument. */ -int strlen(s) register char *s; { +strlen(s) +register char *s; +{ register n; n = 0; diff --git a/lib/libstdc/gen/strncat.c b/lib/libstdc/gen/strncat.c index b8e4605..21d75cb 100644 --- a/lib/libstdc/gen/strncat.c +++ b/lib/libstdc/gen/strncat.c @@ -1,8 +1,6 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strncat.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Concatenate s2 on the end of s1. S1's space must be large enough. @@ -10,7 +8,11 @@ static char sccsid[] = "@(#)strncat.c 5.2 (Berkeley) 3/9/86"; * Return s1. */ -char *strncat(s1, s2, n) register char *s1; register char *s2; register n; { +char * +strncat(s1, s2, n) +register char *s1, *s2; +register n; +{ register char *os1; os1 = s1; diff --git a/lib/libstdc/gen/strncmp.c b/lib/libstdc/gen/strncmp.c index 5fd5beb..9d035e8 100644 --- a/lib/libstdc/gen/strncmp.c +++ b/lib/libstdc/gen/strncmp.c @@ -1,14 +1,15 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strncmp.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Compare strings (at most n bytes): s1>s2: >0 s1==s2: 0 s1= 0 && *s1 == *s2++) if (*s1++ == '\0') diff --git a/lib/libstdc/gen/strncpy.c b/lib/libstdc/gen/strncpy.c index 2f46479..40be252 100644 --- a/lib/libstdc/gen/strncpy.c +++ b/lib/libstdc/gen/strncpy.c @@ -1,15 +1,16 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strncpy.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Copy s2 to s1, truncating or null-padding to always copy n bytes * return s1 */ -char *strncpy(s1, s2, n) register char *s1; register char *s2; int n; { +char * +strncpy(s1, s2, n) +register char *s1, *s2; +{ register i; register char *os1; diff --git a/lib/libstdc/gen/swab.c b/lib/libstdc/gen/swab.c index 289f39d..8085998 100644 --- a/lib/libstdc/gen/swab.c +++ b/lib/libstdc/gen/swab.c @@ -1,15 +1,16 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)swab.c 5.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Swab bytes * Jeffrey Mogul, Stanford */ -int swab(from, to, n) register char *from; register char *to; register int n; { +swab(from, to, n) + register char *from, *to; + register int n; +{ register unsigned long temp; n >>= 1; n++; diff --git a/lib/libstdc/gen/syslog.c b/lib/libstdc/gen/syslog.c index d84afa8..d422956 100644 --- a/lib/libstdc/gen/syslog.c +++ b/lib/libstdc/gen/syslog.c @@ -1,14 +1,6 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - +#include +#include +#include /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -17,7 +9,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)syslog.c 5.9 (Berkeley) 5/7/86"; -#endif +#endif LIBC_SCCS and not lint /* * SYSLOG -- print message on log file @@ -36,13 +28,13 @@ static char sccsid[] = "@(#)syslog.c 5.9 (Berkeley) 5/7/86"; * Modified to use UNIX domain IPC by Ralph Campbell */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include +#include +#include #define MAXLINE 1024 /* max message size */ #define NULL 0 /* manifest */ @@ -65,7 +57,10 @@ static struct sockaddr SyslogAddr; /* AF_UNIX address of local logger */ extern int errno, sys_nerr; extern char *sys_errlist[]; -int syslog(pri, fmt, p0, p1, p2, p3, p4) int pri; char *fmt; int p0; int p1; int p2; int p3; int p4; { +syslog(pri, fmt, p0, p1, p2, p3, p4) + int pri; + char *fmt; +{ char buf[MAXLINE + 1], outline[MAXLINE + 1]; register char *b, *f, *o; register int c; @@ -160,7 +155,10 @@ int syslog(pri, fmt, p0, p1, p2, p3, p4) int pri; char *fmt; int p0; int p1; int * OPENLOG -- open system log */ -int openlog(ident, logstat, logfac) char *ident; int logstat; int logfac; { +openlog(ident, logstat, logfac) + char *ident; + int logstat, logfac; +{ if (ident != NULL) LogTag = ident; LogStat = logstat; @@ -180,7 +178,8 @@ int openlog(ident, logstat, logfac) char *ident; int logstat; int logfac; { * CLOSELOG -- close the system log */ -int closelog() { +closelog() +{ (void) close(LogFile); LogFile = -1; @@ -189,7 +188,9 @@ int closelog() { /* * SETLOGMASK -- set the log mask level */ -int setlogmask(pmask) int pmask; { +setlogmask(pmask) + int pmask; +{ int omask; omask = LogMask; diff --git a/lib/libstdc/gen/system.c b/lib/libstdc/gen/system.c index 9785bd6..4ab8a7b 100644 --- a/lib/libstdc/gen/system.c +++ b/lib/libstdc/gen/system.c @@ -1,15 +1,14 @@ -#include -#include -#include +#include #include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)system.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int system(s) char *s; { +system(s) +char *s; +{ int status, pid, w; register int (*istat)(), (*qstat)(); diff --git a/lib/libstdc/gen/telldir.c b/lib/libstdc/gen/telldir.c index 3ccd91c..2b7af90 100644 --- a/lib/libstdc/gen/telldir.c +++ b/lib/libstdc/gen/telldir.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,15 +6,18 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)telldir.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * return a pointer into a directory */ -long telldir(dirp) DIR *dirp; { +long +telldir(dirp) + DIR *dirp; +{ extern long lseek(); return (lseek(dirp->dd_fd, 0L, 1) - dirp->dd_size + dirp->dd_loc); diff --git a/lib/libstdc/gen/time.c b/lib/libstdc/gen/time.c index f8e66b2..49eeb8d 100644 --- a/lib/libstdc/gen/time.c +++ b/lib/libstdc/gen/time.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,15 +6,18 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)time.c 5.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Backwards compatible time call. */ -/*#include */ -/*#include */ +#include +#include -long time(t) time_t *t; { +long +time(t) + time_t *t; +{ struct timeval tt; if (gettimeofday(&tt, (struct timezone *)0) < 0) diff --git a/lib/libstdc/gen/timezone.c b/lib/libstdc/gen/timezone.c index 55ab489..644bbd2 100644 --- a/lib/libstdc/gen/timezone.c +++ b/lib/libstdc/gen/timezone.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)timezone.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * The arguments are the number of minutes of time @@ -44,7 +40,8 @@ static struct zone { -1 }; -char *timezone(zone, dst) int zone; int dst; { +char *timezone(zone, dst) +{ register struct zone *zp; static char czone[10]; char *sign; diff --git a/lib/libstdc/gen/ttyname.c b/lib/libstdc/gen/ttyname.c index 2ede046..9fd0c91 100644 --- a/lib/libstdc/gen/ttyname.c +++ b/lib/libstdc/gen/ttyname.c @@ -1,12 +1,6 @@ -#include -#include -#include -#include -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ttyname.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * ttyname(f): return "/dev/ttyXX" which the the name of the @@ -15,15 +9,17 @@ static char sccsid[] = "@(#)ttyname.c 5.2 (Berkeley) 3/9/86"; */ #define NULL 0 -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include static char dev[] = "/dev/"; -/*char *strcpy();*/ -/*char *strcat();*/ +char *strcpy(); +char *strcat(); -char *ttyname(f) int f; { +char * +ttyname(f) +{ struct stat fsb; struct stat tsb; register struct direct *db; diff --git a/lib/libstdc/gen/ttyslot.c b/lib/libstdc/gen/ttyslot.c index 7e75cab..e8ba04f 100644 --- a/lib/libstdc/gen/ttyslot.c +++ b/lib/libstdc/gen/ttyslot.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1984 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,21 +6,22 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ttyslot.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Return the number of the slot in the utmp file * corresponding to the current user: try for file 0, 1, 2. * Definition is the line number in the /etc/ttys file. */ -/*#include */ +#include -/*char *ttyname();*/ -/*char *rindex();*/ +char *ttyname(); +char *rindex(); #define NULL 0 -int ttyslot() { +ttyslot() +{ register struct ttyent *ty; register char *tp, *p; register s; diff --git a/lib/libstdc/gen/ualarm.c b/lib/libstdc/gen/ualarm.c index 22624f6..6f14494 100644 --- a/lib/libstdc/gen/ualarm.c +++ b/lib/libstdc/gen/ualarm.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,9 +6,9 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ualarm.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include #define USPS 1000000 /* # of microseconds in a second */ @@ -19,7 +17,11 @@ static char sccsid[] = "@(#)ualarm.c 5.2 (Berkeley) 3/9/86"; * If ``reload'' is non-zero, keep generating SIGALRM * every ``reload'' microseconds after the first signal. */ -unsigned ualarm(usecs, reload) register unsigned usecs; register unsigned reload; { +unsigned +ualarm(usecs, reload) + register unsigned usecs; + register unsigned reload; +{ struct itimerval new, old; new.it_interval.tv_usec = reload % USPS; diff --git a/lib/libstdc/gen/usleep.c b/lib/libstdc/gen/usleep.c index 402d4cd..ae6595d 100644 --- a/lib/libstdc/gen/usleep.c +++ b/lib/libstdc/gen/usleep.c @@ -1,6 +1,4 @@ #include -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,10 +7,10 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)usleep.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include #define USPS 1000000 /* number of microseconds in a second */ #define TICK 10000 /* system clock resolution in microseconds */ @@ -22,9 +20,9 @@ static char sccsid[] = "@(#)usleep.c 5.2 (Berkeley) 3/9/86"; static int ringring; -static sleepx __P((void)); - -int usleep(n) unsigned n; { +usleep(n) + unsigned n; +{ int sleepx(), omask; struct itimerval itv, oitv; register struct itimerval *itp = &itv; @@ -64,7 +62,9 @@ int usleep(n) unsigned n; { (void) setitimer(ITIMER_REAL, &oitv, (struct itimerval *)0); } -static sleepx() { +static +sleepx() +{ ringring = 1; } diff --git a/lib/libstdc/gen/valloc.c b/lib/libstdc/gen/valloc.c index 5b066cd..1388d1d 100644 --- a/lib/libstdc/gen/valloc.c +++ b/lib/libstdc/gen/valloc.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,11 +6,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)valloc.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*char *malloc();*/ +char *malloc(); -char *valloc(i) int i; { +char * +valloc(i) + int i; +{ int valsiz = getpagesize(), j; char *cp = malloc(i + (valsiz-1)); diff --git a/lib/libstdc/grp.h b/lib/libstdc/grp.h index 25094e3..f053f22 100644 --- a/lib/libstdc/grp.h +++ b/lib/libstdc/grp.h @@ -1,7 +1,3 @@ -#ifndef _GRP_H_ -#define _GRP_H_ - - /* grp.h 4.1 83/05/03 */ struct group { /* see getgrent(3) */ @@ -11,28 +7,4 @@ struct group { /* see getgrent(3) */ char **gr_mem; }; -/*struct group *getgrent(), *getgrgid(), *getgrnam();*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* gen/getgrent.c */ -int setgrent __P((void)); -int endgrent __P((void)); -struct group *getgrent __P((void)); - -/* gen/getgrgid.c */ -struct group *getgrgid __P((register gid)); - -/* gen/getgrnam.c */ -struct group *getgrnam __P((register char *name)); - -/* gen/initgroups.c */ -int initgroups __P((char *uname, int agroup)); - -#endif +struct group *getgrent(), *getgrgid(), *getgrnam(); diff --git a/lib/libstdc/include.patch b/lib/libstdc/include.patch deleted file mode 100644 index 3ac9d23..0000000 --- a/lib/libstdc/include.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff --git a/include/a.out.h b/include/a.out.h -index 91d4fcd..ee338c8 100644 ---- a/include/a.out.h -+++ b/include/a.out.h -@@ -39,44 +39,4 @@ unsigned int r_symbolnum:24, /* local symbol ordinal */ - :4; /* nothing, yet */ - }; - --/* -- * Format of a symbol table entry; this file is included by -- * and should be used if you aren't interested the a.out header -- * or relocation information. -- */ --struct nlist { -- union { -- char *n_name; /* for use when in-core */ -- long n_strx; /* index into file string table */ -- } n_un; --unsigned char n_type; /* type flag, i.e. N_TEXT etc; see below */ -- char n_other; /* unused */ -- short n_desc; /* see */ --unsigned long n_value; /* value of this symbol (or sdb offset) */ --}; --#define n_hash n_desc /* used internally by ld */ -- --/* -- * Simple values for n_type. -- */ --#define N_UNDF 0x0 /* undefined */ --#define N_ABS 0x2 /* absolute */ --#define N_TEXT 0x4 /* text */ --#define N_DATA 0x6 /* data */ --#define N_BSS 0x8 /* bss */ --#define N_COMM 0x12 /* common (internal to ld) */ --#define N_FN 0x1f /* file name symbol */ -- --#define N_EXT 01 /* external bit, or'ed in */ --#define N_TYPE 0x1e /* mask for all the type bits */ -- --/* -- * Sdb entries have some of the N_STAB bits set. -- * These are given in -- */ --#define N_STAB 0xe0 /* if any of these bits set, a SDB entry */ -- --/* -- * Format for namelist values. -- */ --#define N_FORMAT "%08x" -+#include -diff --git a/include/stdio.h b/include/stdio.h -index 2001be8..ca9648c 100644 ---- a/include/stdio.h -+++ b/include/stdio.h -@@ -59,7 +59,7 @@ FILE *popen(); - long ftell(); - char *fgets(); - char *gets(); --#ifdef vax -+#if 0 /*def vax*/ - char *sprintf(); /* too painful to do right */ - #endif - # endif diff --git a/lib/libstdc/inet.h b/lib/libstdc/inet.h deleted file mode 100644 index 0230786..0000000 --- a/lib/libstdc/inet.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _INET_H_ -#define _INET_H_ - -#include - -#endif diff --git a/lib/libstdc/inet/inet_addr.c b/lib/libstdc/inet/inet_addr.c index 9c26492..342ff4a 100644 --- a/lib/libstdc/inet/inet_addr.c +++ b/lib/libstdc/inet/inet_addr.c @@ -1,8 +1,4 @@ #include -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,11 +7,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_addr.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include /* * Internet address interpretation routine. @@ -24,7 +20,10 @@ static char sccsid[] = "@(#)inet_addr.c 5.2 (Berkeley) 3/9/86"; * which are expected to be an address. * The value returned is in network order. */ -u_long inet_addr(cp) register char *cp; { +u_long +inet_addr(cp) + register char *cp; +{ register u_long val, base, n; register char c; u_long parts[4], *pp = parts; diff --git a/lib/libstdc/inet/inet_lnaof.c b/lib/libstdc/inet/inet_lnaof.c index 3b74af2..4c8b0ba 100644 --- a/lib/libstdc/inet/inet_lnaof.c +++ b/lib/libstdc/inet/inet_lnaof.c @@ -1,7 +1,4 @@ #include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,17 +7,19 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_lnaof.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * Return the local network address portion of an * internet address; handles class a/b/c network * number formats. */ -int inet_lnaof(in) struct in_addr in; { +inet_lnaof(in) + struct in_addr in; +{ register u_long i = ntohl(in.s_addr); if (IN_CLASSA(i)) diff --git a/lib/libstdc/inet/inet_makeaddr.c b/lib/libstdc/inet/inet_makeaddr.c index 2ecccc0..8e62682 100644 --- a/lib/libstdc/inet/inet_makeaddr.c +++ b/lib/libstdc/inet/inet_makeaddr.c @@ -1,7 +1,4 @@ #include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,16 +7,19 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_makeaddr.c 5.1 (Berkeley) 3/11/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * Formulate an Internet address from network + host. Used in * building addresses stored in the ifnet structure. */ -struct in_addr inet_makeaddr(net, host) int net; int host; { +struct in_addr +inet_makeaddr(net, host) + int net, host; +{ u_long addr; if (net < 128) diff --git a/lib/libstdc/inet/inet_netof.c b/lib/libstdc/inet/inet_netof.c index 4a4e71b..d752878 100644 --- a/lib/libstdc/inet/inet_netof.c +++ b/lib/libstdc/inet/inet_netof.c @@ -1,7 +1,4 @@ #include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,16 +7,18 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_netof.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * Return the network number from an internet * address; handles class a/b/c network #'s. */ -int inet_netof(in) struct in_addr in; { +inet_netof(in) + struct in_addr in; +{ register u_long i = ntohl(in.s_addr); if (IN_CLASSA(i)) diff --git a/lib/libstdc/inet/inet_network.c b/lib/libstdc/inet/inet_network.c index cf83ece..57f0b5f 100644 --- a/lib/libstdc/inet/inet_network.c +++ b/lib/libstdc/inet/inet_network.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,17 +6,20 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_network.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include /* * Internet network address interpretation routine. * The library routines call this routine to interpret * network numbers. */ -u_long inet_network(cp) register char *cp; { +u_long +inet_network(cp) + register char *cp; +{ register u_long val, base, n; register char c; u_long parts[4], *pp = parts; diff --git a/lib/libstdc/inet/inet_ntoa.c b/lib/libstdc/inet/inet_ntoa.c index f0c6b43..98713f4 100644 --- a/lib/libstdc/inet/inet_ntoa.c +++ b/lib/libstdc/inet/inet_ntoa.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,16 +6,19 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)inet_ntoa.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Convert network-format internet address * to base 256 d.d.d.d representation. */ -/*#include */ -/*#include */ +#include +#include -char *inet_ntoa(in) struct in_addr in; { +char * +inet_ntoa(in) + struct in_addr in; +{ static char b[18]; register char *p; diff --git a/lib/libstdc/lastlog.h b/lib/libstdc/lastlog.h index 65c514f..3686a91 100644 --- a/lib/libstdc/lastlog.h +++ b/lib/libstdc/lastlog.h @@ -1,8 +1,3 @@ -#ifndef _LASTLOG_H_ -#define _LASTLOG_H_ - -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -16,5 +11,3 @@ struct lastlog { char ll_line[8]; char ll_host[16]; /* same as in utmp */ }; - -#endif diff --git a/lib/libstdc/libstdc.patch b/lib/libstdc/libstdc.patch new file mode 100644 index 0000000..04d3d1e --- /dev/null +++ b/lib/libstdc/libstdc.patch @@ -0,0 +1,1031 @@ +diff --unified --recursive --new-file libstdc.orig/a.out.h libstdc/a.out.h +--- libstdc.orig/a.out.h 2017-01-18 10:16:51.521265224 +1100 ++++ libstdc/a.out.h 2017-01-18 10:16:51.529265233 +1100 +@@ -39,44 +39,4 @@ + :4; /* nothing, yet */ + }; + +-/* +- * Format of a symbol table entry; this file is included by +- * and should be used if you aren't interested the a.out header +- * or relocation information. +- */ +-struct nlist { +- union { +- char *n_name; /* for use when in-core */ +- long n_strx; /* index into file string table */ +- } n_un; +-unsigned char n_type; /* type flag, i.e. N_TEXT etc; see below */ +- char n_other; /* unused */ +- short n_desc; /* see */ +-unsigned long n_value; /* value of this symbol (or sdb offset) */ +-}; +-#define n_hash n_desc /* used internally by ld */ +- +-/* +- * Simple values for n_type. +- */ +-#define N_UNDF 0x0 /* undefined */ +-#define N_ABS 0x2 /* absolute */ +-#define N_TEXT 0x4 /* text */ +-#define N_DATA 0x6 /* data */ +-#define N_BSS 0x8 /* bss */ +-#define N_COMM 0x12 /* common (internal to ld) */ +-#define N_FN 0x1f /* file name symbol */ +- +-#define N_EXT 01 /* external bit, or'ed in */ +-#define N_TYPE 0x1e /* mask for all the type bits */ +- +-/* +- * Sdb entries have some of the N_STAB bits set. +- * These are given in +- */ +-#define N_STAB 0xe0 /* if any of these bits set, a SDB entry */ +- +-/* +- * Format for namelist values. +- */ +-#define N_FORMAT "%08x" ++#include +diff --unified --recursive --new-file libstdc.orig/compat-4.1/gtty.c libstdc/compat-4.1/gtty.c +--- libstdc.orig/compat-4.1/gtty.c 2017-01-18 10:16:51.517265220 +1100 ++++ libstdc/compat-4.1/gtty.c 2017-01-18 10:16:56.825271193 +1100 +@@ -15,7 +15,7 @@ + #include + + gtty(fd, ap) +- struct sgtty *ap; ++ struct sgttyb *ap; + { + + return(ioctl(fd, TIOCGETP, ap)); +diff --unified --recursive --new-file libstdc.orig/compat-4.1/stty.c libstdc/compat-4.1/stty.c +--- libstdc.orig/compat-4.1/stty.c 2017-01-18 10:16:51.521265224 +1100 ++++ libstdc/compat-4.1/stty.c 2017-01-18 10:16:56.825271193 +1100 +@@ -15,7 +15,7 @@ + #include + + stty(fd, ap) +- struct sgtty *ap; ++ struct sgttyb *ap; + { + + return(ioctl(fd, TIOCSETP, ap)); +diff --unified --recursive --new-file libstdc.orig/gen/insque.c libstdc/gen/insque.c +--- libstdc.orig/gen/insque.c 2017-01-18 10:16:51.525265228 +1100 ++++ libstdc/gen/insque.c 2017-01-18 11:09:24.774728999 +1100 +@@ -14,10 +14,11 @@ + * NOTE: this implementation is non-atomic!! + */ + +-struct vaxque { /* queue format expected by VAX queue instructions */ +- struct vaxque *vq_next; +- struct vaxque *vq_prev; +-}; ++/* moved this to gen.h as it's shared by caller and by remque.c */ ++/*struct vaxque {*/ /* queue format expected by VAX queue instructions */ ++/* struct vaxque *vq_next;*/ ++/* struct vaxque *vq_prev;*/ ++/*};*/ + + insque(e, prev) + register struct vaxque *e, *prev; +diff --unified --recursive --new-file libstdc.orig/gen/popen.c libstdc/gen/popen.c +--- libstdc.orig/gen/popen.c 2017-01-18 10:16:51.525265228 +1100 ++++ libstdc/gen/popen.c 1970-01-01 10:00:00.000000000 +1000 +@@ -1,79 +0,0 @@ +-/* +- * Copyright (c) 1980 Regents of the University of California. +- * All rights reserved. The Berkeley software License Agreement +- * specifies the terms and conditions for redistribution. +- */ +- +-#if defined(LIBC_SCCS) && !defined(lint) +-static char sccsid[] = "@(#)popen.c 5.4 (Berkeley) 3/26/86"; +-#endif LIBC_SCCS and not lint +- +-#include +-#include +- +-#define tst(a,b) (*mode == 'r'? (b) : (a)) +-#define RDR 0 +-#define WTR 1 +- +-extern char *malloc(); +- +-static int *popen_pid; +-static int nfiles; +- +-FILE * +-popen(cmd,mode) +- char *cmd; +- char *mode; +-{ +- int p[2]; +- int myside, hisside, pid; +- +- if (nfiles <= 0) +- nfiles = getdtablesize(); +- if (popen_pid == NULL) { +- popen_pid = (int *)malloc(nfiles * sizeof *popen_pid); +- if (popen_pid == NULL) +- return (NULL); +- for (pid = 0; pid < nfiles; pid++) +- popen_pid[pid] = -1; +- } +- if (pipe(p) < 0) +- return (NULL); +- myside = tst(p[WTR], p[RDR]); +- hisside = tst(p[RDR], p[WTR]); +- if ((pid = vfork()) == 0) { +- /* myside and hisside reverse roles in child */ +- close(myside); +- if (hisside != tst(0, 1)) { +- dup2(hisside, tst(0, 1)); +- close(hisside); +- } +- execl("/bin/sh", "sh", "-c", cmd, (char *)NULL); +- _exit(127); +- } +- if (pid == -1) { +- close(myside); +- close(hisside); +- return (NULL); +- } +- popen_pid[myside] = pid; +- close(hisside); +- return (fdopen(myside, mode)); +-} +- +-pclose(ptr) +- FILE *ptr; +-{ +- int child, pid, status, omask; +- +- child = popen_pid[fileno(ptr)]; +- popen_pid[fileno(ptr)] = -1; +- fclose(ptr); +- if (child == -1) +- return (-1); +- omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP)); +- while ((pid = wait(&status)) != child && pid != -1) +- ; +- (void) sigsetmask(omask); +- return (pid == -1 ? -1 : status); +-} +diff --unified --recursive --new-file libstdc.orig/gen/remque.c libstdc/gen/remque.c +--- libstdc.orig/gen/remque.c 2017-01-18 10:16:51.525265228 +1100 ++++ libstdc/gen/remque.c 2017-01-18 11:09:47.842769559 +1100 +@@ -14,10 +14,11 @@ + * NOTE: this implementation is non-atomic!! + */ + +-struct vaxque { /* queue format expected by VAX queue instructions */ +- struct vaxque *vq_next; +- struct vaxque *vq_prev; +-}; ++/* moved this to gen.h as it's shared by caller and by remque.c */ ++/*struct vaxque {*/ /* queue format expected by VAX queue instructions */ ++/* struct vaxque *vq_next;*/ ++/* struct vaxque *vq_prev;*/ ++/*};*/ + + remque(e) + register struct vaxque *e; +diff --unified --recursive --new-file libstdc.orig/gen.h libstdc/gen.h +--- libstdc.orig/gen.h 1970-01-01 10:00:00.000000000 +1000 ++++ libstdc/gen.h 2017-01-18 11:14:09.663327386 +1100 +@@ -0,0 +1,5 @@ ++/* formerly duplicated in gen/insque.c and gen/remque.c */ ++struct vaxque { /* queue format expected by VAX queue instructions */ ++ struct vaxque *vq_next; ++ struct vaxque *vq_prev; ++}; +diff --unified --recursive --new-file libstdc.orig/net.h libstdc/net.h +--- libstdc.orig/net.h 1970-01-01 10:00:00.000000000 +1000 ++++ libstdc/net.h 2017-01-18 11:13:55.939294422 +1100 +@@ -0,0 +1,15 @@ ++/* formerly duplicated in netinet/in.h and netns/ns.h */ ++#if !defined(vax) && !defined(ntohl) && !defined(lint) ++/* ++ * Macros for number representation conversion. ++ */ ++#define ntohl(x) (x) ++#define ntohs(x) (x) ++#define htonl(x) (x) ++#define htons(x) (x) ++#endif ++ ++#if !defined(ntohl) && (defined(vax) || defined(lint)) ++u_short ntohs(), htons(); ++u_long ntohl(), htonl(); ++#endif +diff --unified --recursive --new-file libstdc.orig/netinet/in.h libstdc/netinet/in.h +--- libstdc.orig/netinet/in.h 2017-01-18 10:16:51.521265224 +1100 ++++ libstdc/netinet/in.h 2017-01-18 11:08:03.002599308 +1100 +@@ -90,20 +90,21 @@ + */ + #define IP_OPTIONS 1 /* set/get IP per-packet options */ + +-#if !defined(vax) && !defined(ntohl) && !defined(lint) ++/* moved this to net.h as it's shared by netns/ns.h */ ++/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/ + /* + * Macros for number representation conversion. + */ +-#define ntohl(x) (x) +-#define ntohs(x) (x) +-#define htonl(x) (x) +-#define htons(x) (x) +-#endif ++/*#define ntohl(x) (x)*/ ++/*#define ntohs(x) (x)*/ ++/*#define htonl(x) (x)*/ ++/*#define htons(x) (x)*/ ++/*#endif*/ + +-#if !defined(ntohl) && (defined(vax) || defined(lint)) +-u_short ntohs(), htons(); +-u_long ntohl(), htonl(); +-#endif ++/*#if !defined(ntohl) && (defined(vax) || defined(lint))*/ ++/*u_short ntohs(), htons();*/ ++/*u_long ntohl(), htonl();*/ ++/*#endif*/ + + #ifdef KERNEL + extern struct domain inetdomain; +diff --unified --recursive --new-file libstdc.orig/netinet/ip.h libstdc/netinet/ip.h +--- libstdc.orig/netinet/ip.h 2017-01-18 10:16:51.521265224 +1100 ++++ libstdc/netinet/ip.h 2017-01-18 10:16:51.529265233 +1100 +@@ -81,7 +81,7 @@ + struct in_addr ipt_addr; + n_long ipt_time; + } ipt_ta[1]; +- } ++ }; + }; + + /* flag bits for ipt_flg */ +diff --unified --recursive --new-file libstdc.orig/netinet/tcp.h libstdc/netinet/tcp.h +--- libstdc.orig/netinet/tcp.h 2017-01-18 10:16:51.521265224 +1100 ++++ libstdc/netinet/tcp.h 2017-01-18 11:12:57.871158957 +1100 +@@ -44,7 +44,9 @@ + #ifdef lint + #define TCP_MSS 536 + #else +-#define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr)) ++/* redefined this to avoid a circular dependency */ ++/*#define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr))*/ ++#define TCP_MSS MIN(512, IP_MSS - sizeof(struct ipovly) - sizeof(struct tcphdr)) + #endif + + /* +diff --unified --recursive --new-file libstdc.orig/netns/ns.h libstdc/netns/ns.h +--- libstdc.orig/netns/ns.h 2017-01-18 10:16:51.521265224 +1100 ++++ libstdc/netns/ns.h 2017-01-18 11:08:30.898640954 +1100 +@@ -103,20 +103,21 @@ + #define ns_nullhost(x) (((x).x_host.s_host[0]==0) && \ + ((x).x_host.s_host[1]==0) && ((x).x_host.s_host[2]==0)) + +-#if !defined(vax) && !defined(ntohl) && !defined(lint) ++/* moved this to net.h as it's shared by netns/ns.h */ ++/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/ + /* + * Macros for number representation conversion. + */ +-#define ntohl(x) (x) +-#define ntohs(x) (x) +-#define htonl(x) (x) +-#define htons(x) (x) +-#endif ++/*#define ntohl(x) (x)*/ ++/*#define ntohs(x) (x)*/ ++/*#define htonl(x) (x)*/ ++/*#define htons(x) (x)*/ ++/*#endif*/ + +-#if !defined(ntohl) && (defined(vax) || defined(lint)) +-u_short ntohs(), htons(); +-u_long ntohl(), htonl(); +-#endif ++/*#if !defined(ntohl) && (defined(vax) || defined(lint))*/ ++/*u_short ntohs(), htons();*/ ++/*u_long ntohl(), htonl();*/ ++/*#endif*/ + + #ifdef KERNEL + extern struct domain nsdomain; +diff --unified --recursive --new-file libstdc.orig/stdio/doscan.c libstdc/stdio/doscan.c +--- libstdc.orig/stdio/doscan.c 2017-01-18 10:16:51.517265220 +1100 ++++ libstdc/stdio/doscan.c 2017-01-18 10:16:56.829271198 +1100 +@@ -3,7 +3,8 @@ + #endif LIBC_SCCS and not lint + + #include +-#include ++#include ++#include + + #define SPC 01 + #define STP 02 +@@ -27,14 +28,14 @@ + 0,0,0,0,0,0,0,0, + }; + +-_doscan(iop, fmt, argp) ++_doscan(iop, fmt, ap) + FILE *iop; + register char *fmt; +-register int **argp; ++register va_list ap; + { + register int ch; + int nmatch, len, ch1; +- int **ptr, fileended, size; ++ int *ptr, fileended, size; + + nmatch = 0; + fileended = 0; +@@ -46,7 +47,7 @@ + goto def; + ptr = 0; + if (ch != '*') +- ptr = argp++; ++ ptr = va_arg(ap, int *); + else + ch = *fmt++; + len = 0; +@@ -100,7 +101,7 @@ + + static + _innum(ptr, type, len, size, iop, eofptr) +-int **ptr, *eofptr; ++int *ptr, *eofptr; + FILE *iop; + { + extern double atof(); +@@ -111,7 +112,7 @@ + long lcval; + + if (type=='c' || type=='s' || type=='[') +- return(_instr(ptr? *(char **)ptr: (char *)NULL, type, len, iop, eofptr)); ++ return(_instr(ptr? (char *)ptr: (char *)NULL, type, len, iop, eofptr)); + lcval = 0; + ndigit = 0; + scale = INT; +@@ -185,23 +186,23 @@ + + case (FLOAT<<4) | SHORT: + case (FLOAT<<4) | REGULAR: +- **(float **)ptr = atof(numbuf); ++ *(float *)ptr = atof(numbuf); + break; + + case (FLOAT<<4) | LONG: +- **(double **)ptr = atof(numbuf); ++ *(double *)ptr = atof(numbuf); + break; + + case (INT<<4) | SHORT: +- **(short **)ptr = lcval; ++ *(short *)ptr = lcval; + break; + + case (INT<<4) | REGULAR: +- **(int **)ptr = lcval; ++ *(int *)ptr = lcval; + break; + + case (INT<<4) | LONG: +- **(long **)ptr = lcval; ++ *(long *)ptr = lcval; + break; + } + return(1); +diff --unified --recursive --new-file libstdc.orig/stdio/fprintf.c libstdc/stdio/fprintf.c +--- libstdc.orig/stdio/fprintf.c 2017-01-18 10:16:51.517265220 +1100 ++++ libstdc/stdio/fprintf.c 2017-01-18 10:16:56.829271198 +1100 +@@ -1,32 +1,49 @@ + /* + * Copyright (c) 1980 Regents of the University of California. +- * All rights reserved. The Berkeley software License Agreement +- * specifies the terms and conditions for redistribution. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms are permitted ++ * provided that the above copyright notice and this paragraph are ++ * duplicated in all such forms and that any documentation, ++ * advertising materials, and other materials related to such ++ * distribution and use acknowledge that the software was developed ++ * by the University of California, Berkeley. The name of the ++ * University may not be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + + #if defined(LIBC_SCCS) && !defined(lint) +-static char sccsid[] = "@(#)fprintf.c 5.2 (Berkeley) 3/9/86"; +-#endif LIBC_SCCS and not lint ++static char sccsid[] = "@(#)fprintf.c 5.4 (Berkeley) 6/27/88"; ++#endif /* LIBC_SCCS and not lint */ + +-#include ++#include ++#include + +-fprintf(iop, fmt, args) +-register FILE *iop; +-char *fmt; ++fprintf(iop, fmt, va_alist) ++ register FILE *iop; ++ char *fmt; ++ va_dcl + { ++ va_list ap; ++ int len; + char localbuf[BUFSIZ]; + ++ va_start(ap); + if (iop->_flag & _IONBF) { + iop->_flag &= ~_IONBF; + iop->_ptr = iop->_base = localbuf; + iop->_bufsiz = BUFSIZ; +- _doprnt(fmt, &args, iop); ++ len = _doprnt(fmt, ap, iop); + fflush(iop); + iop->_flag |= _IONBF; + iop->_base = NULL; + iop->_bufsiz = NULL; + iop->_cnt = 0; + } else +- _doprnt(fmt, &args, iop); +- return(ferror(iop)? EOF: 0); ++ len = _doprnt(fmt, ap, iop); ++ va_end(ap); ++ return(ferror(iop) ? EOF : len); + } +diff --unified --recursive --new-file libstdc.orig/stdio/Makefile libstdc/stdio/Makefile +--- libstdc.orig/stdio/Makefile 2017-01-18 10:16:51.517265220 +1100 ++++ libstdc/stdio/Makefile 2017-01-18 10:16:56.825271193 +1100 +@@ -25,15 +25,15 @@ + fprintf.c fputc.c fread.c freopen.c fseek.c ftell.c \ + fwrite.c getchar.c getw.c printf.c putchar.c \ + putw.c rew.c scanf.c setbuf.c setbuffer.c sibuf.c sobuf.c \ +- sprintf.c strout.c ungetc.c +-VAXSRC= fgets.c fputs.c gets.c puts.c ++ sprintf.c strout.c ungetc.c vfprintf.c vprintf.c vsprintf.c ++VAXSRC= doprnt.c fgets.c fputs.c gets.c puts.c + STDOBJ= clrerr.o doscan.o \ + exit.o fdopen.o fgetc.o filbuf.o findiop.o flsbuf.o fopen.o \ + fprintf.o fputc.o fread.o freopen.o fseek.o ftell.o \ + fwrite.o getchar.o getw.o printf.o putchar.o \ + putw.o rew.o scanf.o setbuf.o setbuffer.o sibuf.o sobuf.o \ +- sprintf.o strout.o ungetc.o +-VAXOBJ= fgets.o fputs.o gets.o puts.o ++ sprintf.o strout.o ungetc.o vfprintf.o vprintf.o vsprintf.o ++VAXOBJ= doprnt.o fgets.o fputs.o gets.o puts.o + TAGSFILE=tags + + .c.o: +diff --unified --recursive --new-file libstdc.orig/stdio/popen.c libstdc/stdio/popen.c +--- libstdc.orig/stdio/popen.c 1970-01-01 10:00:00.000000000 +1000 ++++ libstdc/stdio/popen.c 2017-01-18 10:16:50.157263730 +1100 +@@ -0,0 +1,79 @@ ++/* ++ * Copyright (c) 1980 Regents of the University of California. ++ * All rights reserved. The Berkeley software License Agreement ++ * specifies the terms and conditions for redistribution. ++ */ ++ ++#if defined(LIBC_SCCS) && !defined(lint) ++static char sccsid[] = "@(#)popen.c 5.4 (Berkeley) 3/26/86"; ++#endif LIBC_SCCS and not lint ++ ++#include ++#include ++ ++#define tst(a,b) (*mode == 'r'? (b) : (a)) ++#define RDR 0 ++#define WTR 1 ++ ++extern char *malloc(); ++ ++static int *popen_pid; ++static int nfiles; ++ ++FILE * ++popen(cmd,mode) ++ char *cmd; ++ char *mode; ++{ ++ int p[2]; ++ int myside, hisside, pid; ++ ++ if (nfiles <= 0) ++ nfiles = getdtablesize(); ++ if (popen_pid == NULL) { ++ popen_pid = (int *)malloc(nfiles * sizeof *popen_pid); ++ if (popen_pid == NULL) ++ return (NULL); ++ for (pid = 0; pid < nfiles; pid++) ++ popen_pid[pid] = -1; ++ } ++ if (pipe(p) < 0) ++ return (NULL); ++ myside = tst(p[WTR], p[RDR]); ++ hisside = tst(p[RDR], p[WTR]); ++ if ((pid = vfork()) == 0) { ++ /* myside and hisside reverse roles in child */ ++ close(myside); ++ if (hisside != tst(0, 1)) { ++ dup2(hisside, tst(0, 1)); ++ close(hisside); ++ } ++ execl("/bin/sh", "sh", "-c", cmd, (char *)NULL); ++ _exit(127); ++ } ++ if (pid == -1) { ++ close(myside); ++ close(hisside); ++ return (NULL); ++ } ++ popen_pid[myside] = pid; ++ close(hisside); ++ return (fdopen(myside, mode)); ++} ++ ++pclose(ptr) ++ FILE *ptr; ++{ ++ int child, pid, status, omask; ++ ++ child = popen_pid[fileno(ptr)]; ++ popen_pid[fileno(ptr)] = -1; ++ fclose(ptr); ++ if (child == -1) ++ return (-1); ++ omask = sigblock(sigmask(SIGINT)|sigmask(SIGQUIT)|sigmask(SIGHUP)); ++ while ((pid = wait(&status)) != child && pid != -1) ++ ; ++ (void) sigsetmask(omask); ++ return (pid == -1 ? -1 : status); ++} +diff --unified --recursive --new-file libstdc.orig/stdio/printf.c libstdc/stdio/printf.c +--- libstdc.orig/stdio/printf.c 2017-01-18 10:16:51.517265220 +1100 ++++ libstdc/stdio/printf.c 2017-01-18 10:16:56.829271198 +1100 +@@ -1,12 +1,36 @@ ++/* ++ * Copyright (c) 1987 Regents of the University of California. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms are permitted ++ * provided that the above copyright notice and this paragraph are ++ * duplicated in all such forms and that any documentation, ++ * advertising materials, and other materials related to such ++ * distribution and use acknowledge that the software was developed ++ * by the University of California, Berkeley. The name of the ++ * University may not be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ++ */ ++ + #if defined(LIBC_SCCS) && !defined(lint) +-static char sccsid[] = "@(#)printf.c 5.2 (Berkeley) 3/9/86"; +-#endif LIBC_SCCS and not lint ++static char sccsid[] = "@(#)printf.c 5.4 (Berkeley) 6/27/88"; ++#endif /* LIBC_SCCS and not lint */ + +-#include ++#include ++#include + +-printf(fmt, args) +-char *fmt; ++printf(fmt, va_alist) ++ char *fmt; ++ va_dcl + { +- _doprnt(fmt, &args, stdout); +- return(ferror(stdout)? EOF: 0); ++ va_list ap; ++ int len; ++ ++ va_start(ap); ++ len = _doprnt(fmt, ap, stdout); ++ va_end(ap); ++ return(ferror(stdout) ? EOF : len); + } +diff --unified --recursive --new-file libstdc.orig/stdio/scanf.c libstdc/stdio/scanf.c +--- libstdc.orig/stdio/scanf.c 2017-01-18 10:16:51.517265220 +1100 ++++ libstdc/stdio/scanf.c 2017-01-18 10:16:56.829271198 +1100 +@@ -2,32 +2,53 @@ + static char sccsid[] = "@(#)scanf.c 5.2 (Berkeley) 3/9/86"; + #endif LIBC_SCCS and not lint + +-#include ++#include ++#include + +-scanf(fmt, args) ++scanf(fmt, va_alist) + char *fmt; ++va_dcl + { +- return(_doscan(stdin, fmt, &args)); ++ va_list ap; ++ int len; ++ ++ va_start(ap); ++ len = _doscan(stdin, fmt, &args); ++ va_end(ap); ++ return len; + } + +-fscanf(iop, fmt, args) ++fscanf(iop, fmt, va_alist) + FILE *iop; + char *fmt; ++va_dcl + { +- return(_doscan(iop, fmt, &args)); ++ va_list ap; ++ int len; ++ ++ va_start(ap); ++ len = _doscan(iop, fmt, &args); ++ va_end(ap); ++ return len; + } + +-sscanf(str, fmt, args) ++sscanf(str, fmt, va_alist) + register char *str; + char *fmt; ++va_dcl + { + FILE _strbuf; ++ va_list ap; ++ int len; + ++ va_start(ap); + _strbuf._flag = _IOREAD|_IOSTRG; + _strbuf._ptr = _strbuf._base = str; + _strbuf._cnt = 0; + while (*str++) + _strbuf._cnt++; + _strbuf._bufsiz = _strbuf._cnt; +- return(_doscan(&_strbuf, fmt, &args)); ++ len = _doscan(&_strbuf, fmt, &args); ++ va_end(ap); ++ return len; + } +diff --unified --recursive --new-file libstdc.orig/stdio/sprintf.c libstdc/stdio/sprintf.c +--- libstdc.orig/stdio/sprintf.c 2017-01-18 10:16:51.517265220 +1100 ++++ libstdc/stdio/sprintf.c 2017-01-18 10:16:56.829271198 +1100 +@@ -1,18 +1,41 @@ ++/* ++ * Copyright (c) 1987 Regents of the University of California. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms are permitted ++ * provided that the above copyright notice and this paragraph are ++ * duplicated in all such forms and that any documentation, ++ * advertising materials, and other materials related to such ++ * distribution and use acknowledge that the software was developed ++ * by the University of California, Berkeley. The name of the ++ * University may not be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ++ */ ++ + #if defined(LIBC_SCCS) && !defined(lint) +-static char sccsid[] = "@(#)sprintf.c 5.2 (Berkeley) 3/9/86"; +-#endif LIBC_SCCS and not lint ++static char sccsid[] = "@(#)sprintf.c 5.5 (Berkeley) 6/27/88"; ++#endif /* LIBC_SCCS and not lint */ + +-#include ++#include ++#include + +-char *sprintf(str, fmt, args) +-char *str, *fmt; ++sprintf(str, fmt, va_alist) ++ char *str, *fmt; ++ va_dcl + { ++ va_list ap; + FILE _strbuf; ++ int len; + ++ va_start(ap); + _strbuf._flag = _IOWRT+_IOSTRG; + _strbuf._ptr = str; + _strbuf._cnt = 32767; +- _doprnt(fmt, &args, &_strbuf); +- putc('\0', &_strbuf); +- return(str); ++ len = _doprnt(fmt, ap, &_strbuf); ++ *_strbuf._ptr = 0; ++ va_end(ap); ++ return(len); + } +diff --unified --recursive --new-file libstdc.orig/stdio/vfprintf.c libstdc/stdio/vfprintf.c +--- libstdc.orig/stdio/vfprintf.c 1970-01-01 10:00:00.000000000 +1000 ++++ libstdc/stdio/vfprintf.c 2017-01-18 10:16:56.829271198 +1100 +@@ -0,0 +1,47 @@ ++/* ++ * Copyright (c) 1988 Regents of the University of California. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms are permitted ++ * provided that the above copyright notice and this paragraph are ++ * duplicated in all such forms and that any documentation, ++ * advertising materials, and other materials related to such ++ * distribution and use acknowledge that the software was developed ++ * by the University of California, Berkeley. The name of the ++ * University may not be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ++ */ ++ ++#if defined(LIBC_SCCS) && !defined(lint) ++static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88"; ++#endif /* LIBC_SCCS and not lint */ ++ ++#include ++#include ++ ++int ++vfprintf(iop, fmt, ap) ++ FILE *iop; ++ char *fmt; ++ va_list ap; ++{ ++ int len; ++ char localbuf[BUFSIZ]; ++ ++ if (iop->_flag & _IONBF) { ++ iop->_flag &= ~_IONBF; ++ iop->_ptr = iop->_base = localbuf; ++ len = _doprnt(fmt, ap, iop); ++ (void) fflush(iop); ++ iop->_flag |= _IONBF; ++ iop->_base = NULL; ++ iop->_bufsiz = 0; ++ iop->_cnt = 0; ++ } else ++ len = _doprnt(fmt, ap, iop); ++ ++ return (ferror(iop) ? EOF : len); ++} +diff --unified --recursive --new-file libstdc.orig/stdio/vprintf.c libstdc/stdio/vprintf.c +--- libstdc.orig/stdio/vprintf.c 1970-01-01 10:00:00.000000000 +1000 ++++ libstdc/stdio/vprintf.c 2017-01-18 10:16:56.829271198 +1100 +@@ -0,0 +1,34 @@ ++/* ++ * Copyright (c) 1988 Regents of the University of California. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms are permitted ++ * provided that the above copyright notice and this paragraph are ++ * duplicated in all such forms and that any documentation, ++ * advertising materials, and other materials related to such ++ * distribution and use acknowledge that the software was developed ++ * by the University of California, Berkeley. The name of the ++ * University may not be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ++ */ ++ ++#if defined(LIBC_SCCS) && !defined(lint) ++static char sccsid[] = "@(#)vprintf.c 5.2 (Berkeley) 6/27/88"; ++#endif /* LIBC_SCCS and not lint */ ++ ++#include ++#include ++ ++int ++vprintf(fmt, ap) ++ char *fmt; ++ va_list ap; ++{ ++ int len; ++ ++ len = _doprnt(fmt, ap, stdout); ++ return (ferror(stdout) ? EOF : len); ++} +diff --unified --recursive --new-file libstdc.orig/stdio/vsprintf.c libstdc/stdio/vsprintf.c +--- libstdc.orig/stdio/vsprintf.c 1970-01-01 10:00:00.000000000 +1000 ++++ libstdc/stdio/vsprintf.c 2017-01-18 10:16:56.829271198 +1100 +@@ -0,0 +1,39 @@ ++/* ++ * Copyright (c) 1988 Regents of the University of California. ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms are permitted ++ * provided that the above copyright notice and this paragraph are ++ * duplicated in all such forms and that any documentation, ++ * advertising materials, and other materials related to such ++ * distribution and use acknowledge that the software was developed ++ * by the University of California, Berkeley. The name of the ++ * University may not be used to endorse or promote products derived ++ * from this software without specific prior written permission. ++ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ++ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. ++ */ ++ ++#if defined(LIBC_SCCS) && !defined(lint) ++static char sccsid[] = "@(#)vsprintf.c 5.2 (Berkeley) 6/27/88"; ++#endif /* LIBC_SCCS and not lint */ ++ ++#include ++#include ++ ++int ++vsprintf(str, fmt, ap) ++ char *str, *fmt; ++ va_list ap; ++{ ++ FILE f; ++ int len; ++ ++ f._flag = _IOWRT+_IOSTRG; ++ f._ptr = str; ++ f._cnt = 32767; ++ len = _doprnt(fmt, ap, &f); ++ *f._ptr = 0; ++ return (len); ++} +diff --unified --recursive --new-file libstdc.orig/stdio.h libstdc/stdio.h +--- libstdc.orig/stdio.h 2017-01-18 10:16:51.521265224 +1100 ++++ libstdc/stdio.h 2017-01-18 10:16:51.529265233 +1100 +@@ -59,7 +59,7 @@ + long ftell(); + char *fgets(); + char *gets(); +-#ifdef vax ++#if 0 /*def vax*/ + char *sprintf(); /* too painful to do right */ + #endif + # endif +diff --unified --recursive --new-file libstdc.orig/sys/dir.h libstdc/sys/dir.h +--- libstdc.orig/sys/dir.h 2017-01-18 10:16:51.525265228 +1100 ++++ libstdc/sys/dir.h 2017-01-18 10:16:51.529265233 +1100 +@@ -32,9 +32,9 @@ + * dp->d_ino set to 0. + */ + /* so user programs can just include dir.h */ +-#if !defined(KERNEL) && !defined(DEV_BSIZE) +-#define DEV_BSIZE 512 +-#endif ++/*#if !defined(KERNEL) && !defined(DEV_BSIZE)*/ ++/*#define DEV_BSIZE 512*/ ++/*#endif*/ + #define DIRBLKSIZ DEV_BSIZE + #define MAXNAMLEN 255 + +diff --unified --recursive --new-file libstdc.orig/sys/param.h libstdc/sys/param.h +--- libstdc.orig/sys/param.h 2017-01-18 10:16:51.525265228 +1100 ++++ libstdc/sys/param.h 2017-01-18 11:21:27.168516781 +1100 +@@ -174,12 +174,16 @@ + /* + * Macros for counting and rounding. + */ +-#ifndef howmany ++/* formerly duplicated in sys/types.h, but we now get it from here */ ++/*#ifndef howmany*/ + #define howmany(x, y) (((x)+((y)-1))/(y)) +-#endif ++/*#endif*/ + #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) + + /* + * Maximum size of hostname recognized and stored in the kernel. + */ + #define MAXHOSTNAMELEN 64 ++ ++/* moved this from sys/types.h */ ++#define NBBY 8 /* number of bits in a byte */ +diff --unified --recursive --new-file libstdc.orig/sys/select.h libstdc/sys/select.h +--- libstdc.orig/sys/select.h 1970-01-01 10:00:00.000000000 +1000 ++++ libstdc/sys/select.h 2017-01-18 11:18:18.483976173 +1100 +@@ -0,0 +1,28 @@ ++#include ++ ++/* moved this from sys/types.h */ ++/* ++ * Select uses bit masks of file descriptors in longs. ++ * These macros manipulate such bit fields (the filesystem macros use chars). ++ * FD_SETSIZE may be defined by the user, but the default here ++ * should be >= NOFILE (param.h). ++ */ ++#ifndef FD_SETSIZE ++#define FD_SETSIZE 256 ++#endif ++ ++typedef long fd_mask; ++#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ ++/* this was duplicated in sys/param.h, get it from there */ ++/*#ifndef howmany*/ ++/*#define howmany(x, y) (((x)+((y)-1))/(y))*/ ++/*#endif*/ ++ ++typedef struct fd_set { ++ fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; ++} fd_set; ++ ++#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) ++#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) ++#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) ++#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) +diff --unified --recursive --new-file libstdc.orig/sys/types.h libstdc/sys/types.h +--- libstdc.orig/sys/types.h 2017-01-18 10:16:51.525265228 +1100 ++++ libstdc/sys/types.h 2017-01-18 11:19:48.332229461 +1100 +@@ -45,30 +45,32 @@ + typedef u_short uid_t; + typedef u_short gid_t; + +-#define NBBY 8 /* number of bits in a byte */ ++/* moved this to sys/param.h */ ++/*#define NBBY 8*/ /* number of bits in a byte */ ++/* moved this to sys/select.h */ + /* + * Select uses bit masks of file descriptors in longs. + * These macros manipulate such bit fields (the filesystem macros use chars). + * FD_SETSIZE may be defined by the user, but the default here + * should be >= NOFILE (param.h). + */ +-#ifndef FD_SETSIZE +-#define FD_SETSIZE 256 +-#endif ++/*#ifndef FD_SETSIZE*/ ++/*#define FD_SETSIZE 256*/ ++/*#endif*/ + +-typedef long fd_mask; +-#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ +-#ifndef howmany +-#define howmany(x, y) (((x)+((y)-1))/(y)) +-#endif ++/*typedef long fd_mask;*/ ++/*#define NFDBITS (sizeof(fd_mask) * NBBY)*/ /* bits per mask */ ++/*#ifndef howmany*/ ++/*#define howmany(x, y) (((x)+((y)-1))/(y))*/ ++/*#endif*/ + +-typedef struct fd_set { +- fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; +-} fd_set; ++/*typedef struct fd_set {*/ ++/* fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];*/ ++/*} fd_set;*/ + +-#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) +-#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) +-#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) +-#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) ++/*#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))*/ ++/*#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))*/ ++/*#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))*/ ++/*#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))*/ + + #endif +diff --unified --recursive --new-file libstdc.orig/sys/vmmac.h libstdc/sys/vmmac.h +--- libstdc.orig/sys/vmmac.h 2017-01-18 10:16:51.525265228 +1100 ++++ libstdc/sys/vmmac.h 2017-01-18 11:11:57.943026557 +1100 +@@ -157,3 +157,10 @@ + } \ + c->c_lock = 0; \ + } ++ ++/* ++ * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 ++ */ ++/* moved this from sys/vmmac.h to avoid a circular dependency */ ++#define mapin(pte, v, pfnum, count, prot) \ ++ (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) +diff --unified --recursive --new-file libstdc.orig/vax/vmparam.h libstdc/vax/vmparam.h +--- libstdc.orig/vax/vmparam.h 2017-01-18 10:16:51.525265228 +1100 ++++ libstdc/vax/vmparam.h 2017-01-18 11:11:21.434949961 +1100 +@@ -156,5 +156,6 @@ + /* + * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 + */ +-#define mapin(pte, v, pfnum, count, prot) \ +- (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) ++/* moved this to sys/vmmac.h to avoid a circular dependency */ ++/*#define mapin(pte, v, pfnum, count, prot) \ ++ (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v)))*/ diff --git a/lib/libstdc/machine b/lib/libstdc/machine deleted file mode 120000 index 4fa2d2a..0000000 --- a/lib/libstdc/machine +++ /dev/null @@ -1 +0,0 @@ -vax \ No newline at end of file diff --git a/lib/libstdc/math.h b/lib/libstdc/math.h index 1f9c864..6b874d6 100644 --- a/lib/libstdc/math.h +++ b/lib/libstdc/math.h @@ -1,26 +1,20 @@ -#ifndef _MATH_H_ -#define _MATH_H_ - - /* math.h 4.6 9/11/85 */ -/*extern double asinh(), acosh(), atanh();*/ -/*extern double erf(), erfc();*/ -/*extern double exp(), expm1(), log(), log10(), log1p(), pow();*/ -/*extern double fabs(), floor(), ceil(), rint();*/ -/*extern double lgamma();*/ -/*extern double hypot(), cabs();*/ -/*extern double copysign(), drem(), logb(), scalb();*/ -/*extern int finite();*/ +extern double asinh(), acosh(), atanh(); +extern double erf(), erfc(); +extern double exp(), expm1(), log(), log10(), log1p(), pow(); +extern double fabs(), floor(), ceil(), rint(); +extern double lgamma(); +extern double hypot(), cabs(); +extern double copysign(), drem(), logb(), scalb(); +extern int finite(); #ifdef vax -/*extern double infnan();*/ +extern double infnan(); #endif -/*extern double j0(), j1(), jn(), y0(), y1(), yn();*/ -/*extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2();*/ -/*extern double sinh(), cosh(), tanh();*/ -/*extern double cbrt(), sqrt();*/ -/*extern double modf(), ldexp(), frexp(), atof();*/ +extern double j0(), j1(), jn(), y0(), y1(), yn(); +extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2(); +extern double sinh(), cosh(), tanh(); +extern double cbrt(), sqrt(); +extern double modf(), ldexp(), frexp(), atof(); #define HUGE 1.701411733192644270e38 - -#endif diff --git a/lib/libstdc/memory.h b/lib/libstdc/memory.h index 8f7e7a7..532c8df 100644 --- a/lib/libstdc/memory.h +++ b/lib/libstdc/memory.h @@ -1,7 +1,3 @@ -#ifndef _MEMORY_H_ -#define _MEMORY_H_ - - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,33 +10,8 @@ * Definitions of the Sys5 compat memory manipulation routines */ -/*extern char *memccpy();*/ -/*extern char *memchr();*/ -/*extern int memcmp();*/ -/*extern char *memcpy();*/ -/*extern char *memset();*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* compat-sys5/memccpy.c */ -char *memccpy __P((register char *t, register char *f, register c, register n)); - -/* compat-sys5/memchr.c */ -char *memchr __P((register char *s, register c, register n)); - -/* compat-sys5/memcmp.c */ -int memcmp __P((register char *s1, register char *s2, register n)); - -/* compat-sys5/memcpy.c */ -char *memcpy __P((register char *t, register char *f, register n)); - -/* compat-sys5/memset.c */ -char *memset __P((register char *s, register c, register n)); - -#endif +extern char *memccpy(); +extern char *memchr(); +extern int memcmp(); +extern char *memcpy(); +extern char *memset(); diff --git a/lib/libstdc/mp.h b/lib/libstdc/mp.h new file mode 100644 index 0000000..05a1d39 --- /dev/null +++ b/lib/libstdc/mp.h @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1980 Regents of the University of California. + * All rights reserved. The Berkeley software License Agreement + * specifies the terms and conditions for redistribution. + * + * @(#)mp.h 5.1 (Berkeley) 5/30/85 + */ + +#define MINT struct mint +MINT +{ int len; + short *val; +}; +#define FREE(x) {if(x.len!=0) {free((char *)x.val); x.len=0;}} +#ifndef DBG +#define shfree(u) free((char *)u) +#else +#include +#define shfree(u) { if(dbg) fprintf(stderr, "free %o\n", u); free((char *)u);} +extern int dbg; +#endif +#ifndef vax +struct half +{ short high; + short low; +}; +#else +struct half +{ short low; + short high; +}; +#endif +extern MINT *itom(); +extern short *xalloc(); + +#ifdef lint +extern xv_oid; +#define VOID xv_oid = +#else +#define VOID +#endif diff --git a/lib/libstdc/mtab.h b/lib/libstdc/mtab.h index 7025ffa..bfe07ce 100644 --- a/lib/libstdc/mtab.h +++ b/lib/libstdc/mtab.h @@ -1,7 +1,3 @@ -#ifndef _MTAB_H_ -#define _MTAB_H_ - - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -18,5 +14,3 @@ struct mtab { char m_dname[32]; /* block device pathname */ char m_type[4]; /* read-only, quotas */ }; - -#endif diff --git a/lib/libstdc/n.sh b/lib/libstdc/n.sh index ff6be43..7f4baba 100755 --- a/lib/libstdc/n.sh +++ b/lib/libstdc/n.sh @@ -1,75 +1,120 @@ -#!/bin/sh +#!/bin/sh -v -rm -rf *.c *.h *.[ch].append *.[ch].nocomm *.[ch].protos *.[ch].usedby arpa compat-4.1 compat-sys5 csu gen inet net netimp netinet netns ns pascal protocols stdio sys temp.c vax vaxif vaxmba vaxuba +rm -rf *.c *.h *.o *.orig *.[ch].append *.[ch].append.nocomm *.[ch].nocomm *.[ch].protos *.[ch].usedby arpa compat-4.1 compat-sys5 csu gen inet machine net netimp netinet netns ns pascal protocols stdio sys temp.c vax vaxif vaxmba vaxuba xx* -find ../libc \( -name '*.c' -o -name 'Makefile' \) -print |\ +find ../libc \( -name '*.[cs]' -o -name Makefile \) -print |\ sed -e 's:^\.\./libc/::' |\ while read i do mkdir --parents `dirname $i` cp ../libc/$i $i done -patch --strip 3 llib-lc.temp -find vax -name '*.c' -print |\ -sed -e 's:^vax/::' |\ +find vax -name '*.s' -print |\ +sed -e 's:^vax/\(.*\)\.s$:\1:' |\ while read i do echo "i=$i" - if ! test -f $i + if test -f $i.c then - if grep -q "^}" vax/$i - then - mkdir -p `dirname $i` - mv vax/$i $i - elif test -f /mnt/4.3tahoe/usr/src/lib/libc/$i + rm vax/$i.s + elif test -f ../libc4.3tahoe/$i.c + then + rm vax/$i.s + mkdir -p `dirname $i` + cp ../libc4.3tahoe/$i.c $i.c + else + entries="`sed -ne 's/^\(ASENTRY\|ENTRY\|PSEUDO\|SYSCALL\)(\([^),]*\)\(,[^)]*\)\?)$/\2/p' vax/$i.s`" + echo "entries=$entries" + if test -n "$entries" then - mkdir -p `dirname $i` - cp /mnt/4.3tahoe/usr/src/lib/libc/$i $i - chmod u+w $i - else - entries="`sed -ne 's/^\(ASENTRY\|ENTRY\|PSEUDO\|SYSCALL\)(\([^),]*\)\(,[^)]*\)\?)$/\2/p' vax/$i`" - echo "entries=$entries" - if test -n "$entries" + for j in $entries + do + grep "[^0-9A-Za-z_]$j[ ]*(" llib-lc.temp |\ + #sed -e 's/{.*}/{\n errno = ENOSYS;\n return -1;\n}/' + sed -e 's/{.*}/{\n abort();\n}/' + done >a + if test -s a then - for j in $entries - do - grep "[^0-9A-Za-z_]$j[ ]*(" llib-lc.temp |\ - sed -e 's/{.*}/{\n abort();\n}/' - done >a - if test -s a - then - mkdir -p `dirname $i` - cp a $i - fi + rm vax/$i.s + mkdir -p `dirname $i` + mv a $i.c fi fi fi done + +find vax -name Makefile -print |\ +while read i +do + rm $i +done + +find vax -type f -print >unported.txt rm -rf vax -find . -name '*.c' -print |\ -sed -e 's:^\./::' |\ +find ../../include -name '*.h' -print |\ +sed -e 's:^\.\./\.\./include/::' |\ while read i do - #sed -e '1i' -i $i - echo "i=$i" - ( - echo - cat $i - ) >a - mv a $i + mkdir -p `dirname $i` + cp ../../include/$i $i +done + +find ../../sys/h -name '*.h' -print |\ +sed -e 's:^\.\./\.\./sys/h/::' |\ +while read i +do + mkdir -p sys/`dirname $i` + cp ../../sys/h/$i sys +done + +for i in net netimp netinet netns vax vaxif vaxmba vaxuba +do + find ../../sys/$i -name '*.h' -print |\ + sed -e "s:^\.\./\.\./sys/$i/::" |\ + while read j + do + mkdir -p $i/`dirname $j` + cp ../../sys/$i/$j $i/$j + done done -done + +#rm -f fcntl.h mp.h +#ln -s sys/file.h fcntl.h +#rm -f machine +#ln -s vax machine +#rm -f frame.h +#ln -s machine/frame.h frame.h +for i in errno.h signal.h syslog.h +do + rm -f $i + ln -s sys/$i $i +done + +rm -rf ../libstdc.orig +cp -r ../libstdc ../libstdc.orig +patch --strip 1 -#include -#include -#include - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif +/* formerly duplicated in netinet/in.h and netns/ns.h */ +#if !defined(vax) && !defined(ntohl) && !defined(lint) +/* + * Macros for number representation conversion. + */ +#define ntohl(x) (x) +#define ntohs(x) (x) +#define htonl(x) (x) +#define htons(x) (x) #endif -/* net/htonl.c */ -u_long htonl __P((u_long hostlong)); - -/* net/htons.c */ -u_short htons __P((int hostshort)); - -/* net/ntohl.c */ -u_long ntohl __P((u_long netlong)); - -/* net/ntohs.c */ -u_short ntohs __P((int netshort)); - -/* net/rcmd.c */ -int rcmd __P((char **ahost, int rport, char *locuser, char *remuser, char *cmd, int *fd2p)); -int rresvport __P((int *alport)); -int ruserok __P((char *rhost, int superuser, char *ruser, char *luser)); -int _validuser __P((FILE *hostf, char *rhost, char *luser, char *ruser, int baselen)); -int _checkhost __P((char *rhost, char *lhost, int len)); - -/* net/rexec.c */ -int rexec __P((char **ahost, int rport, char *name, char *pass, char *cmd, int *fd2p)); - -/* net/ruserpass.c */ -int ruserpass __P((char *host, char **aname, char **apass)); -int mkpwunclear __P((char *spasswd, int mch, char *sencpasswd)); -int mkpwclear __P((char *sencpasswd, int mch, char *spasswd)); - +#if !defined(ntohl) && (defined(vax) || defined(lint)) +u_short ntohs(), htons(); +u_long ntohl(), htonl(); #endif diff --git a/lib/libstdc/net/af.h b/lib/libstdc/net/af.h index 7a00375..676507b 100644 --- a/lib/libstdc/net/af.h +++ b/lib/libstdc/net/af.h @@ -1,8 +1,3 @@ -#ifndef _NET_AF_H_ -#define _NET_AF_H_ - -#include - /* * Copyright (c) 1980, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -38,5 +33,3 @@ struct afhash { #ifdef KERNEL struct afswitch afswitch[]; #endif - -#endif diff --git a/lib/libstdc/net/getnetbyaddr.c b/lib/libstdc/net/getnetbyaddr.c index 38b3904..848c1c8 100644 --- a/lib/libstdc/net/getnetbyaddr.c +++ b/lib/libstdc/net/getnetbyaddr.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,13 +6,16 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getnetbyaddr.c 5.3 (Berkeley) 5/19/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include extern int _net_stayopen; -struct netent *getnetbyaddr(net, type) register int net; register int type; { +struct netent * +getnetbyaddr(net, type) + register int net, type; +{ register struct netent *p; setnetent(_net_stayopen); diff --git a/lib/libstdc/net/getnetbyname.c b/lib/libstdc/net/getnetbyname.c index a2a48dd..c944ae5 100644 --- a/lib/libstdc/net/getnetbyname.c +++ b/lib/libstdc/net/getnetbyname.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,13 +6,16 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getnetbyname.c 5.3 (Berkeley) 5/19/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include extern int _net_stayopen; -struct netent *getnetbyname(name) register char *name; { +struct netent * +getnetbyname(name) + register char *name; +{ register struct netent *p; register char **cp; diff --git a/lib/libstdc/net/getnetent.c b/lib/libstdc/net/getnetent.c index 092cf65..488aa50 100644 --- a/lib/libstdc/net/getnetent.c +++ b/lib/libstdc/net/getnetent.c @@ -1,8 +1,3 @@ -#include -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,13 +6,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getnetent.c 5.3 (Berkeley) 5/19/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include #define MAXALIASES 35 @@ -27,11 +22,11 @@ static char line[BUFSIZ+1]; static struct netent net; static char *net_aliases[MAXALIASES]; int _net_stayopen; -/*static char *any();*/ - -static char *any __P((register char *cp, char *match)); +static char *any(); -int setnetent(f) int f; { +setnetent(f) + int f; +{ if (netf == NULL) netf = fopen(NETDB, "r" ); else @@ -39,7 +34,8 @@ int setnetent(f) int f; { _net_stayopen |= f; } -int endnetent() { +endnetent() +{ if (netf) { fclose(netf); netf = NULL; @@ -47,7 +43,9 @@ int endnetent() { _net_stayopen = 0; } -struct netent *getnetent() { +struct netent * +getnetent() +{ char *p; register char *cp, **q; @@ -93,7 +91,11 @@ again: return (&net); } -static char *any(cp, match) register char *cp; char *match; { +static char * +any(cp, match) + register char *cp; + char *match; +{ register char *mp, c; while (c = *cp) { diff --git a/lib/libstdc/net/getproto.c b/lib/libstdc/net/getproto.c index 2e3b13b..f35a6d6 100644 --- a/lib/libstdc/net/getproto.c +++ b/lib/libstdc/net/getproto.c @@ -1,5 +1,3 @@ -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,13 +6,16 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getproto.c 5.3 (Berkeley) 5/19/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include extern int _proto_stayopen; -struct protoent *getprotobynumber(proto) register int proto; { +struct protoent * +getprotobynumber(proto) + register int proto; +{ register struct protoent *p; setprotoent(_proto_stayopen); diff --git a/lib/libstdc/net/getprotoent.c b/lib/libstdc/net/getprotoent.c index 4ec4e7a..15a6a18 100644 --- a/lib/libstdc/net/getprotoent.c +++ b/lib/libstdc/net/getprotoent.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,13 +6,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getprotoent.c 5.3 (Berkeley) 5/19/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include #define MAXALIASES 35 @@ -25,12 +21,12 @@ static FILE *protof = NULL; static char line[BUFSIZ+1]; static struct protoent proto; static char *proto_aliases[MAXALIASES]; -/*static char *any();*/ +static char *any(); int _proto_stayopen; -static char *any __P((register char *cp, char *match)); - -int setprotoent(f) int f; { +setprotoent(f) + int f; +{ if (protof == NULL) protof = fopen(PROTODB, "r" ); else @@ -38,7 +34,8 @@ int setprotoent(f) int f; { _proto_stayopen |= f; } -int endprotoent() { +endprotoent() +{ if (protof) { fclose(protof); protof = NULL; @@ -46,7 +43,9 @@ int endprotoent() { _proto_stayopen = 0; } -struct protoent *getprotoent() { +struct protoent * +getprotoent() +{ char *p; register char *cp, **q; @@ -91,7 +90,11 @@ again: return (&proto); } -static char *any(cp, match) register char *cp; char *match; { +static char * +any(cp, match) + register char *cp; + char *match; +{ register char *mp, c; while (c = *cp) { diff --git a/lib/libstdc/net/getprotoname.c b/lib/libstdc/net/getprotoname.c index b0ea83f..872303f 100644 --- a/lib/libstdc/net/getprotoname.c +++ b/lib/libstdc/net/getprotoname.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,13 +6,16 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getprotoname.c 5.3 (Berkeley) 5/19/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include extern int _proto_stayopen; -struct protoent *getprotobyname(name) register char *name; { +struct protoent * +getprotobyname(name) + register char *name; +{ register struct protoent *p; register char **cp; diff --git a/lib/libstdc/net/getservbyname.c b/lib/libstdc/net/getservbyname.c index 4209683..40c784d 100644 --- a/lib/libstdc/net/getservbyname.c +++ b/lib/libstdc/net/getservbyname.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,13 +6,16 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getservbyname.c 5.3 (Berkeley) 5/19/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include extern int _serv_stayopen; -struct servent *getservbyname(name, proto) char *name; char *proto; { +struct servent * +getservbyname(name, proto) + char *name, *proto; +{ register struct servent *p; register char **cp; diff --git a/lib/libstdc/net/getservbyport.c b/lib/libstdc/net/getservbyport.c index 9c5e4ed..d3632a2 100644 --- a/lib/libstdc/net/getservbyport.c +++ b/lib/libstdc/net/getservbyport.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,13 +6,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getservbyport.c 5.3 (Berkeley) 5/19/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include extern int _serv_stayopen; -struct servent *getservbyport(port, proto) int port; char *proto; { +struct servent * +getservbyport(port, proto) + int port; + char *proto; +{ register struct servent *p; setservent(_serv_stayopen); diff --git a/lib/libstdc/net/getservent.c b/lib/libstdc/net/getservent.c index 8bc3121..1f68cc2 100644 --- a/lib/libstdc/net/getservent.c +++ b/lib/libstdc/net/getservent.c @@ -1,9 +1,4 @@ -#include #include -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,13 +7,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getservent.c 5.3 (Berkeley) 5/19/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include #define MAXALIASES 35 @@ -27,12 +22,12 @@ static FILE *servf = NULL; static char line[BUFSIZ+1]; static struct servent serv; static char *serv_aliases[MAXALIASES]; -/*static char *any();*/ +static char *any(); int _serv_stayopen; -static char *any __P((register char *cp, char *match)); - -int setservent(f) int f; { +setservent(f) + int f; +{ if (servf == NULL) servf = fopen(SERVDB, "r" ); else @@ -40,7 +35,8 @@ int setservent(f) int f; { _serv_stayopen |= f; } -int endservent() { +endservent() +{ if (servf) { fclose(servf); servf = NULL; @@ -48,7 +44,9 @@ int endservent() { _serv_stayopen = 0; } -struct servent *getservent() { +struct servent * +getservent() +{ char *p; register char *cp, **q; @@ -95,7 +93,11 @@ again: return (&serv); } -static char *any(cp, match) register char *cp; char *match; { +static char * +any(cp, match) + register char *cp; + char *match; +{ register char *mp, c; while (c = *cp) { diff --git a/lib/libstdc/net/hosttable/gethostent.c b/lib/libstdc/net/hosttable/gethostent.c index 9e0e694..4faffe1 100644 --- a/lib/libstdc/net/hosttable/gethostent.c +++ b/lib/libstdc/net/hosttable/gethostent.c @@ -1,10 +1,3 @@ -#include -#include -#include -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -13,14 +6,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostent.c 5.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include +#include /* * Internet version. @@ -45,17 +38,18 @@ char *_host_file = "/etc/hosts"; int _host_stayopen; DBM *_host_db; /* set by gethostbyname(), gethostbyaddr() */ -/*static char *any();*/ - -static char *any __P((register char *cp, char *match)); +static char *any(); -int sethostent(f) int f; { +sethostent(f) + int f; +{ if (hostf != NULL) rewind(hostf); _host_stayopen |= f; } -int endhostent() { +endhostent() +{ if (hostf) { fclose(hostf); hostf = NULL; @@ -67,7 +61,9 @@ int endhostent() { _host_stayopen = 0; } -struct hostent *gethostent() { +struct hostent * +gethostent() +{ char *p; register char *cp, **q; @@ -113,11 +109,17 @@ again: return (&host); } -int sethostfile(file) char *file; { +sethostfile(file) + char *file; +{ _host_file = file; } -static char *any(cp, match) register char *cp; char *match; { +static char * +any(cp, match) + register char *cp; + char *match; +{ register char *mp, c; while (c = *cp) { diff --git a/lib/libstdc/net/hosttable/gethostnamadr.c b/lib/libstdc/net/hosttable/gethostnamadr.c index ac71172..a077c5c 100644 --- a/lib/libstdc/net/hosttable/gethostnamadr.c +++ b/lib/libstdc/net/hosttable/gethostnamadr.c @@ -1,11 +1,4 @@ -#include -#include -#include -#include -#include -#include -#include - +#include /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,13 +7,13 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostnamadr.c 5.5 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include #define MAXALIASES 35 @@ -38,7 +31,10 @@ extern char *_host_file; DBM *_host_db = (DBM *)NULL; int _host_stayopen; /* set by sethostent(), cleared by endhostent() */ -static struct hostent *fetchhost(key) datum key; { +static struct hostent * +fetchhost(key) + datum key; +{ register char *cp, *tp, **ap; int naliases; @@ -70,9 +66,10 @@ static struct hostent *fetchhost(key) datum key; { return (&host); } -static struct hostent *fetchhost __P((datum key)); - -struct hostent *gethostbyname(nam) register char *nam; { +struct hostent * +gethostbyname(nam) + register char *nam; +{ register struct hostent *hp; register char **cp; datum key; @@ -113,7 +110,12 @@ struct hostent *gethostbyname(nam) register char *nam; { return (hp); } -struct hostent *gethostbyaddr(addr, length, type) char *addr; register int length; register int type; { +struct hostent * +gethostbyaddr(addr, length, type) + char *addr; + register int length; + register int type; +{ register struct hostent *hp; datum key; diff --git a/lib/libstdc/net/htonl.c b/lib/libstdc/net/htonl.c index f9c56cd..944e195 100644 --- a/lib/libstdc/net/htonl.c +++ b/lib/libstdc/net/htonl.c @@ -1,7 +1,5 @@ -#include #include #include - u_long htonl(hostlong) u_long hostlong; { abort(); } diff --git a/lib/libstdc/net/htons.c b/lib/libstdc/net/htons.c index 723d5b3..df43047 100644 --- a/lib/libstdc/net/htons.c +++ b/lib/libstdc/net/htons.c @@ -1,7 +1,5 @@ -#include #include #include - -u_short htons(hostshort) int hostshort; { +u_short htons(hostshort) u_short hostshort; { abort(); } diff --git a/lib/libstdc/net/if.h b/lib/libstdc/net/if.h index 5247a34..5a0cc23 100644 --- a/lib/libstdc/net/if.h +++ b/lib/libstdc/net/if.h @@ -1,10 +1,3 @@ -#ifndef _NET_IF_H_ -#define _NET_IF_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -211,13 +204,11 @@ struct ifconf { }; #ifdef KERNEL -/*#include "../net/if_arp.h"*/ +#include "../net/if_arp.h" struct ifqueue rawintrq; /* raw packet input queue */ struct ifnet *ifnet; -/*struct ifaddr *ifa_ifwithaddr(), *ifa_ifwithnet();*/ -/*struct ifaddr *ifa_ifwithdstaddr();*/ -#else -/*#include */ -#endif - -#endif +struct ifaddr *ifa_ifwithaddr(), *ifa_ifwithnet(); +struct ifaddr *ifa_ifwithdstaddr(); +#else KERNEL +#include +#endif KERNEL diff --git a/lib/libstdc/net/if_arp.h b/lib/libstdc/net/if_arp.h index f24180d..4701f41 100644 --- a/lib/libstdc/net/if_arp.h +++ b/lib/libstdc/net/if_arp.h @@ -1,9 +1,3 @@ -#ifndef _NET_IF_ARP_H_ -#define _NET_IF_ARP_H_ - -#include -#include - /* * Copyright (c) 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -55,5 +49,3 @@ struct arpreq { #define ATF_PERM 0x04 /* permanent entry */ #define ATF_PUBL 0x08 /* publish entry (respond for other host) */ #define ATF_USETRAILERS 0x10 /* has requested trailers */ - -#endif diff --git a/lib/libstdc/net/named/gethostnamadr.c b/lib/libstdc/net/named/gethostnamadr.c index edbbe9b..5157098 100644 --- a/lib/libstdc/net/named/gethostnamadr.c +++ b/lib/libstdc/net/named/gethostnamadr.c @@ -1,16 +1,5 @@ -#include -#include #include -#include -#include -#include -#include -#include -#include -#include #include -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -19,18 +8,18 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gethostnamadr.c 6.12 (Berkeley) 5/19/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define MAXALIASES 35 #define MAXADDRS 35 @@ -47,7 +36,7 @@ static char line[BUFSIZ+1]; static char hostaddr[MAXADDRS]; static char *host_addrs[2]; static int stayopen = 0; -/*static char *any();*/ +static char *any(); typedef union { HEADER qb1; @@ -63,7 +52,11 @@ static union { int h_errno; extern errno; -static struct hostent *getanswer(msg, msglen, iquery) char *msg; int msglen; int iquery; { +static struct hostent * +getanswer(msg, msglen, iquery) + char *msg; + int msglen, iquery; +{ register HEADER *hp; register char *cp; register int n; @@ -231,10 +224,10 @@ static struct hostent *getanswer(msg, msglen, iquery) char *msg; int msglen; int } } -static struct hostent *getanswer __P((char *msg, int msglen, int iquery)); -static char *any __P((register char *cp, char *match)); - -struct hostent *gethostbyname(name) char *name; { +struct hostent * +gethostbyname(name) + char *name; +{ int n; querybuf buf; register struct hostent *hp; @@ -255,7 +248,11 @@ struct hostent *gethostbyname(name) char *name; { return(hp); } -struct hostent *gethostbyaddr(addr, len, type) char *addr; int len; int type; { +struct hostent * +gethostbyaddr(addr, len, type) + char *addr; + int len, type; +{ int n; querybuf buf; register struct hostent *hp; @@ -292,7 +289,9 @@ struct hostent *gethostbyaddr(addr, len, type) char *addr; int len; int type; { } -int _sethtent(f) int f; { +_sethtent(f) + int f; +{ if (hostf == NULL) hostf = fopen(HOSTDB, "r" ); else @@ -300,14 +299,17 @@ int _sethtent(f) int f; { stayopen |= f; } -int _endhtent() { +_endhtent() +{ if (hostf && !stayopen) { (void) fclose(hostf); hostf = NULL; } } -struct hostent *_gethtent() { +struct hostent * +_gethtent() +{ char *p; register char *cp, **q; @@ -354,7 +356,11 @@ again: return (&host); } -static char *any(cp, match) register char *cp; char *match; { +static char * +any(cp, match) + register char *cp; + char *match; +{ register char *mp, c; while (c = *cp) { @@ -366,7 +372,10 @@ static char *any(cp, match) register char *cp; char *match; { return ((char *)0); } -struct hostent *_gethtbyname(name) char *name; { +struct hostent * +_gethtbyname(name) + char *name; +{ register struct hostent *p; register char **cp; char lowname[128]; @@ -392,7 +401,11 @@ found: return (p); } -struct hostent *_gethtbyaddr(addr, len, type) char *addr; int len; int type; { +struct hostent * +_gethtbyaddr(addr, len, type) + char *addr; + int len, type; +{ register struct hostent *p; _sethtent(0); diff --git a/lib/libstdc/net/named/sethostent.c b/lib/libstdc/net/named/sethostent.c index 0340b42..0acfe9c 100644 --- a/lib/libstdc/net/named/sethostent.c +++ b/lib/libstdc/net/named/sethostent.c @@ -1,6 +1,3 @@ -#include -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,24 +6,28 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)sethostent.c 6.3 (Berkeley) 4/10/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include -int sethostent(stayopen) int stayopen; { +sethostent(stayopen) +{ if (stayopen) _res.options |= RES_STAYOPEN | RES_USEVC; } -int endhostent() { +endhostent() +{ _res.options &= ~(RES_STAYOPEN | RES_USEVC); _res_close(); } -int sethostfile(name) char *name; { +sethostfile(name) +char *name; +{ #ifdef lint name = name; #endif diff --git a/lib/libstdc/net/netisr.h b/lib/libstdc/net/netisr.h index 77d190d..6691e5f 100644 --- a/lib/libstdc/net/netisr.h +++ b/lib/libstdc/net/netisr.h @@ -1,8 +1,3 @@ -#ifndef _NET_NETISR_H_ -#define _NET_NETISR_H_ - -#include - /* * Copyright (c) 1980, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -41,5 +36,3 @@ int netisr; /* scheduling bits for network */ #endif #endif - -#endif diff --git a/lib/libstdc/net/ntohl.c b/lib/libstdc/net/ntohl.c index e37c058..9e05142 100644 --- a/lib/libstdc/net/ntohl.c +++ b/lib/libstdc/net/ntohl.c @@ -1,7 +1,5 @@ -#include #include #include - u_long ntohl(netlong) u_long netlong; { abort(); } diff --git a/lib/libstdc/net/ntohs.c b/lib/libstdc/net/ntohs.c index 7c4f76f..0a9632b 100644 --- a/lib/libstdc/net/ntohs.c +++ b/lib/libstdc/net/ntohs.c @@ -1,7 +1,5 @@ -#include #include #include - -u_short ntohs(netshort) int netshort; { +u_short ntohs(netshort) u_short netshort; { abort(); } diff --git a/lib/libstdc/net/raw_cb.h b/lib/libstdc/net/raw_cb.h index c0ccc90..3b8912a 100644 --- a/lib/libstdc/net/raw_cb.h +++ b/lib/libstdc/net/raw_cb.h @@ -1,10 +1,3 @@ -#ifndef _NET_RAW_CB_H_ -#define _NET_RAW_CB_H_ - -#include -#include -#include - /* * Copyright (c) 1980, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -60,5 +53,3 @@ struct raw_header { #ifdef KERNEL struct rawcb rawcb; /* head of list */ #endif - -#endif diff --git a/lib/libstdc/net/rcmd.c b/lib/libstdc/net/rcmd.c index c5957d0..43e4150 100644 --- a/lib/libstdc/net/rcmd.c +++ b/lib/libstdc/net/rcmd.c @@ -1,22 +1,8 @@ -#include -#include -#include +#include +#include +#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -25,26 +11,31 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)rcmd.c 5.11 (Berkeley) 5/6/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include +#include +#include +#include -/*#include */ +#include -/*#include */ -/*#include */ +#include +#include extern errno; -/*char *index(), *sprintf();*/ +char *index(), *sprintf(); -int rcmd(ahost, rport, locuser, remuser, cmd, fd2p) char **ahost; int rport; char *locuser; char *remuser; char *cmd; int *fd2p; { +rcmd(ahost, rport, locuser, remuser, cmd, fd2p) + char **ahost; + u_short rport; + char *locuser, *remuser, *cmd; + int *fd2p; +{ int s, timo = 1, pid, oldmask; struct sockaddr_in sin, sin2, from; char c; @@ -163,7 +154,9 @@ bad: return (-1); } -int rresvport(alport) int *alport; { +rresvport(alport) + int *alport; +{ struct sockaddr_in sin; int s; @@ -189,7 +182,11 @@ int rresvport(alport) int *alport; { } } -int ruserok(rhost, superuser, ruser, luser) char *rhost; int superuser; char *ruser; char *luser; { +ruserok(rhost, superuser, ruser, luser) + char *rhost; + int superuser; + char *ruser, *luser; +{ FILE *hostf; char fhost[MAXHOSTNAMELEN]; int first = 1; @@ -239,7 +236,11 @@ again: return (-1); } -int _validuser(hostf, rhost, luser, ruser, baselen) FILE *hostf; char *rhost; char *luser; char *ruser; int baselen; { +_validuser(hostf, rhost, luser, ruser, baselen) +char *rhost, *luser, *ruser; +FILE *hostf; +int baselen; +{ char *user; char ahost[MAXHOSTNAMELEN]; register char *p; @@ -268,7 +269,10 @@ int _validuser(hostf, rhost, luser, ruser, baselen) FILE *hostf; char *rhost; ch return (-1); } -int _checkhost(rhost, lhost, len) char *rhost; char *lhost; int len; { +_checkhost(rhost, lhost, len) +char *rhost, *lhost; +int len; +{ static char ldomain[MAXHOSTNAMELEN + 1]; static char *domainp = NULL; register char *cp; diff --git a/lib/libstdc/net/res_comp.c b/lib/libstdc/net/res_comp.c index f525bcc..4047129 100644 --- a/lib/libstdc/net/res_comp.c +++ b/lib/libstdc/net/res_comp.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,11 +6,11 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_comp.c 6.7 (Berkeley) 3/11/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include /* @@ -24,7 +20,10 @@ static char sccsid[] = "@(#)res_comp.c 6.7 (Berkeley) 3/11/86"; * 'exp_dn' is a pointer to a buffer of size 'length' for the result. * Return size of compressed name or -1 if there was an error. */ -int dn_expand(msg, eomorig, comp_dn, exp_dn, length) char *msg; char *eomorig; char *comp_dn; char *exp_dn; int length; { +dn_expand(msg, eomorig, comp_dn, exp_dn, length) + char *msg, *eomorig, *comp_dn, *exp_dn; + int length; +{ register char *cp, *dn; register int n, c; char *eom; @@ -91,7 +90,11 @@ int dn_expand(msg, eomorig, comp_dn, exp_dn, length) char *msg; char *eomorig; c * If 'dnptr' is NULL, we don't try to compress names. If 'lastdnptr' * is NULL, we don't update the list. */ -int dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) char *exp_dn; char *comp_dn; int length; char **dnptrs; char **lastdnptr; { +dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) + char *exp_dn, *comp_dn; + int length; + char **dnptrs, **lastdnptr; +{ register char *cp, *dn; register int c, l; char **cpp, **lpp, *sp, *eob; @@ -156,7 +159,9 @@ int dn_comp(exp_dn, comp_dn, length, dnptrs, lastdnptr) char *exp_dn; char *comp /* * Skip over a compressed domain name. Return the size or -1. */ -int dn_skip(comp_dn) char *comp_dn; { +dn_skip(comp_dn) + char *comp_dn; +{ register char *cp; register int n; @@ -183,7 +188,10 @@ int dn_skip(comp_dn) char *comp_dn; { * Search for expanded name from a list of previously compressed names. * Return the offset from msg if found or -1. */ -int dn_find(exp_dn, msg, dnptrs, lastdnptr) char *exp_dn; char *msg; char **dnptrs; char **lastdnptr; { +dn_find(exp_dn, msg, dnptrs, lastdnptr) + char *exp_dn, *msg; + char **dnptrs, **lastdnptr; +{ register char *dn, *cp, **cpp; register int n; char *sp; @@ -229,7 +237,10 @@ int dn_find(exp_dn, msg, dnptrs, lastdnptr) char *exp_dn; char *msg; char **dnpt * advantage of being portable. */ -u_short getshort(msgp) char *msgp; { +u_short +getshort(msgp) + char *msgp; +{ register u_char *p = (u_char *) msgp; #ifdef vax /* @@ -244,7 +255,10 @@ u_short getshort(msgp) char *msgp; { return ((u_short)(u | *p)); } -u_long getlong(msgp) char *msgp; { +u_long +getlong(msgp) + char *msgp; +{ register u_char *p = (u_char *) msgp; register u_long u; @@ -255,13 +269,19 @@ u_long getlong(msgp) char *msgp; { } -int putshort(s, msgp) int s; register char *msgp; { +putshort(s, msgp) + register u_short s; + register char *msgp; +{ msgp[1] = s; msgp[0] = s >> 8; } -int putlong(l, msgp) register u_long l; register char *msgp; { +putlong(l, msgp) + register u_long l; + register char *msgp; +{ msgp[3] = l; msgp[2] = (l >>= 8); diff --git a/lib/libstdc/net/res_debug.c b/lib/libstdc/net/res_debug.c index 0ad9fd2..cbd0f72 100644 --- a/lib/libstdc/net/res_debug.c +++ b/lib/libstdc/net/res_debug.c @@ -1,11 +1,4 @@ -#include #include -#include -#include -#include -#include -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,19 +7,19 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_debug.c 5.13 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint #if defined(lint) && !defined(DEBUG) #define DEBUG #endif -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include -/*extern char *p_cdname(), *p_rr(), *p_type(), *p_class();*/ -/*extern char *inet_ntoa();*/ +extern char *p_cdname(), *p_rr(), *p_type(), *p_class(); +extern char *inet_ntoa(); char *opcodes[] = { "QUERY", @@ -66,7 +59,9 @@ char *rcodes[] = { "NOCHANGE", }; -int p_query(msg) char *msg; { +p_query(msg) + char *msg; +{ #ifdef DEBUG fp_query(msg,stdout); #endif @@ -76,7 +71,10 @@ int p_query(msg) char *msg; { * Print the contents of a query. * This is intended to be primarily a debugging routine. */ -int fp_query(msg, file) char *msg; FILE *file; { +fp_query(msg,file) + char *msg; + FILE *file; +{ #ifdef DEBUG register char *cp; register HEADER *hp; @@ -163,7 +161,11 @@ int fp_query(msg, file) char *msg; FILE *file; { #endif } -char *p_cdname(cp, msg, file) char *cp; char *msg; FILE *file; { +char * +p_cdname(cp, msg, file) + char *cp, *msg; + FILE *file; +{ #ifdef DEBUG char name[MAXDNAME]; int n; @@ -182,7 +184,11 @@ char *p_cdname(cp, msg, file) char *cp; char *msg; FILE *file; { /* * Print resource record fields in human readable form. */ -char *p_rr(cp, msg, file) char *cp; char *msg; FILE *file; { +char * +p_rr(cp, msg, file) + char *cp, *msg; + FILE *file; +{ #ifdef DEBUG int type, class, dlen, n, c; struct in_addr inaddr; @@ -227,7 +233,7 @@ char *p_rr(cp, msg, file) char *cp; char *msg; FILE *file; { #ifdef OLDRR case T_MD: case T_MF: -#endif +#endif /* OLDRR */ case T_MG: case T_MR: case T_NS: @@ -323,12 +329,15 @@ char *p_rr(cp, msg, file) char *cp; char *msg; FILE *file; { } static char nbuf[20]; -/*extern char *sprintf();*/ +extern char *sprintf(); /* * Return a string for the type */ -char *p_type(type) int type; { +char * +p_type(type) + int type; +{ switch (type) { case T_A: return("A"); @@ -339,7 +348,7 @@ char *p_type(type) int type; { return("MD"); case T_MF: /* mail forwarder */ return("MF"); -#endif +#endif /* OLDRR */ case T_CNAME: /* connonical name */ return("CNAME"); case T_SOA: /* start of authority zone */ @@ -384,7 +393,10 @@ char *p_type(type) int type; { /* * Return a mnemonic for class */ -char *p_class(class) int class; { +char * +p_class(class) + int class; +{ switch (class) { case C_IN: /* internet class */ diff --git a/lib/libstdc/net/res_init.c b/lib/libstdc/net/res_init.c index e354e73..197b31b 100644 --- a/lib/libstdc/net/res_init.c +++ b/lib/libstdc/net/res_init.c @@ -1,14 +1,4 @@ -#include -#include #include -#include -#include -#include -#include -#include -#include -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -17,14 +7,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_init.c 6.5 (Berkeley) 4/11/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include +#include /* * Resolver configuration file. Contains the address of the @@ -63,7 +53,8 @@ struct state _res = { * * Return 0 if completes successfully, -1 on error */ -int res_init() { +res_init() +{ register FILE *fp; char buf[BUFSIZ], *cp; extern u_long inet_addr(); @@ -71,7 +62,7 @@ int res_init() { extern char *strcpy(), *strncpy(); #ifdef DEBUG extern char *getenv(); -#endif +#endif DEBUG int n = 0; /* number of nameserver records read from file */ _res.nsaddr.sin_addr.s_addr = INADDR_ANY; @@ -114,7 +105,7 @@ int res_init() { #ifdef DEBUG if ( _res.options & RES_DEBUG ) printf("MAXNS reached, reading resolv.conf\n"); -#endif +#endif DEBUG } continue; } @@ -133,7 +124,7 @@ int res_init() { /* Allow user to override the local domain definition */ if ((cp = getenv("LOCALDOMAIN")) != NULL) (void)strncpy(_res.defdname, cp, sizeof(_res.defdname)); -#endif +#endif DEBUG _res.options |= RES_INIT; return(0); } diff --git a/lib/libstdc/net/res_mkquery.c b/lib/libstdc/net/res_mkquery.c index 5baa6a4..849a2c9 100644 --- a/lib/libstdc/net/res_mkquery.c +++ b/lib/libstdc/net/res_mkquery.c @@ -1,11 +1,4 @@ -#include -#include #include -#include -#include -#include -#include - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,21 +7,30 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_mkquery.c 6.3 (Berkeley) 3/17/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include -/*extern char *sprintf();*/ +extern char *sprintf(); /* * Form all types of queries. * Returns the size of the result or -1. */ -int res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) int op; /* opcode of query */ char *dname; /* domain name */ int class; int type; /* class and type of query */ char *data; /* resource record data */ int datalen; /* length of data */ struct rrec *newrr; /* new rr for modify or append */ char *buf; /* buffer to put query */ int buflen; /* size of buffer */ { +res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) + int op; /* opcode of query */ + char *dname; /* domain name */ + int class, type; /* class and type of query */ + char *data; /* resource record data */ + int datalen; /* length of data */ + struct rrec *newrr; /* new rr for modify or append */ + char *buf; /* buffer to put query */ + int buflen; /* size of buffer */ +{ register HEADER *hp; register char *cp; register int n; @@ -39,7 +41,7 @@ int res_mkquery(op, dname, class, type, data, datalen, newrr, buf, buflen) int o #ifdef DEBUG if (_res.options & RES_DEBUG) printf("res_mkquery(%d, %s, %d, %d)\n", op, dname, class, type); -#endif +#endif DEBUG /* * Initialize header fields. */ diff --git a/lib/libstdc/net/res_send.c b/lib/libstdc/net/res_send.c index 0d8fc5f..5e08986 100644 --- a/lib/libstdc/net/res_send.c +++ b/lib/libstdc/net/res_send.c @@ -1,17 +1,7 @@ -#include #include -#include -#include -#include +#include #include -#include #include -#include -#include -#include -#include -#include - /* * Copyright (c) 1985 Regents of the University of California. @@ -21,21 +11,21 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)res_send.c 6.14 (Berkeley) 7/2/86"; -#endif +#endif LIBC_SCCS and not lint /* * Send query to name server and wait for reply. */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include +#include +#include +#include +#include extern int errno; @@ -43,7 +33,12 @@ static int s = -1; /* socket used for communications */ #define KEEPOPEN (RES_USEVC|RES_STAYOPEN) -int res_send(buf, buflen, answer, anslen) char *buf; int buflen; char *answer; int anslen; { +res_send(buf, buflen, answer, anslen) + char *buf; + int buflen; + char *answer; + int anslen; +{ register int n; int retry, v_circuit, resplen, ns; int gotsomewhere = 0; @@ -61,7 +56,7 @@ int res_send(buf, buflen, answer, anslen) char *buf; int buflen; char *answer; i printf("res_send()\n"); p_query(buf); } -#endif +#endif DEBUG if (!(_res.options & RES_INIT)) if (res_init() == -1) { return(-1); @@ -77,7 +72,7 @@ int res_send(buf, buflen, answer, anslen) char *buf; int buflen; char *answer; i if (_res.options & RES_DEBUG) printf("Querying server (# %d) address = %s\n", ns+1, inet_ntoa(_res.nsaddr_list[ns].sin_addr.s_addr)); -#endif +#endif DEBUG if (v_circuit) { /* * Use virtual circuit. @@ -89,7 +84,7 @@ int res_send(buf, buflen, answer, anslen) char *buf; int buflen; char *answer; i #ifdef DEBUG if (_res.options & RES_DEBUG) perror("socket failed"); -#endif +#endif DEBUG continue; } if (connect(s, &(_res.nsaddr_list[ns]), @@ -98,7 +93,7 @@ int res_send(buf, buflen, answer, anslen) char *buf; int buflen; char *answer; i #ifdef DEBUG if (_res.options & RES_DEBUG) perror("connect failed"); -#endif +#endif DEBUG (void) close(s); s = -1; continue; @@ -117,7 +112,7 @@ int res_send(buf, buflen, answer, anslen) char *buf; int buflen; char *answer; i #ifdef DEBUG if (_res.options & RES_DEBUG) perror("write failed"); -#endif +#endif DEBUG (void) close(s); s = -1; continue; @@ -137,7 +132,7 @@ int res_send(buf, buflen, answer, anslen) char *buf; int buflen; char *answer; i #ifdef DEBUG if (_res.options & RES_DEBUG) perror("read failed"); -#endif +#endif DEBUG (void) close(s); s = -1; continue; @@ -154,7 +149,7 @@ int res_send(buf, buflen, answer, anslen) char *buf; int buflen; char *answer; i #ifdef DEBUG if (_res.options & RES_DEBUG) perror("read failed"); -#endif +#endif DEBUG (void) close(s); s = -1; continue; @@ -172,19 +167,19 @@ int res_send(buf, buflen, answer, anslen) char *buf; int buflen; char *answer; i #ifdef DEBUG if (_res.options & RES_DEBUG) perror("connect"); -#endif +#endif DEBUG continue; } -#else +#else BSD if (sendto(s, buf, buflen, 0, &_res.nsaddr_list[ns], sizeof(struct sockaddr)) != buflen) { #ifdef DEBUG if (_res.options & RES_DEBUG) perror("sendto"); -#endif +#endif DEBUG continue; } -#endif +#endif BSD /* * Wait for reply */ @@ -202,7 +197,7 @@ wait: #ifdef DEBUG if (_res.options & RES_DEBUG) perror("select"); -#endif +#endif DEBUG continue; } if (n == 0) { @@ -212,7 +207,7 @@ wait: #ifdef DEBUG if (_res.options & RES_DEBUG) printf("timeout\n"); -#endif +#endif DEBUG gotsomewhere = 1; continue; } @@ -220,7 +215,7 @@ wait: #ifdef DEBUG if (_res.options & RES_DEBUG) perror("recvfrom"); -#endif +#endif DEBUG continue; } gotsomewhere = 1; @@ -233,7 +228,7 @@ wait: printf("old answer:\n"); p_query(answer); } -#endif +#endif DEBUG goto wait; } if (!(_res.options & RES_IGNTC) && anhp->tc) { @@ -243,7 +238,7 @@ wait: #ifdef DEBUG if (_res.options & RES_DEBUG) printf("truncated answer\n"); -#endif +#endif DEBUG (void) close(s); s = -1; /* @@ -260,7 +255,7 @@ wait: printf("got answer:\n"); p_query(answer); } -#endif +#endif DEBUG /* * We are going to assume that the first server is preferred * over the rest (i.e. it is on the local machine) and only @@ -296,7 +291,8 @@ wait: * * This routine is not expected to be user visible. */ -int _res_close() { +_res_close() +{ if (s != -1) { (void) close(s); s = -1; diff --git a/lib/libstdc/net/rexec.c b/lib/libstdc/net/rexec.c index 0797698..1da7ea5 100644 --- a/lib/libstdc/net/rexec.c +++ b/lib/libstdc/net/rexec.c @@ -1,15 +1,5 @@ -#include -#include -#include -#include -#include #include -#include -#include -#include #include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -18,23 +8,28 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)rexec.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include -/*#include */ +#include -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include extern errno; -/*char *index(), *sprintf();*/ +char *index(), *sprintf(); int rexecoptions; -/*char *getpass(), *getlogin();*/ +char *getpass(), *getlogin(); -int rexec(ahost, rport, name, pass, cmd, fd2p) char **ahost; int rport; char *name; char *pass; char *cmd; int *fd2p; { +rexec(ahost, rport, name, pass, cmd, fd2p) + char **ahost; + int rport; + char *name, *pass, *cmd; + int *fd2p; +{ int s, timo = 1, s3; struct sockaddr_in sin, sin2, from; char c; diff --git a/lib/libstdc/net/route.h b/lib/libstdc/net/route.h index 3c170dd..0fc82da 100644 --- a/lib/libstdc/net/route.h +++ b/lib/libstdc/net/route.h @@ -1,9 +1,3 @@ -#ifndef _NET_ROUTE_H_ -#define _NET_ROUTE_H_ - -#include -#include - /* * Copyright (c) 1980, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -84,5 +78,3 @@ struct mbuf *rthost[RTHASHSIZ]; struct mbuf *rtnet[RTHASHSIZ]; struct rtstat rtstat; #endif - -#endif diff --git a/lib/libstdc/net/ruserpass.c b/lib/libstdc/net/ruserpass.c index 2235f16..6e495f4 100644 --- a/lib/libstdc/net/ruserpass.c +++ b/lib/libstdc/net/ruserpass.c @@ -1,15 +1,4 @@ -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -18,38 +7,22 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ruserpass.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include +#include -/*char *renvlook(), *malloc(), *index(), *getenv(), *getpass(), *getlogin();*/ -/*struct utmp *getutmp();*/ +char *renvlook(), *malloc(), *index(), *getenv(), *getpass(), *getlogin(); +struct utmp *getutmp(); static FILE *cfile; -static renv __P((char *host, char **aname, char **apass)); -static char *renvlook __P((char *host)); -static rnetrc __P((char *host, char **aname, char **apass)); -static token __P((void)); -static char *nbsencrypt __P((char *str, char *key, char *result)); -static char *nbsdecrypt __P((char *cpt, char *key, char *result)); -static char *nbs8encrypt __P((char *str, char *key)); -static char *nbs8decrypt __P((char *crp, char *key)); -static enblkclr __P((char *blk, char *str)); -static char *deblkclr __P((char *blk)); -static enblknot __P((char *blk, char *crp)); -static char *deblknot __P((char *blk)); -static nbssetkey __P((char *key)); -static blkencrypt __P((char *block, int edflag)); -static struct utmp *getutmp __P((char *sttyname)); -static sreverse __P((register char *sto, register char *sfrom)); -static char *mkenvkey __P((int mch)); - -int ruserpass(host, aname, apass) char *host; char **aname; char **apass; { +ruserpass(host, aname, apass) + char *host, **aname, **apass; +{ renv(host, aname, apass); if (*aname == 0 || *apass == 0) @@ -74,7 +47,10 @@ int ruserpass(host, aname, apass) char *host; char **aname; char **apass; { } } -static renv(host, aname, apass) char *host; char **aname; char **apass; { +static +renv(host, aname, apass) + char *host, **aname, **apass; +{ register char *cp; char *stemp, fgetlogin, *comma; @@ -99,7 +75,11 @@ static renv(host, aname, apass) char *host; char **aname; char **apass; { mkpwclear(cp, host[0], *apass); } -static char *renvlook(host) char *host; { +static +char * +renvlook(host) + char *host; +{ register char *cp, **env; extern char **environ; @@ -149,7 +129,10 @@ static struct toktab { 0, 0 }; -static rnetrc(host, aname, apass) char *host; char **aname; char **apass; { +static +rnetrc(host, aname, apass) + char *host, **aname, **apass; +{ char *hdir, buf[BUFSIZ]; int t; struct stat stb; @@ -215,7 +198,9 @@ done: fclose(cfile); } -static token() { +static +token() +{ char *cp; int c; struct toktab *t; @@ -253,8 +238,8 @@ static token() { } /* rest is nbs.c stolen from berknet */ -/*char *deblknot(), *deblkclr();*/ -/*char *nbs8decrypt(), *nbs8encrypt();*/ +char *deblknot(), *deblkclr(); +char *nbs8decrypt(), *nbs8encrypt(); static char E[48]; /* @@ -270,7 +255,10 @@ static char e[] = { 24,25,26,27,28,29, 28,29,30,31,32, 1, }; -static char *nbsencrypt(str, key, result) char *str; char *key; char *result; { +static +char *nbsencrypt(str,key,result) + char *result; + char *str, *key; { static char buf[20],oldbuf[20]; register int j; result[0] = 0; @@ -284,7 +272,10 @@ static char *nbsencrypt(str, key, result) char *str; char *key; char *result; { } return(result); } -static char *nbsdecrypt(cpt, key, result) char *cpt; char *key; char *result; { +static +char *nbsdecrypt(cpt,key,result) + char *result; + char *cpt,*key; { char *s; char c,oldbuf[20]; result[0] = 0; @@ -301,7 +292,9 @@ static char *nbsdecrypt(cpt, key, result) char *cpt; char *key; char *result; { return(result); } -static char *nbs8encrypt(str, key) char *str; char *key; { +static +char *nbs8encrypt(str,key) +char *str, *key; { static char keyblk[100], blk[100]; register int i; @@ -315,7 +308,9 @@ static char *nbs8encrypt(str, key) char *str; char *key; { return(deblknot(blk)); } -static char *nbs8decrypt(crp, key) char *crp; char *key; { +static +char *nbs8decrypt(crp,key) +char *crp, *key; { static char keyblk[100], blk[100]; register int i; @@ -329,7 +324,9 @@ static char *nbs8decrypt(crp, key) char *crp; char *key; { return(deblkclr(blk)); } -static enblkclr(blk, str) /* ignores top bit of chars in string str */ char *blk; char *str; { +static +enblkclr(blk,str) /* ignores top bit of chars in string str */ +char *blk,*str; { register int i,j; char c; for(i=0;i<70;i++)blk[i] = 0; @@ -340,7 +337,9 @@ static enblkclr(blk, str) /* ignores top bit of chars in string str */ char *bl } } -static char *deblkclr(blk) char *blk; { +static +char *deblkclr(blk) +char *blk; { register int i,j; char c; static char iobuf[30]; @@ -356,7 +355,10 @@ static char *deblkclr(blk) char *blk; { return(iobuf); } -static enblknot(blk, crp) char *blk; char *crp; { +static +enblknot(blk,crp) +char *blk; +char *crp; { register int i,j; char c; for(i=0;i<70;i++)blk[i] = 0; @@ -369,7 +371,9 @@ static enblknot(blk, crp) char *blk; char *crp; { } } -static char *deblknot(blk) char *blk; { +static +char *deblknot(blk) +char *blk; { register int i,j; char c; static char iobuf[30]; @@ -484,7 +488,10 @@ static char KS[16][48]; * Set up the key schedule from the key. */ -static nbssetkey(key) char *key; { +static +nbssetkey(key) +char *key; +{ register i, j, k; int t; @@ -606,7 +613,10 @@ static char preS[48]; * The payoff: encrypt a block. */ -static blkencrypt(block, edflag) char *block; int edflag; { +static +blkencrypt(block, edflag) +char *block; +{ int i, ii; register t, j, k; @@ -698,7 +708,10 @@ static blkencrypt(block, edflag) char *block; int edflag; { Is version independent-- will work on v6 systems return NULL if error */ -static struct utmp *getutmp(sttyname) char *sttyname; { +static +struct utmp *getutmp(sttyname) +char *sttyname; +{ static struct utmp utmpstr; FILE *fdutmp; @@ -716,7 +729,10 @@ static struct utmp *getutmp(sttyname) char *sttyname; { return(NULL); } -static sreverse(sto, sfrom) register char *sto; register char *sfrom; { +static +sreverse(sto, sfrom) + register char *sto, *sfrom; +{ register int i; i = strlen(sfrom); @@ -724,7 +740,10 @@ static sreverse(sto, sfrom) register char *sto; register char *sfrom; { *sto++ = sfrom[i--]; } -static char *mkenvkey(mch) int mch; { +static +char *mkenvkey(mch) + char mch; +{ static char skey[40]; register struct utmp *putmp; char stemp[40], stemp1[40], sttyname[30]; @@ -755,7 +774,9 @@ static char *mkenvkey(mch) int mch; { return (skey); } -int mkpwunclear(spasswd, mch, sencpasswd) char *spasswd; int mch; char *sencpasswd; { +mkpwunclear(spasswd,mch,sencpasswd) + char mch, *spasswd, *sencpasswd; +{ register char *skey; if (spasswd[0] == 0) { @@ -770,7 +791,9 @@ int mkpwunclear(spasswd, mch, sencpasswd) char *spasswd; int mch; char *sencpass nbsencrypt(spasswd, skey, sencpasswd); } -int mkpwclear(sencpasswd, mch, spasswd) char *sencpasswd; int mch; char *spasswd; { +mkpwclear(sencpasswd,mch,spasswd) + char mch, *spasswd, *sencpasswd; +{ register char *skey; if (sencpasswd[0] == 0) { diff --git a/lib/libstdc/netdb.h b/lib/libstdc/netdb.h index fb1ffbd..762e4a5 100644 --- a/lib/libstdc/netdb.h +++ b/lib/libstdc/netdb.h @@ -1,7 +1,3 @@ -#ifndef _NETDB_H_ -#define _NETDB_H_ - - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -50,10 +46,10 @@ struct protoent { int p_proto; /* protocol # */ }; -/*struct hostent *gethostbyname(), *gethostbyaddr(), *gethostent();*/ -/*struct netent *getnetbyname(), *getnetbyaddr(), *getnetent();*/ -/*struct servent *getservbyname(), *getservbyport(), *getservent();*/ -/*struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent();*/ +struct hostent *gethostbyname(), *gethostbyaddr(), *gethostent(); +struct netent *getnetbyname(), *getnetbyaddr(), *getnetent(); +struct servent *getservbyname(), *getservbyport(), *getservent(); +struct protoent *getprotobyname(), *getprotobynumber(), *getprotoent(); /* * Error return codes from gethostbyname() and gethostbyaddr() @@ -65,70 +61,3 @@ extern int h_errno; #define TRY_AGAIN 2 /* Non-Authoritive Host not found, or SERVERFAIL */ #define NO_RECOVERY 3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */ #define NO_ADDRESS 4 /* Valid host name, no address, look for MX record */ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* net/getnetbyaddr.c */ -struct netent *getnetbyaddr __P((register int net, register int type)); - -/* net/getnetbyname.c */ -struct netent *getnetbyname __P((register char *name)); - -/* net/getnetent.c */ -int setnetent __P((int f)); -int endnetent __P((void)); -struct netent *getnetent __P((void)); - -/* net/getproto.c */ -struct protoent *getprotobynumber __P((register int proto)); - -/* net/getprotoent.c */ -int setprotoent __P((int f)); -int endprotoent __P((void)); -struct protoent *getprotoent __P((void)); - -/* net/getprotoname.c */ -struct protoent *getprotobyname __P((register char *name)); - -/* net/getservbyname.c */ -struct servent *getservbyname __P((char *name, char *proto)); - -/* net/getservbyport.c */ -struct servent *getservbyport __P((int port, char *proto)); - -/* net/getservent.c */ -int setservent __P((int f)); -int endservent __P((void)); -struct servent *getservent __P((void)); - -/* net/hosttable/gethostent.c */ -int sethostent __P((int f)); -int endhostent __P((void)); -struct hostent *gethostent __P((void)); -int sethostfile __P((char *file)); - -/* net/hosttable/gethostnamadr.c */ -struct hostent *gethostbyname __P((register char *nam)); -struct hostent *gethostbyaddr __P((char *addr, register int length, register int type)); - -/* net/named/gethostnamadr.c */ -struct hostent *gethostbyname __P((char *name)); -struct hostent *gethostbyaddr __P((char *addr, int len, int type)); -int _sethtent __P((int f)); -int _endhtent __P((void)); -struct hostent *_gethtent __P((void)); -struct hostent *_gethtbyname __P((char *name)); -struct hostent *_gethtbyaddr __P((char *addr, int len, int type)); - -/* net/named/sethostent.c */ -int sethostent __P((int stayopen)); -int endhostent __P((void)); -int sethostfile __P((char *name)); - -#endif diff --git a/lib/libstdc/netimp/if_imp.h b/lib/libstdc/netimp/if_imp.h index e4713b8..32535ac 100644 --- a/lib/libstdc/netimp/if_imp.h +++ b/lib/libstdc/netimp/if_imp.h @@ -1,8 +1,3 @@ -#ifndef _NETIMP_IF_IMP_H_ -#define _NETIMP_IF_IMP_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -163,5 +158,3 @@ char *impleaders[IMPTYPE_READY+1] = { "NOTIFY", "TRYING", "READY" }; #endif - -#endif diff --git a/lib/libstdc/netimp/if_imphost.h b/lib/libstdc/netimp/if_imphost.h index d504c50..3b7bf4b 100644 --- a/lib/libstdc/netimp/if_imphost.h +++ b/lib/libstdc/netimp/if_imphost.h @@ -1,12 +1,3 @@ -#ifndef _NETIMP_IF_IMPHOST_H_ -#define _NETIMP_IF_IMPHOST_H_ - -#include -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -94,9 +85,7 @@ struct hmbuf { }; #ifdef KERNEL -/*struct host *hostlookup();*/ -/*struct host *hostenter();*/ -/*struct mbuf *hostdeque();*/ -#endif - +struct host *hostlookup(); +struct host *hostenter(); +struct mbuf *hostdeque(); #endif diff --git a/lib/libstdc/netinet/icmp_var.h b/lib/libstdc/netinet/icmp_var.h index 2c50dc5..482615a 100644 --- a/lib/libstdc/netinet/icmp_var.h +++ b/lib/libstdc/netinet/icmp_var.h @@ -1,8 +1,3 @@ -#ifndef _NETINET_ICMP_VAR_H_ -#define _NETINET_ICMP_VAR_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -33,5 +28,3 @@ struct icmpstat { #ifdef KERNEL struct icmpstat icmpstat; #endif - -#endif diff --git a/lib/libstdc/netinet/if_ether.h b/lib/libstdc/netinet/if_ether.h index acddd8c..20167e8 100644 --- a/lib/libstdc/netinet/if_ether.h +++ b/lib/libstdc/netinet/if_ether.h @@ -1,11 +1,3 @@ -#ifndef _NETINET_IF_ETHER_H_ -#define _NETINET_IF_ETHER_H_ - -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -83,8 +75,6 @@ struct arptab { #ifdef KERNEL u_char etherbroadcastaddr[6]; -/*struct arptab *arptnew();*/ -/*char *ether_sprintf();*/ -#endif - +struct arptab *arptnew(); +char *ether_sprintf(); #endif diff --git a/lib/libstdc/netinet/in.h b/lib/libstdc/netinet/in.h index f1eb1ce..3a59f1d 100644 --- a/lib/libstdc/netinet/in.h +++ b/lib/libstdc/netinet/in.h @@ -1,10 +1,3 @@ -#ifndef _NETINET_IN_H_ -#define _NETINET_IN_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -97,11 +90,11 @@ struct sockaddr_in { */ #define IP_OPTIONS 1 /* set/get IP per-packet options */ -/* this needs to be rationalized, remove for now */ +/* moved this to net.h as it's shared by netns/ns.h */ +/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/ /* * Macros for number representation conversion. */ -/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/ /*#define ntohl(x) (x)*/ /*#define ntohs(x) (x)*/ /*#define htonl(x) (x)*/ @@ -112,39 +105,10 @@ struct sockaddr_in { /*u_short ntohs(), htons();*/ /*u_long ntohl(), htonl();*/ /*#endif*/ -/* to here */ #ifdef KERNEL extern struct domain inetdomain; extern struct protosw inetsw[]; -/*struct in_addr in_makeaddr();*/ -/*u_long in_netof(), in_lnaof();*/ -#endif - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* inet/inet_addr.c */ -u_long inet_addr __P((register char *cp)); - -/* inet/inet_lnaof.c */ -int inet_lnaof __P((struct in_addr in)); - -/* inet/inet_makeaddr.c */ -struct in_addr inet_makeaddr __P((int net, int host)); - -/* inet/inet_netof.c */ -int inet_netof __P((struct in_addr in)); - -/* inet/inet_network.c */ -u_long inet_network __P((register char *cp)); - -/* inet/inet_ntoa.c */ -char *inet_ntoa __P((struct in_addr in)); - +struct in_addr in_makeaddr(); +u_long in_netof(), in_lnaof(); #endif diff --git a/lib/libstdc/netinet/in_pcb.h b/lib/libstdc/netinet/in_pcb.h index 45a5217..bba0e0f 100644 --- a/lib/libstdc/netinet/in_pcb.h +++ b/lib/libstdc/netinet/in_pcb.h @@ -1,10 +1,3 @@ -#ifndef _NETINET_IN_PCB_H_ -#define _NETINET_IN_PCB_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -41,7 +34,5 @@ struct inpcb { #define sotoinpcb(so) ((struct inpcb *)(so)->so_pcb) #ifdef KERNEL -/*struct inpcb *in_pcblookup();*/ -#endif - +struct inpcb *in_pcblookup(); #endif diff --git a/lib/libstdc/netinet/in_systm.h b/lib/libstdc/netinet/in_systm.h index 60d7a12..1825d88 100644 --- a/lib/libstdc/netinet/in_systm.h +++ b/lib/libstdc/netinet/in_systm.h @@ -1,8 +1,3 @@ -#ifndef _NETINET_IN_SYSTM_H_ -#define _NETINET_IN_SYSTM_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -30,7 +25,5 @@ typedef u_long n_long; /* long as received from the net */ typedef u_long n_time; /* ms since 00:00 GMT, byte rev */ #ifdef KERNEL -/*n_time iptime();*/ -#endif - +n_time iptime(); #endif diff --git a/lib/libstdc/netinet/in_var.h b/lib/libstdc/netinet/in_var.h index 3952a8c..9225938 100644 --- a/lib/libstdc/netinet/in_var.h +++ b/lib/libstdc/netinet/in_var.h @@ -1,10 +1,3 @@ -#ifndef _NETINET_IN_VAR_H_ -#define _NETINET_IN_VAR_H_ - -#include -#include -#include - /* * Copyright (c) 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -45,8 +38,6 @@ struct in_ifaddr { #ifdef KERNEL struct in_ifaddr *in_ifaddr; -/*struct in_ifaddr *in_iaonnetof();*/ +struct in_ifaddr *in_iaonnetof(); struct ifqueue ipintrq; /* ip packet input queue */ #endif - -#endif diff --git a/lib/libstdc/netinet/ip.h b/lib/libstdc/netinet/ip.h index 3eb9751..809778c 100644 --- a/lib/libstdc/netinet/ip.h +++ b/lib/libstdc/netinet/ip.h @@ -1,10 +1,3 @@ -#ifndef _NETINET_IP_H_ -#define _NETINET_IP_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -113,5 +106,3 @@ struct ip_timestamp { #define IPTTLDEC 1 /* subtracted when forwarding */ #define IP_MSS 576 /* default maximum segment size */ - -#endif diff --git a/lib/libstdc/netinet/ip_icmp.h b/lib/libstdc/netinet/ip_icmp.h index f16bdd3..a342e31 100644 --- a/lib/libstdc/netinet/ip_icmp.h +++ b/lib/libstdc/netinet/ip_icmp.h @@ -1,11 +1,3 @@ -#ifndef _NETINET_IP_ICMP_H_ -#define _NETINET_IP_ICMP_H_ - -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -106,5 +98,3 @@ struct icmp { #define ICMP_MASKREPLY 18 /* address mask reply */ #define ICMP_MAXTYPE 18 - -#endif diff --git a/lib/libstdc/netinet/ip_var.h b/lib/libstdc/netinet/ip_var.h index 092d8ab..d28c3f8 100644 --- a/lib/libstdc/netinet/ip_var.h +++ b/lib/libstdc/netinet/ip_var.h @@ -1,10 +1,3 @@ -#ifndef _NETINET_IP_VAR_H_ -#define _NETINET_IP_VAR_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -100,7 +93,5 @@ struct ipstat ipstat; struct ipq ipq; /* ip reass. queue */ u_short ip_id; /* ip packet ctr, for ids */ -/*struct mbuf *ip_srcroute();*/ -#endif - +struct mbuf *ip_srcroute(); #endif diff --git a/lib/libstdc/netinet/tcp.h b/lib/libstdc/netinet/tcp.h index 9158eb2..8409c43 100644 --- a/lib/libstdc/netinet/tcp.h +++ b/lib/libstdc/netinet/tcp.h @@ -1,11 +1,3 @@ -#ifndef _NETINET_TCP_H_ -#define _NETINET_TCP_H_ - -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -52,7 +44,9 @@ struct tcphdr { #ifdef lint #define TCP_MSS 536 #else -#define TCP_MSS MIN(512, IP_MSS - /*sizeof (struct tcpiphdr)*/(sizeof(struct ipovly) + sizeof(struct tcphdr))) +/* redefined this to avoid a circular dependency */ +/*#define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr))*/ +#define TCP_MSS MIN(512, IP_MSS - sizeof(struct ipovly) - sizeof(struct tcphdr)) #endif /* @@ -60,5 +54,3 @@ struct tcphdr { */ #define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ #define TCP_MAXSEG 0x02 /* set maximum segment size */ - -#endif diff --git a/lib/libstdc/netinet/tcp_debug.h b/lib/libstdc/netinet/tcp_debug.h index 11d410a..3dd6279 100644 --- a/lib/libstdc/netinet/tcp_debug.h +++ b/lib/libstdc/netinet/tcp_debug.h @@ -1,11 +1,3 @@ -#ifndef _NETINET_TCP_DEBUG_H_ -#define _NETINET_TCP_DEBUG_H_ - -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -38,5 +30,3 @@ char *tanames[] = #define TCP_NDEBUG 100 struct tcp_debug tcp_debug[TCP_NDEBUG]; int tcp_debx; - -#endif diff --git a/lib/libstdc/netinet/tcp_fsm.h b/lib/libstdc/netinet/tcp_fsm.h index b662bf3..3ef9026 100644 --- a/lib/libstdc/netinet/tcp_fsm.h +++ b/lib/libstdc/netinet/tcp_fsm.h @@ -1,10 +1,3 @@ -#ifndef _NETINET_TCP_FSM_H_ -#define _NETINET_TCP_FSM_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -63,5 +56,3 @@ char *tcpstates[] = { "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT", }; #endif - -#endif diff --git a/lib/libstdc/netinet/tcp_seq.h b/lib/libstdc/netinet/tcp_seq.h index deddd92..14c2865 100644 --- a/lib/libstdc/netinet/tcp_seq.h +++ b/lib/libstdc/netinet/tcp_seq.h @@ -1,8 +1,3 @@ -#ifndef _NETINET_TCP_SEQ_H_ -#define _NETINET_TCP_SEQ_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -38,5 +33,3 @@ #ifdef KERNEL tcp_seq tcp_iss; /* tcp initial send seq # */ #endif - -#endif diff --git a/lib/libstdc/netinet/tcp_timer.h b/lib/libstdc/netinet/tcp_timer.h index 8aef842..d6071fd 100644 --- a/lib/libstdc/netinet/tcp_timer.h +++ b/lib/libstdc/netinet/tcp_timer.h @@ -1,8 +1,3 @@ -#ifndef _NETINET_TCP_TIMER_H_ -#define _NETINET_TCP_TIMER_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -113,5 +108,3 @@ float tcp_alpha, tcp_beta; if ((tv) > (tvmax)) \ (tv) = (tvmax); \ } - -#endif diff --git a/lib/libstdc/netinet/tcp_var.h b/lib/libstdc/netinet/tcp_var.h index 1016a45..f1745ea 100644 --- a/lib/libstdc/netinet/tcp_var.h +++ b/lib/libstdc/netinet/tcp_var.h @@ -1,11 +1,3 @@ -#ifndef _NETINET_TCP_VAR_H_ -#define _NETINET_TCP_VAR_H_ - -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -94,9 +86,7 @@ struct tcpstat { #ifdef KERNEL struct inpcb tcb; /* head of queue of active tcpcb's */ struct tcpstat tcpstat; /* tcp statistics */ -/*struct tcpiphdr *tcp_template();*/ -/*struct tcpcb *tcp_close(), *tcp_drop();*/ -/*struct tcpcb *tcp_timers(), *tcp_disconnect(), *tcp_usrclosed();*/ -#endif - +struct tcpiphdr *tcp_template(); +struct tcpcb *tcp_close(), *tcp_drop(); +struct tcpcb *tcp_timers(), *tcp_disconnect(), *tcp_usrclosed(); #endif diff --git a/lib/libstdc/netinet/tcpip.h b/lib/libstdc/netinet/tcpip.h index 126a886..8356c39 100644 --- a/lib/libstdc/netinet/tcpip.h +++ b/lib/libstdc/netinet/tcpip.h @@ -1,9 +1,3 @@ -#ifndef _NETINET_TCPIP_H_ -#define _NETINET_TCPIP_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -36,5 +30,3 @@ struct tcpiphdr { #define ti_win ti_t.th_win #define ti_sum ti_t.th_sum #define ti_urp ti_t.th_urp - -#endif diff --git a/lib/libstdc/netinet/udp.h b/lib/libstdc/netinet/udp.h index 6c25e77..6a7f020 100644 --- a/lib/libstdc/netinet/udp.h +++ b/lib/libstdc/netinet/udp.h @@ -1,8 +1,3 @@ -#ifndef _NETINET_UDP_H_ -#define _NETINET_UDP_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -21,5 +16,3 @@ struct udphdr { short uh_ulen; /* udp length */ u_short uh_sum; /* udp checksum */ }; - -#endif diff --git a/lib/libstdc/netinet/udp_var.h b/lib/libstdc/netinet/udp_var.h index b6022fe..cfca943 100644 --- a/lib/libstdc/netinet/udp_var.h +++ b/lib/libstdc/netinet/udp_var.h @@ -1,10 +1,3 @@ -#ifndef _NETINET_UDP_VAR_H_ -#define _NETINET_UDP_VAR_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -44,5 +37,3 @@ struct udpstat { struct inpcb udb; struct udpstat udpstat; #endif - -#endif diff --git a/lib/libstdc/netns/idp.h b/lib/libstdc/netns/idp.h index 84ddfd9..ba6eef8 100644 --- a/lib/libstdc/netns/idp.h +++ b/lib/libstdc/netns/idp.h @@ -1,9 +1,3 @@ -#ifndef _NETNS_IDP_H_ -#define _NETNS_IDP_H_ - -#include -#include - /* * Copyright (c) 1984, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -23,5 +17,3 @@ struct idp { struct ns_addr idp_dna; /* Destination Network Address */ struct ns_addr idp_sna; /* Source Network Address */ }; - -#endif diff --git a/lib/libstdc/netns/idp_var.h b/lib/libstdc/netns/idp_var.h index 97d3cac..0c86598 100644 --- a/lib/libstdc/netns/idp_var.h +++ b/lib/libstdc/netns/idp_var.h @@ -1,7 +1,3 @@ -#ifndef _NETNS_IDP_VAR_H_ -#define _NETNS_IDP_VAR_H_ - - /* * Copyright (c) 1984, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -24,5 +20,3 @@ struct idpstat { #ifdef KERNEL struct idpstat idpstat; #endif - -#endif diff --git a/lib/libstdc/netns/ns.h b/lib/libstdc/netns/ns.h index e372caa..c111a2c 100644 --- a/lib/libstdc/netns/ns.h +++ b/lib/libstdc/netns/ns.h @@ -1,10 +1,3 @@ -#ifndef _NETNS_NS_H_ -#define _NETNS_NS_H_ - -#include -#include -#include - /* * Copyright (c) 1984, 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -110,11 +103,11 @@ struct sockaddr_ns { #define ns_nullhost(x) (((x).x_host.s_host[0]==0) && \ ((x).x_host.s_host[1]==0) && ((x).x_host.s_host[2]==0)) -/* this needs to be rationalized, remove for now */ +/* moved this to net.h as it's shared by netns/ns.h */ +/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/ /* * Macros for number representation conversion. */ -/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/ /*#define ntohl(x) (x)*/ /*#define ntohs(x) (x)*/ /*#define htonl(x) (x)*/ @@ -125,7 +118,6 @@ struct sockaddr_ns { /*u_short ntohs(), htons();*/ /*u_long ntohl(), htonl();*/ /*#endif*/ -/* to here */ #ifdef KERNEL extern struct domain nsdomain; @@ -134,21 +126,5 @@ union ns_host ns_zerohost; union ns_host ns_broadhost; union ns_net ns_zeronet; union ns_net ns_broadnet; -/*u_short ns_cksum();*/ -#endif - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* ns/ns_addr.c */ -struct ns_addr ns_addr __P((char *name)); - -/* ns/ns_ntoa.c */ -char *ns_ntoa __P((struct ns_addr addr)); - +u_short ns_cksum(); #endif diff --git a/lib/libstdc/netns/ns_error.h b/lib/libstdc/netns/ns_error.h index 7903601..c98119f 100644 --- a/lib/libstdc/netns/ns_error.h +++ b/lib/libstdc/netns/ns_error.h @@ -1,9 +1,3 @@ -#ifndef _NETNS_NS_ERROR_H_ -#define _NETNS_NS_ERROR_H_ - -#include -#include - /* * Copyright (c) 1984, 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -68,5 +62,3 @@ struct ns_errstat { #ifdef KERNEL struct ns_errstat ns_errstat; #endif - -#endif diff --git a/lib/libstdc/netns/ns_if.h b/lib/libstdc/netns/ns_if.h index 06a43fb..a349ab4 100644 --- a/lib/libstdc/netns/ns_if.h +++ b/lib/libstdc/netns/ns_if.h @@ -1,10 +1,3 @@ -#ifndef _NETNS_NS_IF_H_ -#define _NETNS_NS_IF_H_ - -#include -#include -#include - /* * Copyright (c) 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -55,8 +48,6 @@ struct nsip_req { #ifdef KERNEL struct ns_ifaddr *ns_ifaddr; -/*struct ns_ifaddr *ns_iaonnetof();*/ +struct ns_ifaddr *ns_iaonnetof(); struct ifqueue nsintrq; /* XNS input packet queue */ #endif - -#endif diff --git a/lib/libstdc/netns/ns_pcb.h b/lib/libstdc/netns/ns_pcb.h index 9bf0b7c..06a8487 100644 --- a/lib/libstdc/netns/ns_pcb.h +++ b/lib/libstdc/netns/ns_pcb.h @@ -1,10 +1,3 @@ -#ifndef _NETNS_NS_PCB_H_ -#define _NETNS_NS_PCB_H_ - -#include -#include -#include - /* * Copyright (c) 1984, 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -56,7 +49,5 @@ struct nspcb { #ifdef KERNEL struct nspcb nspcb; /* head of list */ -/*struct nspcb *ns_pcblookup();*/ -#endif - +struct nspcb *ns_pcblookup(); #endif diff --git a/lib/libstdc/netns/sp.h b/lib/libstdc/netns/sp.h index 53ee606..bf13709 100644 --- a/lib/libstdc/netns/sp.h +++ b/lib/libstdc/netns/sp.h @@ -1,8 +1,3 @@ -#ifndef _NETNS_SP_H_ -#define _NETNS_SP_H_ - -#include - /* * Copyright (c) 1984, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -28,5 +23,3 @@ struct sphdr { u_short sp_ack; /* acknowledge number */ u_short sp_alo; /* allocation number */ }; - -#endif diff --git a/lib/libstdc/netns/spidp.h b/lib/libstdc/netns/spidp.h index 6d960e1..10715ad 100644 --- a/lib/libstdc/netns/spidp.h +++ b/lib/libstdc/netns/spidp.h @@ -1,9 +1,3 @@ -#ifndef _NETNS_SPIDP_H_ -#define _NETNS_SPIDP_H_ - -#include -#include - /* * Copyright (c) 1984, 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -39,5 +33,3 @@ struct spidp_q { #define si_seq si_s.sp_seq #define si_ack si_s.sp_ack #define si_alo si_s.sp_alo - -#endif diff --git a/lib/libstdc/netns/spp_debug.h b/lib/libstdc/netns/spp_debug.h index 6329b89..1f06c96 100644 --- a/lib/libstdc/netns/spp_debug.h +++ b/lib/libstdc/netns/spp_debug.h @@ -1,10 +1,3 @@ -#ifndef _NETNS_SPP_DEBUG_H_ -#define _NETNS_SPP_DEBUG_H_ - -#include -#include -#include - /* * Copyright (c) 1984, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -37,5 +30,3 @@ char *sanames[] = #define SPP_NDEBUG 100 struct spp_debug spp_debug[SPP_NDEBUG]; int spp_debx; - -#endif diff --git a/lib/libstdc/netns/spp_var.h b/lib/libstdc/netns/spp_var.h index 5dde326..de0bb31 100644 --- a/lib/libstdc/netns/spp_var.h +++ b/lib/libstdc/netns/spp_var.h @@ -1,12 +1,3 @@ -#ifndef _NETNS_SPP_VAR_H_ -#define _NETNS_SPP_VAR_H_ - -#include -#include -#include -#include -#include - /* * Copyright (c) 1984, 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -99,5 +90,3 @@ extern struct sppcb *spp_close(), *spp_disconnect(), #define SSEQ_LEQ(a,b) (((short)((a)-(b))) <= 0) #define SSEQ_GT(a,b) (((short)((a)-(b))) > 0) #define SSEQ_GEQ(a,b) (((short)((a)-(b))) >= 0) - -#endif diff --git a/lib/libstdc/nlist.h b/lib/libstdc/nlist.h index 3f073bf..6b5b8ba 100644 --- a/lib/libstdc/nlist.h +++ b/lib/libstdc/nlist.h @@ -1,7 +1,3 @@ -#ifndef _NLIST_H_ -#define _NLIST_H_ - - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -48,16 +44,3 @@ struct nlist { * Format for namelist values. */ #define N_FORMAT "%08x" - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* gen/nlist.c */ -int nlist __P((char *name, struct nlist *list)); - -#endif diff --git a/lib/libstdc/ns.h b/lib/libstdc/ns.h deleted file mode 100644 index 953afdf..0000000 --- a/lib/libstdc/ns.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _NS_H_ -#define _NS_H_ - -#include - -#endif diff --git a/lib/libstdc/ns/ns_addr.c b/lib/libstdc/ns/ns_addr.c index daaa329..ff1758b 100644 --- a/lib/libstdc/ns/ns_addr.c +++ b/lib/libstdc/ns/ns_addr.c @@ -1,9 +1,4 @@ #include -#include -#include -#include -#include - /* * Copyright (c) 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -15,17 +10,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ns_addr.c 6.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include static struct ns_addr addr, zero_addr; -static Field __P((char *buf, u_char *out, int len)); -static cvtbase __P((int oldbase, int newbase, int input[], int inlen, unsigned char result[], int reslen)); - -struct ns_addr ns_addr(name) char *name; { +struct ns_addr +ns_addr(name) + char *name; +{ u_long net; u_short socket; char separator = '.'; @@ -69,7 +64,12 @@ struct ns_addr ns_addr(name) char *name; { return (addr); } -static Field(buf, out, len) char *buf; u_char *out; int len; { +static +Field(buf, out, len) +char *buf; +u_char *out; +int len; +{ register char *bp = buf; int i, ibase, base16 = 0, base10 = 0, clen = 0; int hb[6], *hp; @@ -168,7 +168,14 @@ static Field(buf, out, len) char *buf; u_char *out; int len; { cvtbase(ibase, 256, hb, i, out, len); } -static cvtbase(oldbase, newbase, input, inlen, result, reslen) int oldbase; int newbase; int input[]; int inlen; unsigned char result[]; int reslen; { +static +cvtbase(oldbase,newbase,input,inlen,result,reslen) + int oldbase, newbase; + int input[]; + int inlen; + unsigned char result[]; + int reslen; +{ int d, e; long sum; diff --git a/lib/libstdc/ns/ns_ntoa.c b/lib/libstdc/ns/ns_ntoa.c index a0000b4..78c8eef 100644 --- a/lib/libstdc/ns/ns_ntoa.c +++ b/lib/libstdc/ns/ns_ntoa.c @@ -1,8 +1,4 @@ #include -#include -#include -#include - /* * Copyright (c) 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,14 +8,15 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ns_ntoa.c 6.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ - -static char *spectHex __P((char *p0)); +#include +#include -char *ns_ntoa(addr) struct ns_addr addr; { +char * +ns_ntoa(addr) +struct ns_addr addr; +{ static char obuf[40]; char *spectHex(); union { union ns_net net_e; u_long long_e; } net; @@ -54,7 +51,10 @@ char *ns_ntoa(addr) struct ns_addr addr; { return (obuf); } -static char *spectHex(p0) char *p0; { +static char * +spectHex(p0) +char *p0; +{ int ok = 0; int nonzero = 0; register char *p = p0; diff --git a/lib/libstdc/o.sh b/lib/libstdc/o.sh index 3cf0cb7..9bc2065 100755 --- a/lib/libstdc/o.sh +++ b/lib/libstdc/o.sh @@ -1,126 +1,69 @@ #!/bin/sh -find ../../include -name '*.h' -print |\ -sed -e 's:^\.\./\.\./include/::' |\ -while read i -do - mkdir -p `dirname $i` - cp ../../include/$i $i -done -patch --strip 2 conflicts.temp -find ../../sys/h -name '*.h' -print |\ -sed -e 's:^\.\./\.\./sys/h/::' |\ +find . -name '*.[ch]' -print |\ +sed -e 's:^\./::' |\ while read i do - mkdir -p sys/`dirname $i` - cp ../../sys/h/$i sys + ../../xify/nocomment <$i |../../xify/nostring >$i.nocomm done -(cd sys; patch --strip 3) $i - fi - fi - - grep '^#[ ]*include[ ]*<[^>]*>' $i - sed -e 's/^#[ ]*include[ ]*<[^>]*>/\/\*&\*\//' -i $i - grep '^#[ ]*include[ ]*"[^"]*"' $i - sed -e 's/^#[ ]*include[ ]*"[^"]*"/\/\*&\*\//' -i $i - - grep -H '^[A-Za-z_][0-9A-Za-z_]*[^0-9A-Za-z_][^;]*[A-Za-z_][0-9A-Za-z_]*[ ]*([ ]*)[ ]*\(,[^;]*\)\?;' $i >a - if test -s a - then - mv a $i.protos - sed -e 's/^[A-Za-z_][0-9A-Za-z_]*[^0-9A-Za-z_][^;]*[A-Za-z_][0-9A-Za-z_]*[ ]*([ ]*)[ ]*\(,[^;]*\)\?;/\/\*&\*\//' -i $i - fi + rm -f $i.usedby - rm -f xx* - csplit -b '%05d' -q $i '/^[ ]*{[ ]*$/' '{*}' - for j in xx* + pattern= + prefix= + for j in $macros do - : + pattern="$pattern$prefix$j" + prefix='\|' done - for k in xx* + for j in $typedefs do - if test $k != xx00000 - then - sed -ne '2,$p' -i $k - fi - if test $k != $j - then - sed -e '$s/$/ {/' -i $k - fi + pattern="$pattern$prefix$j" + prefix='\|' done - cat xx* >$i -done - -find . -name '*.h' -print |\ -sed -e 's:^\./::' |\ -while read i -do - name=_`echo $i |tr '.\-/abcdefghijklmnopqrstuvwxyz' '___ABCDEFGHIJKLMNOPQRSTUVWXYZ'`_ - echo "i=$i name=$name" - ( - cat <a - mv a $i + if test -n "$pattern" + then + grep -H "^\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern\\)\\([^0-9A-Za-z_].*\\)\\?$" `find . -name '*.c.nocomm' -print` |sed -e 's:^\./::' |grep -v "^$i\.nocomm:" >a + if test -s a + then + cat a >>$i.usedby + for j in `sed -e 's/\.nocomm:.*//' \$" $j + then + sed -e "1i#include <$i>" -i $j + fi + done + fi + fi done diff --git a/lib/libstdc/p.sh b/lib/libstdc/p.sh deleted file mode 100755 index 297f5dc..0000000 --- a/lib/libstdc/p.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/bin/sh - -sed -e 's/^/:/;s/ /::/g;s/$/:/' conflicts.temp - -find . -name '*.[ch]' -print |\ -sed -e 's:\./::' |\ -while read i -do - ../../xify/nocomment <$i |../../xify/nostring >$i.nocomm -done - -find . -name '*.h' -print |\ -sed -e 's:^\./::' |\ -LC_ALL=C sort -r |\ -while read i -do - echo "i=$i" - macros="`sed -ne 's/^#[ ]*define[ ]\+\([A-Za-z_][0-9A-Za-z_]*\).*/\1/p' $i |grep -v '^NULL$'`" - echo "macros=$macros" - typedefs="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?typedef[^0-9A-Za-z_]\(.*[^0-9A-Za-z_]\)\?\([A-Za-z_][0-9A-Za-z_]*\)[ ]*\(\[[ 0-9]*\][ ]*\)\?;.*/\3/p' $i; sed -ne 's/^}[ ]*\([A-Za-z_][0-9A-Za-z_]*\)[ ]*;.*/\1/p' $i`" - echo "typedefs=$typedefs" - structs="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?struct[ ]\+\([A-Za-z_][0-9A-Za-z_]*\)[ ]*{.*/\2/p' $i`" - echo "structs=$structs" - unions="`sed -ne 's/^\(.*[^0-9A-Za-z_]\)\?union[ ]\+\([A-Za-z_][0-9A-Za-z_]*\)[ ]*{.*/\2/p' $i`" - echo "unions=$unions" - - rm -f $i.usedby - - pattern= - prefix= - for j in $macros - do - pattern="$pattern$prefix$j" - prefix='\|' - done - for j in $typedefs - do - pattern="$pattern$prefix$j" - prefix='\|' - done - for j in $structs - do - pattern="$pattern${prefix}struct[ ]\\+$j" - prefix='\|' - done - for j in $unions - do - pattern="$pattern${prefix}union[ ]\\+$j" - prefix='\|' - done - echo "pattern=$pattern" - - if test -n "$pattern" - then - grep -H "^\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern\\)\\([^0-9A-Za-z_].*\\)\\?$" `find . -name '*.c.nocomm' -print` |sed -e 's:^\./::' |grep -v "^$i\.nocomm:" >a - if test -s a - then - cat a >>$i.usedby - for j in `sed -e 's/\.nocomm:.*//' \$" $j - then - sed -e "1i#include <$i>" -i $j - fi - done - fi - fi - - pattern0= - prefix0= - - pattern1= - prefix1= - for j in $macros - do - pattern1="$pattern1$prefix1$j" - prefix1='\|' - done - for j in $typedefs - do - pattern1="$pattern1$prefix1$j" - prefix1='\|' - done - echo "pattern1=$pattern1" - if test -n "$pattern1" - then - pattern0="$pattern0$prefix0\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern1\\)\\([^0-9A-Za-z_].*\\)\\?" - prefix0='\|' - fi - - pattern1= - prefix1= - for j in $structs - do - pattern1="$pattern1${prefix1}struct[ ]\\+$j" - prefix1='\|' - done - for j in $unions - do - pattern1="$pattern1${prefix1}union[ ]\\+$j" - prefix1='\|' - done - echo "pattern1=$pattern1" - if test -n "$pattern1" - then - pattern0="$pattern0$prefix0\\(.*[^0-9A-Za-z_]\\)\\?\\($pattern1\\)\\([^ *0-9A-Za-z_].*\\|[ ]\\+\\([^*].*\\)\\?\\)\\?" - prefix0='\|' - fi - - echo "pattern0=$pattern0" - - if test -n "$pattern0" - then - grep -H "^\\($pattern0\\)$" `find . -name '*.h.nocomm' -print` |sed -e 's:^\./::' |grep -v "^$i\.nocomm:" >a - if test -s a - then - cat a >>$i.usedby - for j in `sed -e 's/\.nocomm:.*//' \$" $j - then - sed -e "4i#include <$i>" -i $j - fi - done - fi - fi -done diff --git a/lib/libstdc/pcc.h b/lib/libstdc/pcc.h index 9a273b5..efc6da5 100644 --- a/lib/libstdc/pcc.h +++ b/lib/libstdc/pcc.h @@ -1,8 +1,3 @@ -#ifndef _PCC_H_ -#define _PCC_H_ - -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -118,7 +113,7 @@ # define PCC_INLINE 61 /* inline function */ /* no ASG */ # define PCC_UINLINE 63 /* inline with no arguments */ -# endif +# endif INLINE /* * Referencing and dereferencing. @@ -184,7 +179,7 @@ # define PCCF_FARIF 156 /* not implemented */ # define PCCF_FLABEL 157 /* an f77 label */ -# endif +# endif PCC_TOKENS /* @@ -232,5 +227,3 @@ # define PCCM_ADDTYPE(t, m) \ ((((t) &~ PCCTM_BASETYPE) << PCCTM_TYPESHIFT) | \ (m) | ((t) & PCCTM_BASETYPE)) - -#endif diff --git a/lib/libstdc/protocols/dumprestore.h b/lib/libstdc/protocols/dumprestore.h index 3647460..fc576ec 100644 --- a/lib/libstdc/protocols/dumprestore.h +++ b/lib/libstdc/protocols/dumprestore.h @@ -1,9 +1,3 @@ -#ifndef _PROTOCOLS_DUMPRESTORE_H_ -#define _PROTOCOLS_DUMPRESTORE_H_ - -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -61,5 +55,3 @@ union u_spcl { #define DUMPOUTFMT "%-16s %c %s" /* for printf */ /* name, incno, ctime(date) */ #define DUMPINFMT "%16s %c %[^\n]\n" /* inverse for scanf */ - -#endif diff --git a/lib/libstdc/protocols/routed.h b/lib/libstdc/protocols/routed.h index f212f1c..ad7a61c 100644 --- a/lib/libstdc/protocols/routed.h +++ b/lib/libstdc/protocols/routed.h @@ -1,9 +1,3 @@ -#ifndef _PROTOCOLS_ROUTED_H_ -#define _PROTOCOLS_ROUTED_H_ - -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -68,5 +62,3 @@ char *ripcmds[RIPCMD_MAX] = #define EXPIRE_TIME 180 /* time to mark entry invalid */ #define GARBAGE_TIME 240 /* time to garbage collect */ - -#endif diff --git a/lib/libstdc/protocols/rwhod.h b/lib/libstdc/protocols/rwhod.h index 1fa9f7c..745c4b1 100644 --- a/lib/libstdc/protocols/rwhod.h +++ b/lib/libstdc/protocols/rwhod.h @@ -1,7 +1,3 @@ -#ifndef _PROTOCOLS_RWHOD_H_ -#define _PROTOCOLS_RWHOD_H_ - - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -36,5 +32,3 @@ struct whod { #define WHODVERSION 1 #define WHODTYPE_STATUS 1 /* host status */ - -#endif diff --git a/lib/libstdc/protocols/talkd.h b/lib/libstdc/protocols/talkd.h index f8c1b8c..b932862 100644 --- a/lib/libstdc/protocols/talkd.h +++ b/lib/libstdc/protocols/talkd.h @@ -1,9 +1,3 @@ -#ifndef _PROTOCOLS_TALKD_H_ -#define _PROTOCOLS_TALKD_H_ - -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,8 +6,8 @@ * @(#)talkd.h 5.2 (Berkeley) 3/13/86 */ -/*#include */ -/*#include */ +#include +#include /* * This describes the protocol used by the talk server and clients. * @@ -88,5 +82,3 @@ typedef struct { #define MAX_LIFE 60 /* max time daemon saves invitations */ /* RING_WAIT should be 10's of seconds less than MAX_LIFE */ #define RING_WAIT 30 /* time to wait before resending invitation */ - -#endif diff --git a/lib/libstdc/protocols/timed.h b/lib/libstdc/protocols/timed.h index 7a66f31..786d9d8 100644 --- a/lib/libstdc/protocols/timed.h +++ b/lib/libstdc/protocols/timed.h @@ -1,10 +1,3 @@ -#ifndef _PROTOCOLS_TIMED_H_ -#define _PROTOCOLS_TIMED_H_ - -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -72,5 +65,3 @@ char *tsptype[TSPTYPENUMBER] = "DATE", "DATEREQ", "DATEACK", "TRACEON", "TRACEOFF", "MSITE", "MSITEREQ", "TEST", "SETDATE", "SETDATEREQ", "LOOP" }; #endif - -#endif diff --git a/lib/libstdc/pwd.h b/lib/libstdc/pwd.h index 5e7dfe8..6954fd7 100644 --- a/lib/libstdc/pwd.h +++ b/lib/libstdc/pwd.h @@ -1,7 +1,3 @@ -#ifndef _PWD_H_ -#define _PWD_H_ - - /* pwd.h 4.1 83/05/03 */ struct passwd { /* see getpwent(3) */ @@ -16,24 +12,4 @@ struct passwd { /* see getpwent(3) */ char *pw_shell; }; -/*struct passwd *getpwent(), *getpwuid(), *getpwnam();*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* gen/getpwent.c */ -int setpwent __P((void)); -int endpwent __P((void)); -struct passwd *getpwent __P((void)); -int setpwfile __P((char *file)); - -/* gen/getpwnamuid.c */ -struct passwd *getpwnam __P((char *nam)); -struct passwd *getpwuid __P((int uid)); - -#endif +struct passwd *getpwent(), *getpwuid(), *getpwnam(); diff --git a/lib/libstdc/ranlib.h b/lib/libstdc/ranlib.h index 7ea58a1..936ba34 100644 --- a/lib/libstdc/ranlib.h +++ b/lib/libstdc/ranlib.h @@ -1,8 +1,3 @@ -#ifndef _RANLIB_H_ -#define _RANLIB_H_ - -#include - /* ranlib.h 4.1 83/05/03 */ /* @@ -20,5 +15,3 @@ struct ranlib { } ran_un; off_t ran_off; /* library member at this offset */ }; - -#endif diff --git a/lib/libstdc/resolv.h b/lib/libstdc/resolv.h index e6e33a9..ec5ff75 100644 --- a/lib/libstdc/resolv.h +++ b/lib/libstdc/resolv.h @@ -1,11 +1,3 @@ -#ifndef _RESOLV_H_ -#define _RESOLV_H_ - -#include -#include -#include -#include - /* * Copyright (c) 1983 Regents of the University of California. @@ -48,42 +40,4 @@ struct state { #define RES_STAYOPEN 0x0100 /* Keep TCP socket open */ extern struct state _res; -/*extern char *p_cdname(), *p_rr(), *p_type(), *p_class();*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* net/res_comp.c */ -int dn_expand __P((char *msg, char *eomorig, char *comp_dn, char *exp_dn, int length)); -int dn_comp __P((char *exp_dn, char *comp_dn, int length, char **dnptrs, char **lastdnptr)); -int dn_skip __P((char *comp_dn)); -int dn_find __P((char *exp_dn, char *msg, char **dnptrs, char **lastdnptr)); -u_short getshort __P((char *msgp)); -u_long getlong __P((char *msgp)); -int putshort __P((int s, register char *msgp)); -int putlong __P((register u_long l, register char *msgp)); - -/* net/res_debug.c */ -int p_query __P((char *msg)); -int fp_query __P((char *msg, FILE *file)); -char *p_cdname __P((char *cp, char *msg, FILE *file)); -char *p_rr __P((char *cp, char *msg, FILE *file)); -char *p_type __P((int type)); -char *p_class __P((int class)); - -/* net/res_init.c */ -int res_init __P((void)); - -/* net/res_mkquery.c */ -int res_mkquery __P((int op, char *dname, int class, int type, char *data, int datalen, struct rrec *newrr, char *buf, int buflen)); - -/* net/res_send.c */ -int res_send __P((char *buf, int buflen, char *answer, int anslen)); -int _res_close __P((void)); - -#endif +extern char *p_cdname(), *p_rr(), *p_type(), *p_class(); diff --git a/lib/libstdc/setjmp.h b/lib/libstdc/setjmp.h index ded8ac2..a8c173c 100644 --- a/lib/libstdc/setjmp.h +++ b/lib/libstdc/setjmp.h @@ -1,28 +1,3 @@ -#ifndef _SETJMP_H_ -#define _SETJMP_H_ - - /* setjmp.h 4.1 83/05/03 */ typedef int jmp_buf[10]; - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* gen/_setjmp.c */ -int _setjmp __P((jmp_buf e)); -void _longjmp __P((jmp_buf e, int v)); - -/* gen/setjmp.c */ -int setjmp __P((jmp_buf e)); -void longjmp __P((jmp_buf e, int v)); - -/* gen/setjmperr.c */ -int longjmperror __P((void)); - -#endif diff --git a/lib/libstdc/sgtty.h b/lib/libstdc/sgtty.h index b0afdfe..e1186ca 100644 --- a/lib/libstdc/sgtty.h +++ b/lib/libstdc/sgtty.h @@ -1,11 +1,5 @@ -#ifndef _SGTTY_H_ -#define _SGTTY_H_ - - /* sgtty.h 4.2 85/01/03 */ -/*#ifndef _IOCTL_*/ -/*#include */ -/*#endif*/ - +#ifndef _IOCTL_ +#include #endif diff --git a/lib/libstdc/signal.h b/lib/libstdc/signal.h new file mode 120000 index 0000000..df1896d --- /dev/null +++ b/lib/libstdc/signal.h @@ -0,0 +1 @@ +sys/signal.h \ No newline at end of file diff --git a/lib/libstdc/stab.h b/lib/libstdc/stab.h index 5e42b75..d7547d4 100644 --- a/lib/libstdc/stab.h +++ b/lib/libstdc/stab.h @@ -1,7 +1,3 @@ -#ifndef _STAB_H_ -#define _STAB_H_ - - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -44,5 +40,3 @@ * for the berkeley pascal compiler, pc(1): */ #define N_PC 0x30 /* global pascal symbol: name,,0,subtype,line */ - -#endif diff --git a/lib/libstdc/stdio.h b/lib/libstdc/stdio.h index 9b78922..ca9648c 100644 --- a/lib/libstdc/stdio.h +++ b/lib/libstdc/stdio.h @@ -1,12 +1,3 @@ -#ifndef _STDIO_H_ -#define _STDIO_H_ - -#include -#include -#ifdef __STDC__ -#include -#endif - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -15,7 +6,7 @@ * @(#)stdio.h 5.3 (Berkeley) 3/15/86 */ -/*# ifndef FILE*/ +# ifndef FILE #define BUFSIZ 1024 extern struct _iobuf { int _cnt; @@ -44,7 +35,7 @@ extern struct _iobuf { #define stderr (&_iob[2]) #ifndef lint #define getc(p) (--(p)->_cnt>=0? (int)(*(unsigned char *)(p)->_ptr++):_filbuf(p)) -#endif +#endif not lint #define getchar() getc(stdin) #ifndef lint #define putc(x, p) (--(p)->_cnt >= 0 ?\ @@ -54,152 +45,21 @@ extern struct _iobuf { (int)(*(unsigned char *)(p)->_ptr++) :\ _flsbuf(*(unsigned char *)(p)->_ptr, p)) :\ _flsbuf((unsigned char)(x), p))) -#endif +#endif not lint #define putchar(x) putc(x,stdout) #define feof(p) (((p)->_flag&_IOEOF)!=0) #define ferror(p) (((p)->_flag&_IOERR)!=0) #define fileno(p) ((p)->_file) #define clearerr(p) ((p)->_flag &= ~(_IOERR|_IOEOF)) -/*FILE *fopen();*/ -/*FILE *fdopen();*/ -/*FILE *freopen();*/ -/*FILE *popen();*/ -/*long ftell();*/ -/*char *fgets();*/ -/*char *gets();*/ +FILE *fopen(); +FILE *fdopen(); +FILE *freopen(); +FILE *popen(); +long ftell(); +char *fgets(); +char *gets(); #if 0 /*def vax*/ -/*char *sprintf();*/ /* too painful to do right */ -#endif -/*# endif*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* gen/popen.c */ -FILE *popen __P((char *cmd, char *mode)); -int pclose __P((FILE *ptr)); - -/* stdio/clrerr.c */ -int clearerr __P((register FILE *iop)); - -/* stdio/doprnt.c */ -int _doprnt __P((u_char *fmt0, va_list argp, register FILE *fp)); - -/* stdio/doscan.c */ -int _doscan __P((FILE *iop, register char *fmt, register va_list ap)); - -/* stdio/exit.c */ -int exit __P((int code)); - -/* stdio/fdopen.c */ -FILE *fdopen __P((int fd, register char *mode)); - -/* stdio/fgetc.c */ -int fgetc __P((FILE *fp)); - -/* stdio/fgets.c */ -char *fgets __P((char *s, int n, register FILE *iop)); - -/* stdio/filbuf.c */ -int _filbuf __P((register FILE *iop)); - -/* stdio/findiop.c */ -FILE *_findiop __P((void)); -int _f_morefiles __P((void)); -int f_prealloc __P((void)); -int _fwalk __P((register int (*function)(void))); -int _cleanup __P((void)); - -/* stdio/flsbuf.c */ -int _flsbuf __P((int c, register FILE *iop)); -int fflush __P((register FILE *iop)); -int fclose __P((register FILE *iop)); - -/* stdio/fopen.c */ -FILE *fopen __P((char *file, register char *mode)); - -/* stdio/fprintf.c */ -int fprintf __P((register FILE *iop, char *fmt, ...)); - -/* stdio/fputc.c */ -int fputc __P((int c, register FILE *fp)); - -/* stdio/fputs.c */ -int fputs __P((register char *s, register FILE *iop)); - -/* stdio/fread.c */ -int fread __P((register char *ptr, unsigned size, unsigned count, register FILE *iop)); - -/* stdio/freopen.c */ -FILE *freopen __P((char *file, register char *mode, register FILE *iop)); - -/* stdio/fseek.c */ -int fseek __P((register FILE *iop, long offset, int ptrname)); - -/* stdio/ftell.c */ -long ftell __P((register FILE *iop)); - -/* stdio/fwrite.c */ -int fwrite __P((register char *ptr, unsigned size, unsigned count, register FILE *iop)); - -/* stdio/getchar.c */ -int getchar __P((void)); - -/* stdio/gets.c */ -char *gets __P((char *s)); - -/* stdio/getw.c */ -int getw __P((register FILE *iop)); - -/* stdio/printf.c */ -int printf __P((char *fmt, ...)); - -/* stdio/putchar.c */ -int putchar __P((register c)); - -/* stdio/puts.c */ -int puts __P((register char *s)); - -/* stdio/putw.c */ -int putw __P((int w, register FILE *iop)); - -/* stdio/rew.c */ -int rewind __P((register FILE *iop)); - -/* stdio/scanf.c */ -int scanf __P((char *fmt, ...)); -int fscanf __P((FILE *iop, char *fmt, ...)); -int sscanf __P((register char *str, char *fmt, ...)); - -/* stdio/setbuf.c */ -int setbuf __P((register FILE *iop, char *buf)); - -/* stdio/setbuffer.c */ -int setbuffer __P((register FILE *iop, char *buf, int size)); -int setlinebuf __P((register FILE *iop)); - -/* stdio/sprintf.c */ -int sprintf __P((char *str, char *fmt, ...)); - -/* stdio/strout.c */ -int _strout __P((register count, register char *string, int adjust, register FILE *file, int fillch)); - -/* stdio/ungetc.c */ -int ungetc __P((int c, register FILE *iop)); - -/* stdio/vfprintf.c */ -int vfprintf __P((FILE *iop, char *fmt, va_list ap)); - -/* stdio/vprintf.c */ -int vprintf __P((char *fmt, va_list ap)); - -/* stdio/vsprintf.c */ -int vsprintf __P((char *str, char *fmt, va_list ap)); - +char *sprintf(); /* too painful to do right */ #endif +# endif diff --git a/lib/libstdc/stdio.h.orig b/lib/libstdc/stdio.h.orig deleted file mode 100644 index 1e7c48a..0000000 --- a/lib/libstdc/stdio.h.orig +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1980 Regents of the University of California. - * All rights reserved. The Berkeley software License Agreement - * specifies the terms and conditions for redistribution. - * - * @(#)stdio.h 5.3 (Berkeley) 3/15/86 - */ - -/*# ifndef FILE*/ -#define BUFSIZ 1024 -extern struct _iobuf { - int _cnt; - char *_ptr; /* should be unsigned char */ - char *_base; /* ditto */ - int _bufsiz; - short _flag; - char _file; /* should be short */ -} _iob[]; - -#define _IOREAD 01 -#define _IOWRT 02 -#define _IONBF 04 -#define _IOMYBUF 010 -#define _IOEOF 020 -#define _IOERR 040 -#define _IOSTRG 0100 -#define _IOLBF 0200 -#define _IORW 0400 -#define NULL 0 -#define FILE struct _iobuf -#define EOF (-1) - -#define stdin (&_iob[0]) -#define stdout (&_iob[1]) -#define stderr (&_iob[2]) -#ifndef lint -#define getc(p) (--(p)->_cnt>=0? (int)(*(unsigned char *)(p)->_ptr++):_filbuf(p)) -#endif not lint -#define getchar() getc(stdin) -#ifndef lint -#define putc(x, p) (--(p)->_cnt >= 0 ?\ - (int)(*(unsigned char *)(p)->_ptr++ = (x)) :\ - (((p)->_flag & _IOLBF) && -(p)->_cnt < (p)->_bufsiz ?\ - ((*(p)->_ptr = (x)) != '\n' ?\ - (int)(*(unsigned char *)(p)->_ptr++) :\ - _flsbuf(*(unsigned char *)(p)->_ptr, p)) :\ - _flsbuf((unsigned char)(x), p))) -#endif not lint -#define putchar(x) putc(x,stdout) -#define feof(p) (((p)->_flag&_IOEOF)!=0) -#define ferror(p) (((p)->_flag&_IOERR)!=0) -#define fileno(p) ((p)->_file) -#define clearerr(p) ((p)->_flag &= ~(_IOERR|_IOEOF)) - -/*FILE *fopen();*/ -/*FILE *fdopen();*/ -/*FILE *freopen();*/ -/*FILE *popen();*/ -/*long ftell();*/ -/*char *fgets();*/ -/*char *gets();*/ -#if 0 /*def vax*/ -/*char *sprintf();*/ /* too painful to do right */ -#endif -/*# endif*/ diff --git a/lib/libstdc/stdio/clrerr.c b/lib/libstdc/stdio/clrerr.c index 99234f3..baaede2 100644 --- a/lib/libstdc/stdio/clrerr.c +++ b/lib/libstdc/stdio/clrerr.c @@ -1,12 +1,12 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)clrerr.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include #undef clearerr -int clearerr(iop) register FILE *iop; { +clearerr(iop) + register FILE *iop; +{ iop->_flag &= ~(_IOERR|_IOEOF); } diff --git a/lib/libstdc/stdio/doprnt.c b/lib/libstdc/stdio/doprnt.c index fb89447..fb26796 100644 --- a/lib/libstdc/stdio/doprnt.c +++ b/lib/libstdc/stdio/doprnt.c @@ -1,17 +1,3 @@ -#include -#include -#include -#include -#include -#include -#ifdef __STDC__ -#include -#define _va_start(ap, arg) va_start(ap, arg) -#else -#include -#define _va_start(ap, arg) va_start(ap) -#endif - /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -31,12 +17,12 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)doprnt.c 5.35 (Berkeley) 6/27/88"; -#endif +#endif /* LIBC_SCCS and not lint */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include /* 11-bit exponent (VAX G floating point) is 308 decimal digits */ #define MAXEXP 308 @@ -67,11 +53,11 @@ static char sccsid[] = "@(#)doprnt.c 5.35 (Berkeley) 6/27/88"; #define ZEROPAD 0x20 /* zero (as opposed to blank) pad */ #define HEXPREFIX 0x40 /* add 0x or 0X prefix */ -static cvt __P((double number, register int prec, int flags, char *signp, int fmtch, char *startp, char *endp)); -static char *round __P((double fract, int *exp, register char *start, register char *end, int ch, char *signp)); -static char *exponent __P((register char *p, register int exp, int fmtch)); - -int _doprnt(fmt0, argp, fp) u_char *fmt0; va_list argp; register FILE *fp; { +_doprnt(fmt0, argp, fp) + u_char *fmt0; + va_list argp; + register FILE *fp; +{ register u_char *fmt; /* format string */ register int ch; /* character from fmt */ register int cnt; /* return value accumulator */ @@ -416,7 +402,14 @@ pforw: /* NOTREACHED */ } -static cvt(number, prec, flags, signp, fmtch, startp, endp) double number; register int prec; int flags; char *signp; int fmtch; char *startp; char *endp; { +static +cvt(number, prec, flags, signp, fmtch, startp, endp) + double number; + register int prec; + int flags; + u_char fmtch; + char *signp, *startp, *endp; +{ register char *p, *t; register double fract; int dotrim, expcnt, gformat; @@ -595,7 +588,13 @@ eformat: if (expcnt) { return(t - startp); } -static char *round(fract, exp, start, end, ch, signp) double fract; int *exp; register char *start; register char *end; int ch; char *signp; { +static char * +round(fract, exp, start, end, ch, signp) + double fract; + int *exp; + register char *start, *end; + char ch, *signp; +{ double tmp; if (fract) @@ -634,7 +633,12 @@ static char *round(fract, exp, start, end, ch, signp) double fract; int *exp; re return(start); } -static char *exponent(p, exp, fmtch) register char *p; register int exp; int fmtch; { +static char * +exponent(p, exp, fmtch) + register char *p; + register int exp; + u_char fmtch; +{ register char *t; char expbuf[MAXEXP]; diff --git a/lib/libstdc/stdio/doscan.c b/lib/libstdc/stdio/doscan.c index c033ad0..415d6ed 100644 --- a/lib/libstdc/stdio/doscan.c +++ b/lib/libstdc/stdio/doscan.c @@ -1,21 +1,10 @@ -#include -#include -#include -#ifdef __STDC__ -#include -#define _va_start(ap, arg) va_start(ap, arg) -#else -#include -#define _va_start(ap, arg) va_start(ap) -#endif - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)doscan.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include #define SPC 01 #define STP 02 @@ -26,7 +15,7 @@ static char sccsid[] = "@(#)doscan.c 5.2 (Berkeley) 3/9/86"; #define INT 0 #define FLOAT 1 -/*static char *_getccl();*/ +static char *_getccl(); static char _sctab[256] = { 0,0,0,0,0,0,0,0, @@ -39,11 +28,11 @@ static char _sctab[256] = { 0,0,0,0,0,0,0,0, }; -static _innum __P((int *ptr, int type, int len, int size, FILE *iop, int *eofptr)); -static _instr __P((register char *ptr, int type, int len, register FILE *iop, int *eofptr)); -static char *_getccl __P((register unsigned char *s)); - -int _doscan(iop, fmt, ap) FILE *iop; register char *fmt; register va_list ap; { +_doscan(iop, fmt, ap) +FILE *iop; +register char *fmt; +register va_list ap; +{ register int ch; int nmatch, len, ch1; int *ptr, fileended, size; @@ -110,7 +99,11 @@ int _doscan(iop, fmt, ap) FILE *iop; register char *fmt; register va_list ap; { } } -static _innum(ptr, type, len, size, iop, eofptr) int *ptr; int type; int len; int size; FILE *iop; int *eofptr; { +static +_innum(ptr, type, len, size, iop, eofptr) +int *ptr, *eofptr; +FILE *iop; +{ extern double atof(); register char *np; char numbuf[64]; @@ -215,7 +208,12 @@ static _innum(ptr, type, len, size, iop, eofptr) int *ptr; int type; int len; in return(1); } -static _instr(ptr, type, len, iop, eofptr) register char *ptr; int type; int len; register FILE *iop; int *eofptr; { +static +_instr(ptr, type, len, iop, eofptr) +register char *ptr; +register FILE *iop; +int *eofptr; +{ register ch; register char *optr; int ignstp; @@ -255,7 +253,10 @@ static _instr(ptr, type, len, iop, eofptr) register char *ptr; int type; int len return(0); } -static char *_getccl(s) register unsigned char *s; { +static char * +_getccl(s) +register unsigned char *s; +{ register c, t; t = 0; diff --git a/lib/libstdc/stdio/exit.c b/lib/libstdc/stdio/exit.c index 05d7779..aa9949c 100644 --- a/lib/libstdc/stdio/exit.c +++ b/lib/libstdc/stdio/exit.c @@ -1,13 +1,10 @@ -#include -#include -#include -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)exit.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -int exit(code) int code; { +exit(code) + int code; +{ _cleanup(); _exit(code); diff --git a/lib/libstdc/stdio/fdopen.c b/lib/libstdc/stdio/fdopen.c index a63adec..04032b7 100644 --- a/lib/libstdc/stdio/fdopen.c +++ b/lib/libstdc/stdio/fdopen.c @@ -1,7 +1,3 @@ -#include -#include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,7 +6,7 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fdopen.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Unix routine to do an "fopen" on file descriptor @@ -18,11 +14,14 @@ static char sccsid[] = "@(#)fdopen.c 5.2 (Berkeley) 3/9/86"; * status */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include -FILE *fdopen(fd, mode) int fd; register char *mode; { +FILE * +fdopen(fd, mode) + register char *mode; +{ extern FILE *_findiop(); static int nofile = -1; register FILE *iop; diff --git a/lib/libstdc/stdio/fgetc.c b/lib/libstdc/stdio/fgetc.c index ad7235b..4fa4e8e 100644 --- a/lib/libstdc/stdio/fgetc.c +++ b/lib/libstdc/stdio/fgetc.c @@ -1,11 +1,11 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fgetc.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int fgetc(fp) FILE *fp; { +fgetc(fp) +FILE *fp; +{ return(getc(fp)); } diff --git a/lib/libstdc/stdio/fgets.c b/lib/libstdc/stdio/fgets.c index a43d2de..8452eff 100644 --- a/lib/libstdc/stdio/fgets.c +++ b/lib/libstdc/stdio/fgets.c @@ -1,12 +1,15 @@ #include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fgets.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -char *fgets(s, n, iop) char *s; int n; register FILE *iop; { +char * +fgets(s, n, iop) +char *s; +register FILE *iop; +{ register c; register char *cs; diff --git a/lib/libstdc/stdio/filbuf.c b/lib/libstdc/stdio/filbuf.c index 6657d32..d600992 100644 --- a/lib/libstdc/stdio/filbuf.c +++ b/lib/libstdc/stdio/filbuf.c @@ -1,8 +1,4 @@ -#include -#include #include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,14 +7,16 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)filbuf.c 5.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ -/*char *malloc();*/ +#include +#include +#include +char *malloc(); -int _filbuf(iop) register FILE *iop; { +_filbuf(iop) +register FILE *iop; +{ int size; struct stat stbuf; extern char *_smallbuf; diff --git a/lib/libstdc/stdio/findiop.c b/lib/libstdc/stdio/findiop.c index 176de2c..c0789a9 100644 --- a/lib/libstdc/stdio/findiop.c +++ b/lib/libstdc/stdio/findiop.c @@ -1,8 +1,4 @@ -#include -#include -#include #include - /* * Copyright (c) 1983, 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,10 +7,10 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)findiop.c 5.6 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include extern int errno; @@ -28,7 +24,7 @@ FILE _iob[NSTATIC] = { { 0, NULL, NULL, 0, _IOWRT|_IONBF, 2 }, /* stderr */ }; -/*extern char *calloc();*/ +extern char *calloc(); static char sbuf[NSTATIC]; char *_smallbuf = sbuf; @@ -44,7 +40,9 @@ static FILE **endglue; * If none are available, then we allocate a structure to glue together * the old and new FILE entries, which are then no longer contiguous. */ -FILE *_findiop() { +FILE * +_findiop() +{ register FILE **iov, *iop; register FILE *fp; @@ -72,7 +70,8 @@ FILE *_findiop() { return (*iov); } -int _f_morefiles() { +_f_morefiles() +{ register FILE **iov; register FILE *fp; register char *cp; @@ -93,7 +92,8 @@ int _f_morefiles() { return (1); } -int f_prealloc() { +f_prealloc() +{ register FILE **iov; register FILE *fp; @@ -105,7 +105,9 @@ int f_prealloc() { *iov = (FILE *)calloc(1, sizeof **iov); } -int _fwalk(function) register int (*function)(); { +_fwalk(function) + register int (*function)(); +{ register FILE **iov; register FILE *fp; @@ -120,7 +122,8 @@ int _fwalk(function) register int (*function)(); { } } -int _cleanup() { +_cleanup() +{ extern int fclose(); _fwalk(fclose); diff --git a/lib/libstdc/stdio/flsbuf.c b/lib/libstdc/stdio/flsbuf.c index dda3f37..759ebc1 100644 --- a/lib/libstdc/stdio/flsbuf.c +++ b/lib/libstdc/stdio/flsbuf.c @@ -1,9 +1,4 @@ -#include -#include -#include #include -#include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,15 +7,18 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)flsbuf.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include -/*char *malloc();*/ +char *malloc(); -int _flsbuf(c, iop) int c; register FILE *iop; { +_flsbuf(c, iop) +unsigned char c; +register FILE *iop; +{ register char *base; register n, rn; char c1; @@ -83,7 +81,9 @@ tryagain: return(c); } -int fflush(iop) register FILE *iop; { +fflush(iop) +register FILE *iop; +{ register char *base; register n; @@ -99,7 +99,9 @@ int fflush(iop) register FILE *iop; { return(0); } -int fclose(iop) register FILE *iop; { +fclose(iop) + register FILE *iop; +{ register int r; r = EOF; diff --git a/lib/libstdc/stdio/fopen.c b/lib/libstdc/stdio/fopen.c index ac81888..40201ac 100644 --- a/lib/libstdc/stdio/fopen.c +++ b/lib/libstdc/stdio/fopen.c @@ -1,7 +1,4 @@ -#include -#include -#include - +#include /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,13 +7,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fopen.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include -FILE *fopen(file, mode) char *file; register char *mode; { +FILE * +fopen(file, mode) + char *file; + register char *mode; +{ register FILE *iop; register f, rw, oflags; extern FILE *_findiop(); diff --git a/lib/libstdc/stdio/fprintf.c b/lib/libstdc/stdio/fprintf.c index d500012..29f2efa 100644 --- a/lib/libstdc/stdio/fprintf.c +++ b/lib/libstdc/stdio/fprintf.c @@ -1,12 +1,3 @@ -#include -#ifdef __STDC__ -#include -#define _va_start(ap, arg) va_start(ap, arg) -#else -#include -#define _va_start(ap, arg) va_start(ap) -#endif - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. @@ -26,22 +17,21 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fprintf.c 5.4 (Berkeley) 6/27/88"; -#endif +#endif /* LIBC_SCCS and not lint */ -/*#include */ -/*#include */ +#include +#include -#ifdef __STDC__ -int fprintf(register FILE *iop, char *fmt, ...) -#else -int fprintf(iop, fmt, va_alist) register FILE *iop; char *fmt; va_dcl -#endif +fprintf(iop, fmt, va_alist) + register FILE *iop; + char *fmt; + va_dcl { va_list ap; int len; char localbuf[BUFSIZ]; - _va_start(ap, fmt); + va_start(ap); if (iop->_flag & _IONBF) { iop->_flag &= ~_IONBF; iop->_ptr = iop->_base = localbuf; diff --git a/lib/libstdc/stdio/fputc.c b/lib/libstdc/stdio/fputc.c index 2106d52..2bd5999 100644 --- a/lib/libstdc/stdio/fputc.c +++ b/lib/libstdc/stdio/fputc.c @@ -1,11 +1,11 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fputc.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int fputc(c, fp) int c; register FILE *fp; { +fputc(c, fp) +register FILE *fp; +{ return(putc(c, fp)); } diff --git a/lib/libstdc/stdio/fputs.c b/lib/libstdc/stdio/fputs.c index 932dd05..e2385e3 100644 --- a/lib/libstdc/stdio/fputs.c +++ b/lib/libstdc/stdio/fputs.c @@ -1,5 +1,4 @@ #include - /* * Copyright (c) 1984 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -8,11 +7,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fputs.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int fputs(s, iop) register char *s; register FILE *iop; { +fputs(s, iop) +register char *s; +register FILE *iop; +{ register r = 0; register c; int unbuffered; diff --git a/lib/libstdc/stdio/fread.c b/lib/libstdc/stdio/fread.c index 32034dc..fa25a8e 100644 --- a/lib/libstdc/stdio/fread.c +++ b/lib/libstdc/stdio/fread.c @@ -1,6 +1,4 @@ -#include #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,11 +7,15 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fread.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int fread(ptr, size, count, iop) register char *ptr; unsigned size; unsigned count; register FILE *iop; { +fread(ptr, size, count, iop) + register char *ptr; + unsigned size, count; + register FILE *iop; +{ register int s; int c; diff --git a/lib/libstdc/stdio/freopen.c b/lib/libstdc/stdio/freopen.c index 573ef5c..8aeb9c1 100644 --- a/lib/libstdc/stdio/freopen.c +++ b/lib/libstdc/stdio/freopen.c @@ -1,7 +1,4 @@ -#include -#include -#include - +#include /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,13 +7,18 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)freopen.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include -FILE *freopen(file, mode, iop) char *file; register char *mode; register FILE *iop; { +FILE * +freopen(file, mode, iop) + char *file; + register char *mode; + register FILE *iop; +{ register f, rw, oflags; rw = (mode[1] == '+'); diff --git a/lib/libstdc/stdio/fseek.c b/lib/libstdc/stdio/fseek.c index 39972c2..799bd0a 100644 --- a/lib/libstdc/stdio/fseek.c +++ b/lib/libstdc/stdio/fseek.c @@ -1,19 +1,20 @@ -#include #include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fseek.c 5.3 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Seek for standard library. Coordinates with buffering. */ -/*#include */ +#include -/*long lseek();*/ +long lseek(); -int fseek(iop, offset, ptrname) register FILE *iop; long offset; int ptrname; { +fseek(iop, offset, ptrname) + register FILE *iop; + long offset; +{ register resync, c; long p = -1; /* can't happen? */ diff --git a/lib/libstdc/stdio/ftell.c b/lib/libstdc/stdio/ftell.c index bd73267..4ed479a 100644 --- a/lib/libstdc/stdio/ftell.c +++ b/lib/libstdc/stdio/ftell.c @@ -1,20 +1,20 @@ -#include #include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ftell.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * Return file offset. * Coordinates with buffering. */ -/*#include */ -/*long lseek();*/ +#include +long lseek(); -long ftell(iop) register FILE *iop; { +long ftell(iop) +register FILE *iop; +{ register long tres; register adjust; diff --git a/lib/libstdc/stdio/fwrite.c b/lib/libstdc/stdio/fwrite.c index 4afd737..688214a 100644 --- a/lib/libstdc/stdio/fwrite.c +++ b/lib/libstdc/stdio/fwrite.c @@ -1,6 +1,4 @@ -#include #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,11 +7,15 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)fwrite.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int fwrite(ptr, size, count, iop) register char *ptr; unsigned size; unsigned count; register FILE *iop; { +fwrite(ptr, size, count, iop) + register char *ptr; + unsigned size, count; + register FILE *iop; +{ register int s; s = size * count; diff --git a/lib/libstdc/stdio/getchar.c b/lib/libstdc/stdio/getchar.c index 53fa8b0..f85e8dd 100644 --- a/lib/libstdc/stdio/getchar.c +++ b/lib/libstdc/stdio/getchar.c @@ -1,16 +1,15 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getchar.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * A subroutine version of the macro getchar. */ -/*#include */ +#include #undef getchar -int getchar() { +getchar() +{ return(getc(stdin)); } diff --git a/lib/libstdc/stdio/gets.c b/lib/libstdc/stdio/gets.c index 73e5ecb..8cbb92a 100644 --- a/lib/libstdc/stdio/gets.c +++ b/lib/libstdc/stdio/gets.c @@ -1,12 +1,14 @@ #include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)gets.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -char *gets(s) char *s; { +char * +gets(s) +char *s; +{ register c; register char *cs; diff --git a/lib/libstdc/stdio/getw.c b/lib/libstdc/stdio/getw.c index 187e43d..f307e1b 100644 --- a/lib/libstdc/stdio/getw.c +++ b/lib/libstdc/stdio/getw.c @@ -1,12 +1,12 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getw.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int getw(iop) register FILE *iop; { +getw(iop) +register FILE *iop; +{ register i; register char *p; int w; diff --git a/lib/libstdc/gen/popen.c b/lib/libstdc/stdio/popen.c similarity index 85% rename from lib/libstdc/gen/popen.c rename to lib/libstdc/stdio/popen.c index b2e9399..b55ca31 100644 --- a/lib/libstdc/gen/popen.c +++ b/lib/libstdc/stdio/popen.c @@ -1,11 +1,4 @@ -#include -#include -#include -#include -#include -#include #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,21 +7,25 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)popen.c 5.4 (Berkeley) 3/26/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include #define tst(a,b) (*mode == 'r'? (b) : (a)) #define RDR 0 #define WTR 1 -/*extern char *malloc();*/ +extern char *malloc(); static int *popen_pid; static int nfiles; -FILE *popen(cmd, mode) char *cmd; char *mode; { +FILE * +popen(cmd,mode) + char *cmd; + char *mode; +{ int p[2]; int myside, hisside, pid; @@ -65,7 +62,9 @@ FILE *popen(cmd, mode) char *cmd; char *mode; { return (fdopen(myside, mode)); } -int pclose(ptr) FILE *ptr; { +pclose(ptr) + FILE *ptr; +{ int child, pid, status, omask; child = popen_pid[fileno(ptr)]; diff --git a/lib/libstdc/stdio/printf.c b/lib/libstdc/stdio/printf.c index 771af83..7c14a77 100644 --- a/lib/libstdc/stdio/printf.c +++ b/lib/libstdc/stdio/printf.c @@ -1,12 +1,3 @@ -#include -#ifdef __STDC__ -#include -#define _va_start(ap, arg) va_start(ap, arg) -#else -#include -#define _va_start(ap, arg) va_start(ap) -#endif - /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. @@ -26,21 +17,19 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)printf.c 5.4 (Berkeley) 6/27/88"; -#endif +#endif /* LIBC_SCCS and not lint */ -/*#include */ -/*#include */ +#include +#include -#ifdef __STDC__ -int printf(char *fmt, ...) -#else -int printf(fmt, va_alist) char *fmt; va_dcl -#endif +printf(fmt, va_alist) + char *fmt; + va_dcl { va_list ap; int len; - _va_start(ap, fmt); + va_start(ap); len = _doprnt(fmt, ap, stdout); va_end(ap); return(ferror(stdout) ? EOF : len); diff --git a/lib/libstdc/stdio/putchar.c b/lib/libstdc/stdio/putchar.c index 9a63dc1..5aa3cee 100644 --- a/lib/libstdc/stdio/putchar.c +++ b/lib/libstdc/stdio/putchar.c @@ -1,16 +1,16 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)putchar.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint /* * A subroutine version of the macro putchar */ -/*#include */ +#include #undef putchar -int putchar(c) register c; { +putchar(c) +register c; +{ putc(c, stdout); } diff --git a/lib/libstdc/stdio/puts.c b/lib/libstdc/stdio/puts.c index a0e1669..d0a0b6e 100644 --- a/lib/libstdc/stdio/puts.c +++ b/lib/libstdc/stdio/puts.c @@ -1,12 +1,13 @@ #include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)puts.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int puts(s) register char *s; { +puts(s) +register char *s; +{ register c; while (c = *s++) diff --git a/lib/libstdc/stdio/putw.c b/lib/libstdc/stdio/putw.c index d307535..d56868b 100644 --- a/lib/libstdc/stdio/putw.c +++ b/lib/libstdc/stdio/putw.c @@ -1,12 +1,12 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)putw.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int putw(w, iop) int w; register FILE *iop; { +putw(w, iop) +register FILE *iop; +{ register char *p; register i; diff --git a/lib/libstdc/stdio/rew.c b/lib/libstdc/stdio/rew.c index 1eaf529..f1b8a3f 100644 --- a/lib/libstdc/stdio/rew.c +++ b/lib/libstdc/stdio/rew.c @@ -1,13 +1,13 @@ -#include #include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)rew.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int rewind(iop) register FILE *iop; { +rewind(iop) +register FILE *iop; +{ fflush(iop); lseek(fileno(iop), 0L, 0); iop->_cnt = 0; diff --git a/lib/libstdc/stdio/scanf.c b/lib/libstdc/stdio/scanf.c index 37a1113..9bca136 100644 --- a/lib/libstdc/stdio/scanf.c +++ b/lib/libstdc/stdio/scanf.c @@ -1,60 +1,47 @@ -#include -#ifdef __STDC__ -#include -#define _va_start(ap, arg) va_start(ap, arg) -#else -#include -#define _va_start(ap, arg) va_start(ap) -#endif - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)scanf.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ -/*#include */ +#include +#include -#ifdef __STDC__ -int scanf(char *fmt, ...) -#else -int scanf(fmt, va_alist) char *fmt; va_dcl -#endif +scanf(fmt, va_alist) +char *fmt; +va_dcl { va_list ap; int len; - _va_start(ap, fmt); + va_start(ap); len = _doscan(stdin, fmt, &args); va_end(ap); return len; } -#ifdef __STDC__ -int fscanf(FILE *iop, char *fmt, ...) -#else -int fscanf(iop, fmt, va_alist) FILE *iop; char *fmt; va_dcl -#endif +fscanf(iop, fmt, va_alist) +FILE *iop; +char *fmt; +va_dcl { va_list ap; int len; - _va_start(ap, fmt); + va_start(ap); len = _doscan(iop, fmt, &args); va_end(ap); return len; } -#ifdef __STDC__ -int sscanf(register char *str, char *fmt, ...) -#else -int sscanf(str, fmt, va_alist) register char *str; char *fmt; va_dcl -#endif +sscanf(str, fmt, va_alist) +register char *str; +char *fmt; +va_dcl { FILE _strbuf; va_list ap; int len; - _va_start(ap, fmt); + va_start(ap); _strbuf._flag = _IOREAD|_IOSTRG; _strbuf._ptr = _strbuf._base = str; _strbuf._cnt = 0; diff --git a/lib/libstdc/stdio/setbuf.c b/lib/libstdc/stdio/setbuf.c index c51b025..5d201cd 100644 --- a/lib/libstdc/stdio/setbuf.c +++ b/lib/libstdc/stdio/setbuf.c @@ -1,6 +1,4 @@ -#include #include - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,11 +7,14 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setbuf.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int setbuf(iop, buf) register FILE *iop; char *buf; { +setbuf(iop, buf) +register FILE *iop; +char *buf; +{ if (iop->_base != NULL && iop->_flag&_IOMYBUF) free(iop->_base); iop->_flag &= ~(_IOMYBUF|_IONBF|_IOLBF); diff --git a/lib/libstdc/stdio/setbuffer.c b/lib/libstdc/stdio/setbuffer.c index 4cb3cd0..82aeb93 100644 --- a/lib/libstdc/stdio/setbuffer.c +++ b/lib/libstdc/stdio/setbuffer.c @@ -1,6 +1,4 @@ -#include #include - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -9,11 +7,15 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)setbuffer.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int setbuffer(iop, buf, size) register FILE *iop; char *buf; int size; { +setbuffer(iop, buf, size) + register FILE *iop; + char *buf; + int size; +{ if (iop->_base != NULL && iop->_flag&_IOMYBUF) free(iop->_base); iop->_flag &= ~(_IOMYBUF|_IONBF|_IOLBF); @@ -30,7 +32,9 @@ int setbuffer(iop, buf, size) register FILE *iop; char *buf; int size; { /* * set line buffering for either stdout or stderr */ -int setlinebuf(iop) register FILE *iop; { +setlinebuf(iop) + register FILE *iop; +{ char *buf; extern char *malloc(); diff --git a/lib/libstdc/stdio/sibuf.c b/lib/libstdc/stdio/sibuf.c index b749e84..691f250 100644 --- a/lib/libstdc/stdio/sibuf.c +++ b/lib/libstdc/stdio/sibuf.c @@ -1,9 +1,7 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)sibuf.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include char _sibuf[BUFSIZ]; diff --git a/lib/libstdc/stdio/sobuf.c b/lib/libstdc/stdio/sobuf.c index dee91d1..e0b63f2 100644 --- a/lib/libstdc/stdio/sobuf.c +++ b/lib/libstdc/stdio/sobuf.c @@ -1,9 +1,7 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)sobuf.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include char _sobuf[BUFSIZ]; diff --git a/lib/libstdc/stdio/sprintf.c b/lib/libstdc/stdio/sprintf.c index 99948ef..e4e9143 100644 --- a/lib/libstdc/stdio/sprintf.c +++ b/lib/libstdc/stdio/sprintf.c @@ -1,12 +1,3 @@ -#include -#ifdef __STDC__ -#include -#define _va_start(ap, arg) va_start(ap, arg) -#else -#include -#define _va_start(ap, arg) va_start(ap) -#endif - /* * Copyright (c) 1987 Regents of the University of California. * All rights reserved. @@ -26,22 +17,20 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)sprintf.c 5.5 (Berkeley) 6/27/88"; -#endif +#endif /* LIBC_SCCS and not lint */ -/*#include */ -/*#include */ +#include +#include -#ifdef __STDC__ -int sprintf(char *str, char *fmt, ...) -#else -int sprintf(str, fmt, va_alist) char *str; char *fmt; va_dcl -#endif +sprintf(str, fmt, va_alist) + char *str, *fmt; + va_dcl { va_list ap; FILE _strbuf; int len; - _va_start(ap, fmt); + va_start(ap); _strbuf._flag = _IOWRT+_IOSTRG; _strbuf._ptr = str; _strbuf._cnt = 32767; diff --git a/lib/libstdc/stdio/strout.c b/lib/libstdc/stdio/strout.c index 520cb33..a1086e7 100644 --- a/lib/libstdc/stdio/strout.c +++ b/lib/libstdc/stdio/strout.c @@ -1,12 +1,16 @@ #include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)strout.c 5.2 (Berkeley) 3/9/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int _strout(count, string, adjust, file, fillch) register count; register char *string; int adjust; register FILE *file; int fillch; { +_strout(count, string, adjust, file, fillch) +register char *string; +register count; +int adjust; +register FILE *file; +{ while (adjust < 0) { if (*string=='-' && fillch=='0') { putc(*string++, file); diff --git a/lib/libstdc/stdio/ungetc.c b/lib/libstdc/stdio/ungetc.c index c041c3d..286734c 100644 --- a/lib/libstdc/stdio/ungetc.c +++ b/lib/libstdc/stdio/ungetc.c @@ -1,12 +1,12 @@ -#include - #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)ungetc.c 5.3 (Berkeley) 3/26/86"; -#endif +#endif LIBC_SCCS and not lint -/*#include */ +#include -int ungetc(c, iop) int c; register FILE *iop; { +ungetc(c, iop) + register FILE *iop; +{ if (c == EOF || (iop->_flag & (_IOREAD|_IORW)) == 0 || iop->_ptr == NULL || iop->_base == NULL) return (EOF); diff --git a/lib/libstdc/stdio/vfprintf.c b/lib/libstdc/stdio/vfprintf.c index 13d6bf2..94f0fb5 100644 --- a/lib/libstdc/stdio/vfprintf.c +++ b/lib/libstdc/stdio/vfprintf.c @@ -1,12 +1,3 @@ -#include -#ifdef __STDC__ -#include -#define _va_start(ap, arg) va_start(ap, arg) -#else -#include -#define _va_start(ap, arg) va_start(ap) -#endif - /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -26,12 +17,17 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88"; -#endif +#endif /* LIBC_SCCS and not lint */ -/*#include */ -/*#include */ +#include +#include -int vfprintf(iop, fmt, ap) FILE *iop; char *fmt; va_list ap; { +int +vfprintf(iop, fmt, ap) + FILE *iop; + char *fmt; + va_list ap; +{ int len; char localbuf[BUFSIZ]; diff --git a/lib/libstdc/stdio/vprintf.c b/lib/libstdc/stdio/vprintf.c index 224499f..ff99f39 100644 --- a/lib/libstdc/stdio/vprintf.c +++ b/lib/libstdc/stdio/vprintf.c @@ -1,12 +1,3 @@ -#include -#ifdef __STDC__ -#include -#define _va_start(ap, arg) va_start(ap, arg) -#else -#include -#define _va_start(ap, arg) va_start(ap) -#endif - /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -26,12 +17,16 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vprintf.c 5.2 (Berkeley) 6/27/88"; -#endif +#endif /* LIBC_SCCS and not lint */ -/*#include */ -/*#include */ +#include +#include -int vprintf(fmt, ap) char *fmt; va_list ap; { +int +vprintf(fmt, ap) + char *fmt; + va_list ap; +{ int len; len = _doprnt(fmt, ap, stdout); diff --git a/lib/libstdc/stdio/vsprintf.c b/lib/libstdc/stdio/vsprintf.c index 68c30c6..7f43f90 100644 --- a/lib/libstdc/stdio/vsprintf.c +++ b/lib/libstdc/stdio/vsprintf.c @@ -1,12 +1,3 @@ -#include -#ifdef __STDC__ -#include -#define _va_start(ap, arg) va_start(ap, arg) -#else -#include -#define _va_start(ap, arg) va_start(ap) -#endif - /* * Copyright (c) 1988 Regents of the University of California. * All rights reserved. @@ -26,12 +17,16 @@ #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)vsprintf.c 5.2 (Berkeley) 6/27/88"; -#endif +#endif /* LIBC_SCCS and not lint */ -/*#include */ -/*#include */ +#include +#include -int vsprintf(str, fmt, ap) char *str; char *fmt; va_list ap; { +int +vsprintf(str, fmt, ap) + char *str, *fmt; + va_list ap; +{ FILE f; int len; diff --git a/lib/libstdc/string.h b/lib/libstdc/string.h index 50be195..b9e5c45 100644 --- a/lib/libstdc/string.h +++ b/lib/libstdc/string.h @@ -1,7 +1,3 @@ -#ifndef _STRING_H_ -#define _STRING_H_ - - /* * Copyright (c) 1985 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,61 +6,24 @@ * @(#)string.h 5.1 (Berkeley) 85/08/05 */ -/*#include */ +#include /* * these next few are obsolete trash */ -/*extern char *strcpyn();*/ -/*extern char *strcatn();*/ -/*extern int strcmpn();*/ +extern char *strcpyn(); +extern char *strcatn(); +extern int strcmpn(); /* * and the rest are Sys5 functions supported just so * Sys5 progs will compile easily. */ -/*extern char *strchr();*/ -/*extern char *strrchr();*/ -/*extern char *strpbrk();*/ -/*extern int strspn();*/ -/*extern int strcspn();*/ -/*extern char *strtok();*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* compat-sys5/strcatn.c */ -char *strcatn __P((register char *s1, register char *s2, register n)); - -/* compat-sys5/strchr.c */ -char *strchr __P((register char *sp, int c)); - -/* compat-sys5/strcmpn.c */ -int strcmpn __P((register char *s1, register char *s2, register n)); - -/* compat-sys5/strcpyn.c */ -char *strcpyn __P((register char *s1, register char *s2, int n)); - -/* compat-sys5/strcspn.c */ -int strcspn __P((register char *s, register char *set)); - -/* compat-sys5/strpbrk.c */ -char *strpbrk __P((register char *s, register char *brk)); - -/* compat-sys5/strrchr.c */ -char *strrchr __P((register char *sp, int c)); - -/* compat-sys5/strspn.c */ -int strspn __P((register char *s, register char *set)); - -/* compat-sys5/strtok.c */ -char *strtok __P((register char *s, register char *sep)); - -#endif +extern char *strchr(); +extern char *strrchr(); +extern char *strpbrk(); +extern int strspn(); +extern int strcspn(); +extern char *strtok(); diff --git a/lib/libstdc/strings.h b/lib/libstdc/strings.h index b75576e..2b69a31 100644 --- a/lib/libstdc/strings.h +++ b/lib/libstdc/strings.h @@ -1,7 +1,3 @@ -#ifndef _STRINGS_H_ -#define _STRINGS_H_ - - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,49 +10,12 @@ * External function definitions * for routines described in string(3). */ -/*char *strcat();*/ -/*char *strncat();*/ -/*int strcmp();*/ -/*int strncmp();*/ -/*char *strcpy();*/ -/*char *strncpy();*/ -/*int strlen();*/ -/*char *index();*/ -/*char *rindex();*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* gen/index.c */ -char *index __P((register char *sp, int c)); - -/* gen/rindex.c */ -char *rindex __P((register char *sp, int c)); - -/* gen/strcat.c */ -char *strcat __P((register char *s1, register char *s2)); - -/* gen/strcmp.c */ -int strcmp __P((register char *s1, register char *s2)); - -/* gen/strcpy.c */ -char *strcpy __P((register char *s1, register char *s2)); - -/* gen/strlen.c */ -int strlen __P((register char *s)); - -/* gen/strncat.c */ -char *strncat __P((register char *s1, register char *s2, register n)); - -/* gen/strncmp.c */ -int strncmp __P((register char *s1, register char *s2, register n)); - -/* gen/strncpy.c */ -char *strncpy __P((register char *s1, register char *s2, int n)); - -#endif +char *strcat(); +char *strncat(); +int strcmp(); +int strncmp(); +char *strcpy(); +char *strncpy(); +int strlen(); +char *index(); +char *rindex(); diff --git a/lib/libstdc/struct.h b/lib/libstdc/struct.h index 9e3754f..2486388 100644 --- a/lib/libstdc/struct.h +++ b/lib/libstdc/struct.h @@ -1,7 +1,3 @@ -#ifndef _STRUCT_H_ -#define _STRUCT_H_ - - /* struct.h 4.1 83/05/03 */ /* @@ -11,5 +7,3 @@ #define fldoff(str, fld) ((int)&(((struct str *)0)->fld)) #define fldsiz(str, fld) (sizeof(((struct str *)0)->fld)) #define strbase(str, ptr, fld) ((struct str *)((char *)(ptr)-fldoff(str, fld))) - -#endif diff --git a/lib/libstdc/sys.h b/lib/libstdc/sys.h deleted file mode 100644 index 2d3fce1..0000000 --- a/lib/libstdc/sys.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef _SYS_H_ -#define _SYS_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* sys/gethostid.c */ -long gethostid __P((void)); - -/* sys/gethostname.c */ -int gethostname __P((char *n, int l)); - -/* sys/getpagesize.c */ -int getpagesize __P((void)); - -/* sys/profil.c */ -void profil __P((char *b, int s, int o, int i)); - -/* sys/reboot.c */ -void reboot __P((int h)); - -/* sys/sethostid.c */ -int sethostid __P((long h)); - -/* sys/sethostname.c */ -int sethostname __P((char *n, int l)); - -/* sys/shutdown.c */ -int shutdown __P((int s, int h)); - -/* sys/swapon.c */ -int swapon __P((char *s)); - -/* sys/vhangup.c */ -void vhangup __P((void)); - -#endif diff --git a/lib/libstdc/sys/_exit.c b/lib/libstdc/sys/_exit.c index f3b57df..026d457 100644 --- a/lib/libstdc/sys/_exit.c +++ b/lib/libstdc/sys/_exit.c @@ -1,6 +1,3 @@ -#include -#include - -void _exit(s) int s; { +void _exit(s) { abort(); } diff --git a/lib/libstdc/sys/accept.c b/lib/libstdc/sys/accept.c index 4fad803..ab65645 100644 --- a/lib/libstdc/sys/accept.c +++ b/lib/libstdc/sys/accept.c @@ -1,6 +1,4 @@ -#include #include - -int accept(s, a, l) int s; struct sockaddr *a; int *l; { +int accept(s, a, l) struct sockaddr *a; int *l; { abort(); } diff --git a/lib/libstdc/sys/access.c b/lib/libstdc/sys/access.c index f5bfafa..8fca604 100644 --- a/lib/libstdc/sys/access.c +++ b/lib/libstdc/sys/access.c @@ -1,6 +1,3 @@ -#include -#include - -int access(p, m) char *p; int m; { +int access(p, m) char *p; { abort(); } diff --git a/lib/libstdc/sys/acct.c b/lib/libstdc/sys/acct.c index 3a1ecc3..7b4823a 100644 --- a/lib/libstdc/sys/acct.c +++ b/lib/libstdc/sys/acct.c @@ -1,6 +1,3 @@ -#include -#include - int acct(f) char *f; { abort(); } diff --git a/lib/libstdc/sys/acct.h b/lib/libstdc/sys/acct.h index 535484b..e4dffee 100644 --- a/lib/libstdc/sys/acct.h +++ b/lib/libstdc/sys/acct.h @@ -1,8 +1,3 @@ -#ifndef _SYS_ACCT_H_ -#define _SYS_ACCT_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -19,7 +14,8 @@ */ typedef u_short comp_t; -struct acct { +struct acct +{ char ac_comm[10]; /* Accounting command name */ comp_t ac_utime; /* Accounting user time */ comp_t ac_stime; /* Accounting system time */ @@ -49,18 +45,3 @@ struct acct { struct acct acctbuf; struct inode *acctp; #endif - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* sys/acct.c */ -int acct __P((char *f)); -#endif - -#endif diff --git a/lib/libstdc/sys/adjtime.c b/lib/libstdc/sys/adjtime.c index 66b26f4..9098979 100644 --- a/lib/libstdc/sys/adjtime.c +++ b/lib/libstdc/sys/adjtime.c @@ -1,6 +1,4 @@ -#include #include - -int adjtime(delta, odelta) struct timeval *delta; struct timeval *odelta; { +int adjtime(delta, odelta) struct timeval *delta, *odelta; { abort(); } diff --git a/lib/libstdc/sys/bind.c b/lib/libstdc/sys/bind.c index 7af924c..ac662db 100644 --- a/lib/libstdc/sys/bind.c +++ b/lib/libstdc/sys/bind.c @@ -1,6 +1,4 @@ -#include #include - -int bind(s, n, l) int s; struct sockaddr *n; int l; { +int bind(s, n, l) struct sockaddr *n; { abort(); } diff --git a/lib/libstdc/sys/bkmac.h b/lib/libstdc/sys/bkmac.h index afed6b5..6bd020d 100644 --- a/lib/libstdc/sys/bkmac.h +++ b/lib/libstdc/sys/bkmac.h @@ -1,9 +1,3 @@ -#ifndef _SYS_BKMAC_H_ -#define _SYS_BKMAC_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -32,5 +26,3 @@ } \ } \ } - -#endif diff --git a/lib/libstdc/sys/brk.c b/lib/libstdc/sys/brk.c index e40e738..202296c 100644 --- a/lib/libstdc/sys/brk.c +++ b/lib/libstdc/sys/brk.c @@ -1,6 +1,3 @@ -#include -#include - char *brk(a) char *a; { abort(); } diff --git a/lib/libstdc/sys/buf.h b/lib/libstdc/sys/buf.h index c053dd7..1064b22 100644 --- a/lib/libstdc/sys/buf.h +++ b/lib/libstdc/sys/buf.h @@ -1,9 +1,3 @@ -#ifndef _SYS_BUF_H_ -#define _SYS_BUF_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -38,11 +32,13 @@ * We only need three words for these, so this abbreviated * definition saves some space. */ -struct bufhd { +struct bufhd +{ long b_flags; /* see defines below */ struct buf *b_forw, *b_back; /* fwd/bkwd pointer in chain */ }; -struct buf { +struct buf +{ long b_flags; /* too much goes here to describe */ struct buf *b_forw, *b_back; /* hash chain (2 way street) */ struct buf *av_forw, *av_back; /* position on free list if not BUSY */ @@ -99,16 +95,16 @@ struct buf bfreelist[BQUEUES]; /* heads of available lists */ struct buf bswlist; /* head of free swap header list */ struct buf *bclnlist; /* head of cleaned page list */ -/*struct buf *alloc();*/ -/*struct buf *realloccg();*/ -/*struct buf *baddr();*/ -/*struct buf *getblk();*/ -/*struct buf *geteblk();*/ -/*struct buf *getnewbuf();*/ -/*struct buf *bread();*/ -/*struct buf *breada();*/ +struct buf *alloc(); +struct buf *realloccg(); +struct buf *baddr(); +struct buf *getblk(); +struct buf *geteblk(); +struct buf *getnewbuf(); +struct buf *bread(); +struct buf *breada(); -/*unsigned minphys();*/ +unsigned minphys(); #endif /* @@ -192,5 +188,3 @@ struct buf *bclnlist; /* head of cleaned page list */ blkclr((bp)->b_un.b_addr, (unsigned)(bp)->b_bcount); \ (bp)->b_resid = 0; \ } - -#endif diff --git a/lib/libstdc/sys/callout.h b/lib/libstdc/sys/callout.h index 378e70d..1f3831e 100644 --- a/lib/libstdc/sys/callout.h +++ b/lib/libstdc/sys/callout.h @@ -1,8 +1,3 @@ -#ifndef _SYS_CALLOUT_H_ -#define _SYS_CALLOUT_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -31,5 +26,3 @@ struct callout { struct callout *callfree, *callout, calltodo; int ncallout; #endif - -#endif diff --git a/lib/libstdc/sys/chdir.c b/lib/libstdc/sys/chdir.c index 727cb39..28482cc 100644 --- a/lib/libstdc/sys/chdir.c +++ b/lib/libstdc/sys/chdir.c @@ -1,6 +1,3 @@ -#include -#include - int chdir(s) char *s; { abort(); } diff --git a/lib/libstdc/sys/chmod.c b/lib/libstdc/sys/chmod.c index 6c87af8..2b70bbe 100644 --- a/lib/libstdc/sys/chmod.c +++ b/lib/libstdc/sys/chmod.c @@ -1,6 +1,3 @@ -#include -#include - -int chmod(s, m) char *s; int m; { +int chmod(s, m) char *s; { abort(); } diff --git a/lib/libstdc/sys/chown.c b/lib/libstdc/sys/chown.c index e2ad367..6e005e5 100644 --- a/lib/libstdc/sys/chown.c +++ b/lib/libstdc/sys/chown.c @@ -1,6 +1,3 @@ -#include -#include - -int chown(s, u, g) char *s; int u; int g; { +int chown(s, u, g) char *s; { abort(); } diff --git a/lib/libstdc/sys/chroot.c b/lib/libstdc/sys/chroot.c index e6ea5e9..f8fc744 100644 --- a/lib/libstdc/sys/chroot.c +++ b/lib/libstdc/sys/chroot.c @@ -1,6 +1,3 @@ -#include -#include - int chroot(d) char *d; { abort(); } diff --git a/lib/libstdc/sys/clist.h b/lib/libstdc/sys/clist.h index b2ada32..d33094c 100644 --- a/lib/libstdc/sys/clist.h +++ b/lib/libstdc/sys/clist.h @@ -1,8 +1,3 @@ -#ifndef _SYS_CLIST_H_ -#define _SYS_CLIST_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -24,5 +19,3 @@ int nclist; struct cblock *cfreelist; int cfreecount; #endif - -#endif diff --git a/lib/libstdc/sys/close.c b/lib/libstdc/sys/close.c index 76c0c76..1d14931 100644 --- a/lib/libstdc/sys/close.c +++ b/lib/libstdc/sys/close.c @@ -1,6 +1,3 @@ -#include -#include - -int close(f) int f; { +int close(f) { abort(); } diff --git a/lib/libstdc/sys/cmap.h b/lib/libstdc/sys/cmap.h index 5cf8ec2..18fa690 100644 --- a/lib/libstdc/sys/cmap.h +++ b/lib/libstdc/sys/cmap.h @@ -1,9 +1,3 @@ -#ifndef _SYS_CMAP_H_ -#define _SYS_CMAP_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -29,8 +23,9 @@ * and increasing MAXMEM below. Also, the type of cmhash * (below) must be changed to long. */ -/*#ifndef LOCORE*/ -struct cmap { +#ifndef LOCORE +struct cmap +{ unsigned short c_next, /* index of next free list entry */ c_prev, /* index of previous free list entry */ c_hlink; /* hash link for */ @@ -46,7 +41,7 @@ unsigned int c_page:21, /* virtual page number in segment */ c_blkno:24, /* disk block this is a copy of */ c_mdev:8; /* which mounted dev this is from */ }; -#else +#else LOCORE /* * bit offsets of elements in cmap */ @@ -55,7 +50,7 @@ unsigned int c_page:21, /* virtual page number in segment */ #define SZ_CMAP 16 /* sizeof(struct cmap) */ #define MAXMEM 64*1024 /* maximum memory, in Kbytes */ -#endif +#endif LOCORE #define CMHEAD 0 @@ -73,7 +68,7 @@ unsigned int c_page:21, /* virtual page number in segment */ struct cmap *cmap; struct cmap *ecmap; int ncmap; -/*struct cmap *mfind();*/ +struct cmap *mfind(); int firstfree, maxfree; int ecmx; /* cmap index of ecmap */ u_short cmhash[CMHSIZ]; @@ -88,6 +83,4 @@ u_short cmhash[CMHSIZ]; #define pgtocm(x) (((int) ((x)-firstfree) / CLSIZE) + 1) #define cmtopg(x) ((((x)-1) * CLSIZE) + firstfree) -/*#endif*/ - -#endif +#endif LOCORE diff --git a/lib/libstdc/sys/conf.h b/lib/libstdc/sys/conf.h index 7e7da19..d97b00d 100644 --- a/lib/libstdc/sys/conf.h +++ b/lib/libstdc/sys/conf.h @@ -1,8 +1,3 @@ -#ifndef _SYS_CONF_H_ -#define _SYS_CONF_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -20,7 +15,8 @@ * device switches is in the * file conf.c. */ -struct bdevsw { +struct bdevsw +{ int (*d_open)(); int (*d_close)(); int (*d_strategy)(); @@ -35,7 +31,8 @@ struct bdevsw bdevsw[]; /* * Character device switch. */ -struct cdevsw { +struct cdevsw +{ int (*d_open)(); int (*d_close)(); int (*d_read)(); @@ -54,7 +51,8 @@ struct cdevsw cdevsw[]; /* * tty line control switch. */ -struct linesw { +struct linesw +{ int (*l_open)(); int (*l_close)(); int (*l_read)(); @@ -73,7 +71,8 @@ struct linesw linesw[]; /* * Swap device information */ -struct swdevt { +struct swdevt +{ dev_t sw_dev; int sw_freed; int sw_nblks; @@ -81,5 +80,3 @@ struct swdevt { #ifdef KERNEL struct swdevt swdevt[]; #endif - -#endif diff --git a/lib/libstdc/sys/connect.c b/lib/libstdc/sys/connect.c index 9160599..57a4a35 100644 --- a/lib/libstdc/sys/connect.c +++ b/lib/libstdc/sys/connect.c @@ -1,6 +1,4 @@ -#include #include - -int connect(s, n, l) int s; struct sockaddr *n; int l; { +int connect(s, n, l) struct sockaddr *n; { abort(); } diff --git a/lib/libstdc/sys/creat.c b/lib/libstdc/sys/creat.c index cc3066b..ac19a9d 100644 --- a/lib/libstdc/sys/creat.c +++ b/lib/libstdc/sys/creat.c @@ -1,6 +1,3 @@ -#include -#include - -int creat(s, m) char *s; int m; { +int creat(s, m) char *s; { abort(); } diff --git a/lib/libstdc/sys/dir.h b/lib/libstdc/sys/dir.h index 29be31e..913a549 100644 --- a/lib/libstdc/sys/dir.h +++ b/lib/libstdc/sys/dir.h @@ -1,9 +1,3 @@ -#ifndef _SYS_DIR_H_ -#define _SYS_DIR_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -74,12 +68,12 @@ typedef struct _dirdesc { #ifndef NULL #define NULL 0 #endif -/*extern DIR *opendir();*/ -/*extern struct direct *readdir();*/ -/*extern long telldir();*/ -/*extern void seekdir();*/ +extern DIR *opendir(); +extern struct direct *readdir(); +extern long telldir(); +extern void seekdir(); #define rewinddir(dirp) seekdir((dirp), (long)0) -/*extern void closedir();*/ +extern void closedir(); #endif #ifdef KERNEL @@ -99,43 +93,3 @@ struct dirtemplate { char dotdot_name[4]; /* ditto */ }; #endif - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* gen/closedir.c */ -void closedir __P((register DIR *dirp)); - -/* gen/getwd.c */ -char *getwd __P((char *pathname)); - -/* gen/opendir.c */ -DIR *opendir __P((char *name)); - -/* gen/readdir.c */ -struct direct *readdir __P((register DIR *dirp)); - -/* gen/scandir.c */ -int scandir __P((char *dirname, struct direct *(*namelist[]), int (*select)(void), int (*dcomp)(void))); -int alphasort __P((struct direct **d1, struct direct **d2)); - -/* gen/seekdir.c */ -void seekdir __P((register DIR *dirp, long loc)); - -/* gen/telldir.c */ -long telldir __P((DIR *dirp)); - -/* sys/mkdir.c */ -int mkdir __P((char *p, int m)); - -/* sys/rmdir.c */ -int rmdir __P((char *p)); -#endif - -#endif diff --git a/lib/libstdc/sys/dk.h b/lib/libstdc/sys/dk.h index 82fa1f2..0ba837a 100644 --- a/lib/libstdc/sys/dk.h +++ b/lib/libstdc/sys/dk.h @@ -1,7 +1,3 @@ -#ifndef _SYS_DK_H_ -#define _SYS_DK_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -35,5 +31,3 @@ float dk_mspw[DK_NDRIVE]; long tk_nin; long tk_nout; #endif - -#endif diff --git a/lib/libstdc/sys/dkbad.h b/lib/libstdc/sys/dkbad.h index 8e9bc0c..4c72788 100644 --- a/lib/libstdc/sys/dkbad.h +++ b/lib/libstdc/sys/dkbad.h @@ -1,8 +1,3 @@ -#ifndef _SYS_DKBAD_H_ -#define _SYS_DKBAD_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -50,5 +45,3 @@ struct dkbad { #define SSE 1 #define BSE 2 #define CONT 3 - -#endif diff --git a/lib/libstdc/sys/dmap.h b/lib/libstdc/sys/dmap.h index 5916ae3..57052d5 100644 --- a/lib/libstdc/sys/dmap.h +++ b/lib/libstdc/sys/dmap.h @@ -1,8 +1,3 @@ -#ifndef _SYS_DMAP_H_ -#define _SYS_DMAP_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -18,7 +13,8 @@ #define NDMAP 38 /* size of the swap area map */ -struct dmap { +struct dmap +{ swblk_t dm_size; /* current size used by process */ swblk_t dm_alloc; /* amount of physical swap space allocated */ swblk_t dm_map[NDMAP]; /* first disk block number in each chunk */ @@ -32,9 +28,8 @@ int dmmin, dmmax, dmtext; * The following structure is that ``returned'' * from a call to vstodb(). */ -struct dblock { +struct dblock +{ swblk_t db_base; /* base of physical contig drum block */ swblk_t db_size; /* size of block */ }; - -#endif diff --git a/lib/libstdc/sys/domain.h b/lib/libstdc/sys/domain.h index bd8a9a7..3c75cc3 100644 --- a/lib/libstdc/sys/domain.h +++ b/lib/libstdc/sys/domain.h @@ -1,7 +1,3 @@ -#ifndef _SYS_DOMAIN_H_ -#define _SYS_DOMAIN_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -26,5 +22,3 @@ struct domain { #ifdef KERNEL struct domain *domains; #endif - -#endif diff --git a/lib/libstdc/sys/dup.c b/lib/libstdc/sys/dup.c index dd4d321..92de68f 100644 --- a/lib/libstdc/sys/dup.c +++ b/lib/libstdc/sys/dup.c @@ -1,6 +1,3 @@ -#include -#include - -int dup(f) int f; { +int dup(f) { abort(); } diff --git a/lib/libstdc/sys/dup2.c b/lib/libstdc/sys/dup2.c index c7ec418..0ffca47 100644 --- a/lib/libstdc/sys/dup2.c +++ b/lib/libstdc/sys/dup2.c @@ -1,6 +1,3 @@ -#include -#include - -int dup2(o, n) int o; int n; { +int dup2(o, n) { abort(); } diff --git a/lib/libstdc/sys/errno.h b/lib/libstdc/sys/errno.h index 3ecdaff..cf0fd68 100644 --- a/lib/libstdc/sys/errno.h +++ b/lib/libstdc/sys/errno.h @@ -1,7 +1,3 @@ -#ifndef _SYS_ERRNO_H_ -#define _SYS_ERRNO_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -100,18 +96,3 @@ #define EPROCLIM 67 /* Too many processes */ #define EUSERS 68 /* Too many users */ #define EDQUOT 69 /* Disc quota exceeded */ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* gen/perror.c */ -int perror __P((char *s)); -#endif - -#endif diff --git a/lib/libstdc/sys/exec.h b/lib/libstdc/sys/exec.h index 8729f4b..97ccf68 100644 --- a/lib/libstdc/sys/exec.h +++ b/lib/libstdc/sys/exec.h @@ -1,7 +1,3 @@ -#ifndef _SYS_EXEC_H_ -#define _SYS_EXEC_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -27,37 +23,3 @@ unsigned long a_drsize; /* size of data relocation */ #define OMAGIC 0407 /* old impure format */ #define NMAGIC 0410 /* read-only text */ #define ZMAGIC 0413 /* demand load format */ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* gen/execvp.c */ -int execlp __P((char *name, char *argv)); -int execvp __P((char *name, char **argv)); - -/* gen/system.c */ -int system __P((char *s)); - -/* sys/execl.c */ -void execl __P((char *f, char *a)); - -/* sys/execle.c */ -void execle __P((char *f, char *a)); - -/* sys/exect.c */ -void exect __P((char *s, char *v[], char *e[])); - -/* sys/execv.c */ -void execv __P((char *s, char *v[])); - -/* sys/execve.c */ -void execve __P((char *s, char *v[], char *e[])); -#endif - -#endif diff --git a/lib/libstdc/sys/execl.c b/lib/libstdc/sys/execl.c index 702d82c..56895f9 100644 --- a/lib/libstdc/sys/execl.c +++ b/lib/libstdc/sys/execl.c @@ -1,6 +1,3 @@ -#include -#include - -void execl(f, a) char *f; char *a; { +void execl(f, a) char *f, *a; { abort(); } diff --git a/lib/libstdc/sys/execle.c b/lib/libstdc/sys/execle.c index e4aec0c..0a46fb2 100644 --- a/lib/libstdc/sys/execle.c +++ b/lib/libstdc/sys/execle.c @@ -1,6 +1,3 @@ -#include -#include - -void execle(f, a) char *f; char *a; { +void execle(f, a) char *f, *a; { abort(); } diff --git a/lib/libstdc/sys/exect.c b/lib/libstdc/sys/exect.c index 4c56ee2..d37b357 100644 --- a/lib/libstdc/sys/exect.c +++ b/lib/libstdc/sys/exect.c @@ -1,6 +1,3 @@ -#include -#include - -void exect(s, v, e) char *s; char *v[]; char *e[]; { +void exect(s, v, e) char *s, *v[], *e[]; { abort(); } diff --git a/lib/libstdc/sys/execv.c b/lib/libstdc/sys/execv.c index 7f20aff..f93b0f1 100644 --- a/lib/libstdc/sys/execv.c +++ b/lib/libstdc/sys/execv.c @@ -1,6 +1,3 @@ -#include -#include - -void execv(s, v) char *s; char *v[]; { +void execv(s, v) char *s, *v[]; { abort(); } diff --git a/lib/libstdc/sys/execve.c b/lib/libstdc/sys/execve.c index 5e5c873..3b17210 100644 --- a/lib/libstdc/sys/execve.c +++ b/lib/libstdc/sys/execve.c @@ -1,6 +1,3 @@ -#include -#include - -void execve(s, v, e) char *s; char *v[]; char *e[]; { +void execve(s, v, e) char *s, *v[], *e[]; { abort(); } diff --git a/lib/libstdc/sys/fchmod.c b/lib/libstdc/sys/fchmod.c index 95b8a7a..0c725ba 100644 --- a/lib/libstdc/sys/fchmod.c +++ b/lib/libstdc/sys/fchmod.c @@ -1,6 +1,3 @@ -#include -#include - -int fchmod(f, m) int f; int m; { +int fchmod(f, m) { abort(); } diff --git a/lib/libstdc/sys/fchown.c b/lib/libstdc/sys/fchown.c index 5a58887..836e042 100644 --- a/lib/libstdc/sys/fchown.c +++ b/lib/libstdc/sys/fchown.c @@ -1,6 +1,3 @@ -#include -#include - -int fchown(f, u, g) int f; int u; int g; { +int fchown(f, u, g) { abort(); } diff --git a/lib/libstdc/sys/fcntl.c b/lib/libstdc/sys/fcntl.c index dc041e8..0be0092 100644 --- a/lib/libstdc/sys/fcntl.c +++ b/lib/libstdc/sys/fcntl.c @@ -1,6 +1,3 @@ -#include -#include - -int fcntl(f, c, a) int f; int c; int a; { +int fcntl(f, c, a) { abort(); } diff --git a/lib/libstdc/sys/file.h b/lib/libstdc/sys/file.h index a0c8aaf..26a8d89 100644 --- a/lib/libstdc/sys/file.h +++ b/lib/libstdc/sys/file.h @@ -1,10 +1,3 @@ -#ifndef _SYS_FILE_H_ -#define _SYS_FILE_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -35,8 +28,8 @@ struct file { struct file *file, *fileNFILE; int nfile; -/*struct file *getf();*/ -/*struct file *falloc();*/ +struct file *getf(); +struct file *falloc(); #endif /* @@ -126,99 +119,3 @@ int nfile; #define DTYPE_INODE 1 /* file */ #define DTYPE_SOCKET 2 /* communications endpoint */ #endif - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* sys/access.c */ -int access __P((char *p, int m)); - -/* sys/chmod.c */ -int chmod __P((char *s, int m)); - -/* sys/chown.c */ -int chown __P((char *s, int u, int g)); - -/* sys/close.c */ -int close __P((int f)); - -/* sys/creat.c */ -int creat __P((char *s, int m)); - -/* sys/dup2.c */ -int dup2 __P((int o, int n)); - -/* sys/dup.c */ -int dup __P((int f)); - -/* sys/fchmod.c */ -int fchmod __P((int f, int m)); - -/* sys/fchown.c */ -int fchown __P((int f, int u, int g)); - -/* sys/fcntl.c */ -int fcntl __P((int f, int c, int a)); - -/* sys/flock.c */ -int flock __P((int f, int o)); - -/* sys/fsync.c */ -int fsync __P((int f)); - -/* sys/ftruncate.c */ -int ftruncate __P((int d, off_t l)); - -/* sys/getdtablesize.c */ -int getdtablesize __P((void)); - -/* sys/link.c */ -int link __P((char *a, char *b)); - -/* sys/lseek.c */ -off_t lseek __P((int f, off_t o, int d)); - -/* sys/mknod.c */ -int mknod __P((char *n, int m, int a)); - -/* sys/open.c */ -int open __P((char *f, int m, int stuff)); - -/* sys/pipe.c */ -int pipe __P((int f[2])); - -/* sys/read.c */ -int read __P((int f, char *b, int l)); - -/* sys/readlink.c */ -int readlink __P((char *p, char *b, int s)); - -/* sys/rename.c */ -int rename __P((char *f, char *t)); - -/* sys/symlink.c */ -int symlink __P((char *t, char *f)); - -/* sys/sync.c */ -void sync __P((void)); - -/* sys/truncate.c */ -int truncate __P((char *p, off_t l)); - -/* sys/umask.c */ -int umask __P((int n)); - -/* sys/unlink.c */ -int unlink __P((char *s)); - -/* sys/write.c */ -int write __P((int f, char *b, int l)); -#endif - -#endif diff --git a/lib/libstdc/sys/flock.c b/lib/libstdc/sys/flock.c index a522d04..c0593fe 100644 --- a/lib/libstdc/sys/flock.c +++ b/lib/libstdc/sys/flock.c @@ -1,6 +1,3 @@ -#include -#include - -int flock(f, o) int f; int o; { +int flock(f, o) { abort(); } diff --git a/lib/libstdc/sys/fork.c b/lib/libstdc/sys/fork.c index fe715fd..aaa0987 100644 --- a/lib/libstdc/sys/fork.c +++ b/lib/libstdc/sys/fork.c @@ -1,6 +1,3 @@ -#include -#include - int fork() { abort(); } diff --git a/lib/libstdc/sys/fs.h b/lib/libstdc/sys/fs.h index b7347f0..f453adb 100644 --- a/lib/libstdc/sys/fs.h +++ b/lib/libstdc/sys/fs.h @@ -1,10 +1,3 @@ -#ifndef _SYS_FS_H_ -#define _SYS_FS_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -137,7 +130,8 @@ struct csum { * Super block for a file system. */ #define FS_MAGIC 0x011954 -struct fs { +struct fs +{ struct fs *fs_link; /* linked list of file systems */ struct fs *fs_rlink; /* used for incore super blocks */ daddr_t fs_sblkno; /* addr of super-block in filesys */ @@ -379,8 +373,6 @@ struct cg { #define NINDIR(fs) ((fs)->fs_nindir) #ifdef KERNEL -/*struct fs *getfs();*/ -/*struct fs *mountfs();*/ -#endif - +struct fs *getfs(); +struct fs *mountfs(); #endif diff --git a/lib/libstdc/sys/fstat.c b/lib/libstdc/sys/fstat.c index 0ce2621..59d563e 100644 --- a/lib/libstdc/sys/fstat.c +++ b/lib/libstdc/sys/fstat.c @@ -1,6 +1,3 @@ -#include -#include - -int fstat(f, b) int f; struct stat *b; { +int fstat(f, b) struct stat *b; { abort(); } diff --git a/lib/libstdc/sys/fsync.c b/lib/libstdc/sys/fsync.c index e51763e..80c1ebd 100644 --- a/lib/libstdc/sys/fsync.c +++ b/lib/libstdc/sys/fsync.c @@ -1,6 +1,3 @@ -#include -#include - -int fsync(f) int f; { +int fsync(f) { abort(); } diff --git a/lib/libstdc/sys/ftruncate.c b/lib/libstdc/sys/ftruncate.c index 488cdcd..2d9da12 100644 --- a/lib/libstdc/sys/ftruncate.c +++ b/lib/libstdc/sys/ftruncate.c @@ -1,7 +1,4 @@ -#include -#include #include - -int ftruncate(d, l) int d; off_t l; { +int ftruncate(d, l) off_t l; { abort(); } diff --git a/lib/libstdc/sys/getdtablesize.c b/lib/libstdc/sys/getdtablesize.c index 14762ff..0b58c5a 100644 --- a/lib/libstdc/sys/getdtablesize.c +++ b/lib/libstdc/sys/getdtablesize.c @@ -1,6 +1,3 @@ -#include -#include - int getdtablesize() { abort(); } diff --git a/lib/libstdc/sys/getegid.c b/lib/libstdc/sys/getegid.c index a087126..50cb56c 100644 --- a/lib/libstdc/sys/getegid.c +++ b/lib/libstdc/sys/getegid.c @@ -1,7 +1,4 @@ -#include -#include #include - gid_t getegid() { abort(); } diff --git a/lib/libstdc/sys/geteuid.c b/lib/libstdc/sys/geteuid.c index 688303a..cf06b7c 100644 --- a/lib/libstdc/sys/geteuid.c +++ b/lib/libstdc/sys/geteuid.c @@ -1,7 +1,4 @@ -#include -#include #include - uid_t geteuid() { abort(); } diff --git a/lib/libstdc/sys/getgid.c b/lib/libstdc/sys/getgid.c index fcad32d..ad28f31 100644 --- a/lib/libstdc/sys/getgid.c +++ b/lib/libstdc/sys/getgid.c @@ -1,7 +1,4 @@ -#include -#include #include - gid_t getgid() { abort(); } diff --git a/lib/libstdc/sys/getgroups.c b/lib/libstdc/sys/getgroups.c index 66997ea..8dcbde7 100644 --- a/lib/libstdc/sys/getgroups.c +++ b/lib/libstdc/sys/getgroups.c @@ -1,6 +1,3 @@ -#include -#include - -int getgroups(n, g) int n; int *g; { +int getgroups(n, g) int n, *g; { abort(); } diff --git a/lib/libstdc/sys/gethostid.c b/lib/libstdc/sys/gethostid.c index 2111a51..c10a3b9 100644 --- a/lib/libstdc/sys/gethostid.c +++ b/lib/libstdc/sys/gethostid.c @@ -1,6 +1,3 @@ -#include -#include - long gethostid() { abort(); } diff --git a/lib/libstdc/sys/gethostname.c b/lib/libstdc/sys/gethostname.c index 3287d80..453c085 100644 --- a/lib/libstdc/sys/gethostname.c +++ b/lib/libstdc/sys/gethostname.c @@ -1,6 +1,3 @@ -#include -#include - int gethostname(n, l) char *n; int l; { abort(); } diff --git a/lib/libstdc/sys/getitimer.c b/lib/libstdc/sys/getitimer.c index e5cd88b..c6e104c 100644 --- a/lib/libstdc/sys/getitimer.c +++ b/lib/libstdc/sys/getitimer.c @@ -1,6 +1,4 @@ -#include #include - -int getitimer(w, v) int w; struct itimerval *v; { +int getitimer(w, v) struct itimerval *v; { abort(); } diff --git a/lib/libstdc/sys/getpagesize.c b/lib/libstdc/sys/getpagesize.c index cd48754..f6682c8 100644 --- a/lib/libstdc/sys/getpagesize.c +++ b/lib/libstdc/sys/getpagesize.c @@ -1,6 +1,3 @@ -#include -#include - int getpagesize() { abort(); } diff --git a/lib/libstdc/sys/getpeername.c b/lib/libstdc/sys/getpeername.c index b963940..855f1f9 100644 --- a/lib/libstdc/sys/getpeername.c +++ b/lib/libstdc/sys/getpeername.c @@ -1,6 +1,4 @@ -#include #include - -int getpeername(s, n, l) int s; struct sockaddr *n; int *l; { +int getpeername(s, n, l) struct sockaddr *n; int *l; { abort(); } diff --git a/lib/libstdc/sys/getpgrp.c b/lib/libstdc/sys/getpgrp.c index 9a25071..6dbf7eb 100644 --- a/lib/libstdc/sys/getpgrp.c +++ b/lib/libstdc/sys/getpgrp.c @@ -1,6 +1,3 @@ -#include -#include - -int getpgrp(p) int p; { +int getpgrp(p) { abort(); } diff --git a/lib/libstdc/sys/getpid.c b/lib/libstdc/sys/getpid.c index 521d029..fc1c4fa 100644 --- a/lib/libstdc/sys/getpid.c +++ b/lib/libstdc/sys/getpid.c @@ -1,6 +1,3 @@ -#include -#include - int getpid() { abort(); } diff --git a/lib/libstdc/sys/getppid.c b/lib/libstdc/sys/getppid.c index 8b34a8e..d0a1303 100644 --- a/lib/libstdc/sys/getppid.c +++ b/lib/libstdc/sys/getppid.c @@ -1,6 +1,3 @@ -#include -#include - int getppid() { abort(); } diff --git a/lib/libstdc/sys/getpriority.c b/lib/libstdc/sys/getpriority.c index 4ece97c..5f548cb 100644 --- a/lib/libstdc/sys/getpriority.c +++ b/lib/libstdc/sys/getpriority.c @@ -1,6 +1,3 @@ -#include -#include - -int getpriority(w, who) int w; int who; { +int getpriority(w, who) { abort(); } diff --git a/lib/libstdc/sys/getrlimit.c b/lib/libstdc/sys/getrlimit.c index ad1cce4..bd2abaa 100644 --- a/lib/libstdc/sys/getrlimit.c +++ b/lib/libstdc/sys/getrlimit.c @@ -1,6 +1,4 @@ -#include #include - -int getrlimit(res, rip) int res; struct rlimit *rip; { +int getrlimit(res, rip) struct rlimit *rip; { abort(); } diff --git a/lib/libstdc/sys/getrusage.c b/lib/libstdc/sys/getrusage.c index 11b26f9..2bacd99 100644 --- a/lib/libstdc/sys/getrusage.c +++ b/lib/libstdc/sys/getrusage.c @@ -1,6 +1,4 @@ -#include #include - -int getrusage(res, rip) int res; struct rusage *rip; { +int getrusage(res, rip) struct rusage *rip; { abort(); } diff --git a/lib/libstdc/sys/getsockname.c b/lib/libstdc/sys/getsockname.c index 1595fa2..828a5ea 100644 --- a/lib/libstdc/sys/getsockname.c +++ b/lib/libstdc/sys/getsockname.c @@ -1,6 +1,3 @@ -#include -#include - -int getsockname(s, name, namelen) int s; char *name; int *namelen; { +int getsockname(s, name, namelen) char *name; int *namelen; { abort(); } diff --git a/lib/libstdc/sys/getsockopt.c b/lib/libstdc/sys/getsockopt.c index e281a96..23db576 100644 --- a/lib/libstdc/sys/getsockopt.c +++ b/lib/libstdc/sys/getsockopt.c @@ -1,6 +1,3 @@ -#include -#include - -int getsockopt(s, level, opt, buf, len) int s; int level; int opt; char *buf; int *len; { +int getsockopt(s, level, opt, buf, len) char *buf; int *len; { abort(); } diff --git a/lib/libstdc/sys/gettimeofday.c b/lib/libstdc/sys/gettimeofday.c index 6d82e32..c5e4e42 100644 --- a/lib/libstdc/sys/gettimeofday.c +++ b/lib/libstdc/sys/gettimeofday.c @@ -1,6 +1,4 @@ -#include #include - int gettimeofday(t, z) struct timeval *t; struct timezone *z; { abort(); } diff --git a/lib/libstdc/sys/getuid.c b/lib/libstdc/sys/getuid.c index dbdd982..a6fccf8 100644 --- a/lib/libstdc/sys/getuid.c +++ b/lib/libstdc/sys/getuid.c @@ -1,7 +1,4 @@ -#include -#include #include - uid_t getuid() { abort(); } diff --git a/lib/libstdc/sys/gprof.h b/lib/libstdc/sys/gprof.h index 5766934..a332381 100644 --- a/lib/libstdc/sys/gprof.h +++ b/lib/libstdc/sys/gprof.h @@ -1,7 +1,3 @@ -#ifndef _SYS_GPROF_H_ -#define _SYS_GPROF_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -89,5 +85,3 @@ struct rawarc { */ #define ROUNDDOWN(x,y) (((x)/(y))*(y)) #define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y)) - -#endif diff --git a/lib/libstdc/sys/inode.h b/lib/libstdc/sys/inode.h index 9e17987..a6fd37c 100644 --- a/lib/libstdc/sys/inode.h +++ b/lib/libstdc/sys/inode.h @@ -1,10 +1,3 @@ -#ifndef _SYS_INODE_H_ -#define _SYS_INODE_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -44,7 +37,8 @@ struct inode { struct inode **if_freeb; /* free list back */ } i_fr; } i_un; - struct icommon { + struct icommon + { u_short ic_mode; /* 0: mode and type of file */ short ic_nlink; /* 2: number of links to file */ uid_t ic_uid; /* 4: owner's user id */ @@ -127,16 +121,16 @@ long nextinodeid; /* unique id generator */ struct inode *rootdir; /* pointer to inode of root directory */ -/*struct inode *ialloc();*/ -/*struct inode *iget();*/ +struct inode *ialloc(); +struct inode *iget(); #ifdef notdef -/*struct inode *ifind();*/ +struct inode *ifind(); #endif -/*struct inode *owner();*/ -/*struct inode *maknode();*/ -/*struct inode *namei();*/ +struct inode *owner(); +struct inode *maknode(); +struct inode *namei(); -/*ino_t dirpref();*/ +ino_t dirpref(); #endif /* flags */ @@ -202,5 +196,3 @@ struct inode *rootdir; /* pointer to inode of root directory */ (ip)->i_flag &= ~(IACC|IUPD|ICHG); \ } \ } - -#endif diff --git a/lib/libstdc/sys/ioctl.c b/lib/libstdc/sys/ioctl.c index bbf9cd6..1a52843 100644 --- a/lib/libstdc/sys/ioctl.c +++ b/lib/libstdc/sys/ioctl.c @@ -1,7 +1,4 @@ -#include -#include #include - -int ioctl(d, r, p) int d; u_long r; char *p; { +int ioctl(d, r, p) u_long r; char *p; { abort(); } diff --git a/lib/libstdc/sys/ioctl.h b/lib/libstdc/sys/ioctl.h index bb5311c..366a268 100644 --- a/lib/libstdc/sys/ioctl.h +++ b/lib/libstdc/sys/ioctl.h @@ -1,11 +1,3 @@ -#ifndef _SYS_IOCTL_H_ -#define _SYS_IOCTL_H_ - -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -17,14 +9,14 @@ /* * Ioctl definitions */ -/*#ifndef _IOCTL_*/ -/*#define _IOCTL_*/ +#ifndef _IOCTL_ +#define _IOCTL_ #ifdef KERNEL -/*#include "ttychars.h"*/ -/*#include "ttydev.h"*/ +#include "ttychars.h" +#include "ttydev.h" #else -/*#include */ -/*#include */ +#include +#include #endif struct tchars { @@ -277,28 +269,4 @@ struct ttysize { #define SIOCGARP _IOWR(i,31, struct arpreq) /* get arp entry */ #define SIOCDARP _IOW(i, 32, struct arpreq) /* delete arp entry */ -/*#endif*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* compat-4.1/gtty.c */ -int gtty __P((int fd, struct sgttyb *ap)); - -/* compat-4.1/stty.c */ -int stty __P((int fd, struct sgttyb *ap)); - -/* gen/isatty.c */ -int isatty __P((int f)); - -/* sys/ioctl.c */ -int ioctl __P((int d, u_long r, char *p)); -#endif - #endif diff --git a/lib/libstdc/sys/kernel.h b/lib/libstdc/sys/kernel.h index 1834330..c8bab76 100644 --- a/lib/libstdc/sys/kernel.h +++ b/lib/libstdc/sys/kernel.h @@ -1,10 +1,3 @@ -#ifndef _SYS_KERNEL_H_ -#define _SYS_KERNEL_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -17,7 +10,7 @@ * Global variables for the kernel */ -/*long rmalloc();*/ +long rmalloc(); /* 1.1 */ long hostid; @@ -32,7 +25,7 @@ int hz; int phz; /* alternate clock's frequency */ int tick; int lbolt; /* awoken once a second */ -/*int realitexpire();*/ +int realitexpire(); double avenrun[3]; @@ -42,5 +35,3 @@ extern char *s_lowpc; extern u_long s_textsize; extern u_short *kcount; #endif - -#endif diff --git a/lib/libstdc/sys/kill.c b/lib/libstdc/sys/kill.c index dfaffad..0c87e6e 100644 --- a/lib/libstdc/sys/kill.c +++ b/lib/libstdc/sys/kill.c @@ -1,6 +1,3 @@ -#include -#include - -int kill(p, s) int p; int s; { +int kill(p, s) { abort(); } diff --git a/lib/libstdc/sys/killpg.c b/lib/libstdc/sys/killpg.c index 71a29d9..dd05bb0 100644 --- a/lib/libstdc/sys/killpg.c +++ b/lib/libstdc/sys/killpg.c @@ -1,6 +1,3 @@ -#include -#include - -int killpg(pg, s) int pg; int s; { +int killpg(pg, s) { abort(); } diff --git a/lib/libstdc/sys/link.c b/lib/libstdc/sys/link.c index c7e58f9..dd87a4d 100644 --- a/lib/libstdc/sys/link.c +++ b/lib/libstdc/sys/link.c @@ -1,6 +1,3 @@ -#include -#include - -int link(a, b) char *a; char *b; { +int link(a, b) char *a, *b; { abort(); } diff --git a/lib/libstdc/sys/listen.c b/lib/libstdc/sys/listen.c index 094b5a3..e43d4ad 100644 --- a/lib/libstdc/sys/listen.c +++ b/lib/libstdc/sys/listen.c @@ -1,6 +1,3 @@ -#include -#include - -int listen(s, b) int s; int b; { +int listen(s, b){ abort(); } diff --git a/lib/libstdc/sys/lseek.c b/lib/libstdc/sys/lseek.c index 6469c01..ccadf77 100644 --- a/lib/libstdc/sys/lseek.c +++ b/lib/libstdc/sys/lseek.c @@ -1,7 +1,4 @@ -#include -#include #include - -off_t lseek(f, o, d) int f; off_t o; int d; { +off_t lseek(f, o, d) off_t o; { abort(); } diff --git a/lib/libstdc/sys/lstat.c b/lib/libstdc/sys/lstat.c index 3057146..275c947 100644 --- a/lib/libstdc/sys/lstat.c +++ b/lib/libstdc/sys/lstat.c @@ -1,6 +1,3 @@ -#include -#include - int lstat(s, b) char *s; struct stat *b; { abort(); } diff --git a/lib/libstdc/sys/map.h b/lib/libstdc/sys/map.h index a163714..7e8ab8e 100644 --- a/lib/libstdc/sys/map.h +++ b/lib/libstdc/sys/map.h @@ -1,7 +1,3 @@ -#ifndef _SYS_MAP_H_ -#define _SYS_MAP_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -38,7 +34,8 @@ struct map { char *m_name; /* name of resource */ /* we use m_name when the map overflows, in warning messages */ }; -struct mapent { +struct mapent +{ int m_size; /* size of this segment of the map */ int m_addr; /* resource-space addr of start of segment */ }; @@ -51,5 +48,3 @@ struct map *argmap; struct map *kernelmap; struct map *mbmap; #endif - -#endif diff --git a/lib/libstdc/sys/mbuf.h b/lib/libstdc/sys/mbuf.h index afc6416..6b6ffab 100644 --- a/lib/libstdc/sys/mbuf.h +++ b/lib/libstdc/sys/mbuf.h @@ -1,10 +1,3 @@ -#ifndef _SYS_MBUF_H_ -#define _SYS_MBUF_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -159,8 +152,6 @@ int nmbclusters; struct mbuf *mfree, *mclfree; char mclrefcnt[NMBCLUSTERS + 1]; int m_want; -/*struct mbuf *m_get(),*m_getclr(),*m_free(),*m_more(),*m_copy(),*m_pullup();*/ -/*caddr_t m_clalloc();*/ -#endif - +struct mbuf *m_get(),*m_getclr(),*m_free(),*m_more(),*m_copy(),*m_pullup(); +caddr_t m_clalloc(); #endif diff --git a/lib/libstdc/sys/mkdir.c b/lib/libstdc/sys/mkdir.c index 55855c2..6c393d2 100644 --- a/lib/libstdc/sys/mkdir.c +++ b/lib/libstdc/sys/mkdir.c @@ -1,6 +1,3 @@ -#include -#include - -int mkdir(p, m) char *p; int m; { +int mkdir(p, m) char *p; { abort(); } diff --git a/lib/libstdc/sys/mknod.c b/lib/libstdc/sys/mknod.c index 30a7d89..c313e7b 100644 --- a/lib/libstdc/sys/mknod.c +++ b/lib/libstdc/sys/mknod.c @@ -1,6 +1,3 @@ -#include -#include - -int mknod(n, m, a) char *n; int m; int a; { +int mknod(n, m, a) char *n; { abort(); } diff --git a/lib/libstdc/sys/mman.h b/lib/libstdc/sys/mman.h index 25b48e8..4c1c14d 100644 --- a/lib/libstdc/sys/mman.h +++ b/lib/libstdc/sys/mman.h @@ -1,7 +1,3 @@ -#ifndef _SYS_MMAN_H_ -#define _SYS_MMAN_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -25,5 +21,3 @@ #define MADV_SEQUENTIAL 2 /* expect sequential page references */ #define MADV_WILLNEED 3 /* will need these pages */ #define MADV_DONTNEED 4 /* dont need these pages */ - -#endif diff --git a/lib/libstdc/sys/mount.c b/lib/libstdc/sys/mount.c index 03b9c16..15e1720 100644 --- a/lib/libstdc/sys/mount.c +++ b/lib/libstdc/sys/mount.c @@ -1,6 +1,3 @@ -#include -#include - -int mount(s, n, f) char *s; char *n; int f; { +int mount(s, n, f) char *s, *n; { abort(); } diff --git a/lib/libstdc/sys/mount.h b/lib/libstdc/sys/mount.h index e25def1..65a895b 100644 --- a/lib/libstdc/sys/mount.h +++ b/lib/libstdc/sys/mount.h @@ -1,9 +1,3 @@ -#ifndef _SYS_MOUNT_H_ -#define _SYS_MOUNT_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -17,7 +11,8 @@ * One allocated on every mount. * Used to find the super block. */ -struct mount { +struct mount +{ dev_t m_dev; /* device mounted */ struct buf *m_bufp; /* pointer to superblock */ struct inode *m_inodp; /* pointer to mounted on inode */ @@ -26,21 +21,3 @@ struct mount { #ifdef KERNEL struct mount mount[NMOUNT]; #endif - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* sys/mount.c */ -int mount __P((char *s, char *n, int f)); - -/* sys/umount.c */ -int umount __P((char *s)); -#endif - -#endif diff --git a/lib/libstdc/sys/msgbuf.h b/lib/libstdc/sys/msgbuf.h index 2892cf3..4efb8a7 100644 --- a/lib/libstdc/sys/msgbuf.h +++ b/lib/libstdc/sys/msgbuf.h @@ -1,7 +1,3 @@ -#ifndef _SYS_MSGBUF_H_ -#define _SYS_MSGBUF_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -21,5 +17,3 @@ struct msgbuf { #ifdef KERNEL struct msgbuf msgbuf; #endif - -#endif diff --git a/lib/libstdc/sys/mtio.h b/lib/libstdc/sys/mtio.h index ebe8977..6647b33 100644 --- a/lib/libstdc/sys/mtio.h +++ b/lib/libstdc/sys/mtio.h @@ -1,9 +1,3 @@ -#ifndef _SYS_MTIO_H_ -#define _SYS_MTIO_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -71,5 +65,3 @@ struct mtget { #ifndef KERNEL #define DEFTAPE "/dev/rmt12" #endif - -#endif diff --git a/lib/libstdc/sys/namei.h b/lib/libstdc/sys/namei.h index f6140ca..89fba9d 100644 --- a/lib/libstdc/sys/namei.h +++ b/lib/libstdc/sys/namei.h @@ -1,10 +1,3 @@ -#ifndef _SYS_NAMEI_H_ -#define _SYS_NAMEI_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -13,13 +6,13 @@ * @(#)namei.h 7.1 (Berkeley) 6/4/86 */ -/*#ifndef _NAMEI_*/ -/*#define _NAMEI_*/ +#ifndef _NAMEI_ +#define _NAMEI_ #ifdef KERNEL -/*#include "uio.h"*/ +#include "uio.h" #else -/*#include */ +#include #endif /* @@ -92,6 +85,4 @@ struct nchstats { long ncs_pass2; /* names found with passes == 2 */ long ncs_2passes; /* number of times we attempt it */ }; -/*#endif*/ - #endif diff --git a/lib/libstdc/sys/open.c b/lib/libstdc/sys/open.c index 77c608c..763a459 100644 --- a/lib/libstdc/sys/open.c +++ b/lib/libstdc/sys/open.c @@ -1,6 +1,3 @@ -#include -#include - -int open(f, m, stuff) char *f; int m; int stuff; { +int open(f, m, stuff) char *f; { abort(); } diff --git a/lib/libstdc/sys/param.h b/lib/libstdc/sys/param.h index 05e835e..16b06b1 100644 --- a/lib/libstdc/sys/param.h +++ b/lib/libstdc/sys/param.h @@ -1,11 +1,3 @@ -#ifndef _SYS_PARAM_H_ -#define _SYS_PARAM_H_ - -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -21,9 +13,9 @@ * Machine type dependent parameters. */ #ifdef KERNEL -/*#include "../machine/machparam.h"*/ +#include "../machine/machparam.h" #else -/*#include */ +#include #endif #define NPTEPG (NBPG/(sizeof (struct pte))) @@ -62,9 +54,9 @@ * Signals */ #ifdef KERNEL -/*#include "signal.h"*/ +#include "signal.h" #else -/*#include */ +#include #endif #define ISSIG(p) \ @@ -106,10 +98,10 @@ #define CROUND (CBLOCK - 1) /* clist rounding */ #ifndef KERNEL -/*#include */ +#include #else #ifndef LOCORE -/*#include "types.h"*/ +#include "types.h" #endif #endif @@ -182,9 +174,9 @@ /* * Macros for counting and rounding. */ -/* this is defined in sys/types.h which must be included anyway */ +/* formerly duplicated in sys/types.h, but we now get it from here */ /*#ifndef howmany*/ -/*#define howmany(x, y) (((x)+((y)-1))/(y))*/ +#define howmany(x, y) (((x)+((y)-1))/(y)) /*#endif*/ #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) @@ -193,4 +185,5 @@ */ #define MAXHOSTNAMELEN 64 -#endif +/* moved this from sys/types.h */ +#define NBBY 8 /* number of bits in a byte */ diff --git a/lib/libstdc/sys/pipe.c b/lib/libstdc/sys/pipe.c index 9389ceb..0504def 100644 --- a/lib/libstdc/sys/pipe.c +++ b/lib/libstdc/sys/pipe.c @@ -1,6 +1,3 @@ -#include -#include - int pipe(f) int f[2]; { abort(); } diff --git a/lib/libstdc/sys/proc.h b/lib/libstdc/sys/proc.h index 8de46eb..b81c5cb 100644 --- a/lib/libstdc/sys/proc.h +++ b/lib/libstdc/sys/proc.h @@ -1,9 +1,3 @@ -#ifndef _SYS_PROC_H_ -#define _SYS_PROC_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -75,7 +69,7 @@ struct proc { #ifdef KERNEL short pidhash[PIDHSZ]; -/*struct proc *pfind();*/ +struct proc *pfind(); struct proc *proc, *procNPROC; /* the proc table itself */ struct proc *freeproc, *zombproc, *allproc; /* lists of procs in various states */ @@ -123,87 +117,3 @@ int whichqs; /* bit mask summarizing non-empty qs's */ #define SSEL 0x0400000 /* selecting; wakeup/waiting danger */ #define SLOGIN 0x0800000 /* a login process (legit child of init) */ #define SPTECHG 0x1000000 /* pte's for process have changed */ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* gen/setegid.c */ -int setegid __P((int egid)); - -/* gen/seteuid.c */ -int seteuid __P((int euid)); - -/* gen/setgid.c */ -int setgid __P((int gid)); - -/* gen/setrgid.c */ -int setrgid __P((int rgid)); - -/* gen/setruid.c */ -int setruid __P((int ruid)); - -/* gen/setuid.c */ -int setuid __P((int uid)); - -/* sys/brk.c */ -char *brk __P((char *a)); - -/* sys/chdir.c */ -int chdir __P((char *s)); - -/* sys/chroot.c */ -int chroot __P((char *d)); - -/* sys/_exit.c */ -void _exit __P((int s)); - -/* sys/fork.c */ -int fork __P((void)); - -/* sys/getegid.c */ -gid_t getegid __P((void)); - -/* sys/geteuid.c */ -uid_t geteuid __P((void)); - -/* sys/getgid.c */ -gid_t getgid __P((void)); - -/* sys/getgroups.c */ -int getgroups __P((int n, int *g)); - -/* sys/getpgrp.c */ -int getpgrp __P((int p)); - -/* sys/getpid.c */ -int getpid __P((void)); - -/* sys/getppid.c */ -int getppid __P((void)); - -/* sys/getuid.c */ -uid_t getuid __P((void)); - -/* sys/sbrk.c */ -char *sbrk __P((int i)); - -/* sys/setgroups.c */ -int setgroups __P((int n, int *g)); - -/* sys/setpgrp.c */ -int setpgrp __P((int g, int pg)); - -/* sys/setregid.c */ -int setregid __P((int r, int e)); - -/* sys/setreuid.c */ -int setreuid __P((int r, int e)); -#endif - -#endif diff --git a/lib/libstdc/sys/profil.c b/lib/libstdc/sys/profil.c index 9434cfd..53fb81f 100644 --- a/lib/libstdc/sys/profil.c +++ b/lib/libstdc/sys/profil.c @@ -1,6 +1,3 @@ -#include -#include - -void profil(b, s, o, i) char *b; int s; int o; int i; { +void profil(b, s, o, i) char *b; { abort(); } diff --git a/lib/libstdc/sys/protosw.h b/lib/libstdc/sys/protosw.h index d5499c3..968fa28 100644 --- a/lib/libstdc/sys/protosw.h +++ b/lib/libstdc/sys/protosw.h @@ -1,7 +1,3 @@ -#ifndef _SYS_PROTOSW_H_ -#define _SYS_PROTOSW_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -183,7 +179,5 @@ char *prcorequests[] = { #endif #ifdef KERNEL -/*extern struct protosw *pffindproto(), *pffindtype();*/ -#endif - +extern struct protosw *pffindproto(), *pffindtype(); #endif diff --git a/lib/libstdc/sys/ptrace.c b/lib/libstdc/sys/ptrace.c index 9b677b6..87312fc 100644 --- a/lib/libstdc/sys/ptrace.c +++ b/lib/libstdc/sys/ptrace.c @@ -1,6 +1,3 @@ -#include -#include - -int ptrace(r, p, a, d) int r; int p; int *a; int d; { +int ptrace(r, p, a, d) int *a; { abort(); } diff --git a/lib/libstdc/sys/ptrace.h b/lib/libstdc/sys/ptrace.h index a87af94..88a8f75 100644 --- a/lib/libstdc/sys/ptrace.h +++ b/lib/libstdc/sys/ptrace.h @@ -1,7 +1,3 @@ -#ifndef _SYS_PTRACE_H_ -#define _SYS_PTRACE_H_ - - /* * Copyright (c) 1980, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,8 +6,8 @@ * @(#)ptrace.h 7.1 (Berkeley) 6/4/86 */ -/*#ifndef _PTRACE_*/ -/*#define _PTRACE_*/ +#ifndef _PTRACE_ +#define _PTRACE_ #define PT_TRACE_ME 0 /* child declares it's being traced */ #define PT_READ_I 1 /* read word in child's I space */ @@ -24,19 +20,4 @@ #define PT_KILL 8 /* kill the child process */ #define PT_STEP 9 /* single step the child */ -/*#endif*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* sys/ptrace.c */ -int ptrace __P((int r, int p, int *a, int d)); -#endif - #endif diff --git a/lib/libstdc/sys/quota.c b/lib/libstdc/sys/quota.c index 7950492..fe06ce4 100644 --- a/lib/libstdc/sys/quota.c +++ b/lib/libstdc/sys/quota.c @@ -1,6 +1,3 @@ -#include -#include - -int quota(c, u, a, ad) int c; int u; int a; char *ad; { +int quota(c, u, a, ad) char *ad; { abort(); } diff --git a/lib/libstdc/sys/quota.h b/lib/libstdc/sys/quota.h index 0bae9e6..429790c 100644 --- a/lib/libstdc/sys/quota.h +++ b/lib/libstdc/sys/quota.h @@ -1,9 +1,3 @@ -#ifndef _SYS_QUOTA_H_ -#define _SYS_QUOTA_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -43,7 +37,7 @@ struct quota { #if defined(KERNEL) && defined(QUOTA) struct quota *quota, *quotaNQUOTA; int nquota; -/*struct quota *getquota(), *qfind();*/ +struct quota *getquota(), *qfind(); #endif /* @@ -119,7 +113,7 @@ struct dquot { #if defined(KERNEL) && defined(QUOTA) struct dquot *dquot, *dquotNDQUOT; int ndquot; -/*struct dquot *discquota(), *inoquota(), *dqalloc(), *dqp();*/ +struct dquot *discquota(), *inoquota(), *dqalloc(), *dqp(); #endif /* @@ -148,21 +142,3 @@ struct dqwarn { u_char dw_bwarn; u_char dw_iwarn; }; - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* sys/quota.c */ -int quota __P((int c, int u, int a, char *ad)); - -/* sys/setquota.c */ -int setquota __P((char *s, char *f)); -#endif - -#endif diff --git a/lib/libstdc/sys/read.c b/lib/libstdc/sys/read.c index aa2c121..53fb7e4 100644 --- a/lib/libstdc/sys/read.c +++ b/lib/libstdc/sys/read.c @@ -1,6 +1,3 @@ -#include -#include - -int read(f, b, l) int f; char *b; int l; { +int read(f, b, l) char *b; { abort(); } diff --git a/lib/libstdc/sys/readlink.c b/lib/libstdc/sys/readlink.c index eb2ac71..fe3c749 100644 --- a/lib/libstdc/sys/readlink.c +++ b/lib/libstdc/sys/readlink.c @@ -1,6 +1,3 @@ -#include -#include - -int readlink(p, b, s) char *p; char *b; int s; { +int readlink(p, b, s) char *p, *b; { abort(); } diff --git a/lib/libstdc/sys/readv.c b/lib/libstdc/sys/readv.c index a0d8913..ad24217 100644 --- a/lib/libstdc/sys/readv.c +++ b/lib/libstdc/sys/readv.c @@ -1,6 +1,4 @@ -#include #include - -int readv(d, v, l) int d; struct iovec *v; int l; { +int readv(d, v, l) struct iovec *v; { abort(); } diff --git a/lib/libstdc/sys/reboot.c b/lib/libstdc/sys/reboot.c index 1f9004f..1ff5b2d 100644 --- a/lib/libstdc/sys/reboot.c +++ b/lib/libstdc/sys/reboot.c @@ -1,6 +1,3 @@ -#include -#include - -void reboot(h) int h; { +void reboot(h) { abort(); } diff --git a/lib/libstdc/sys/reboot.h b/lib/libstdc/sys/reboot.h index 1ac1cfc..1776012 100644 --- a/lib/libstdc/sys/reboot.h +++ b/lib/libstdc/sys/reboot.h @@ -1,7 +1,3 @@ -#ifndef _SYS_REBOOT_H_ -#define _SYS_REBOOT_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -44,5 +40,3 @@ #define B_TYPEMASK 0xff #define B_MAGICMASK 0xf0000000 #define B_DEVMAGIC 0xa0000000 - -#endif diff --git a/lib/libstdc/sys/recv.c b/lib/libstdc/sys/recv.c index 4d175fb..db28262 100644 --- a/lib/libstdc/sys/recv.c +++ b/lib/libstdc/sys/recv.c @@ -1,6 +1,3 @@ -#include -#include - -int recv(s, b, l, f) int s; char *b; int l; int f; { +int recv(s, b, l, f) char *b; { abort(); } diff --git a/lib/libstdc/sys/recvfrom.c b/lib/libstdc/sys/recvfrom.c index 3b1f9a6..c333ed2 100644 --- a/lib/libstdc/sys/recvfrom.c +++ b/lib/libstdc/sys/recvfrom.c @@ -1,6 +1,4 @@ -#include #include - -int recvfrom(s, b, l, f, fr, fl) int s; char *b; int l; int f; struct sockaddr *fr; int *fl; { +int recvfrom(s, b, l, f, fr, fl) char *b; struct sockaddr *fr; int *fl; { abort(); } diff --git a/lib/libstdc/sys/recvmsg.c b/lib/libstdc/sys/recvmsg.c index 32a1e69..4acedcd 100644 --- a/lib/libstdc/sys/recvmsg.c +++ b/lib/libstdc/sys/recvmsg.c @@ -1,6 +1,4 @@ -#include #include - -int recvmsg(s, m, f) int s; struct msghdr m[]; int f; { +int recvmsg(s, m, f) struct msghdr m[]; { abort(); } diff --git a/lib/libstdc/sys/rename.c b/lib/libstdc/sys/rename.c index 7ae70a9..c685463 100644 --- a/lib/libstdc/sys/rename.c +++ b/lib/libstdc/sys/rename.c @@ -1,6 +1,3 @@ -#include -#include - -int rename(f, t) char *f; char *t; { +int rename(f, t) char *f, *t; { abort(); } diff --git a/lib/libstdc/sys/resource.h b/lib/libstdc/sys/resource.h index 7e1b472..16d50d7 100644 --- a/lib/libstdc/sys/resource.h +++ b/lib/libstdc/sys/resource.h @@ -1,8 +1,3 @@ -#ifndef _SYS_RESOURCE_H_ -#define _SYS_RESOURCE_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -67,33 +62,3 @@ struct rlimit { int rlim_cur; /* current (soft) limit */ int rlim_max; /* maximum value for rlim_cur */ }; - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* compat-4.1/nice.c */ -int nice __P((int incr)); - -/* sys/getpriority.c */ -int getpriority __P((int w, int who)); - -/* sys/getrlimit.c */ -int getrlimit __P((int res, struct rlimit *rip)); - -/* sys/getrusage.c */ -int getrusage __P((int res, struct rusage *rip)); - -/* sys/setpriority.c */ -int setpriority __P((int w, int who, int pri)); - -/* sys/setrlimit.c */ -int setrlimit __P((int res, struct rlimit *rip)); -#endif - -#endif diff --git a/lib/libstdc/sys/rmdir.c b/lib/libstdc/sys/rmdir.c index b3cf959..0501658 100644 --- a/lib/libstdc/sys/rmdir.c +++ b/lib/libstdc/sys/rmdir.c @@ -1,6 +1,3 @@ -#include -#include - int rmdir(p) char *p; { abort(); } diff --git a/lib/libstdc/sys/sbrk.c b/lib/libstdc/sys/sbrk.c index cd6e664..bd673e5 100644 --- a/lib/libstdc/sys/sbrk.c +++ b/lib/libstdc/sys/sbrk.c @@ -1,6 +1,3 @@ -#include -#include - -char *sbrk(i) int i; { +char *sbrk(i) { abort(); } diff --git a/lib/libstdc/sys/seg.h b/lib/libstdc/sys/seg.h index 2d97aa8..6810735 100644 --- a/lib/libstdc/sys/seg.h +++ b/lib/libstdc/sys/seg.h @@ -1,8 +1,3 @@ -#ifndef _SYS_SEG_H_ -#define _SYS_SEG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -17,5 +12,3 @@ #define RO PG_URKR /* access abilities */ #define RW PG_UW - -#endif diff --git a/lib/libstdc/sys/select.c b/lib/libstdc/sys/select.c index b5dfaed..0a2a53a 100644 --- a/lib/libstdc/sys/select.c +++ b/lib/libstdc/sys/select.c @@ -1,8 +1,5 @@ -#include #include #include -#include - -int select(n, r, w, e, t) int n; fd_set *r; fd_set *w; fd_set *e; struct timeval *t; { +int select(n, r, w, e, t) fd_set *r, *w, *e; struct timeval *t; { abort(); } diff --git a/lib/libstdc/sys/select.h b/lib/libstdc/sys/select.h index 9abfaa6..c861a51 100644 --- a/lib/libstdc/sys/select.h +++ b/lib/libstdc/sys/select.h @@ -1,20 +1,28 @@ -#ifndef _SYS_SELECT_H_ -#define _SYS_SELECT_H_ +#include -#include -#include - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif +/* moved this from sys/types.h */ +/* + * Select uses bit masks of file descriptors in longs. + * These macros manipulate such bit fields (the filesystem macros use chars). + * FD_SETSIZE may be defined by the user, but the default here + * should be >= NOFILE (param.h). + */ +#ifndef FD_SETSIZE +#define FD_SETSIZE 256 #endif -#ifndef KERNEL -/* sys/select.c */ -int select __P((int n, fd_set *r, fd_set *w, fd_set *e, struct timeval *t)); -#endif +typedef long fd_mask; +#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ +/* this was duplicated in sys/param.h, get it from there */ +/*#ifndef howmany*/ +/*#define howmany(x, y) (((x)+((y)-1))/(y))*/ +/*#endif*/ -#endif +typedef struct fd_set { + fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; +} fd_set; + +#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) +#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) +#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) +#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) diff --git a/lib/libstdc/sys/send.c b/lib/libstdc/sys/send.c index 55d552f..d2b14d1 100644 --- a/lib/libstdc/sys/send.c +++ b/lib/libstdc/sys/send.c @@ -1,6 +1,3 @@ -#include -#include - -int send(s, m, l, f) int s; char *m; int l; int f; { +int send(s, m, l, f) char *m; { abort(); } diff --git a/lib/libstdc/sys/sendmsg.c b/lib/libstdc/sys/sendmsg.c index 44215ac..4875f59 100644 --- a/lib/libstdc/sys/sendmsg.c +++ b/lib/libstdc/sys/sendmsg.c @@ -1,6 +1,4 @@ -#include #include - -int sendmsg(s, m, l) int s; struct msghdr m[]; int l; { +int sendmsg(s, m, l) struct msghdr m[]; { abort(); } diff --git a/lib/libstdc/sys/sendto.c b/lib/libstdc/sys/sendto.c index 1f7db99..8cc5ab9 100644 --- a/lib/libstdc/sys/sendto.c +++ b/lib/libstdc/sys/sendto.c @@ -1,6 +1,4 @@ -#include #include - -int sendto(s, m, l, f, t, tl) int s; char *m; int l; int f; struct sockaddr *t; int tl; { +int sendto(s, m, l, f, t, tl) char *m; struct sockaddr *t; { abort(); } diff --git a/lib/libstdc/sys/setgroups.c b/lib/libstdc/sys/setgroups.c index f97e210..192e28c 100644 --- a/lib/libstdc/sys/setgroups.c +++ b/lib/libstdc/sys/setgroups.c @@ -1,6 +1,3 @@ -#include -#include - -int setgroups(n, g) int n; int *g; { +int setgroups(n, g) int *g; { abort(); } diff --git a/lib/libstdc/sys/sethostid.c b/lib/libstdc/sys/sethostid.c index 27bfb2a..2100941 100644 --- a/lib/libstdc/sys/sethostid.c +++ b/lib/libstdc/sys/sethostid.c @@ -1,6 +1,3 @@ -#include -#include - int sethostid(h) long h; { abort(); } diff --git a/lib/libstdc/sys/sethostname.c b/lib/libstdc/sys/sethostname.c index e6468e2..5b883ad 100644 --- a/lib/libstdc/sys/sethostname.c +++ b/lib/libstdc/sys/sethostname.c @@ -1,6 +1,3 @@ -#include -#include - int sethostname(n, l) char *n; int l; { abort(); } diff --git a/lib/libstdc/sys/setitimer.c b/lib/libstdc/sys/setitimer.c index b6aef57..d65e30f 100644 --- a/lib/libstdc/sys/setitimer.c +++ b/lib/libstdc/sys/setitimer.c @@ -1,6 +1,4 @@ -#include #include - -int setitimer(w, v, ov) int w; struct itimerval *v; struct itimerval *ov; { +int setitimer(w, v, ov) struct itimerval *v, *ov; { abort(); } diff --git a/lib/libstdc/sys/setpgrp.c b/lib/libstdc/sys/setpgrp.c index 8228005..ef20300 100644 --- a/lib/libstdc/sys/setpgrp.c +++ b/lib/libstdc/sys/setpgrp.c @@ -1,6 +1,3 @@ -#include -#include - -int setpgrp(g, pg) int g; int pg; { +int setpgrp(g, pg) { abort(); } diff --git a/lib/libstdc/sys/setpriority.c b/lib/libstdc/sys/setpriority.c index e7bd627..0451299 100644 --- a/lib/libstdc/sys/setpriority.c +++ b/lib/libstdc/sys/setpriority.c @@ -1,6 +1,3 @@ -#include -#include - -int setpriority(w, who, pri) int w; int who; int pri; { +int setpriority(w, who, pri) { abort(); } diff --git a/lib/libstdc/sys/setquota.c b/lib/libstdc/sys/setquota.c index ede27bb..dba93ec 100644 --- a/lib/libstdc/sys/setquota.c +++ b/lib/libstdc/sys/setquota.c @@ -1,6 +1,3 @@ -#include -#include - -int setquota(s, f) char *s; char *f; { +int setquota(s, f) char *s, *f; { abort(); } diff --git a/lib/libstdc/sys/setregid.c b/lib/libstdc/sys/setregid.c index 161e626..54a7330 100644 --- a/lib/libstdc/sys/setregid.c +++ b/lib/libstdc/sys/setregid.c @@ -1,6 +1,3 @@ -#include -#include - -int setregid(r, e) int r; int e; { +int setregid(r, e) int r, e; { abort(); } diff --git a/lib/libstdc/sys/setreuid.c b/lib/libstdc/sys/setreuid.c index 06367db..824352d 100644 --- a/lib/libstdc/sys/setreuid.c +++ b/lib/libstdc/sys/setreuid.c @@ -1,6 +1,3 @@ -#include -#include - -int setreuid(r, e) int r; int e; { +int setreuid(r, e) int r, e; { abort(); } diff --git a/lib/libstdc/sys/setrlimit.c b/lib/libstdc/sys/setrlimit.c index 5da3fa0..6d0ae4e 100644 --- a/lib/libstdc/sys/setrlimit.c +++ b/lib/libstdc/sys/setrlimit.c @@ -1,6 +1,4 @@ -#include #include - -int setrlimit(res, rip) int res; struct rlimit *rip; { +int setrlimit(res, rip) struct rlimit *rip; { abort(); } diff --git a/lib/libstdc/sys/setsockopt.c b/lib/libstdc/sys/setsockopt.c index 0df0d2e..d5770e7 100644 --- a/lib/libstdc/sys/setsockopt.c +++ b/lib/libstdc/sys/setsockopt.c @@ -1,6 +1,3 @@ -#include -#include - -int setsockopt(s, level, opt, buf, len) int s; int level; int opt; char *buf; int len; { +int setsockopt(s, level, opt, buf, len) char *buf; { abort(); } diff --git a/lib/libstdc/sys/settimeofday.c b/lib/libstdc/sys/settimeofday.c index 08059f5..3191240 100644 --- a/lib/libstdc/sys/settimeofday.c +++ b/lib/libstdc/sys/settimeofday.c @@ -1,6 +1,4 @@ -#include #include - int settimeofday(t, z) struct timeval *t; struct timezone *z; { abort(); } diff --git a/lib/libstdc/sys/shutdown.c b/lib/libstdc/sys/shutdown.c index 388a978..eed6b1a 100644 --- a/lib/libstdc/sys/shutdown.c +++ b/lib/libstdc/sys/shutdown.c @@ -1,6 +1,3 @@ -#include -#include - -int shutdown(s, h) int s; int h; { +int shutdown(s, h){ abort(); } diff --git a/lib/libstdc/sys/sigblock.c b/lib/libstdc/sys/sigblock.c index dc378bf..18bf69b 100644 --- a/lib/libstdc/sys/sigblock.c +++ b/lib/libstdc/sys/sigblock.c @@ -1,6 +1,3 @@ -#include -#include - -int sigblock(m) int m; { +int sigblock(m) { abort(); } diff --git a/lib/libstdc/sys/signal.h b/lib/libstdc/sys/signal.h index 9b0bd44..e08cebc 100644 --- a/lib/libstdc/sys/signal.h +++ b/lib/libstdc/sys/signal.h @@ -1,7 +1,3 @@ -#ifndef _SYS_SIGNAL_H_ -#define _SYS_SIGNAL_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -116,48 +112,3 @@ struct sigcontext { * sigblock(). */ #define sigmask(m) (1 << ((m)-1)) - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* gen/psignal.c */ -int psignal __P((unsigned sig, char *s)); - -/* gen/siginterrupt.c */ -int siginterrupt __P((int sig, int flag)); - -/* gen/signal.c */ -int (*signal __P((int s, int (*a)(void)))) __P((void)); - -/* sys/kill.c */ -int kill __P((int p, int s)); - -/* sys/killpg.c */ -int killpg __P((int pg, int s)); - -/* sys/sigblock.c */ -int sigblock __P((int m)); - -/* sys/sigpause.c */ -void sigpause __P((int m)); - -/* sys/sigreturn.c */ -int sigreturn __P((struct sigcontext *scp)); - -/* sys/sigsetmask.c */ -int sigsetmask __P((int m)); - -/* sys/sigstack.c */ -int sigstack __P((struct sigstack *ss, struct sigstack *oss)); - -/* sys/sigvec.c */ -int sigvec __P((int c, struct sigvec *f, struct sigvec *m)); -#endif - -#endif diff --git a/lib/libstdc/sys/sigpause.c b/lib/libstdc/sys/sigpause.c index 5a555c6..fc6fcff 100644 --- a/lib/libstdc/sys/sigpause.c +++ b/lib/libstdc/sys/sigpause.c @@ -1,6 +1,3 @@ -#include -#include - -void sigpause(m) int m; { +void sigpause(m) { abort(); } diff --git a/lib/libstdc/sys/sigreturn.c b/lib/libstdc/sys/sigreturn.c index c50cae7..218fd59 100644 --- a/lib/libstdc/sys/sigreturn.c +++ b/lib/libstdc/sys/sigreturn.c @@ -1,6 +1,5 @@ -#include +#include #include - int sigreturn(scp) struct sigcontext *scp; { abort(); } diff --git a/lib/libstdc/sys/sigsetmask.c b/lib/libstdc/sys/sigsetmask.c index eb714b5..ef23897 100644 --- a/lib/libstdc/sys/sigsetmask.c +++ b/lib/libstdc/sys/sigsetmask.c @@ -1,6 +1,3 @@ -#include -#include - -int sigsetmask(m) int m; { +int sigsetmask(m) { abort(); } diff --git a/lib/libstdc/sys/sigstack.c b/lib/libstdc/sys/sigstack.c index e9af3c7..bb31e1e 100644 --- a/lib/libstdc/sys/sigstack.c +++ b/lib/libstdc/sys/sigstack.c @@ -1,6 +1,5 @@ -#include +#include #include - -int sigstack(ss, oss) struct sigstack *ss; struct sigstack *oss; { +int sigstack(ss, oss) struct sigstack *ss, *oss; { abort(); } diff --git a/lib/libstdc/sys/sigvec.c b/lib/libstdc/sys/sigvec.c index 5e87447..8177434 100644 --- a/lib/libstdc/sys/sigvec.c +++ b/lib/libstdc/sys/sigvec.c @@ -1,6 +1,5 @@ -#include +#include #include - -int sigvec(c, f, m) int c; struct sigvec *f; struct sigvec *m; { +int sigvec(c, f, m) struct sigvec *f, *m; { abort(); } diff --git a/lib/libstdc/sys/socket.c b/lib/libstdc/sys/socket.c index ecd4fdc..dee5c5b 100644 --- a/lib/libstdc/sys/socket.c +++ b/lib/libstdc/sys/socket.c @@ -1,6 +1,3 @@ -#include -#include - -int socket(a, t, p) int a; int t; int p; { +int socket(a, t, p) { abort(); } diff --git a/lib/libstdc/sys/socket.h b/lib/libstdc/sys/socket.h index 3ee122d..6883e8c 100644 --- a/lib/libstdc/sys/socket.h +++ b/lib/libstdc/sys/socket.h @@ -1,8 +1,3 @@ -#ifndef _SYS_SOCKET_H_ -#define _SYS_SOCKET_H_ - -#include - /* * Copyright (c) 1982,1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -148,63 +143,3 @@ struct msghdr { #define MSG_DONTROUTE 0x4 /* send without using routing tables */ #define MSG_MAXIOVLEN 16 - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* sys/accept.c */ -int accept __P((int s, struct sockaddr *a, int *l)); - -/* sys/bind.c */ -int bind __P((int s, struct sockaddr *n, int l)); - -/* sys/connect.c */ -int connect __P((int s, struct sockaddr *n, int l)); - -/* sys/getpeername.c */ -int getpeername __P((int s, struct sockaddr *n, int *l)); - -/* sys/getsockname.c */ -int getsockname __P((int s, char *name, int *namelen)); - -/* sys/getsockopt.c */ -int getsockopt __P((int s, int level, int opt, char *buf, int *len)); - -/* sys/listen.c */ -int listen __P((int s, int b)); - -/* sys/recv.c */ -int recv __P((int s, char *b, int l, int f)); - -/* sys/recvfrom.c */ -int recvfrom __P((int s, char *b, int l, int f, struct sockaddr *fr, int *fl)); - -/* sys/recvmsg.c */ -int recvmsg __P((int s, struct msghdr m[], int f)); - -/* sys/send.c */ -int send __P((int s, char *m, int l, int f)); - -/* sys/sendmsg.c */ -int sendmsg __P((int s, struct msghdr m[], int l)); - -/* sys/sendto.c */ -int sendto __P((int s, char *m, int l, int f, struct sockaddr *t, int tl)); - -/* sys/setsockopt.c */ -int setsockopt __P((int s, int level, int opt, char *buf, int len)); - -/* sys/socket.c */ -int socket __P((int a, int t, int p)); - -/* sys/socketpair.c */ -int socketpair __P((int d, int t, int p, int s[2])); -#endif - -#endif diff --git a/lib/libstdc/sys/socketpair.c b/lib/libstdc/sys/socketpair.c index 8b4eb6e..8bc92c8 100644 --- a/lib/libstdc/sys/socketpair.c +++ b/lib/libstdc/sys/socketpair.c @@ -1,6 +1,3 @@ -#include -#include - -int socketpair(d, t, p, s) int d; int t; int p; int s[2]; { +int socketpair(d, t, p, s) int s[2]; { abort(); } diff --git a/lib/libstdc/sys/socketvar.h b/lib/libstdc/sys/socketvar.h index 4e493ef..90779c2 100644 --- a/lib/libstdc/sys/socketvar.h +++ b/lib/libstdc/sys/socketvar.h @@ -1,12 +1,3 @@ -#ifndef _SYS_SOCKETVAR_H_ -#define _SYS_SOCKETVAR_H_ - -#include -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -151,7 +142,5 @@ struct socket { #define sowwakeup(so) sowakeup((so), &(so)->so_snd) #ifdef KERNEL -/*struct socket *sonewconn();*/ -#endif - +struct socket *sonewconn(); #endif diff --git a/lib/libstdc/sys/stat.c b/lib/libstdc/sys/stat.c index 03196a0..a620470 100644 --- a/lib/libstdc/sys/stat.c +++ b/lib/libstdc/sys/stat.c @@ -1,6 +1,3 @@ -#include -#include - int stat(s, b) char *s; struct stat *b; { abort(); } diff --git a/lib/libstdc/sys/stat.h b/lib/libstdc/sys/stat.h index 42b6cca..d5dfbcd 100644 --- a/lib/libstdc/sys/stat.h +++ b/lib/libstdc/sys/stat.h @@ -1,8 +1,3 @@ -#ifndef _SYS_STAT_H_ -#define _SYS_STAT_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,7 +6,8 @@ * @(#)stat.h 7.1 (Berkeley) 6/4/86 */ -struct stat { +struct stat +{ dev_t st_dev; ino_t st_ino; unsigned short st_mode; @@ -44,24 +40,3 @@ struct stat { #define S_IREAD 0000400 /* read permission, owner */ #define S_IWRITE 0000200 /* write permission, owner */ #define S_IEXEC 0000100 /* execute/search permission, owner */ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* sys/fstat.c */ -int fstat __P((int f, struct stat *b)); - -/* sys/lstat.c */ -int lstat __P((char *s, struct stat *b)); - -/* sys/stat.c */ -int stat __P((char *s, struct stat *b)); -#endif - -#endif diff --git a/lib/libstdc/sys/swapon.c b/lib/libstdc/sys/swapon.c index 250f920..9c890f9 100644 --- a/lib/libstdc/sys/swapon.c +++ b/lib/libstdc/sys/swapon.c @@ -1,6 +1,3 @@ -#include -#include - int swapon(s) char *s; { abort(); } diff --git a/lib/libstdc/sys/symlink.c b/lib/libstdc/sys/symlink.c index 8d368e3..458a4d9 100644 --- a/lib/libstdc/sys/symlink.c +++ b/lib/libstdc/sys/symlink.c @@ -1,6 +1,3 @@ -#include -#include - -int symlink(t, f) char *t; char *f; { +int symlink(t, f) char *t, *f; { abort(); } diff --git a/lib/libstdc/sys/sync.c b/lib/libstdc/sys/sync.c index e7c5992..c565415 100644 --- a/lib/libstdc/sys/sync.c +++ b/lib/libstdc/sys/sync.c @@ -1,6 +1,3 @@ -#include -#include - -void sync() { +void sync(){ abort(); } diff --git a/lib/libstdc/sys/syslog.h b/lib/libstdc/sys/syslog.h index 77182f5..5d2c0b9 100644 --- a/lib/libstdc/sys/syslog.h +++ b/lib/libstdc/sys/syslog.h @@ -1,7 +1,3 @@ -#ifndef _SYS_SYSLOG_H_ -#define _SYS_SYSLOG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -66,21 +62,3 @@ #define LOG_ODELAY 0x04 /* delay open until syslog() is called */ #define LOG_NDELAY 0x08 /* don't delay open */ #define LOG_NOWAIT 0x10 /* if forking to log on console, don't wait() */ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* gen/syslog.c */ -int syslog __P((int pri, char *fmt, int p0, int p1, int p2, int p3, int p4)); -int openlog __P((char *ident, int logstat, int logfac)); -int closelog __P((void)); -int setlogmask __P((int pmask)); -#endif - -#endif diff --git a/lib/libstdc/sys/systm.h b/lib/libstdc/sys/systm.h index a300d06..bcd7b5d 100644 --- a/lib/libstdc/sys/systm.h +++ b/lib/libstdc/sys/systm.h @@ -1,8 +1,3 @@ -#ifndef _SYS_SYSTM_H_ -#define _SYS_SYSTM_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -61,17 +56,18 @@ extern int icode[]; /* user init code */ extern int szicode; /* its size */ #endif -/*daddr_t bmap();*/ -/*caddr_t calloc();*/ -/*int memall();*/ -/*int vmemall();*/ -/*caddr_t wmemall();*/ -/*swblk_t vtod();*/ +daddr_t bmap(); +caddr_t calloc(); +int memall(); +int vmemall(); +caddr_t wmemall(); +swblk_t vtod(); /* * Structure of the system-entry table */ -extern struct sysent { +extern struct sysent +{ int sy_narg; /* total number of arguments */ int (*sy_call)(); /* handler */ } sysent[]; @@ -87,5 +83,3 @@ extern char vmmap[]; /* poor name! */ /* casts to keep lint happy */ #define insque(q,p) _insque((caddr_t)q,(caddr_t)p) #define remque(q) _remque((caddr_t)q) - -#endif diff --git a/lib/libstdc/sys/tablet.h b/lib/libstdc/sys/tablet.h index 31a71e2..211678d 100644 --- a/lib/libstdc/sys/tablet.h +++ b/lib/libstdc/sys/tablet.h @@ -1,8 +1,3 @@ -#ifndef _SYS_TABLET_H_ -#define _SYS_TABLET_H_ - -#include - /* * Copyright (c) 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,14 +6,14 @@ * @(#)tablet.h 7.1 (Berkeley) 6/4/86 */ -/*#ifndef _TABLET_*/ +#ifndef _TABLET_ /* * Tablet line discipline. */ #ifdef KERNEL -/*#include "../h/ioctl.h"*/ +#include "../h/ioctl.h" #else -/*#include */ +#include #endif /* @@ -69,6 +64,4 @@ struct polpos { #define TBHDGHIRES 0x0006 /* hdg-1111b, high res */ #define BIOSTYPE _IOW(b, 3, int) /* set tablet type */ #define BIOGTYPE _IOR(b, 4, int) /* get tablet type*/ -/*#endif*/ - #endif diff --git a/lib/libstdc/sys/text.h b/lib/libstdc/sys/text.h index da09ed7..ac0594a 100644 --- a/lib/libstdc/sys/text.h +++ b/lib/libstdc/sys/text.h @@ -1,8 +1,3 @@ -#ifndef _SYS_TEXT_H_ -#define _SYS_TEXT_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -19,7 +14,8 @@ */ #define NXDAD 12 /* param.h:MAXTSIZ / vmparam.h:DMTEXT */ -struct text { +struct text +{ struct text *x_forw; /* forward link in free list */ struct text **x_back; /* backward link in free list */ swblk_t x_daddr[NXDAD]; /* disk addresses of dmtext-page segments */ @@ -63,5 +59,3 @@ struct xstats { u_long free_cache; /* placed in cache */ u_long free_cacheswap; /* swapped out to place in cache */ }; - -#endif diff --git a/lib/libstdc/sys/time.h b/lib/libstdc/sys/time.h index d00a408..f81d40b 100644 --- a/lib/libstdc/sys/time.h +++ b/lib/libstdc/sys/time.h @@ -1,8 +1,3 @@ -#ifndef _SYS_TIME_H_ -#define _SYS_TIME_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -57,53 +52,5 @@ struct itimerval { }; #ifndef KERNEL -/*#include */ -#endif - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* compat-4.1/utime.c */ -int utime __P((char *name, int otv[])); - -/* gen/alarm.c */ -int alarm __P((int secs)); - -/* gen/sleep.c */ -int sleep __P((unsigned n)); - -/* gen/time.c */ -long time __P((time_t *t)); - -/* gen/ualarm.c */ -unsigned ualarm __P((register unsigned usecs, register unsigned reload)); - -/* gen/usleep.c */ -int usleep __P((unsigned n)); - -/* sys/adjtime.c */ -int adjtime __P((struct timeval *delta, struct timeval *odelta)); - -/* sys/getitimer.c */ -int getitimer __P((int w, struct itimerval *v)); - -/* sys/gettimeofday.c */ -int gettimeofday __P((struct timeval *t, struct timezone *z)); - -/* sys/setitimer.c */ -int setitimer __P((int w, struct itimerval *v, struct itimerval *ov)); - -/* sys/settimeofday.c */ -int settimeofday __P((struct timeval *t, struct timezone *z)); - -/* sys/utimes.c */ -int utimes __P((char *f, struct timeval t[2])); -#endif - +#include #endif diff --git a/lib/libstdc/sys/timeb.h b/lib/libstdc/sys/timeb.h index c9a8e3f..47ee0e2 100644 --- a/lib/libstdc/sys/timeb.h +++ b/lib/libstdc/sys/timeb.h @@ -1,8 +1,3 @@ -#ifndef _SYS_TIMEB_H_ -#define _SYS_TIMEB_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,24 +9,10 @@ /* * Structure returned by ftime system call */ -struct timeb { +struct timeb +{ time_t time; unsigned short millitm; short timezone; short dstflag; }; - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* compat-4.1/ftime.c */ -int ftime __P((register struct timeb *tp)); -#endif - -#endif diff --git a/lib/libstdc/sys/times.h b/lib/libstdc/sys/times.h index a4d9a4e..546e7d1 100644 --- a/lib/libstdc/sys/times.h +++ b/lib/libstdc/sys/times.h @@ -1,8 +1,3 @@ -#ifndef _SYS_TIMES_H_ -#define _SYS_TIMES_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -20,18 +15,3 @@ struct tms { time_t tms_cutime; /* user time, children */ time_t tms_cstime; /* system time, children */ }; - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* compat-4.1/times.c */ -int times __P((register struct tms *tmsp)); -#endif - -#endif diff --git a/lib/libstdc/sys/trace.h b/lib/libstdc/sys/trace.h index 94edc15..2e3e47f 100644 --- a/lib/libstdc/sys/trace.h +++ b/lib/libstdc/sys/trace.h @@ -1,7 +1,3 @@ -#ifndef _SYS_TRACE_H_ -#define _SYS_TRACE_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -88,5 +84,3 @@ int tracewhich; #define trace(a,b,b) ; #endif #endif - -#endif diff --git a/lib/libstdc/sys/truncate.c b/lib/libstdc/sys/truncate.c index 89a690d..9450545 100644 --- a/lib/libstdc/sys/truncate.c +++ b/lib/libstdc/sys/truncate.c @@ -1,7 +1,4 @@ -#include -#include #include - int truncate(p, l) char *p; off_t l; { abort(); } diff --git a/lib/libstdc/sys/tty.h b/lib/libstdc/sys/tty.h index fd97561..44e1d80 100644 --- a/lib/libstdc/sys/tty.h +++ b/lib/libstdc/sys/tty.h @@ -1,10 +1,3 @@ -#ifndef _SYS_TTY_H_ -#define _SYS_TTY_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,11 +7,11 @@ */ #ifdef KERNEL -/*#include "ttychars.h"*/ -/*#include "ttydev.h"*/ +#include "ttychars.h" +#include "ttydev.h" #else -/*#include */ -/*#include */ +#include +#include #endif /* @@ -74,42 +67,23 @@ struct tty { char t_col; /* tty */ char t_ispeed, t_ospeed; /* device */ char t_rocount, t_rocol; /* tty */ - /* Nick replaced this */ - /*struct ttychars t_chars;*/ /* tty */ - /* with this */ - char t_erase; /* erase last character */ - char t_kill; /* erase entire line */ - char t_intrc; /* interrupt */ - char t_quitc; /* quit */ - char t_startc; /* start output */ - char t_stopc; /* stop output */ - char t_eofc; /* end-of-file */ - char t_brkc; /* input delimiter (like nl) */ - char t_suspc; /* stop process signal */ - char t_dsuspc; /* delayed stop process signal */ - char t_rprntc; /* reprint line */ - char t_flushc; /* flush output (toggles) */ - char t_werasc; /* word erase */ - char t_lnextc; /* literal next character */ - /* to here */ + struct ttychars t_chars; /* tty */ struct winsize t_winsize; /* window size */ -/* Nick removed these due to conflict with sys/ioctl.h */ /* be careful of tchars & co. */ -/*#define t_erase t_chars.tc_erase*/ -/*#define t_kill t_chars.tc_kill*/ -/*#define t_intrc t_chars.tc_intrc*/ -/*#define t_quitc t_chars.tc_quitc*/ -/*#define t_startc t_chars.tc_startc*/ -/*#define t_stopc t_chars.tc_stopc*/ -/*#define t_eofc t_chars.tc_eofc*/ -/*#define t_brkc t_chars.tc_brkc*/ -/*#define t_suspc t_chars.tc_suspc*/ -/*#define t_dsuspc t_chars.tc_dsuspc*/ -/*#define t_rprntc t_chars.tc_rprntc*/ -/*#define t_flushc t_chars.tc_flushc*/ -/*#define t_werasc t_chars.tc_werasc*/ -/*#define t_lnextc t_chars.tc_lnextc*/ -/* to here */ +#define t_erase t_chars.tc_erase +#define t_kill t_chars.tc_kill +#define t_intrc t_chars.tc_intrc +#define t_quitc t_chars.tc_quitc +#define t_startc t_chars.tc_startc +#define t_stopc t_chars.tc_stopc +#define t_eofc t_chars.tc_eofc +#define t_brkc t_chars.tc_brkc +#define t_suspc t_chars.tc_suspc +#define t_dsuspc t_chars.tc_dsuspc +#define t_rprntc t_chars.tc_rprntc +#define t_flushc t_chars.tc_flushc +#define t_werasc t_chars.tc_werasc +#define t_lnextc t_chars.tc_lnextc }; #define TTIPRI 28 @@ -161,5 +135,3 @@ extern struct ttychars ttydefaults; #define TAB 4 #define VTAB 5 #define RETURN 6 - -#endif diff --git a/lib/libstdc/sys/ttychars.h b/lib/libstdc/sys/ttychars.h index f7d6f25..feb26a1 100644 --- a/lib/libstdc/sys/ttychars.h +++ b/lib/libstdc/sys/ttychars.h @@ -1,7 +1,3 @@ -#ifndef _SYS_TTYCHARS_H_ -#define _SYS_TTYCHARS_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,8 +10,8 @@ * User visible structures and constants * related to terminal handling. */ -/*#ifndef _TTYCHARS_*/ -/*#define _TTYCHARS_*/ +#ifndef _TTYCHARS_ +#define _TTYCHARS_ struct ttychars { char tc_erase; /* erase last character */ char tc_kill; /* erase entire line */ @@ -51,6 +47,4 @@ struct ttychars { #define CFLUSH CTRL(o) #define CWERASE CTRL(w) #define CLNEXT CTRL(v) -/*#endif*/ - #endif diff --git a/lib/libstdc/sys/ttydev.h b/lib/libstdc/sys/ttydev.h index 5bc5b5c..0ccd9a3 100644 --- a/lib/libstdc/sys/ttydev.h +++ b/lib/libstdc/sys/ttydev.h @@ -1,7 +1,3 @@ -#ifndef _SYS_TTYDEV_H_ -#define _SYS_TTYDEV_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -13,8 +9,8 @@ /* * Terminal definitions related to underlying hardware. */ -/*#ifndef _TTYDEV_*/ -/*#define _TTYDEV_*/ +#ifndef _TTYDEV_ +#define _TTYDEV_ /* * Speeds @@ -52,6 +48,4 @@ #define DMBIC 2 #define DMGET 3 #endif -/*#endif*/ - #endif diff --git a/lib/libstdc/sys/types.h b/lib/libstdc/sys/types.h index 668369d..75ce112 100644 --- a/lib/libstdc/sys/types.h +++ b/lib/libstdc/sys/types.h @@ -1,8 +1,3 @@ -#ifndef _SYS_TYPES_H_ -#define _SYS_TYPES_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,8 +6,8 @@ * @(#)types.h 7.1 (Berkeley) 6/4/86 */ -/*#ifndef _TYPES_*/ -/*#define _TYPES_*/ +#ifndef _TYPES_ +#define _TYPES_ /* * Basic system types and major/minor device constructing/busting macros. */ @@ -50,32 +45,32 @@ typedef long off_t; typedef u_short uid_t; typedef u_short gid_t; -#define NBBY 8 /* number of bits in a byte */ +/* moved this to sys/param.h */ +/*#define NBBY 8*/ /* number of bits in a byte */ +/* moved this to sys/select.h */ /* * Select uses bit masks of file descriptors in longs. * These macros manipulate such bit fields (the filesystem macros use chars). * FD_SETSIZE may be defined by the user, but the default here * should be >= NOFILE (param.h). */ -#ifndef FD_SETSIZE -#define FD_SETSIZE 256 -#endif - -typedef long fd_mask; -#define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ -#ifndef howmany -#define howmany(x, y) (((x)+((y)-1))/(y)) -#endif +/*#ifndef FD_SETSIZE*/ +/*#define FD_SETSIZE 256*/ +/*#endif*/ -typedef struct fd_set { - fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; -} fd_set; +/*typedef long fd_mask;*/ +/*#define NFDBITS (sizeof(fd_mask) * NBBY)*/ /* bits per mask */ +/*#ifndef howmany*/ +/*#define howmany(x, y) (((x)+((y)-1))/(y))*/ +/*#endif*/ -#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) -#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) -#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) -#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) +/*typedef struct fd_set {*/ +/* fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)];*/ +/*} fd_set;*/ -/*#endif*/ +/*#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS)))*/ +/*#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS)))*/ +/*#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS)))*/ +/*#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p)))*/ #endif diff --git a/lib/libstdc/sys/uio.h b/lib/libstdc/sys/uio.h index 0ba8831..5efd22b 100644 --- a/lib/libstdc/sys/uio.h +++ b/lib/libstdc/sys/uio.h @@ -1,8 +1,3 @@ -#ifndef _SYS_UIO_H_ -#define _SYS_UIO_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,8 +6,8 @@ * @(#)uio.h 7.1 (Berkeley) 6/4/86 */ -/*#ifndef _UIO_*/ -/*#define _UIO_*/ +#ifndef _UIO_ +#define _UIO_ struct iovec { caddr_t iov_base; @@ -35,22 +30,4 @@ enum uio_rw { UIO_READ, UIO_WRITE }; #define UIO_USERSPACE 0 /* from user data space */ #define UIO_SYSSPACE 1 /* from system space */ #define UIO_USERISPACE 2 /* from user I space */ -/*#endif*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* sys/readv.c */ -int readv __P((int d, struct iovec *v, int l)); - -/* sys/writev.c */ -int writev __P((int f, struct iovec *v, int l)); -#endif - #endif diff --git a/lib/libstdc/sys/umask.c b/lib/libstdc/sys/umask.c index 4c9753b..55a6d9f 100644 --- a/lib/libstdc/sys/umask.c +++ b/lib/libstdc/sys/umask.c @@ -1,6 +1,3 @@ -#include -#include - -int umask(n) int n; { +int umask(n) { abort(); } diff --git a/lib/libstdc/sys/umount.c b/lib/libstdc/sys/umount.c index 37bab9a..ec31be9 100644 --- a/lib/libstdc/sys/umount.c +++ b/lib/libstdc/sys/umount.c @@ -1,6 +1,3 @@ -#include -#include - int umount(s) char *s; { abort(); } diff --git a/lib/libstdc/sys/un.h b/lib/libstdc/sys/un.h index dadb71f..9b7b6ee 100644 --- a/lib/libstdc/sys/un.h +++ b/lib/libstdc/sys/un.h @@ -1,7 +1,3 @@ -#ifndef _SYS_UN_H_ -#define _SYS_UN_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -19,7 +15,5 @@ struct sockaddr_un { }; #ifdef KERNEL -/*int unp_discard();*/ -#endif - +int unp_discard(); #endif diff --git a/lib/libstdc/sys/unlink.c b/lib/libstdc/sys/unlink.c index 4f84696..c97c874 100644 --- a/lib/libstdc/sys/unlink.c +++ b/lib/libstdc/sys/unlink.c @@ -1,6 +1,3 @@ -#include -#include - int unlink(s) char *s; { abort(); } diff --git a/lib/libstdc/sys/unpcb.h b/lib/libstdc/sys/unpcb.h index 39954a3..504b48d 100644 --- a/lib/libstdc/sys/unpcb.h +++ b/lib/libstdc/sys/unpcb.h @@ -1,8 +1,3 @@ -#ifndef _SYS_UNPCB_H_ -#define _SYS_UNPCB_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -49,5 +44,3 @@ struct unpcb { }; #define sotounpcb(so) ((struct unpcb *)((so)->so_pcb)) - -#endif diff --git a/lib/libstdc/sys/user.h b/lib/libstdc/sys/user.h index fb36092..e7cc971 100644 --- a/lib/libstdc/sys/user.h +++ b/lib/libstdc/sys/user.h @@ -1,15 +1,3 @@ -#ifndef _SYS_USER_H_ -#define _SYS_USER_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -19,17 +7,17 @@ */ #ifdef KERNEL -/*#include "../machine/pcb.h"*/ -/*#include "dmap.h"*/ -/*#include "time.h"*/ -/*#include "resource.h"*/ -/*#include "namei.h"*/ +#include "../machine/pcb.h" +#include "dmap.h" +#include "time.h" +#include "resource.h" +#include "namei.h" #else -/*#include */ -/*#include */ -/*#include */ -/*#include */ -/*#include */ +#include +#include +#include +#include +#include #endif /* @@ -143,9 +131,9 @@ struct user { /* u_error codes */ #ifdef KERNEL -/*#include "errno.h"*/ +#include "errno.h" #else -/*#include */ +#include #endif #ifdef KERNEL @@ -157,5 +145,3 @@ extern struct user xswap2utl; extern struct user pushutl; extern struct user vfutl; #endif - -#endif diff --git a/lib/libstdc/sys/utimes.c b/lib/libstdc/sys/utimes.c index 46c4dcc..429b58e 100644 --- a/lib/libstdc/sys/utimes.c +++ b/lib/libstdc/sys/utimes.c @@ -1,6 +1,4 @@ -#include #include - int utimes(f, t) char *f; struct timeval t[2]; { abort(); } diff --git a/lib/libstdc/sys/vadvise.h b/lib/libstdc/sys/vadvise.h index 0497277..81650cf 100644 --- a/lib/libstdc/sys/vadvise.h +++ b/lib/libstdc/sys/vadvise.h @@ -1,7 +1,3 @@ -#ifndef _SYS_VADVISE_H_ -#define _SYS_VADVISE_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -24,5 +20,3 @@ #define VA_ANOM 1 #define VA_SEQL 2 #define VA_FLUSH 3 - -#endif diff --git a/lib/libstdc/sys/vcmd.h b/lib/libstdc/sys/vcmd.h index c2d00a2..58d0255 100644 --- a/lib/libstdc/sys/vcmd.h +++ b/lib/libstdc/sys/vcmd.h @@ -1,8 +1,3 @@ -#ifndef _SYS_VCMD_H_ -#define _SYS_VCMD_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -13,9 +8,9 @@ #ifndef _IOCTL_ #ifdef KERNEL -/*#include "ioctl.h"*/ +#include "ioctl.h" #else -/*#include */ +#include #endif #endif @@ -25,5 +20,3 @@ #define VGETSTATE _IOR(v, 0, int) #define VSETSTATE _IOW(v, 1, int) - -#endif diff --git a/lib/libstdc/sys/vhangup.c b/lib/libstdc/sys/vhangup.c index 5765c8f..b1f66d6 100644 --- a/lib/libstdc/sys/vhangup.c +++ b/lib/libstdc/sys/vhangup.c @@ -1,6 +1,3 @@ -#include -#include - void vhangup() { abort(); } diff --git a/lib/libstdc/sys/vlimit.h b/lib/libstdc/sys/vlimit.h index 2e50d78..25b829a 100644 --- a/lib/libstdc/sys/vlimit.h +++ b/lib/libstdc/sys/vlimit.h @@ -1,7 +1,3 @@ -#ifndef _SYS_VLIMIT_H_ -#define _SYS_VLIMIT_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -24,18 +20,3 @@ #define NLIMITS 6 #define INFINITY 0x7fffffff - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* compat-4.1/vlimit.c */ -int vlimit __P((int limit, int value)); -#endif - -#endif diff --git a/lib/libstdc/sys/vm.h b/lib/libstdc/sys/vm.h index 5e45e07..441e4d1 100644 --- a/lib/libstdc/sys/vm.h +++ b/lib/libstdc/sys/vm.h @@ -1,7 +1,3 @@ -#ifndef _SYS_VM_H_ -#define _SYS_VM_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -16,15 +12,13 @@ * is a quick way to include all the vm header files. */ #ifdef KERNEL -/*#include "vmparam.h"*/ -/*#include "vmmac.h"*/ -/*#include "vmmeter.h"*/ -/*#include "vmsystm.h"*/ +#include "vmparam.h" +#include "vmmac.h" +#include "vmmeter.h" +#include "vmsystm.h" #else -/*#include */ -/*#include */ -/*#include */ -/*#include */ -#endif - +#include +#include +#include +#include #endif diff --git a/lib/libstdc/sys/vmmac.h b/lib/libstdc/sys/vmmac.h index 816587b..6581ea6 100644 --- a/lib/libstdc/sys/vmmac.h +++ b/lib/libstdc/sys/vmmac.h @@ -1,15 +1,3 @@ -#ifndef _SYS_VMMAC_H_ -#define _SYS_VMMAC_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -74,7 +62,7 @@ (((v) < (p)->p_tsize + (p)->p_dsize) ? ((p)->p_p0br + (v)) : \ ((p)->p_addr - (BTOPUSRSTACK - (v)))) #ifdef notdef -/*struct pte *vtopte();*/ +struct pte *vtopte(); #endif /* Bytes to pages without rounding, and back */ @@ -173,8 +161,6 @@ /* * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 */ -/* moved this from sys/vmmac.h to here to avoid a circular dependency */ +/* moved this from sys/vmmac.h to avoid a circular dependency */ #define mapin(pte, v, pfnum, count, prot) \ (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) - -#endif diff --git a/lib/libstdc/sys/vmmeter.h b/lib/libstdc/sys/vmmeter.h index 743b92d..9a04350 100644 --- a/lib/libstdc/sys/vmmeter.h +++ b/lib/libstdc/sys/vmmeter.h @@ -1,7 +1,3 @@ -#ifndef _SYS_VMMETER_H_ -#define _SYS_VMMETER_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -13,7 +9,8 @@ /* * Virtual memory related instrumentation */ -struct vmmeter { +struct vmmeter +{ #define v_first v_swtch unsigned v_swtch; /* context switches */ unsigned v_trap; /* calls to trap */ @@ -53,7 +50,8 @@ struct vmmeter cnt, rate, sum; #endif /* systemwide totals computed every five seconds */ -struct vmtotal { +struct vmtotal +{ short t_rq; /* length of the run queue */ short t_dw; /* jobs in ``disk wait'' (neg priority) */ short t_pw; /* jobs in page wait */ @@ -110,5 +108,3 @@ int rres; unsigned rectime; /* accumulator for reclaim times */ unsigned pgintime; /* accumulator for page in times */ #endif - -#endif diff --git a/lib/libstdc/sys/vmparam.h b/lib/libstdc/sys/vmparam.h index 64e9a4c..deecc6a 100644 --- a/lib/libstdc/sys/vmparam.h +++ b/lib/libstdc/sys/vmparam.h @@ -1,7 +1,3 @@ -#ifndef _SYS_VMPARAM_H_ -#define _SYS_VMPARAM_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -14,9 +10,9 @@ * Machine dependent constants */ #ifdef KERNEL -/*#include "../machine/vmparam.h"*/ +#include "../machine/vmparam.h" #else -/*#include */ +#include #endif #if defined(KERNEL) && !defined(LOCORE) @@ -26,5 +22,3 @@ int klin; int kltxt; int klout; #endif - -#endif diff --git a/lib/libstdc/sys/vmsystm.h b/lib/libstdc/sys/vmsystm.h index 5454f91..972a585 100644 --- a/lib/libstdc/sys/vmsystm.h +++ b/lib/libstdc/sys/vmsystm.h @@ -1,7 +1,3 @@ -#ifndef _SYS_VMSYSTM_H_ -#define _SYS_VMSYSTM_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -37,7 +33,8 @@ int fastscan; /* fastest scan rate, clusters/second */ /* * Fork/vfork accounting. */ -struct forkstat { +struct forkstat +{ int cntfork; int cntvfork; int sizfork; @@ -50,7 +47,8 @@ struct forkstat forkstat; /* * Swap kind accounting. */ -struct swptstat { +struct swptstat +{ int pteasy; /* easy pt swaps */ int ptexpand; /* pt expansion swaps */ int ptshrink; /* pt shrinking swaps */ @@ -59,5 +57,3 @@ struct swptstat { #ifdef KERNEL struct swptstat swptstat; #endif - -#endif diff --git a/lib/libstdc/sys/vsio.h b/lib/libstdc/sys/vsio.h index 6225840..7a6fd1d 100644 --- a/lib/libstdc/sys/vsio.h +++ b/lib/libstdc/sys/vsio.h @@ -1,9 +1,3 @@ -#ifndef _SYS_VSIO_H_ -#define _SYS_VSIO_H_ - -#include -#include - /* @(#)vsio.h 7.1 (MIT) 6/4/86 */ /**************************************************************************** * * @@ -123,5 +117,3 @@ typedef struct _vsIoAddr { vsBox mbox; /* atomic read/write */ } vsIoAddr; typedef vsIoAddr *vsIoAddrAddr; - -#endif diff --git a/lib/libstdc/sys/vtimes.h b/lib/libstdc/sys/vtimes.h index 25bbc9a..f970bd3 100644 --- a/lib/libstdc/sys/vtimes.h +++ b/lib/libstdc/sys/vtimes.h @@ -1,7 +1,3 @@ -#ifndef _SYS_VTIMES_H_ -#define _SYS_VTIMES_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -32,18 +28,3 @@ struct vtimes { #ifdef KERNEL #endif - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* compat-4.1/vtimes.c */ -int vtimes __P((register struct vtimes *par, register struct vtimes *chi)); -#endif - -#endif diff --git a/lib/libstdc/sys/wait.c b/lib/libstdc/sys/wait.c index 402d6f8..8aa4e9c 100644 --- a/lib/libstdc/sys/wait.c +++ b/lib/libstdc/sys/wait.c @@ -1,6 +1,4 @@ -#include #include - int wait(s) union wait *s; { abort(); } diff --git a/lib/libstdc/sys/wait.h b/lib/libstdc/sys/wait.h index 853d7b7..ff44983 100644 --- a/lib/libstdc/sys/wait.h +++ b/lib/libstdc/sys/wait.h @@ -1,8 +1,3 @@ -#ifndef _SYS_WAIT_H_ -#define _SYS_WAIT_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -69,21 +64,3 @@ union wait { #define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED) #define WIFSIGNALED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig != 0) #define WIFEXITED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig == 0) - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -#ifndef KERNEL -/* sys/wait3.c */ -int wait3 __P((union wait *s, int o, struct rusage *r)); - -/* sys/wait.c */ -int wait __P((union wait *s)); -#endif - -#endif diff --git a/lib/libstdc/sys/wait3.c b/lib/libstdc/sys/wait3.c index afb5103..9f1f624 100644 --- a/lib/libstdc/sys/wait3.c +++ b/lib/libstdc/sys/wait3.c @@ -1,7 +1,5 @@ -#include #include #include - -int wait3(s, o, r) union wait *s; int o; struct rusage *r; { +int wait3(s, o, r) union wait *s; struct rusage *r; { abort(); } diff --git a/lib/libstdc/sys/write.c b/lib/libstdc/sys/write.c index 7e63c35..057bd5c 100644 --- a/lib/libstdc/sys/write.c +++ b/lib/libstdc/sys/write.c @@ -1,6 +1,3 @@ -#include -#include - -int write(f, b, l) int f; char *b; int l; { +int write(f, b, l) char *b; { abort(); } diff --git a/lib/libstdc/sys/writev.c b/lib/libstdc/sys/writev.c index 4ac1f50..4a6e26c 100644 --- a/lib/libstdc/sys/writev.c +++ b/lib/libstdc/sys/writev.c @@ -1,6 +1,4 @@ -#include #include - -int writev(f, v, l) int f; struct iovec *v; int l; { +int writev(f, v, l) struct iovec *v; { abort(); } diff --git a/lib/libstdc/sys_h.patch b/lib/libstdc/sys_h.patch deleted file mode 100644 index 884e3c0..0000000 --- a/lib/libstdc/sys_h.patch +++ /dev/null @@ -1,112 +0,0 @@ -diff --git a/sys/h/dir.h b/sys/h/dir.h -index aaf362a..913a549 100644 ---- a/sys/h/dir.h -+++ b/sys/h/dir.h -@@ -32,9 +32,9 @@ - * dp->d_ino set to 0. - */ - /* so user programs can just include dir.h */ --#if !defined(KERNEL) && !defined(DEV_BSIZE) --#define DEV_BSIZE 512 --#endif -+/*#if !defined(KERNEL) && !defined(DEV_BSIZE)*/ -+/*#define DEV_BSIZE 512*/ -+/*#endif*/ - #define DIRBLKSIZ DEV_BSIZE - #define MAXNAMLEN 255 - -diff --git a/sys/h/param.h b/sys/h/param.h -index f7c5c2a..2615196 100644 ---- a/sys/h/param.h -+++ b/sys/h/param.h -@@ -174,9 +174,10 @@ - /* - * Macros for counting and rounding. - */ --#ifndef howmany --#define howmany(x, y) (((x)+((y)-1))/(y)) --#endif -+/* this is defined in sys/types.h which must be included anyway */ -+/*#ifndef howmany*/ -+/*#define howmany(x, y) (((x)+((y)-1))/(y))*/ -+/*#endif*/ - #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) - - /* -diff --git a/sys/h/tty.h b/sys/h/tty.h -index 44e1d80..29a6ca4 100644 ---- a/sys/h/tty.h -+++ b/sys/h/tty.h -@@ -67,23 +67,42 @@ struct tty { - char t_col; /* tty */ - char t_ispeed, t_ospeed; /* device */ - char t_rocount, t_rocol; /* tty */ -- struct ttychars t_chars; /* tty */ -+ /* Nick replaced this */ -+ /*struct ttychars t_chars;*/ /* tty */ -+ /* with this */ -+ char t_erase; /* erase last character */ -+ char t_kill; /* erase entire line */ -+ char t_intrc; /* interrupt */ -+ char t_quitc; /* quit */ -+ char t_startc; /* start output */ -+ char t_stopc; /* stop output */ -+ char t_eofc; /* end-of-file */ -+ char t_brkc; /* input delimiter (like nl) */ -+ char t_suspc; /* stop process signal */ -+ char t_dsuspc; /* delayed stop process signal */ -+ char t_rprntc; /* reprint line */ -+ char t_flushc; /* flush output (toggles) */ -+ char t_werasc; /* word erase */ -+ char t_lnextc; /* literal next character */ -+ /* to here */ - struct winsize t_winsize; /* window size */ -+/* Nick removed these due to conflict with sys/ioctl.h */ - /* be careful of tchars & co. */ --#define t_erase t_chars.tc_erase --#define t_kill t_chars.tc_kill --#define t_intrc t_chars.tc_intrc --#define t_quitc t_chars.tc_quitc --#define t_startc t_chars.tc_startc --#define t_stopc t_chars.tc_stopc --#define t_eofc t_chars.tc_eofc --#define t_brkc t_chars.tc_brkc --#define t_suspc t_chars.tc_suspc --#define t_dsuspc t_chars.tc_dsuspc --#define t_rprntc t_chars.tc_rprntc --#define t_flushc t_chars.tc_flushc --#define t_werasc t_chars.tc_werasc --#define t_lnextc t_chars.tc_lnextc -+/*#define t_erase t_chars.tc_erase*/ -+/*#define t_kill t_chars.tc_kill*/ -+/*#define t_intrc t_chars.tc_intrc*/ -+/*#define t_quitc t_chars.tc_quitc*/ -+/*#define t_startc t_chars.tc_startc*/ -+/*#define t_stopc t_chars.tc_stopc*/ -+/*#define t_eofc t_chars.tc_eofc*/ -+/*#define t_brkc t_chars.tc_brkc*/ -+/*#define t_suspc t_chars.tc_suspc*/ -+/*#define t_dsuspc t_chars.tc_dsuspc*/ -+/*#define t_rprntc t_chars.tc_rprntc*/ -+/*#define t_flushc t_chars.tc_flushc*/ -+/*#define t_werasc t_chars.tc_werasc*/ -+/*#define t_lnextc t_chars.tc_lnextc*/ -+/* to here */ - }; - - #define TTIPRI 28 -diff --git a/sys/h/vmmac.h b/sys/h/vmmac.h -index 99d965c..3307c1d 100644 ---- a/sys/h/vmmac.h -+++ b/sys/h/vmmac.h -@@ -157,3 +157,10 @@ struct pte *vtopte(); - } \ - c->c_lock = 0; \ - } -+ -+/* -+ * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 -+ */ -+/* moved this from sys/vmmac.h to here to avoid a circular dependency */ -+#define mapin(pte, v, pfnum, count, prot) \ -+ (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) diff --git a/lib/libstdc/sys_netinet.patch b/lib/libstdc/sys_netinet.patch deleted file mode 100644 index b9c2c00..0000000 --- a/lib/libstdc/sys_netinet.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff --git a/sys/netinet/in.h b/sys/netinet/in.h -index 4abef17..2b2d716 100644 ---- a/sys/netinet/in.h -+++ b/sys/netinet/in.h -@@ -90,20 +90,22 @@ struct sockaddr_in { - */ - #define IP_OPTIONS 1 /* set/get IP per-packet options */ - --#if !defined(vax) && !defined(ntohl) && !defined(lint) -+/* this needs to be rationalized, remove for now */ - /* - * Macros for number representation conversion. - */ --#define ntohl(x) (x) --#define ntohs(x) (x) --#define htonl(x) (x) --#define htons(x) (x) --#endif -- --#if !defined(ntohl) && (defined(vax) || defined(lint)) --u_short ntohs(), htons(); --u_long ntohl(), htonl(); --#endif -+/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/ -+/*#define ntohl(x) (x)*/ -+/*#define ntohs(x) (x)*/ -+/*#define htonl(x) (x)*/ -+/*#define htons(x) (x)*/ -+/*#endif*/ -+ -+/*#if !defined(ntohl) && (defined(vax) || defined(lint))*/ -+/*u_short ntohs(), htons();*/ -+/*u_long ntohl(), htonl();*/ -+/*#endif*/ -+/* to here */ - - #ifdef KERNEL - extern struct domain inetdomain; -diff --git a/sys/netinet/ip.h b/sys/netinet/ip.h -index 17d93e4..809778c 100644 ---- a/sys/netinet/ip.h -+++ b/sys/netinet/ip.h -@@ -81,7 +81,7 @@ struct ip_timestamp { - struct in_addr ipt_addr; - n_long ipt_time; - } ipt_ta[1]; -- } -+ }; - }; - - /* flag bits for ipt_flg */ -diff --git a/sys/netinet/tcp.h b/sys/netinet/tcp.h -index 3f2f4d3..f0f12a5 100644 ---- a/sys/netinet/tcp.h -+++ b/sys/netinet/tcp.h -@@ -44,7 +44,7 @@ struct tcphdr { - #ifdef lint - #define TCP_MSS 536 - #else --#define TCP_MSS MIN(512, IP_MSS - sizeof (struct tcpiphdr)) -+#define TCP_MSS MIN(512, IP_MSS - /*sizeof (struct tcpiphdr)*/(sizeof(struct ipovly) + sizeof(struct tcphdr))) - #endif - - /* diff --git a/lib/libstdc/sys_netns.patch b/lib/libstdc/sys_netns.patch deleted file mode 100644 index 857ce8e..0000000 --- a/lib/libstdc/sys_netns.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/sys/netns/ns.h b/sys/netns/ns.h -index 63b8a86..2071eb5 100644 ---- a/sys/netns/ns.h -+++ b/sys/netns/ns.h -@@ -103,20 +103,22 @@ struct sockaddr_ns { - #define ns_nullhost(x) (((x).x_host.s_host[0]==0) && \ - ((x).x_host.s_host[1]==0) && ((x).x_host.s_host[2]==0)) - --#if !defined(vax) && !defined(ntohl) && !defined(lint) -+/* this needs to be rationalized, remove for now */ - /* - * Macros for number representation conversion. - */ --#define ntohl(x) (x) --#define ntohs(x) (x) --#define htonl(x) (x) --#define htons(x) (x) --#endif -- --#if !defined(ntohl) && (defined(vax) || defined(lint)) --u_short ntohs(), htons(); --u_long ntohl(), htonl(); --#endif -+/*#if !defined(vax) && !defined(ntohl) && !defined(lint)*/ -+/*#define ntohl(x) (x)*/ -+/*#define ntohs(x) (x)*/ -+/*#define htonl(x) (x)*/ -+/*#define htons(x) (x)*/ -+/*#endif*/ -+ -+/*#if !defined(ntohl) && (defined(vax) || defined(lint))*/ -+/*u_short ntohs(), htons();*/ -+/*u_long ntohl(), htonl();*/ -+/*#endif*/ -+/* to here */ - - #ifdef KERNEL - extern struct domain nsdomain; diff --git a/lib/libstdc/sys_vax.patch b/lib/libstdc/sys_vax.patch deleted file mode 100644 index e7748a1..0000000 --- a/lib/libstdc/sys_vax.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/sys/vax/vmparam.h b/sys/vax/vmparam.h -index ed0f50e..613f4f9 100644 ---- a/sys/vax/vmparam.h -+++ b/sys/vax/vmparam.h -@@ -156,5 +156,6 @@ - /* - * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 - */ --#define mapin(pte, v, pfnum, count, prot) \ -- (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v))) -+/* moved this from here to sys/vmmac.h to avoid a circular dependency */ -+/*#define mapin(pte, v, pfnum, count, prot) \ -+ (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v)))*/ diff --git a/lib/libstdc/syscall.h b/lib/libstdc/syscall.h index b8ecd28..89ceabe 100644 --- a/lib/libstdc/syscall.h +++ b/lib/libstdc/syscall.h @@ -1,7 +1,3 @@ -#ifndef _SYSCALL_H_ -#define _SYSCALL_H_ - - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -160,5 +156,3 @@ #define SYS_setquota 148 #define SYS_quota 149 #define SYS_getsockname 150 - -#endif diff --git a/lib/libstdc/sysexits.h b/lib/libstdc/sysexits.h index 75bd95d..dc4a9ff 100644 --- a/lib/libstdc/sysexits.h +++ b/lib/libstdc/sysexits.h @@ -1,7 +1,3 @@ -#ifndef _SYSEXITS_H_ -#define _SYSEXITS_H_ - - /* ** SYSEXITS.H -- Exit status codes for system programs. ** @@ -84,5 +80,3 @@ # define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */ # define EX_PROTOCOL 76 /* remote error in protocol */ # define EX_NOPERM 77 /* permission denied */ - -#endif diff --git a/lib/libstdc/syslog.h b/lib/libstdc/syslog.h new file mode 120000 index 0000000..11b106a --- /dev/null +++ b/lib/libstdc/syslog.h @@ -0,0 +1 @@ +sys/syslog.h \ No newline at end of file diff --git a/lib/libstdc/time.h b/lib/libstdc/time.h index 542aa81..8eb62c0 100644 --- a/lib/libstdc/time.h +++ b/lib/libstdc/time.h @@ -1,8 +1,3 @@ -#ifndef _TIME_H_ -#define _TIME_H_ - -#include - /* time.h 1.1 85/03/13 */ /* @@ -20,22 +15,5 @@ struct tm { int tm_isdst; }; -/*extern struct tm *gmtime(), *localtime();*/ -/*extern char *asctime(), *ctime();*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* gen/ctime.c */ -char *ctime __P((time_t *t)); -struct tm *localtime __P((time_t *tim)); -struct tm *gmtime __P((time_t *tim)); -char *asctime __P((struct tm *t)); -int dysize __P((int y)); - -#endif +extern struct tm *gmtime(), *localtime(); +extern char *asctime(), *ctime(); diff --git a/lib/libstdc/ttyent.h b/lib/libstdc/ttyent.h index 41e3de9..f7e0835 100644 --- a/lib/libstdc/ttyent.h +++ b/lib/libstdc/ttyent.h @@ -1,7 +1,3 @@ -#ifndef _TTYENT_H_ -#define _TTYENT_H_ - - /* * Copyright (c) 1983 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -22,23 +18,5 @@ struct ttyent { /* see getttyent(3) */ #define TTY_ON 0x1 /* enable logins (startup getty) */ #define TTY_SECURE 0x2 /* allow root to login */ -/*extern struct ttyent *getttyent();*/ -/*extern struct ttyent *getttynam();*/ - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* gen/getttyent.c */ -int setttyent __P((void)); -int endttyent __P((void)); -struct ttyent *getttyent __P((void)); - -/* gen/getttynam.c */ -struct ttyent *getttynam __P((char *tty)); - -#endif +extern struct ttyent *getttyent(); +extern struct ttyent *getttynam(); diff --git a/lib/libstdc/unported.txt b/lib/libstdc/unported.txt new file mode 100644 index 0000000..96d5ecb --- /dev/null +++ b/lib/libstdc/unported.txt @@ -0,0 +1,10 @@ +vax/compat-4.1/reset.s +vax/sys/Ovfork.s +vax/sys/syscall.s +vax/sys/Ovadvise.s +vax/sys/cerror.s +vax/gen/udiv.s +vax/gen/fabs.s +vax/gen/urem.s +vax/gen/alloca.s +vax/gen/nargs.s diff --git a/lib/libstdc/utmp.h b/lib/libstdc/utmp.h index 31edcd0..c45b1f2 100644 --- a/lib/libstdc/utmp.h +++ b/lib/libstdc/utmp.h @@ -1,7 +1,3 @@ -#ifndef _UTMP_H_ -#define _UTMP_H_ - - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -21,22 +17,3 @@ struct utmp { char ut_host[16]; /* host name, if remote */ long ut_time; /* time on */ }; - -#ifndef __P -#ifdef __STDC__ -#define __P(args) args -#else -#define __P(args) () -#endif -#endif - -/* gen/getlogin.c */ -char *getlogin __P((void)); - -/* gen/ttyname.c */ -char *ttyname __P((int f)); - -/* gen/ttyslot.c */ -int ttyslot __P((void)); - -#endif diff --git a/lib/libstdc/varargs.h b/lib/libstdc/varargs.h index caa6616..3a081f5 100644 --- a/lib/libstdc/varargs.h +++ b/lib/libstdc/varargs.h @@ -1,7 +1,3 @@ -#ifndef _VARARGS_H_ -#define _VARARGS_H_ - - /* varargs.h 4.1 83/05/03 */ typedef char *va_list; @@ -9,5 +5,3 @@ typedef char *va_list; # define va_start(list) list = (char *) &va_alist # define va_end(list) # define va_arg(list,mode) ((mode *)(list += sizeof(mode)))[-1] - -#endif diff --git a/lib/libstdc/vax/clock.h b/lib/libstdc/vax/clock.h index e70f12f..67a3f95 100644 --- a/lib/libstdc/vax/clock.h +++ b/lib/libstdc/vax/clock.h @@ -1,8 +1,3 @@ -#ifndef _VAX_CLOCK_H_ -#define _VAX_CLOCK_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -42,5 +37,3 @@ * Software clock is software interrupt level 8, * implemented as mtpr(SIRR, 0x8) in asm.sed. */ - -#endif diff --git a/lib/libstdc/vax/cons.h b/lib/libstdc/vax/cons.h index ce8e685..f947eb4 100644 --- a/lib/libstdc/vax/cons.h +++ b/lib/libstdc/vax/cons.h @@ -1,7 +1,3 @@ -#ifndef _VAX_CONS_H_ -#define _VAX_CONS_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -41,5 +37,3 @@ #define TXDB_BOOT 0x02 /* reboot */ #define TXDB_CWSI 0x03 /* clear warm start inhibit */ #define TXDB_CCSI 0x04 /* clear cold-start inhibit */ - -#endif diff --git a/lib/libstdc/vax/cpu.h b/lib/libstdc/vax/cpu.h index 8835cef..3acf3fc 100644 --- a/lib/libstdc/vax/cpu.h +++ b/lib/libstdc/vax/cpu.h @@ -1,8 +1,3 @@ -#ifndef _VAX_CPU_H_ -#define _VAX_CPU_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -11,7 +6,7 @@ * @(#)cpu.h 7.1 (Berkeley) 6/5/86 */ -/*#ifndef LOCORE*/ +#ifndef LOCORE /* * Cpu identification, from SID register. */ @@ -113,6 +108,4 @@ struct nexusconnect { int cpu; struct percpu percpu[]; #endif -/*#endif*/ - #endif diff --git a/lib/libstdc/vax/crl.h b/lib/libstdc/vax/crl.h index 8c7ea0d..8759364 100644 --- a/lib/libstdc/vax/crl.h +++ b/lib/libstdc/vax/crl.h @@ -1,7 +1,3 @@ -#ifndef _VAX_CRL_H_ -#define _VAX_CRL_H_ - - /* * @(#)crl.h 7.1 (Berkeley) 6/5/86 */ @@ -81,5 +77,3 @@ #define CRLCS_BITS \ "\20\20CE\17DE\16NXM\15DLT\14DCRC\13OPI\1DRDY" #endif - -#endif diff --git a/lib/libstdc/vax/dkio.h b/lib/libstdc/vax/dkio.h index 23fb2ed..acd4a58 100644 --- a/lib/libstdc/vax/dkio.h +++ b/lib/libstdc/vax/dkio.h @@ -1,8 +1,3 @@ -#ifndef _VAX_DKIO_H_ -#define _VAX_DKIO_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -21,5 +16,3 @@ /* disk io control commands */ #define DKIOCHDR _IO(d, 1) /* next I/O will read/write header */ - -#endif diff --git a/lib/libstdc/vax/flp.h b/lib/libstdc/vax/flp.h index 2577524..faceb76 100644 --- a/lib/libstdc/vax/flp.h +++ b/lib/libstdc/vax/flp.h @@ -1,7 +1,3 @@ -#ifndef _VAX_FLP_H_ -#define _VAX_FLP_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -53,5 +49,3 @@ #define FL_OPEN 1 #define FL_BUSY 2 #endif - -#endif diff --git a/lib/libstdc/vax/frame.h b/lib/libstdc/vax/frame.h index 750c2b3..347e6a9 100644 --- a/lib/libstdc/vax/frame.h +++ b/lib/libstdc/vax/frame.h @@ -1,8 +1,3 @@ -#ifndef _VAX_FRAME_H_ -#define _VAX_FRAME_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -25,5 +20,3 @@ struct frame { int fr_savfp; /* saved frame pointer */ int fr_savpc; /* saved program counter */ }; - -#endif diff --git a/lib/libstdc/vax/inline/inline.h b/lib/libstdc/vax/inline/inline.h index 0a6fb87..909e73a 100644 --- a/lib/libstdc/vax/inline/inline.h +++ b/lib/libstdc/vax/inline/inline.h @@ -1,7 +1,3 @@ -#ifndef _VAX_INLINE_INLINE_H_ -#define _VAX_INLINE_INLINE_H_ - - /* * Copyright (c) 1984, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -82,6 +78,4 @@ extern struct inststoptbl inststoptable[]; /* * Miscellaneous functions. */ -/*char *newline(), *copyline(), *doreplaceon();*/ - -#endif +char *newline(), *copyline(), *doreplaceon(); diff --git a/lib/libstdc/vax/ioa.h b/lib/libstdc/vax/ioa.h index 6e41553..e2e7ff2 100644 --- a/lib/libstdc/vax/ioa.h +++ b/lib/libstdc/vax/ioa.h @@ -1,8 +1,3 @@ -#ifndef _VAX_IOA_H_ -#define _VAX_IOA_H_ - -#include - /* * @(#)ioa.h 7.1 (Berkeley) 6/5/86 */ @@ -38,7 +33,8 @@ #define IOA8600(i) ((caddr_t)(0x20080000+IOASIZE*i)) #ifndef LOCORE -struct sbia_regs { +struct sbia_regs +{ int sbi_cfg; int sbi_csr; int sbi_errsum; @@ -85,10 +81,8 @@ struct ioa { }; #ifdef KERNEL struct ioa ioa[MAXNIOA]; -#endif -#endif +#endif KERNEL +#endif LOCORE #define IOA_TYPMSK 0xf0 #define IOA_SBIA 0x10 - -#endif diff --git a/lib/libstdc/vax/ka630.h b/lib/libstdc/vax/ka630.h index 871ee32..8d1a331 100644 --- a/lib/libstdc/vax/ka630.h +++ b/lib/libstdc/vax/ka630.h @@ -1,8 +1,3 @@ -#ifndef _VAX_KA630_H_ -#define _VAX_KA630_H_ - -#include - /* * @(#)ka630.h 7.1 (Berkeley) 6/5/86 * @@ -81,5 +76,3 @@ struct ka630cpu { }; #endif #endif - -#endif diff --git a/lib/libstdc/vax/machparam.h b/lib/libstdc/vax/machparam.h index 2e6dac2..04cec5d 100644 --- a/lib/libstdc/vax/machparam.h +++ b/lib/libstdc/vax/machparam.h @@ -1,8 +1,3 @@ -#ifndef _VAX_MACHPARAM_H_ -#define _VAX_MACHPARAM_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -56,8 +51,6 @@ int cpuspeed; #endif #define DELAY(n) { register int N = cpuspeed * (n); while (--N > 0); } -#else +#else KERNEL #define DELAY(n) { register int N = (n); while (--N > 0); } -#endif - -#endif +#endif KERNEL diff --git a/lib/libstdc/vax/mem.h b/lib/libstdc/vax/mem.h index c8e3ad7..e89add7 100644 --- a/lib/libstdc/vax/mem.h +++ b/lib/libstdc/vax/mem.h @@ -1,8 +1,3 @@ -#ifndef _VAX_MEM_H_ -#define _VAX_MEM_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -88,7 +83,7 @@ struct mcr { \5WR_DT_PE_B0\4CHE_RD_DT_PE\3CHE_SEL\2ANY_REFL\1CP_BW_CHE_DT_PE" #define M8600_MSTAT2_BITS "\20\20CP_BYT_WR\17ABUS_BD_DT_CODE\10MULT_ERR\ \7CHE_TAG_PE\6CHE_TAG_W_PE\5CHE_WRTN_BIT\4NXM\3CP-IO_BUF_ERR\2MBOX_LOCK" -#endif +#endif VAX8600 #if VAX780 #define M780_ICRD 0x40000000 /* inhibit crd interrupts, in [2] */ @@ -173,5 +168,3 @@ int nmcr; struct mcr *mcraddr[MAXNMCR]; int mcrtype[MAXNMCR]; #endif - -#endif diff --git a/lib/libstdc/vax/mscp.h b/lib/libstdc/vax/mscp.h index 1c77cc8..e821159 100644 --- a/lib/libstdc/vax/mscp.h +++ b/lib/libstdc/vax/mscp.h @@ -1,8 +1,3 @@ -#ifndef _VAX_MSCP_H_ -#define _VAX_MSCP_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -323,5 +318,3 @@ struct mslg { #define mslg_busaddr mslg_unitid.val[0] #define mslg_sdecyl mslg_group - -#endif diff --git a/lib/libstdc/vax/mtpr.h b/lib/libstdc/vax/mtpr.h index 1298614..eeb0ca1 100644 --- a/lib/libstdc/vax/mtpr.h +++ b/lib/libstdc/vax/mtpr.h @@ -1,7 +1,3 @@ -#ifndef _VAX_MTPR_H_ -#define _VAX_MTPR_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -95,5 +91,3 @@ #define IUR 0x37 /* init unibus register */ #define TB 0x3b /* translation buffer */ #endif - -#endif diff --git a/lib/libstdc/vax/nexus.h b/lib/libstdc/vax/nexus.h index e2ff63e..7bb6217 100644 --- a/lib/libstdc/vax/nexus.h +++ b/lib/libstdc/vax/nexus.h @@ -1,8 +1,3 @@ -#ifndef _VAX_NEXUS_H_ -#define _VAX_NEXUS_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -46,7 +41,7 @@ #if VAX8600 #define MAXNNEXUS (2 * NNEXSBI) -#else +#else #define MAXNNEXUS NNEXSBI #endif @@ -120,5 +115,3 @@ struct nexus nexus[MAXNNEXUS]; #define NEX_MEM256U 0x72 /* 256K chips, non-interleaved, upper */ #define NEX_MEM256UI 0x73 /* 256K chips, ext-interleaved, upper */ #define NEX_MEM256I 0x74 /* 256K chips, interleaved */ - -#endif diff --git a/lib/libstdc/vax/pcb.h b/lib/libstdc/vax/pcb.h index b280893..fe970aa 100644 --- a/lib/libstdc/vax/pcb.h +++ b/lib/libstdc/vax/pcb.h @@ -1,8 +1,3 @@ -#ifndef _VAX_PCB_H_ -#define _VAX_PCB_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -15,7 +10,8 @@ * VAX process control block */ -struct pcb { +struct pcb +{ int pcb_ksp; /* kernel stack pointer */ int pcb_esp; /* exec stack pointer */ int pcb_ssp; /* supervisor stack pointer */ @@ -69,5 +65,3 @@ struct pcb { { \ mtpr(ASTLVL, ASTLVL_NONE); \ } - -#endif diff --git a/lib/libstdc/vax/psl.h b/lib/libstdc/vax/psl.h index 6fd4988..40917ee 100644 --- a/lib/libstdc/vax/psl.h +++ b/lib/libstdc/vax/psl.h @@ -1,7 +1,3 @@ -#ifndef _VAX_PSL_H_ -#define _VAX_PSL_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -35,5 +31,3 @@ #define PSL_USERSET (PSL_PRVMOD|PSL_CURMOD) #define PSL_USERCLR (PSL_IS|PSL_IPL|PSL_MBZ) - -#endif diff --git a/lib/libstdc/vax/pte.h b/lib/libstdc/vax/pte.h index 39e766c..86d0987 100644 --- a/lib/libstdc/vax/pte.h +++ b/lib/libstdc/vax/pte.h @@ -1,7 +1,3 @@ -#ifndef _VAX_PTE_H_ -#define _VAX_PTE_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -20,8 +16,9 @@ * structure used in page clustering. */ -/*#ifndef LOCORE*/ -struct pte { +#ifndef LOCORE +struct pte +{ unsigned int pg_pfnum:21, /* core page frame number or 0 */ :2, pg_vreadm:1, /* modified since vread (or with _m) */ @@ -31,12 +28,14 @@ unsigned int pg_pfnum:21, /* core page frame number or 0 */ pg_prot:4, /* access control */ pg_v:1; /* valid bit */ }; -struct hpte { +struct hpte +{ unsigned int pg_pfnum:21, :2, pg_high:9; /* special for clustering */ }; -struct fpte { +struct fpte +{ unsigned int pg_blkno:24, /* file system block number */ pg_fileno:1, /* file mapped from or TEXT or ZERO */ pg_fod:1, /* is fill on demand (=1) */ @@ -93,6 +92,4 @@ extern struct pte Clockmap[]; extern struct pte Ka630map[]; #endif #endif -/*#endif*/ - #endif diff --git a/lib/libstdc/vax/reg.h b/lib/libstdc/vax/reg.h index 80486c8..6847fd2 100644 --- a/lib/libstdc/vax/reg.h +++ b/lib/libstdc/vax/reg.h @@ -1,7 +1,3 @@ -#ifndef _VAX_REG_H_ -#define _VAX_REG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -35,5 +31,3 @@ #define SP (-5) #define PS (-1) #define PC (-2) - -#endif diff --git a/lib/libstdc/vax/rpb.h b/lib/libstdc/vax/rpb.h index 3dbd1af..0ec2eb3 100644 --- a/lib/libstdc/vax/rpb.h +++ b/lib/libstdc/vax/rpb.h @@ -1,7 +1,3 @@ -#ifndef _VAX_RPB_H_ -#define _VAX_RPB_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -25,5 +21,3 @@ struct rpb { #ifdef KERNEL extern struct rpb rpb; #endif - -#endif diff --git a/lib/libstdc/vax/rsp.h b/lib/libstdc/vax/rsp.h index f435eb0..3b5279c 100644 --- a/lib/libstdc/vax/rsp.h +++ b/lib/libstdc/vax/rsp.h @@ -1,9 +1,3 @@ -#ifndef _VAX_RSP_H_ -#define _VAX_RSP_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -89,5 +83,3 @@ struct packet { */ #define TUSW_MRSP 010 /* use Modified RSP */ - -#endif diff --git a/lib/libstdc/vax/scb.h b/lib/libstdc/vax/scb.h index 82c00cb..fa438c5 100644 --- a/lib/libstdc/vax/scb.h +++ b/lib/libstdc/vax/scb.h @@ -1,7 +1,3 @@ -#ifndef _VAX_SCB_H_ -#define _VAX_SCB_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -68,5 +64,3 @@ extern struct scb scb; #define SCB_ISTACK 1 #define SCB_WCS 2 #define SCB_HALT 3 - -#endif diff --git a/lib/libstdc/vax/tmscp.h b/lib/libstdc/vax/tmscp.h index c6f152b..91de976 100644 --- a/lib/libstdc/vax/tmscp.h +++ b/lib/libstdc/vax/tmscp.h @@ -1,8 +1,3 @@ -#ifndef _VAX_TMSCP_H_ -#define _VAX_TMSCP_H_ - -#include - /* @(#)tmscp.h 7.1 (Berkeley) 6/5/86 */ /* @@ -325,5 +320,3 @@ struct mslg { #define mslg_busaddr mslg_unitid.val[0] #define mslg_sdecyl mslg_group - -#endif diff --git a/lib/libstdc/vax/trap.h b/lib/libstdc/vax/trap.h index 1db5dd8..b46d1c5 100644 --- a/lib/libstdc/vax/trap.h +++ b/lib/libstdc/vax/trap.h @@ -1,7 +1,3 @@ -#ifndef _VAX_TRAP_H_ -#define _VAX_TRAP_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -30,5 +26,3 @@ #define T_COMPATFLT 11 /* compatibility mode fault */ #define T_PAGEFLT 12 /* page fault */ #define T_TABLEFLT 13 /* page table fault */ - -#endif diff --git a/lib/libstdc/vax/vmparam.h b/lib/libstdc/vax/vmparam.h index 016aa66..a17cf61 100644 --- a/lib/libstdc/vax/vmparam.h +++ b/lib/libstdc/vax/vmparam.h @@ -1,9 +1,3 @@ -#ifndef _VAX_VMPARAM_H_ -#define _VAX_VMPARAM_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -162,8 +156,6 @@ /* * BEWARE THIS DEFINITION WORKS ONLY WITH COUNT OF 1 */ -/* moved this from here to sys/vmmac.h to avoid a circular dependency */ +/* moved this to sys/vmmac.h to avoid a circular dependency */ /*#define mapin(pte, v, pfnum, count, prot) \ (*(int *)(pte) = (pfnum) | (prot), mtpr(TBIS, ptob(v)))*/ - -#endif diff --git a/lib/libstdc/vaxif/if_accreg.h b/lib/libstdc/vaxif/if_accreg.h index 5842ad8..4b501ff 100644 --- a/lib/libstdc/vaxif/if_accreg.h +++ b/lib/libstdc/vaxif/if_accreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXIF_IF_ACCREG_H_ -#define _VAXIF_IF_ACCREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -68,5 +63,3 @@ struct accdevice { #define ACC_OUTBITS \ "\20\20ERR\17NXM\12TMR\10RDY\7IE\4BBACK\3ENLB\2RESET\1GO" - -#endif diff --git a/lib/libstdc/vaxif/if_cssreg.h b/lib/libstdc/vaxif/if_cssreg.h index b8b0bb3..1934eac 100644 --- a/lib/libstdc/vaxif/if_cssreg.h +++ b/lib/libstdc/vaxif/if_cssreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXIF_IF_CSSREG_H_ -#define _VAXIF_IF_CSSREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -70,5 +65,3 @@ struct cssdevice { #define CSS_OUTBITS \ "\20\20ERR\17NXM\16ATTN\15MAINT\11CYCLE\10RDY\7IE\6XBA17\5XBA16\4TXEC\3ENLB\2CLR\1GO" - -#endif diff --git a/lib/libstdc/vaxif/if_ddnreg.h b/lib/libstdc/vaxif/if_ddnreg.h index 2b55859..c541842 100644 --- a/lib/libstdc/vaxif/if_ddnreg.h +++ b/lib/libstdc/vaxif/if_ddnreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXIF_IF_DDNREG_H_ -#define _VAXIF_IF_DDNREG_H_ - -#include - /* @(#)if_ddnreg.h 7.1 (Berkeley) 6/5/86 */ @@ -131,5 +126,3 @@ struct ddnregs { /* device registers */ #define DDNXODD 2 /* start with odd address */ #define DDNNUMR 4 /* non-UMR transfer */ #define DDNXABT 8 /* abort transfer */ - -#endif diff --git a/lib/libstdc/vaxif/if_ddnvar.h b/lib/libstdc/vaxif/if_ddnvar.h index b586fd2..4e63eb8 100644 --- a/lib/libstdc/vaxif/if_ddnvar.h +++ b/lib/libstdc/vaxif/if_ddnvar.h @@ -1,7 +1,3 @@ -#ifndef _VAXIF_IF_DDNVAR_H_ -#define _VAXIF_IF_DDNVAR_H_ - - /* @(#)if_ddnvar.h 7.1 (Berkeley) 6/5/86 */ @@ -122,5 +118,3 @@ typedef int boolean; /* X25 protocols */ #define X25_PROTO_IP 0xcc /* X25 IP protocol type code */ - -#endif diff --git a/lib/libstdc/vaxif/if_dereg.h b/lib/libstdc/vaxif/if_dereg.h index 3136109..7c9dd9c 100644 --- a/lib/libstdc/vaxif/if_dereg.h +++ b/lib/libstdc/vaxif/if_dereg.h @@ -1,9 +1,3 @@ -#ifndef _VAXIF_IF_DEREG_H_ -#define _VAXIF_IF_DEREG_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -195,5 +189,3 @@ struct de_buf { char db_data[ETHERMTU]; /* packet data */ int db_crc; /* CRC - on receive only */ }; - -#endif diff --git a/lib/libstdc/vaxif/if_dmc.h b/lib/libstdc/vaxif/if_dmc.h index 4c70288..b391532 100644 --- a/lib/libstdc/vaxif/if_dmc.h +++ b/lib/libstdc/vaxif/if_dmc.h @@ -1,7 +1,3 @@ -#ifndef _VAXIF_IF_DMC_H_ -#define _VAXIF_IF_DMC_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -102,5 +98,3 @@ struct dmc_header { #define DMC_FATAL (DMC_ERROR|DMC_NEXMEM|DMC_START|DMC_LOSTDATA|DMC_MAINTREC) #define CNTLO_BITS \ "\10\12ERROR\11NEXMEM\10START\7DISC\5LSTDATA\4MAINT\3NOBUF\2TIMEO\1DATACK" - -#endif diff --git a/lib/libstdc/vaxif/if_ecreg.h b/lib/libstdc/vaxif/if_ecreg.h index e7a6e5e..28b76b5 100644 --- a/lib/libstdc/vaxif/if_ecreg.h +++ b/lib/libstdc/vaxif/if_ecreg.h @@ -1,7 +1,3 @@ -#ifndef _VAXIF_IF_ECREG_H_ -#define _VAXIF_IF_ECREG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -67,5 +63,3 @@ struct ecdevice { #define ECRHBF 15 /* Last buffer for receive */ #define ECRDOFF 528 /* Packet offset in read buffer */ - -#endif diff --git a/lib/libstdc/vaxif/if_en.h b/lib/libstdc/vaxif/if_en.h index 2f34b1f..d82b785 100644 --- a/lib/libstdc/vaxif/if_en.h +++ b/lib/libstdc/vaxif/if_en.h @@ -1,8 +1,3 @@ -#ifndef _VAXIF_IF_EN_H_ -#define _VAXIF_IF_EN_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -33,5 +28,3 @@ struct en_header { #define ENTYPE_NTRAILER 16 #define EN_BROADCAST 0 /* Hardware broadcast address */ - -#endif diff --git a/lib/libstdc/vaxif/if_enreg.h b/lib/libstdc/vaxif/if_enreg.h index 370e4c6..623ad80 100644 --- a/lib/libstdc/vaxif/if_enreg.h +++ b/lib/libstdc/vaxif/if_enreg.h @@ -1,7 +1,3 @@ -#ifndef _VAXIF_IF_ENREG_H_ -#define _VAXIF_IF_ENREG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -40,5 +36,3 @@ struct endevice { #define EN_BITS "\10\20ERR\10OPDONE\7IEN\2PROM\1GO" #define spl_enet() spl5() - -#endif diff --git a/lib/libstdc/vaxif/if_exreg.h b/lib/libstdc/vaxif/if_exreg.h index 3db9c4e..68a0968 100644 --- a/lib/libstdc/vaxif/if_exreg.h +++ b/lib/libstdc/vaxif/if_exreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXIF_IF_EXREG_H_ -#define _VAXIF_IF_EXREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -253,5 +248,3 @@ struct confmsg { /*80*/ }; - -#endif diff --git a/lib/libstdc/vaxif/if_hdhreg.h b/lib/libstdc/vaxif/if_hdhreg.h index ba22520..2f8f625 100644 --- a/lib/libstdc/vaxif/if_hdhreg.h +++ b/lib/libstdc/vaxif/if_hdhreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXIF_IF_HDHREG_H_ -#define _VAXIF_IF_HDHREG_H_ - -#include - /* @(#)if_hdhreg.h 7.1 (Berkeley) 6/5/86 */ @@ -104,5 +99,3 @@ struct hdhregs { /* device registers */ #define HDHDTERR (HDHSUP+0x0600) /* host data error detected */ #define HDHSQRCV (HDHSUP+0x0700) /* HDLC sequence error detected by IMP */ #define HDHSQERR (HDHSUP+0x0800) /* HDLC sequence error detected by if-11 */ - -#endif diff --git a/lib/libstdc/vaxif/if_hy.h b/lib/libstdc/vaxif/if_hy.h index 5e1562d..af50b7f 100644 --- a/lib/libstdc/vaxif/if_hy.h +++ b/lib/libstdc/vaxif/if_hy.h @@ -1,10 +1,3 @@ -#ifndef _VAXIF_IF_HY_H_ -#define _VAXIF_IF_HY_H_ - -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -311,5 +304,3 @@ char *hy_state_names[] = { }; #endif - -#endif diff --git a/lib/libstdc/vaxif/if_hyreg.h b/lib/libstdc/vaxif/if_hyreg.h index 26558f9..ca7dec3 100644 --- a/lib/libstdc/vaxif/if_hyreg.h +++ b/lib/libstdc/vaxif/if_hyreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXIF_IF_HYREG_H_ -#define _VAXIF_IF_HYREG_H_ - -#include - /* * @(#)if_hyreg.h 7.1 (Berkeley) 6/5/86 * @@ -188,5 +183,3 @@ struct hydevice { #define HYF_END_OP 0xE4 /* end operation */ #define HYF_CLRWFMSG 0xE6 /* clear wait for mwssage */ #define HYF_WAITFORMSG 0xE8 /* wait for message */ - -#endif diff --git a/lib/libstdc/vaxif/if_il.h b/lib/libstdc/vaxif/if_il.h index 5a6cf0a..75ba5dc 100644 --- a/lib/libstdc/vaxif/if_il.h +++ b/lib/libstdc/vaxif/if_il.h @@ -1,8 +1,3 @@ -#ifndef _VAXIF_IF_IL_H_ -#define _VAXIF_IF_IL_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -55,5 +50,3 @@ struct il_collis { u_short ilc_length; /* Length (should be 0-32) */ u_short ilc_delay[16]; /* Delay Times */ }; - -#endif diff --git a/lib/libstdc/vaxif/if_ilreg.h b/lib/libstdc/vaxif/if_ilreg.h index d1ae9ca..0cad2f1 100644 --- a/lib/libstdc/vaxif/if_ilreg.h +++ b/lib/libstdc/vaxif/if_ilreg.h @@ -1,7 +1,3 @@ -#ifndef _VAXIF_IF_ILREG_H_ -#define _VAXIF_IF_ILREG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -124,5 +120,3 @@ char *ildiag[NILDIAGS] = { #define ILFSTAT_C 0x1 /* CRC error */ #define ILFSTAT_A 0x2 /* alignment error */ #define ILFSTAT_L 0x4 /* 1+ frames lost just before */ - -#endif diff --git a/lib/libstdc/vaxif/if_ix.h b/lib/libstdc/vaxif/if_ix.h index 179a4b0..c708c1a 100644 --- a/lib/libstdc/vaxif/if_ix.h +++ b/lib/libstdc/vaxif/if_ix.h @@ -1,8 +1,3 @@ -#ifndef _VAXIF_IF_IX_H_ -#define _VAXIF_IF_IX_H_ - -#include - /* * Copyright (c) 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -59,5 +54,3 @@ union ix_stats { #define IXC_CSCLR IXC_MAP(10) /* Clear Channel Statistics */ #define IXC_RESET IXC_MAP(11) /* Reset DLA module */ #define IXC_LDPA IXC_MAP(12) /* Load Physical Address */ - -#endif diff --git a/lib/libstdc/vaxif/if_pclreg.h b/lib/libstdc/vaxif/if_pclreg.h index b88660a..8841025 100644 --- a/lib/libstdc/vaxif/if_pclreg.h +++ b/lib/libstdc/vaxif/if_pclreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXIF_IF_PCLREG_H_ -#define _VAXIF_IF_PCLREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -62,5 +57,3 @@ struct pcldevice { #define PCL_RERRBITS "\20\20ERR\17NXL\16MEM_OFL\15TXM_ERR\14PARITY\13TIM_OUT\12BC_OFL\11DTO_RDY\10SUC_TXF\07BUSY\06REJ_COMP\05CHN_OPN" #define PCL_RCSRBITS "\20\20REJ\17RC_NPR\16RCV_WD\10LD_SILO\07IE\04DTI_RDY\03INH_ADI\02RC_INIT\01RCV_DAT" - -#endif diff --git a/lib/libstdc/vaxif/if_qereg.h b/lib/libstdc/vaxif/if_qereg.h index e57ebb1..7293f70 100644 --- a/lib/libstdc/vaxif/if_qereg.h +++ b/lib/libstdc/vaxif/if_qereg.h @@ -1,8 +1,3 @@ -#ifndef _VAXIF_IF_QEREG_H_ -#define _VAXIF_IF_QEREG_H_ - -#include - /* @(#)if_qereg.h 7.1 (Berkeley) 6/5/86 */ /* @(#)if_qereg.h 1.2 (ULTRIX) 1/3/85 */ @@ -138,5 +133,3 @@ struct qe_ring { #define QE_NOTYET 0x8000 /* Descriptor not in use yet */ #define QE_INUSE 0x4000 /* Descriptor being used by QNA */ #define QE_MASK 0xc000 /* Lastnot/error/used mask */ - -#endif diff --git a/lib/libstdc/vaxif/if_uba.h b/lib/libstdc/vaxif/if_uba.h index 90de07f..f9d3805 100644 --- a/lib/libstdc/vaxif/if_uba.h +++ b/lib/libstdc/vaxif/if_uba.h @@ -1,9 +1,3 @@ -#ifndef _VAXIF_IF_UBA_H_ -#define _VAXIF_IF_UBA_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -107,7 +101,5 @@ struct ifuba { if_ubaget(&(ifu)->ifu_info, &(ifu)->ifu_r, totlen, off0, ifp) #define if_wubaput(ifu, m) \ if_ubaput(&(ifu)->ifu_info, &(ifu)->ifu_xmt, m) -/*struct mbuf *if_ubaget();*/ -#endif - +struct mbuf *if_ubaget(); #endif diff --git a/lib/libstdc/vaxif/if_vv.h b/lib/libstdc/vaxif/if_vv.h index 3994e1b..0bc18d6 100644 --- a/lib/libstdc/vaxif/if_vv.h +++ b/lib/libstdc/vaxif/if_vv.h @@ -1,8 +1,3 @@ -#ifndef _VAXIF_IF_VV_H_ -#define _VAXIF_IF_VV_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -115,5 +110,3 @@ struct vvreg { #define VVIDENTSUCC 5 /* number of successes required in self-test */ #define VVIDENTRETRY 10 /* identify loop attempt limit */ #define VVTIMEOUT 60 /* seconds before a transmit timeout */ - -#endif diff --git a/lib/libstdc/vaxmba/hpreg.h b/lib/libstdc/vaxmba/hpreg.h index 4e4911f..a2b7a3d 100644 --- a/lib/libstdc/vaxmba/hpreg.h +++ b/lib/libstdc/vaxmba/hpreg.h @@ -1,7 +1,3 @@ -#ifndef _VAXMBA_HPREG_H_ -#define _VAXMBA_HPREG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,7 +6,8 @@ * @(#)hpreg.h 7.1 (Berkeley) 6/5/86 */ -struct hpdevice { +struct hpdevice +{ int hpcs1; /* control and status register 1 */ int hpds; /* drive status */ int hper1; /* error register 1 */ @@ -167,5 +164,3 @@ struct hpdevice { #define SIRM03 0x8000 /* RM03 indication */ #define SIRM05 0x0000 /* RM05 pseudo-indication */ - -#endif diff --git a/lib/libstdc/vaxmba/htreg.h b/lib/libstdc/vaxmba/htreg.h index 05ba096..91b4802 100644 --- a/lib/libstdc/vaxmba/htreg.h +++ b/lib/libstdc/vaxmba/htreg.h @@ -1,7 +1,3 @@ -#ifndef _VAXMBA_HTREG_H_ -#define _VAXMBA_HTREG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -10,7 +6,8 @@ * @(#)htreg.h 7.1 (Berkeley) 6/5/86 */ -struct htdevice { +struct htdevice +{ int htcs1; /* control status register */ int htds; /* drive status register */ int hter; /* error register */ @@ -113,5 +110,3 @@ struct htdevice { #define b_repcnt b_bcount #define b_command b_resid - -#endif diff --git a/lib/libstdc/vaxmba/mbareg.h b/lib/libstdc/vaxmba/mbareg.h index 9b652f0..3a5a9a9 100644 --- a/lib/libstdc/vaxmba/mbareg.h +++ b/lib/libstdc/vaxmba/mbareg.h @@ -1,8 +1,3 @@ -#ifndef _VAXMBA_MBAREG_H_ -#define _VAXMBA_MBAREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -15,7 +10,8 @@ * VAX MASSBUS adapter registers */ -struct mba_regs { +struct mba_regs +{ int mba_csr; /* configuration register */ int mba_cr; /* control register */ int mba_sr; /* status register */ @@ -137,5 +133,3 @@ extern char mbsr_bits[]; #define MBDT_TU45 052 #define MBDT_TU77 054 #define MBDT_TU78 0101 - -#endif diff --git a/lib/libstdc/vaxmba/mbavar.h b/lib/libstdc/vaxmba/mbavar.h index 4103ed7..04c7c78 100644 --- a/lib/libstdc/vaxmba/mbavar.h +++ b/lib/libstdc/vaxmba/mbavar.h @@ -1,8 +1,3 @@ -#ifndef _VAXMBA_MBAVAR_H_ -#define _VAXMBA_MBAVAR_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -142,11 +137,9 @@ struct mba_driver { int nummba; #if NMBA > 0 struct mba_hd mba_hd[NMBA]; -/*extern Xmba0int(), Xmba1int(), Xmba2int(), Xmba3int();*/ +extern Xmba0int(), Xmba1int(), Xmba2int(), Xmba3int(); extern struct mba_device mbdinit[]; extern struct mba_slave mbsinit[]; #endif #endif - -#endif diff --git a/lib/libstdc/vaxmba/mtreg.h b/lib/libstdc/vaxmba/mtreg.h index 5be011b..05f6b6e 100644 --- a/lib/libstdc/vaxmba/mtreg.h +++ b/lib/libstdc/vaxmba/mtreg.h @@ -1,7 +1,3 @@ -#ifndef _VAXMBA_MTREG_H_ -#define _VAXMBA_MTREG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -133,5 +129,3 @@ struct mtdevice { #define b_repcnt b_bcount #define b_command b_resid - -#endif diff --git a/lib/libstdc/vaxuba/adreg.h b/lib/libstdc/vaxuba/adreg.h index fd3a631..9455b65 100644 --- a/lib/libstdc/vaxuba/adreg.h +++ b/lib/libstdc/vaxuba/adreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXUBA_ADREG_H_ -#define _VAXUBA_ADREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -32,5 +27,3 @@ struct addevice { #define AD_DONE 0200 #define AD_INCENABLE 040000 #define AD_ERROR 0100000 - -#endif diff --git a/lib/libstdc/vaxuba/dhreg.h b/lib/libstdc/vaxuba/dhreg.h index 00c3a4b..f672234 100644 --- a/lib/libstdc/vaxuba/dhreg.h +++ b/lib/libstdc/vaxuba/dhreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXUBA_DHREG_H_ -#define _VAXUBA_DHREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -56,5 +51,3 @@ struct dhdevice { #define DH_PE 0010000 /* parity error */ #define DH_FE 0020000 /* framing error */ #define DH_DO 0040000 /* data overrun */ - -#endif diff --git a/lib/libstdc/vaxuba/dhureg.h b/lib/libstdc/vaxuba/dhureg.h index e6d9f0b..cacb946 100644 --- a/lib/libstdc/vaxuba/dhureg.h +++ b/lib/libstdc/vaxuba/dhureg.h @@ -1,7 +1,3 @@ -#ifndef _VAXUBA_DHUREG_H_ -#define _VAXUBA_DHUREG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -143,5 +139,3 @@ struct dhudevice { #define DML_RTS 0000004 /* request to send */ #define DML_DTR 0000002 /* data terminal ready */ #define DML_LE 0000001 /* line enable */ - -#endif diff --git a/lib/libstdc/vaxuba/dmfreg.h b/lib/libstdc/vaxuba/dmfreg.h index a756ba7..333b00e 100644 --- a/lib/libstdc/vaxuba/dmfreg.h +++ b/lib/libstdc/vaxuba/dmfreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXUBA_DMFREG_H_ -#define _VAXUBA_DMFREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -150,5 +145,3 @@ struct dmfdevice { #define DMFC_LP 0x2000 /* LP dma parallel lineprinter i'face */ #define DMFC_SYNC 0x4000 /* Synchronous serial interface */ #define DMFC_ASYNC 0x8000 /* 8 Serial ports */ - -#endif diff --git a/lib/libstdc/vaxuba/dmreg.h b/lib/libstdc/vaxuba/dmreg.h index 42e4601..49aefc4 100644 --- a/lib/libstdc/vaxuba/dmreg.h +++ b/lib/libstdc/vaxuba/dmreg.h @@ -1,7 +1,3 @@ -#ifndef _VAXUBA_DMREG_H_ -#define _VAXUBA_DMREG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -45,5 +41,3 @@ struct dmdevice { #define DML_ON (DML_DTR|DML_RTS|DML_LE) #define DML_OFF (DML_LE) - -#endif diff --git a/lib/libstdc/vaxuba/dmzreg.h b/lib/libstdc/vaxuba/dmzreg.h index ba3c2dc..efe6cec 100644 --- a/lib/libstdc/vaxuba/dmzreg.h +++ b/lib/libstdc/vaxuba/dmzreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXUBA_DMZREG_H_ -#define _VAXUBA_DMZREG_H_ - -#include - /* * Copyright (c) 1985, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -148,5 +143,3 @@ struct dmzdevice { #define DMZ_NOC_MASK 03 #define DMZ_INTERFACE 000 - -#endif diff --git a/lib/libstdc/vaxuba/dzreg.h b/lib/libstdc/vaxuba/dzreg.h index 9b4e3a1..872a402 100644 --- a/lib/libstdc/vaxuba/dzreg.h +++ b/lib/libstdc/vaxuba/dzreg.h @@ -1,7 +1,3 @@ -#ifndef _VAXUBA_DZREG_H_ -#define _VAXUBA_DZREG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -91,5 +87,3 @@ struct dzdevice { #define DML_RTS 0000004 /* request to send */ #define DML_DTR 0000002 /* data terminal ready */ #define DML_LE 0000001 /* line enable */ - -#endif diff --git a/lib/libstdc/vaxuba/idcreg.h b/lib/libstdc/vaxuba/idcreg.h index ac46635..caa47cf 100644 --- a/lib/libstdc/vaxuba/idcreg.h +++ b/lib/libstdc/vaxuba/idcreg.h @@ -1,7 +1,3 @@ -#ifndef _VAXUBA_IDCREG_H_ -#define _VAXUBA_IDCREG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -17,7 +13,8 @@ #define NRB80TRK 14 /* RB80 tracks/cylinder */ #define NRB80CYL 559 /* RB80 cylinders/disk */ -struct idcdevice { +struct idcdevice +{ int idccsr; /* control status register */ int idcbar; /* bus address register */ int idcbcr; /* byte count register */ @@ -106,5 +103,3 @@ struct idcdevice { #define IDCRB80DS_BITS \ "\10\16WTP\15DRDY\14ONCY\13SKE\12PLGV\11FLT\5SEC4\4SEC3\3SEC2\2SEC1\1SEC0" - -#endif diff --git a/lib/libstdc/vaxuba/ikreg.h b/lib/libstdc/vaxuba/ikreg.h index e3b4b55..5d11725 100644 --- a/lib/libstdc/vaxuba/ikreg.h +++ b/lib/libstdc/vaxuba/ikreg.h @@ -1,9 +1,3 @@ -#ifndef _VAXUBA_IKREG_H_ -#define _VAXUBA_IKREG_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -118,5 +112,3 @@ struct ikdevice { */ #define FMG0 060200000 - -#endif diff --git a/lib/libstdc/vaxuba/npreg.h b/lib/libstdc/vaxuba/npreg.h index ebb6d1a..bb62761 100644 --- a/lib/libstdc/vaxuba/npreg.h +++ b/lib/libstdc/vaxuba/npreg.h @@ -1,9 +1,3 @@ -#ifndef _VAXUBA_NPREG_H_ -#define _VAXUBA_NPREG_H_ - -#include -#include - /* * Copyright (c) 1986 MICOM-Interlan, Inc., Boxborough Mass * All rights reserved. The Berkeley software License Agreement @@ -473,5 +467,3 @@ struct npbase { #define DEBCSR 0x1000 /* debug CSR commands */ #define DEBLOCK 0x2000 /* debug lock / unlock calls */ #define NOBOARD 0x4000 /* debug user/host interface */ - -#endif diff --git a/lib/libstdc/vaxuba/pdma.h b/lib/libstdc/vaxuba/pdma.h index 6213b7a..b19e03d 100644 --- a/lib/libstdc/vaxuba/pdma.h +++ b/lib/libstdc/vaxuba/pdma.h @@ -1,7 +1,3 @@ -#ifndef _VAXUBA_PDMA_H_ -#define _VAXUBA_PDMA_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -17,5 +13,3 @@ struct pdma { int p_arg; int (*p_fcn)(); }; - -#endif diff --git a/lib/libstdc/vaxuba/psreg.h b/lib/libstdc/vaxuba/psreg.h index 7d449c3..efa46f5 100644 --- a/lib/libstdc/vaxuba/psreg.h +++ b/lib/libstdc/vaxuba/psreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXUBA_PSREG_H_ -#define _VAXUBA_PSREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -210,5 +205,3 @@ struct psdevice { #define FSWR 0177626 #define FSLR 0177627 - -#endif diff --git a/lib/libstdc/vaxuba/rkreg.h b/lib/libstdc/vaxuba/rkreg.h index 08e3cba..5c8b4aa 100644 --- a/lib/libstdc/vaxuba/rkreg.h +++ b/lib/libstdc/vaxuba/rkreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXUBA_RKREG_H_ -#define _VAXUBA_RKREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -16,7 +11,8 @@ #define NRKSECT 22 #define NRKTRK 3 -struct rkdevice { +struct rkdevice +{ short rkcs1; /* control status reg 1 */ short rkwc; /* word count */ u_short rkba; /* bus address */ @@ -138,5 +134,3 @@ struct rkdevice { #define RKAS_M800 0240 /* -800 RK06, -400 RK07 */ #define RKAS_P1200 0060 /* +800 RK06, +400 RK07 */ #define RKAS_M1200 0260 /* -1200 RK06, -1200 RK07 */ - -#endif diff --git a/lib/libstdc/vaxuba/rlreg.h b/lib/libstdc/vaxuba/rlreg.h index 5155067..e7d6304 100644 --- a/lib/libstdc/vaxuba/rlreg.h +++ b/lib/libstdc/vaxuba/rlreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXUBA_RLREG_H_ -#define _VAXUBA_RLREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -116,5 +111,3 @@ struct rldevice { #define RLER_BITS \ "\10\20WDE\17CHE\16WL\15SKTO\14SPE\13WGE\12VC\11DSE\ \10DT\7HS\6CO\5HO\4BH\3STC\2STB\1STA" - -#endif diff --git a/lib/libstdc/vaxuba/rxreg.h b/lib/libstdc/vaxuba/rxreg.h index 7cb748a..e1c80e9 100644 --- a/lib/libstdc/vaxuba/rxreg.h +++ b/lib/libstdc/vaxuba/rxreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXUBA_RXREG_H_ -#define _VAXUBA_RXREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -12,9 +7,9 @@ */ #ifdef KERNEL -/*#include "ioctl.h"*/ +#include "ioctl.h" #else -/*#include */ +#include #endif /* @@ -108,5 +103,3 @@ struct rxdeferr { { 0, "Undefined error code" } }; #endif - -#endif diff --git a/lib/libstdc/vaxuba/tmreg.h b/lib/libstdc/vaxuba/tmreg.h index e3be2e9..bf77bd3 100644 --- a/lib/libstdc/vaxuba/tmreg.h +++ b/lib/libstdc/vaxuba/tmreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXUBA_TMREG_H_ -#define _VAXUBA_TMREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -100,6 +95,4 @@ struct tmdevice { #define FSR_BITS \ "\10\20REJ\17TMS\16OVRN\15DATACHK\14SSC\13EOTS\12WRTS\11ROMPS\10CRERR\ \7ONLS\6BOTS\5HDENS\4BUPER\3FPTS\2REWS\1RDYS" -#endif - -#endif +#endif AVIV diff --git a/lib/libstdc/vaxuba/tmscpreg.h b/lib/libstdc/vaxuba/tmscpreg.h index f1c155c..19ea140 100644 --- a/lib/libstdc/vaxuba/tmscpreg.h +++ b/lib/libstdc/vaxuba/tmscpreg.h @@ -1,7 +1,3 @@ -#ifndef _VAXUBA_TMSCPREG_H_ -#define _VAXUBA_TMSCPREG_H_ - - /* @(#)tmscpreg.h 7.1 (Berkeley) 6/5/86 */ /* @(#)tmscpreg.h 1.1 11/2/84 84/09/25 */ @@ -84,5 +80,3 @@ struct mscp_header { char tmscp_credits; /* low 4 bits: credits, high 4 bits: msgtype */ char tmscp_vcid; /* virtual circuit id (connection id) */ }; - -#endif diff --git a/lib/libstdc/vaxuba/tsreg.h b/lib/libstdc/vaxuba/tsreg.h index 20c7802..b7aaf4d 100644 --- a/lib/libstdc/vaxuba/tsreg.h +++ b/lib/libstdc/vaxuba/tsreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXUBA_TSREG_H_ -#define _VAXUBA_TSREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -169,5 +164,3 @@ struct ts_char { #define TS_ENB 0100 /* ??? */ #define TS_EAI 0040 /* enable attention interrupts */ #define TS_ERI 0020 /* enable message buffer release interrupts */ - -#endif diff --git a/lib/libstdc/vaxuba/ubareg.h b/lib/libstdc/vaxuba/ubareg.h index dc6fdaa..4474995 100644 --- a/lib/libstdc/vaxuba/ubareg.h +++ b/lib/libstdc/vaxuba/ubareg.h @@ -1,11 +1,3 @@ -#ifndef _VAXUBA_UBAREG_H_ -#define _VAXUBA_UBAREG_H_ - -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -34,7 +26,8 @@ /* * UBA hardware registers */ -struct uba_regs { +struct uba_regs +{ int uba_cnfgr; /* configuration register */ int uba_cr; /* control register */ int uba_sr; /* status register */ @@ -196,5 +189,3 @@ struct uba_regs { */ #define ubdevreg(addr) (0760000|((addr)&017777)) - -#endif diff --git a/lib/libstdc/vaxuba/ubavar.h b/lib/libstdc/vaxuba/ubavar.h index 12d4edd..c9e71ad 100644 --- a/lib/libstdc/vaxuba/ubavar.h +++ b/lib/libstdc/vaxuba/ubavar.h @@ -1,11 +1,3 @@ -#ifndef _VAXUBA_UBAVAR_H_ -#define _VAXUBA_UBAVAR_H_ - -#include -#include -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -23,7 +15,7 @@ * Each unibus device has a uba_device structure. */ -/*#ifndef LOCORE*/ +#ifndef LOCORE /* * Per-uba structure. * @@ -208,9 +200,7 @@ extern int (*UNI1vec[])(); /* unibus vec for uba1 */ * UNIbus adaptors to vector to locore unibus adaptor interrupt dispatchers * which make 780's look like the other VAXen. */ -/*extern Xua0int(), Xua1int(), Xua2int(), Xua3int();*/ -#endif -#endif -/*#endif*/ - -#endif +extern Xua0int(), Xua1int(), Xua2int(), Xua3int(); +#endif VAX780 +#endif KERNEL +#endif !LOCORE diff --git a/lib/libstdc/vaxuba/udareg.h b/lib/libstdc/vaxuba/udareg.h index 80890e8..6f8adfd 100644 --- a/lib/libstdc/vaxuba/udareg.h +++ b/lib/libstdc/vaxuba/udareg.h @@ -1,7 +1,3 @@ -#ifndef _VAXUBA_UDAREG_H_ -#define _VAXUBA_UDAREG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -59,5 +55,3 @@ struct mscp_header { char uda_credits; /* low 4 bits: credits, high 4 bits: msgtype */ char uda_vcid; /* virtual circuit id */ }; - -#endif diff --git a/lib/libstdc/vaxuba/upreg.h b/lib/libstdc/vaxuba/upreg.h index 6820d7f..c0d8802 100644 --- a/lib/libstdc/vaxuba/upreg.h +++ b/lib/libstdc/vaxuba/upreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXUBA_UPREG_H_ -#define _VAXUBA_UPREG_H_ - -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -16,7 +11,8 @@ * registers and bits. */ -struct updevice { +struct updevice +{ u_short upcs1; /* control and status register 1 */ short upwc; /* word count register */ u_short upba; /* UNIBUS address register */ @@ -168,5 +164,3 @@ struct updevice { #define UPOF_M800 0240 /* -800 uinches */ #define UPOF_P1200 0060 /* +1200 uinches */ #define UPOF_M1200 0260 /* -1200 uinches */ - -#endif diff --git a/lib/libstdc/vaxuba/utreg.h b/lib/libstdc/vaxuba/utreg.h index 1b7a6f0..7a0442d 100644 --- a/lib/libstdc/vaxuba/utreg.h +++ b/lib/libstdc/vaxuba/utreg.h @@ -1,9 +1,3 @@ -#ifndef _VAXUBA_UTREG_H_ -#define _VAXUBA_UTREG_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -179,5 +173,3 @@ struct utdevice { #define b_repcnt b_bcount #define b_command b_resid #define b_state b_active - -#endif diff --git a/lib/libstdc/vaxuba/uureg.h b/lib/libstdc/vaxuba/uureg.h index 46057f6..de64ab7 100644 --- a/lib/libstdc/vaxuba/uureg.h +++ b/lib/libstdc/vaxuba/uureg.h @@ -1,7 +1,3 @@ -#ifndef _VAXUBA_UUREG_H_ -#define _VAXUBA_UUREG_H_ - - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -39,5 +35,3 @@ struct uudevice { #define UUDB_DMASK 0x00ff /* data mask (send and receive data) */ - -#endif diff --git a/lib/libstdc/vaxuba/vpreg.h b/lib/libstdc/vaxuba/vpreg.h index e937c3e..13860bb 100644 --- a/lib/libstdc/vaxuba/vpreg.h +++ b/lib/libstdc/vaxuba/vpreg.h @@ -1,9 +1,3 @@ -#ifndef _VAXUBA_VPREG_H_ -#define _VAXUBA_VPREG_H_ - -#include -#include - /* * Copyright (c) 1982, 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -36,5 +30,3 @@ struct vpdevice { #define VP_CLRCOM 0000004 #define VP_RESET 0000002 #define VP_SPP 0000001 - -#endif diff --git a/lib/libstdc/vaxuba/vsreg.h b/lib/libstdc/vaxuba/vsreg.h index 6e41425..b799d52 100644 --- a/lib/libstdc/vaxuba/vsreg.h +++ b/lib/libstdc/vaxuba/vsreg.h @@ -1,8 +1,3 @@ -#ifndef _VAXUBA_VSREG_H_ -#define _VAXUBA_VSREG_H_ - -#include - /* @(#)vsreg.h 7.1 (MIT) 6/5/86 */ /**************************************************************************** * * @@ -237,5 +232,3 @@ struct vs_fparm{ */ #define vs_ivr2 vs_csrf - -#endif diff --git a/lib/libstdc/vfont.h b/lib/libstdc/vfont.h index 85b9e7c..b2104df 100644 --- a/lib/libstdc/vfont.h +++ b/lib/libstdc/vfont.h @@ -1,7 +1,3 @@ -#ifndef _VFONT_H_ -#define _VFONT_H_ - - /* * Copyright (c) 1980 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement @@ -29,5 +25,3 @@ struct dispatch { char up,down,left,right; short width; }; - -#endif -- 2.34.1