--- a/sys/src/cmd/unix/u9fs/authrhosts.c +++ b/sys/src/cmd/unix/u9fs/authrhosts.c @@ -1,6 +1,7 @@ #include #include #include +#include /* * return whether the user is authenticated. --- a/sys/src/cmd/unix/u9fs/fcall.h +++ b/sys/src/cmd/unix/u9fs/fcall.h @@ -48,7 +48,7 @@ struct Fcall #define GBIT8(p) ((p)[0]) #define GBIT16(p) ((p)[0]|((p)[1]<<8)) #define GBIT32(p) ((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) -#define GBIT64(p) ((ulong)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\ +#define GBIT64(p) ((u32int)((p)[0]|((p)[1]<<8)|((p)[2]<<16)|((p)[3]<<24)) |\ ((vlong)((p)[4]|((p)[5]<<8)|((p)[6]<<16)|((p)[7]<<24)) << 32)) #define PBIT8(p,v) (p)[0]=(v) --- a/sys/src/cmd/unix/u9fs/plan9.h +++ b/sys/src/cmd/unix/u9fs/plan9.h @@ -5,6 +5,8 @@ /* magic to get 64-bit stat on Linux, maybe others */ #define _FILE_OFFSET_BITS 64 +#define _DEFAULT_SOURCE 1 /* also for ruserok */ + #ifdef sgi #define _BSD_TYPES 1 /* for struct timeval */ #include @@ -106,6 +108,7 @@ extern int runetochar(char*, Rune*); extern int chartorune(Rune*, char*); extern int runelen(long); extern int utflen(char*); +extern char* utfrune(char*, long); extern char* strecpy(char*, char*, char*); extern int tokenize(char*, char**, int); extern int getfields(char*, char**, int, int, char*); @@ -188,6 +191,7 @@ struct Dir { long readn(int, void*, long); void remotehost(char*, int); +void sysfatal(char*, ...); enum { NAMELEN = 28, --- a/sys/src/cmd/unix/u9fs/rune.c +++ b/sys/src/cmd/unix/u9fs/rune.c @@ -8,6 +8,7 @@ enum Bit2 = 5, Bit3 = 4, Bit4 = 3, + Bit5 = 2, T1 = ((1<<(Bit1+1))-1) ^ 0xFF, /* 0000 0000 */ Tx = ((1<<(Bitx+1))-1) ^ 0xFF, /* 1000 0000 */ @@ -28,6 +29,7 @@ enum SurrogateMin = 0xD800, SurrogateMax = 0xDFFF, + Runemax = 0x10FFFF, /* 21-bit rune */ Bad = Runeerror }; --- a/sys/src/cmd/unix/u9fs/safecpy.c +++ b/sys/src/cmd/unix/u9fs/safecpy.c @@ -1,3 +1,5 @@ +#include +#include #include void --- a/sys/src/cmd/unix/u9fs/u9fs.c +++ b/sys/src/cmd/unix/u9fs/u9fs.c @@ -71,7 +71,6 @@ void* emalloc(size_t); void* erealloc(void*, size_t); char* estrdup(char*); char* estrpath(char*, char*, int); -void sysfatal(char*, ...); int okuser(char*); void rversion(Fcall*, Fcall*); --- a/sys/src/cmd/unix/u9fs/u9fs.h +++ b/sys/src/cmd/unix/u9fs/u9fs.h @@ -28,3 +28,4 @@ Fid *newauthfid(int fid, void *magic, char **ep); Fid *oldauthfid(int fid, void **magic, char **ep); void safecpy(char *to, char *from, int len); +void getremotehostname(char*, int);