Browse Source

Plan 9 from Bell Labs 2003-01-15

David du Colombier 16 years ago
parent
commit
01c60915c3

+ 4 - 0
29000/include/u.h

@@ -13,7 +13,11 @@ typedef long	jmp_buf[2];
 #define	JMPBUFPC	1
 #define	JMPBUFDPC	0
 typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
+typedef unsigned char u8int;
+typedef unsigned short u16int;
 typedef unsigned int	u32int;
+typedef unsigned long long u64int;
+
 union FPdbleword
 {
 	double	x;

+ 3 - 0
386/include/u.h

@@ -13,7 +13,10 @@ typedef long	jmp_buf[2];
 #define	JMPBUFPC	1
 #define	JMPBUFDPC	0
 typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
+typedef unsigned char u8int;
+typedef unsigned short u16int;
 typedef unsigned int	u32int;
+typedef unsigned long long u64int;
 
 /* FCR */
 #define	FPINEX	(1<<5)

+ 3 - 0
68000/include/u.h

@@ -13,7 +13,10 @@ typedef long	jmp_buf[2];
 #define	JMPBUFPC	1
 #define	JMPBUFDPC	0
 typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
+typedef unsigned char u8int;
+typedef unsigned short u16int;
 typedef unsigned int	u32int;
+typedef unsigned long long u64int;
 
 /* FCR */
 #define	FPINEX	(3<<8)

+ 4 - 0
68020/include/u.h

@@ -13,7 +13,11 @@ typedef long	jmp_buf[2];
 #define	JMPBUFPC	1
 #define	JMPBUFDPC	0
 typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
+typedef unsigned char u8int;
+typedef unsigned short u16int;
 typedef unsigned int	u32int;
+typedef unsigned long long u64int;
+
 
 /* FCR */
 #define	FPINEX	(3<<8)

+ 3 - 0
960/include/u.h

@@ -12,7 +12,10 @@ typedef	ushort		Rune;
 typedef 	union FPdbleword FPdbleword;
 typedef long	jmp_buf[2];
 typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
+typedef unsigned char u8int;
+typedef unsigned short u16int;
 typedef unsigned int	u32int;
+typedef unsigned long long u64int;
 
 union FPdbleword
 {

+ 3 - 0
alpha/include/u.h

@@ -13,7 +13,10 @@ typedef long	jmp_buf[2];
 #define	JMPBUFPC	1
 #define	JMPBUFDPC	0
 typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
+typedef unsigned char u8int;
+typedef unsigned short u16int;
 typedef unsigned int	u32int;
+typedef unsigned long long u64int;
 
 /* FCR */
 #define	FPINEX	(1<<30)

+ 3 - 0
arm/include/u.h

@@ -14,7 +14,10 @@ typedef long	jmp_buf[2];
 #define	JMPBUFPC	1
 #define	JMPBUFDPC	0
 typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
+typedef unsigned char u8int;
+typedef unsigned short u16int;
 typedef unsigned int	u32int;
+typedef unsigned long long u64int;
 
 /* FCR */
 #define	FPINEX	(1<<20)

+ 15 - 15
dist/replica/plan9.db

@@ -1,6 +1,6 @@
 29000 - 20000000775 sys sys 954099276 0
 29000/include - 20000000775 sys sys 954099548 0
-29000/include/u.h - 664 sys sys 1015089429 888
+29000/include/u.h - 664 sys sys 1042604325 984
 29000/include/ureg.h - 664 sys sys 944946363 793
 29000/lib - 20000000775 sys sys 948037563 0
 29000/mkfile - 664 sys sys 948141302 46
@@ -163,7 +163,7 @@
 386/bin/con - 775 sys sys 1039758552 76698
 386/bin/cp - 775 sys sys 1039758553 62687
 386/bin/cpp - 775 sys sys 1039758553 148353
-386/bin/cpu - 775 sys sys 1039758553 137158
+386/bin/cpu - 775 sys sys 1042571399 137045
 386/bin/crop - 775 sys sys 1039758553 115496
 386/bin/date - 775 sys sys 1039758553 43976
 386/bin/db - 775 sys sys 1039758554 323623
@@ -239,7 +239,7 @@
 386/bin/ip/gping - 775 sys sys 1039758567 178125
 386/bin/ip/hogports - 775 sys sys 1039758567 43296
 386/bin/ip/httpd - 20000000775 sys sys 1016920846 0
-386/bin/ip/httpd/httpd - 775 sys sys 1039758567 283575
+386/bin/ip/httpd/httpd - 775 sys sys 1042522767 283517
 386/bin/ip/httpd/imagemap - 775 sys sys 1039758568 113595
 386/bin/ip/httpd/man2html - 775 sys sys 1039758568 121860
 386/bin/ip/httpd/save - 775 sys sys 1039758568 130924
@@ -453,7 +453,7 @@
 386/include/ape/math.h - 664 sys sys 1022624465 1902
 386/include/ape/stdarg.h - 664 sys sys 944946040 276
 386/include/ape/ureg.h - 664 sys sys 944946041 812
-386/include/u.h - 664 sys sys 1015013889 1355
+386/include/u.h - 664 sys sys 1042604326 1450
 386/include/ureg.h - 664 sys sys 944946012 523
 386/init - 775 sys sys 1039762724 97616
 386/ld.com - 775 sys sys 1032215930 64488
@@ -505,7 +505,7 @@
 68000/bin/fossil - 20000000775 sys sys 1042090587 0
 68000/bin/venti - 20000000775 sys sys 1019679272 0
 68000/include - 20000000775 sys sys 948037602 0
-68000/include/u.h - 664 sys sys 1015089430 1340
+68000/include/u.h - 664 sys sys 1042604326 1435
 68000/include/ureg.h - 664 sys sys 944946363 436
 68000/lib - 20000000775 sys sys 948037600 0
 68000/mkfile - 664 sys sys 948141303 52
@@ -530,14 +530,14 @@
 68020/include/ape/ureg.h - 664 sys sys 944946347 741
 68020/include/dac.h - 664 sys sys 944946363 154
 68020/include/lbp.h - 664 sys sys 944946363 76
-68020/include/u.h - 664 sys sys 1015089430 1340
+68020/include/u.h - 664 sys sys 1042604327 1436
 68020/include/ureg.h - 664 sys sys 944946363 436
 68020/lib - 20000000775 sys sys 947992106 0
 68020/lib/ape - 20000000775 sys sys 947992106 0
 68020/mkfile - 664 sys sys 948141303 52
 960 - 20000000775 sys sys 948037581 0
 960/include - 20000000775 sys sys 948037594 0
-960/include/u.h - 664 sys sys 1015089430 864
+960/include/u.h - 664 sys sys 1042604328 959
 960/mkfile - 664 sys sys 948141303 52
 LICENSE - 666 sys sys 1032615845 35386
 NOTICE - 444 sys sys 1018803063 63
@@ -751,7 +751,7 @@ alpha/include/ape/float.h - 664 sys sys 969656988 1674
 alpha/include/ape/math.h - 664 sys sys 1022624467 1900
 alpha/include/ape/stdarg.h - 664 sys sys 958591172 413
 alpha/include/ape/ureg.h - 664 sys sys 944946346 1241
-alpha/include/u.h - 664 sys sys 1015089430 1441
+alpha/include/u.h - 664 sys sys 1042604328 1536
 alpha/include/ureg.h - 664 sys sys 944946362 644
 alpha/lib - 20000000775 sys sys 947992106 0
 alpha/lib/ape - 20000000775 sys sys 947992106 0
@@ -778,7 +778,7 @@ arm/include/ape/float.h - 664 sys sys 985642226 1643
 arm/include/ape/math.h - 664 sys sys 1022624468 1902
 arm/include/ape/stdarg.h - 664 sys sys 985642227 276
 arm/include/ape/ureg.h - 664 sys sys 985642227 617
-arm/include/u.h - 664 sys sys 1015089430 1324
+arm/include/u.h - 664 sys sys 1042604329 1419
 arm/include/ureg.h - 664 sys sys 971095234 341
 arm/lib - 20000000775 sys sys 985643938 0
 arm/lib/ape - 20000000775 sys sys 985643938 0
@@ -2749,7 +2749,7 @@ mips/include/ape/math.h - 664 sys sys 1022624469 1900
 mips/include/ape/stdarg.h - 664 sys sys 944946346 324
 mips/include/ape/ureg.h - 664 sys sys 944946346 991
 mips/include/mips2ureg.h - 664 sys sys 952879416 886
-mips/include/u.h - 664 sys sys 1015089431 1330
+mips/include/u.h - 664 sys sys 1042604329 1425
 mips/include/ureg.h - 664 sys sys 944946362 550
 mips/lib - 20000000775 sys sys 947991960 0
 mips/lib/ape - 20000000775 sys sys 947991960 0
@@ -2843,7 +2843,7 @@ power/include/ape/float.h - 664 sys sys 969656988 1608
 power/include/ape/math.h - 664 sys sys 1032057792 1900
 power/include/ape/stdarg.h - 664 sys sys 944946355 324
 power/include/ape/ureg.h - 664 sys sys 944946362 1025
-power/include/u.h - 664 sys sys 1015089431 2669
+power/include/u.h - 664 sys sys 1042604330 2764
 power/include/ureg.h - 664 sys sys 1032057837 997
 power/lib - 20000000775 sys sys 947992106 0
 power/lib/ape - 20000000775 sys sys 947992106 0
@@ -2969,7 +2969,7 @@ rc/bin/termrc - 775 sys sys 1038278927 2637
 rc/bin/tlsclienttunnel - 775 sys sys 1024375633 153
 rc/bin/tlssrvtunnel - 775 sys sys 1024375634 175
 rc/bin/troff2gif - 775 sys sys 1032539305 161
-rc/bin/ups - 775 sys sys 1038379867 881
+rc/bin/ups - 775 sys sys 1042567965 989
 rc/bin/usps - 775 sys sys 1016826030 450
 rc/bin/vwhois - 775 sys sys 953999875 294
 rc/bin/wdoc2txt - 755 sys sys 1017431153 277
@@ -3002,7 +3002,7 @@ sparc/include/ape/float.h - 664 sys sys 969656988 1624
 sparc/include/ape/math.h - 664 sys sys 1022624470 1901
 sparc/include/ape/stdarg.h - 664 sys sys 944946348 324
 sparc/include/ape/ureg.h - 664 sys sys 944946348 1048
-sparc/include/u.h - 664 sys sys 1015089431 1328
+sparc/include/u.h - 664 sys sys 1042604330 1423
 sparc/include/ureg.h - 664 sys sys 944946363 599
 sparc/lib - 20000000775 sys sys 947992106 0
 sparc/lib/ape - 20000000775 sys sys 947992106 0
@@ -6776,7 +6776,7 @@ sys/src/cmd/cpp/mkfile - 664 sys sys 944960879 178
 sys/src/cmd/cpp/nlist.c - 664 sys sys 944960879 4631
 sys/src/cmd/cpp/test.c - 664 sys sys 944960879 47
 sys/src/cmd/cpp/tokens.c - 664 sys sys 944960879 6755
-sys/src/cmd/cpu.c - 664 sys sys 1034195355 20296
+sys/src/cmd/cpu.c - 664 sys sys 1042571397 20349
 sys/src/cmd/crop.c - 664 sys sys 1039753034 4136
 sys/src/cmd/date.c - 664 sys sys 944961351 449
 sys/src/cmd/db - 20000000775 sys sys 988249965 0
@@ -8903,7 +8903,7 @@ sys/src/cmd/ip/httpd/man2html.c - 664 sys sys 1015090172 8789
 sys/src/cmd/ip/httpd/mkfile - 664 sys sys 1038443005 1384
 sys/src/cmd/ip/httpd/netlib_find.c - 664 sys sys 1015090172 6247
 sys/src/cmd/ip/httpd/netlib_history.c - 664 sys sys 1015096252 4744
-sys/src/cmd/ip/httpd/redirect.c - 664 sys sys 1017679316 2977
+sys/src/cmd/ip/httpd/redirect.c - 664 sys sys 1042522766 2978
 sys/src/cmd/ip/httpd/save.c - 664 sys sys 1015090172 3175
 sys/src/cmd/ip/httpd/sendfd.c - 664 sys sys 1017679317 12134
 sys/src/cmd/ip/httpd/wikipost.c - 664 sys sys 1019678647 5917

+ 16 - 0
dist/replica/plan9.log

@@ -17049,3 +17049,19 @@
 1042470154 0 c sys/man/1/rwd - 664 sys sys 1042469992 2958
 1042498864 0 c sys/src/9/pc/sdata.c - 664 sys sys 1042497924 44703
 1042498864 1 c sys/src/cmd/fossil/disk.c - 664 sys sys 1042497769 5736
+1042524093 0 c 386/bin/ip/httpd/httpd - 775 sys sys 1042522767 283517
+1042524093 1 c sys/src/cmd/ip/httpd/redirect.c - 664 sys sys 1042522766 2978
+1042568043 0 c rc/bin/ups - 775 sys sys 1042567965 989
+1042570975 0 c sys/src/cmd/cpu.c - 664 sys sys 1042570908 20251
+1042571404 0 c 386/bin/cpu - 775 sys sys 1042571399 137045
+1042571404 1 c sys/src/cmd/cpu.c - 664 sys sys 1042571397 20349
+1042605093 0 c 29000/include/u.h - 664 sys sys 1042604325 984
+1042605093 1 c 386/include/u.h - 664 sys sys 1042604326 1450
+1042605093 2 c 68000/include/u.h - 664 sys sys 1042604326 1435
+1042605093 3 c 68020/include/u.h - 664 sys sys 1042604327 1436
+1042605093 4 c 960/include/u.h - 664 sys sys 1042604328 959
+1042605093 5 c alpha/include/u.h - 664 sys sys 1042604328 1536
+1042605093 6 c arm/include/u.h - 664 sys sys 1042604329 1419
+1042605093 7 c mips/include/u.h - 664 sys sys 1042604329 1425
+1042605093 8 c power/include/u.h - 664 sys sys 1042604330 2764
+1042605093 9 c sparc/include/u.h - 664 sys sys 1042604330 1423

+ 3 - 0
mips/include/u.h

@@ -13,7 +13,10 @@ typedef long	jmp_buf[2];
 #define	JMPBUFPC	1
 #define	JMPBUFDPC	0
 typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
+typedef unsigned char u8int;
+typedef unsigned short u16int;
 typedef unsigned int	u32int;
+typedef unsigned long long u64int;
 
 /* FCR */
 #define	FPINEX	(1<<7)

+ 3 - 0
power/include/u.h

@@ -13,7 +13,10 @@ typedef long	jmp_buf[2];
 #define	JMPBUFPC	1
 #define	JMPBUFDPC	0
 typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
+typedef unsigned char u8int;
+typedef unsigned short u16int;
 typedef unsigned int	u32int;
+typedef unsigned long long u64int;
 
 /* FPSCR */
 #define	FPSFX	(1<<31)	/* exception summary (sticky) */

+ 8 - 2
rc/bin/ups

@@ -1,12 +1,18 @@
 #!/bin/rc
 
+# lucent web proxy caches the page; defeat it
+# rfork n
+# if(! test -d /net.alt/tcp) import achille /net.alt
+# bind /net.alt /net
+
+
 if(! ~ $#* 1) {
 	echo usage: ups 1ZA41W190338680961 >[1=2]
 	exit usage
 }
 
 rfork e
-hget -x /net.alt 'http://wwwapps.ups.com/etracking/tracking.cgi?track=Track&InquiryNumber1='^$1^ \
+hget 'http://wwwapps.ups.com/etracking/tracking.cgi?track=Track&InquiryNumber1='^$1^ \
 	'&TypeOfInquiryNumber=T' >/tmp/ups.1
 
 cat /tmp/ups.1 |
@@ -16,7 +22,7 @@ x=$"x
 x=`{echo $x | sed 's/ /\&/g'}
 x=$"x
 x=$x^'&tdts1.x=19&tdts1.y=7'
-hget -x /net.alt -p $x http://wwwapps.ups.com/etracking/tracking.cgi | htmlfmt >/tmp/ups.2
+hget -p $x http://wwwapps.ups.com/etracking/tracking.cgi | htmlfmt >/tmp/ups.2
 
 # to first blank line, output is a simple two-column table, followed by a blank line
 # after that it's a five column table followed by a blank line

+ 3 - 0
sparc/include/u.h

@@ -13,7 +13,10 @@ typedef long	jmp_buf[2];
 #define	JMPBUFPC	1
 #define	JMPBUFDPC	(-8)
 typedef unsigned int	mpdigit;	/* for /sys/include/mp.h */
+typedef unsigned char u8int;
+typedef unsigned short u16int;
 typedef unsigned int	u32int;
+typedef unsigned long long u64int;
 
 /* FCR */
 #define	FPINEX	(1<<23)

+ 12 - 14
sys/src/cmd/cpu.c

@@ -13,6 +13,7 @@
 #include <libsec.h>
 
 #define	Maxfdata 8192
+#define MaxStr 128
 
 void	remoteside(int);
 void	fatal(int, char*, ...);
@@ -27,9 +28,8 @@ int	setamalg(char*);
 char *keyspec = "";
 
 int 	notechan;
-char	system[32];
+char	*system;
 int	cflag;
-int	hflag;
 int	dbg;
 char	*user;
 
@@ -77,7 +77,7 @@ int fdd;
 void
 main(int argc, char **argv)
 {
-	char dat[128], buf[128], cmd[128], *p, *err;
+	char dat[MaxStr], buf[MaxStr], cmd[MaxStr], *p, *err;
 	int fd, ms, data;
 
 	/* see if we should use a larger message size */
@@ -117,9 +117,7 @@ main(int argc, char **argv)
 		remoteside(0);
 		break;
 	case 'h':
-		hflag++;
-		p = EARGF(usage());
-		strcpy(system, p);
+		system = EARGF(usage());
 		break;
 	case 'c':
 		cflag++;
@@ -141,11 +139,11 @@ main(int argc, char **argv)
 	if(argc != 0)
 		usage();
 
-	if(hflag == 0) {
+	if(system == nil) {
 		p = getenv("cpu");
 		if(p == 0)
 			fatal(0, "set $cpu");
-		strcpy(system, p);
+		system = p;
 	}
 
 	if(err = rexcall(&data, system, srvname))
@@ -251,7 +249,7 @@ old9p(int fd)
 void
 remoteside(int old)
 {
-	char user[128], home[128], buf[128], xdir[128], cmd[128];
+	char user[MaxStr], home[MaxStr], buf[MaxStr], xdir[MaxStr], cmd[MaxStr];
 	int i, n, fd, badchdir, gotcmd;
 
 	fd = 0;
@@ -342,9 +340,9 @@ char*
 rexcall(int *fd, char *host, char *service)
 {
 	char *na;
-	char dir[128];
+	char dir[MaxStr];
 	char err[ERRMAX];
-	char msg[128];
+	char msg[MaxStr];
 	int n;
 
 	na = netmkaddr(host, 0, service);
@@ -428,7 +426,7 @@ netkeyauth(int fd)
 	char chall[32];
 	char resp[32];
 
-	strcpy(chall, getuser());
+	strecpy(chall, chall+sizeof chall, getuser());
 	print("user[%s]: ", chall);
 	if(readln(resp, sizeof(resp)) < 0)
 		return -1;
@@ -541,7 +539,7 @@ noauth(int fd)
 static int
 srvnoauth(int fd, char *user)
 {
-	strcpy(user, getuser());
+	strecpy(user, user+MaxStr, getuser());
 	ealgs = nil;
 	return fd;
 }
@@ -572,7 +570,7 @@ srvp9auth(int fd, char *user)
 		return -1;
 	if(auth_chuid(ai, nil) < 0)
 		return -1;
-	strcpy(user, ai->cuid);
+	strecpy(user, user+MaxStr, ai->cuid);
 	memmove(key+4, ai->secret, ai->nsecret);
 
 	if(ealgs == nil)

+ 1 - 1
sys/src/cmd/ip/httpd/redirect.c

@@ -94,7 +94,7 @@ redirectinit(void)
 			if(strncmp(field[0], "http://", STRLEN("http://")) == 0 &&
 					strncmp(field[1], "http://", STRLEN("http://")) != 0){
 				host = field[0]+STRLEN("http://");
-				s = strstr(host, "/:");
+				s = strpbrk(host, "/:");
 				if(s)
 					*s = 0;  /* chop trailing slash or portnumber */
 				insert(vhosttab, estrdup(host), estrdup(field[1]));