Annoying changes to work on Sun boxes.
This commit is contained in:
parent
50e628cb8f
commit
1c253ceb58
19 changed files with 95 additions and 54 deletions
5
bin/9c
5
bin/9c
|
|
@ -15,8 +15,7 @@ usegcc()
|
||||||
"
|
"
|
||||||
}
|
}
|
||||||
|
|
||||||
cc=none
|
tag="`uname`-`uname -m`-${CC9:-cc}"
|
||||||
tag="`uname`-`uname -m`-${CC:-cc}"
|
|
||||||
case "$tag" in
|
case "$tag" in
|
||||||
*BSD*) usegcc ;;
|
*BSD*) usegcc ;;
|
||||||
*Darwin*) usegcc ;;
|
*Darwin*) usegcc ;;
|
||||||
|
|
@ -30,4 +29,4 @@ case "$tag" in
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
exec cc $cflags "$@"
|
exec $cc $cflags "$@"
|
||||||
|
|
|
||||||
18
bin/9l
18
bin/9l
|
|
@ -1,26 +1,18 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
ld=none
|
|
||||||
extralibs=-lm
|
extralibs=-lm
|
||||||
tag="`uname`-`uname -m`-${CC:-cc}"
|
tag="`uname`-`uname -m`"
|
||||||
case "$tag" in
|
case "$tag" in
|
||||||
*FreeBSD*) ld=gcc ;;
|
*FreeBSD*) ld=gcc ;;
|
||||||
*BSD*) ld=gcc ;;
|
*BSD*) ld=gcc ;;
|
||||||
*Linux*) ld=gcc ;;
|
*Linux*) ld=gcc ;;
|
||||||
*Darwin*) ld=gcc ;;
|
*Darwin*) ld=gcc ;;
|
||||||
*SunOS*-cc) ld=cc; extralibs="$extralibs -lrt -lpthread" ;;
|
*SunOS*) ld=${CC9:-cc}
|
||||||
*SunOS*-gcc) ld=gcc ;;
|
extralibs="$extralibs -lrt -lpthread -lsocket -lnsl"
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo do not know how to link on "$tag" 1>&2
|
echo do not know how to link on "$tag" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case $ld in
|
exec $ld -L$PLAN9/lib "$@" $extralibs
|
||||||
gcc)
|
|
||||||
exec gcc \
|
|
||||||
-ggdb \
|
|
||||||
-L$PLAN9/lib \
|
|
||||||
"$@" \
|
|
||||||
$extralibs
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,15 @@ extern "C" {
|
||||||
#define _NEEDUINT 1
|
#define _NEEDUINT 1
|
||||||
#define _NEEDULONG 1
|
#define _NEEDULONG 1
|
||||||
|
|
||||||
|
/* better to assume we have these and then be proved wrong */
|
||||||
|
#define _HAVESTGEN 1
|
||||||
|
#define _HAVETIMEGM 1
|
||||||
|
#define _HAVETMZONE 1
|
||||||
|
#define _HAVETMTZOFF 1
|
||||||
|
#define _HAVETIMEZONEINT 1
|
||||||
|
#define _HAVEFUTIMESAT 1
|
||||||
|
#define _HAVEFUTIMES 1
|
||||||
|
|
||||||
typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
|
typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
|
|
@ -45,6 +54,12 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
|
||||||
# undef _NEEDUSHORT
|
# undef _NEEDUSHORT
|
||||||
# undef _NEEDUINT
|
# undef _NEEDUINT
|
||||||
# undef _NEEDULONG
|
# undef _NEEDULONG
|
||||||
|
# undef _HAVESTGEN
|
||||||
|
# undef _HAVETIMEGM
|
||||||
|
# undef _HAVETMZONE
|
||||||
|
# undef _HAVETMTZOFF
|
||||||
|
# undef _HAVEFUTIMES
|
||||||
|
# undef _HAVEUTIMES
|
||||||
#endif
|
#endif
|
||||||
#if defined(__FreeBSD__)
|
#if defined(__FreeBSD__)
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
|
@ -52,6 +67,7 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
|
||||||
# undef _NEEDUSHORT
|
# undef _NEEDUSHORT
|
||||||
# undef _NEEDUINT
|
# undef _NEEDUINT
|
||||||
# endif
|
# endif
|
||||||
|
# define _HAVEDISKLABEL 1
|
||||||
#endif
|
#endif
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
# include <sys/types.h>
|
# include <sys/types.h>
|
||||||
|
|
@ -412,7 +428,7 @@ extern double atof(char*); <stdlib.h>
|
||||||
extern int atoi(char*);
|
extern int atoi(char*);
|
||||||
extern long atol(char*);
|
extern long atol(char*);
|
||||||
*/
|
*/
|
||||||
extern vlong atoll(char*);
|
extern vlong atoll(const char*);
|
||||||
extern double charstod(int(*)(void*), void*);
|
extern double charstod(int(*)(void*), void*);
|
||||||
extern char* cleanname(char*);
|
extern char* cleanname(char*);
|
||||||
extern int p9decrypt(void*, void*, int);
|
extern int p9decrypt(void*, void*, int);
|
||||||
|
|
@ -723,7 +739,7 @@ extern int p9dup(int, int);
|
||||||
extern int errstr(char*, uint);
|
extern int errstr(char*, uint);
|
||||||
extern int p9exec(char*, char*[]);
|
extern int p9exec(char*, char*[]);
|
||||||
/* extern int execl(char*, ...); <unistd.h> */
|
/* extern int execl(char*, ...); <unistd.h> */
|
||||||
extern int fork(void);
|
/* extern int fork(void); <unistd.h> */
|
||||||
extern int p9rfork(int);
|
extern int p9rfork(int);
|
||||||
/* not implemented
|
/* not implemented
|
||||||
extern int fauth(int, char*);
|
extern int fauth(int, char*);
|
||||||
|
|
@ -788,8 +804,8 @@ extern int dirfwstat(int, Dir*);
|
||||||
extern long dirread(int, Dir**);
|
extern long dirread(int, Dir**);
|
||||||
extern void nulldir(Dir*);
|
extern void nulldir(Dir*);
|
||||||
extern long dirreadall(int, Dir**);
|
extern long dirreadall(int, Dir**);
|
||||||
extern int getpid(void);
|
/* extern int getpid(void); <unistd.h> */
|
||||||
extern int getppid(void);
|
/* extern int getppid(void); */
|
||||||
extern void rerrstr(char*, uint);
|
extern void rerrstr(char*, uint);
|
||||||
extern char* sysname(void);
|
extern char* sysname(void);
|
||||||
extern void werrstr(char*, ...);
|
extern void werrstr(char*, ...);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
../bin/mk: mkmk.sh
|
../bin/mk: mkmk.sh
|
||||||
PATH=`pwd`/../bin:$PATH export PATH
|
PATH=`pwd`/../bin:$$PATH export PATH; \
|
||||||
|
PLAN9=`pwd`/.. export PLAN9; \
|
||||||
sh -x mkmk.sh
|
sh -x mkmk.sh
|
||||||
|
|
||||||
all clean install nuke: ../bin/mk
|
all clean install nuke: ../bin/mk
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ LDFLAGS=$LDFLAGS -lsec -lregexp9 -l9 -lbio -lfmt -lutf
|
||||||
|
|
||||||
<$PLAN9/src/mkmany
|
<$PLAN9/src/mkmany
|
||||||
|
|
||||||
BUGGERED='CVS|oplumb|plumb|plumb2|mk|vac'
|
BUGGERED='CVS|oplumb|plumb|plumb2|mk|vac|9term'
|
||||||
DIRS=`ls -l |sed -n 's/^d.* //p' |egrep -v "$BUGGERED"`
|
DIRS=`ls -l |sed -n 's/^d.* //p' |egrep -v "$BUGGERED"`
|
||||||
|
|
||||||
<$PLAN9/src/mkdirs
|
<$PLAN9/src/mkdirs
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
%left BANG SUBSHELL
|
%left BANG SUBSHELL
|
||||||
%left PIPE
|
%left PIPE
|
||||||
%left '^'
|
%left '^'
|
||||||
%right '$' COUNT '"'
|
%right '$' COUNT '\"'
|
||||||
%left SUB
|
%left SUB
|
||||||
%{
|
%{
|
||||||
#include "rc.h"
|
#include "rc.h"
|
||||||
|
|
|
||||||
|
|
@ -71,16 +71,12 @@ it:V: all
|
||||||
|
|
||||||
<$PLAN9/src/mkmany
|
<$PLAN9/src/mkmany
|
||||||
|
|
||||||
|
$SLIB: $LIBOFILES
|
||||||
|
ar rvc $SLIB $LIBOFILES
|
||||||
|
|
||||||
# xml.c:D: mkxml dat.h
|
# xml.c:D: mkxml dat.h
|
||||||
# ./mkxml dat.h > xml.c
|
# ./mkxml dat.h > xml.c
|
||||||
|
|
||||||
$SLIB(%.$O):N: %.$O
|
|
||||||
$SLIB: ${LIBOFILES:%=$SLIB(%)}
|
|
||||||
names=`echo $newprereq | sed -E 's/'$SLIB'\(([^)]+)\)/\1/g'`
|
|
||||||
# names = `{echo $newprereq |sed 's/ /\n/g' |sed -n 's/'$SLIB'\(([^)]+)\)/\1/gp'}
|
|
||||||
ar rvc $SLIB $names
|
|
||||||
# rm $names
|
|
||||||
|
|
||||||
ainstall:V: ${TARG:%=%.ainstall}
|
ainstall:V: ${TARG:%=%.ainstall}
|
||||||
|
|
||||||
%.ainstall:V: $O.%
|
%.ainstall:V: $O.%
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
#include <u.h>
|
|
||||||
#include <libc.h>
|
|
||||||
|
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
|
||||||
|
#include <u.h>
|
||||||
|
#include <libc.h>
|
||||||
|
|
||||||
static char *nets[] = { "tcp", "udp", nil };
|
static char *nets[] = { "tcp", "udp", nil };
|
||||||
#define CLASS(p) ((*(uchar*)(p))>>6)
|
#define CLASS(p) ((*(uchar*)(p))>>6)
|
||||||
|
|
||||||
|
|
@ -59,7 +59,7 @@ _p9dialparse(char *addr, char **pnet, char **punix, u32int *phost, int *pport)
|
||||||
int i;
|
int i;
|
||||||
struct servent *se;
|
struct servent *se;
|
||||||
struct hostent *he;
|
struct hostent *he;
|
||||||
struct sockaddr_un *sun;
|
struct sockaddr_un *sockun;
|
||||||
|
|
||||||
if(strncmp(addr, "/net/", 5) == 0)
|
if(strncmp(addr, "/net/", 5) == 0)
|
||||||
addr += 5;
|
addr += 5;
|
||||||
|
|
@ -73,7 +73,7 @@ _p9dialparse(char *addr, char **pnet, char **punix, u32int *phost, int *pport)
|
||||||
if((port = strchr(host, '!')) == nil){
|
if((port = strchr(host, '!')) == nil){
|
||||||
if(strcmp(net, "unix")==0 || strcmp(net, "net")==0){
|
if(strcmp(net, "unix")==0 || strcmp(net, "net")==0){
|
||||||
Unix:
|
Unix:
|
||||||
if(strlen(host)+1 > sizeof sun->sun_path){
|
if(strlen(host)+1 > sizeof sockun->sun_path){
|
||||||
werrstr("unix socket name too long");
|
werrstr("unix socket name too long");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
#include <u.h>
|
|
||||||
#define NOPLAN9DEFINES
|
|
||||||
#include <libc.h>
|
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#ifdef _HAVEDISKLABEL
|
||||||
#include <sys/disklabel.h>
|
#include <sys/disklabel.h>
|
||||||
|
#endif
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
|
|
||||||
|
#include <u.h>
|
||||||
|
#define NOPLAN9DEFINES
|
||||||
|
#include <libc.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
_p9dir(struct stat *st, char *name, Dir *d, char **str, char *estr)
|
_p9dir(struct stat *st, char *name, Dir *d, char **str, char *estr)
|
||||||
{
|
{
|
||||||
|
|
@ -83,7 +85,9 @@ _p9dir(struct stat *st, char *name, Dir *d, char **str, char *estr)
|
||||||
|
|
||||||
d->muid = "";
|
d->muid = "";
|
||||||
d->qid.path = ((uvlong)st->st_dev<<32) | st->st_ino;
|
d->qid.path = ((uvlong)st->st_dev<<32) | st->st_ino;
|
||||||
|
#ifdef _HAVESTGEN
|
||||||
d->qid.vers = st->st_gen;
|
d->qid.vers = st->st_gen;
|
||||||
|
#endif
|
||||||
d->mode = st->st_mode&0777;
|
d->mode = st->st_mode&0777;
|
||||||
d->atime = st->st_atime;
|
d->atime = st->st_atime;
|
||||||
d->mtime = st->st_mtime;
|
d->mtime = st->st_mtime;
|
||||||
|
|
@ -96,6 +100,7 @@ _p9dir(struct stat *st, char *name, Dir *d, char **str, char *estr)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fetch real size for disks */
|
/* fetch real size for disks */
|
||||||
|
#ifdef _HAVEDISKLABEL
|
||||||
if(S_ISCHR(st->st_mode)){
|
if(S_ISCHR(st->st_mode)){
|
||||||
int fd, n;
|
int fd, n;
|
||||||
struct disklabel lab;
|
struct disklabel lab;
|
||||||
|
|
@ -114,6 +119,7 @@ _p9dir(struct stat *st, char *name, Dir *d, char **str, char *estr)
|
||||||
if(fd >= 0)
|
if(fd >= 0)
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
return sz;
|
return sz;
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,8 @@
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
|
||||||
|
#undef sun
|
||||||
|
#define sun sockun
|
||||||
extern int _p9dialparse(char*, char**, char**, u32int*, int*);
|
extern int _p9dialparse(char*, char**, char**, u32int*, int*);
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -88,7 +90,6 @@ print("announce dir: %s\n", dir);
|
||||||
Unix:
|
Unix:
|
||||||
memset(&sun, 0, sizeof sun);
|
memset(&sun, 0, sizeof sun);
|
||||||
sun.sun_family = AF_UNIX;
|
sun.sun_family = AF_UNIX;
|
||||||
sun.sun_len = sizeof sun;
|
|
||||||
strcpy(sun.sun_path, unix);
|
strcpy(sun.sun_path, unix);
|
||||||
if((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
|
if((s = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,9 @@ static struct {
|
||||||
SIGVTALRM, "sys: virtual time alarm",
|
SIGVTALRM, "sys: virtual time alarm",
|
||||||
SIGPROF, "sys: profiling timer alarm",
|
SIGPROF, "sys: profiling timer alarm",
|
||||||
SIGWINCH, "sys: window size change",
|
SIGWINCH, "sys: window size change",
|
||||||
|
#ifdef SIGINFO
|
||||||
SIGINFO, "sys: status request",
|
SIGINFO, "sys: status request",
|
||||||
|
#endif
|
||||||
SIGUSR1, "sys: usr1",
|
SIGUSR1, "sys: usr1",
|
||||||
SIGUSR2, "sys: usr2",
|
SIGUSR2, "sys: usr2",
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,12 @@ tm2Tm(struct tm *tm, Tm *bigtm)
|
||||||
bigtm->mon = tm->tm_mon;
|
bigtm->mon = tm->tm_mon;
|
||||||
bigtm->year = tm->tm_year;
|
bigtm->year = tm->tm_year;
|
||||||
bigtm->wday = tm->tm_wday;
|
bigtm->wday = tm->tm_wday;
|
||||||
|
#ifdef _HAVETMZONE
|
||||||
strecpy(bigtm->zone, bigtm->zone+4, tm->tm_zone);
|
strecpy(bigtm->zone, bigtm->zone+4, tm->tm_zone);
|
||||||
|
#endif
|
||||||
|
#ifdef _HAVETZOFF
|
||||||
bigtm->tzoff = tm->tm_gmtoff;
|
bigtm->tzoff = tm->tm_gmtoff;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -40,8 +44,12 @@ Tm2tm(Tm *bigtm, struct tm *tm)
|
||||||
tm->tm_mon = bigtm->mon;
|
tm->tm_mon = bigtm->mon;
|
||||||
tm->tm_year = bigtm->year;
|
tm->tm_year = bigtm->year;
|
||||||
tm->tm_wday = bigtm->wday;
|
tm->tm_wday = bigtm->wday;
|
||||||
|
#ifdef _HAVETMZONE
|
||||||
tm->tm_zone = bigtm->zone;
|
tm->tm_zone = bigtm->zone;
|
||||||
|
#endif
|
||||||
|
#ifdef _HAVETZOFF
|
||||||
tm->tm_gmtoff = bigtm->tzoff;
|
tm->tm_gmtoff = bigtm->tzoff;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
Tm*
|
Tm*
|
||||||
|
|
@ -64,6 +72,14 @@ p9localtime(long t)
|
||||||
return &bigtm;
|
return &bigtm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(_HAVETIMEGM) && defined(_HAVETIMEZONEINT)
|
||||||
|
static long
|
||||||
|
timegm(struct tm *tm)
|
||||||
|
{
|
||||||
|
return mktime(tm)-timezone;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
long
|
long
|
||||||
p9tm2sec(Tm *bigtm)
|
p9tm2sec(Tm *bigtm)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,6 @@ p9dial(char *addr, char *dummy1, char *dummy2, int *dummy3)
|
||||||
|
|
||||||
Unix:
|
Unix:
|
||||||
memset(&su, 0, sizeof su);
|
memset(&su, 0, sizeof su);
|
||||||
su.sun_len = sizeof su;
|
|
||||||
su.sun_family = AF_UNIX;
|
su.sun_family = AF_UNIX;
|
||||||
if(strlen(unix)+1 > sizeof su.sun_path){
|
if(strlen(unix)+1 > sizeof su.sun_path){
|
||||||
werrstr("unix socket name too long");
|
werrstr("unix socket name too long");
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,14 @@
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
#if !defined(_HAVEFUTIMES) && defined(_HAVEFUTIMESAT)
|
||||||
|
static int
|
||||||
|
futimes(int fd, struct timeval *tv)
|
||||||
|
{
|
||||||
|
return futimesat(fd, 0, tv);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
dirfwstat(int fd, Dir *dir)
|
dirfwstat(int fd, Dir *dir)
|
||||||
{
|
{
|
||||||
|
|
@ -19,3 +27,4 @@ dirfwstat(int fd, Dir *dir)
|
||||||
tv[1].tv_usec = 0;
|
tv[1].tv_usec = 0;
|
||||||
return futimes(fd, tv);
|
return futimes(fd, tv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,10 +24,10 @@ countde(char *p, int n)
|
||||||
de = (struct dirent*)p;
|
de = (struct dirent*)p;
|
||||||
if(de->d_reclen <= 4+2+2+1 || p+de->d_reclen > e)
|
if(de->d_reclen <= 4+2+2+1 || p+de->d_reclen > e)
|
||||||
break;
|
break;
|
||||||
if(de->d_namlen == 1 && de->d_name[0]=='.')
|
if(de->d_name[0]=='.' && de->d_name[1]==0)
|
||||||
de->d_namlen = 0;
|
de->d_name[0] = 0;
|
||||||
else if(de->d_namlen == 2 && de->d_name[0]=='.' && de->d_name[1]=='.')
|
else if(de->d_name[0]=='.' && de->d_name[1]=='.' && de->d_name[2]==0)
|
||||||
de->d_namlen = 0;
|
de->d_name[0] = 0;
|
||||||
else
|
else
|
||||||
m++;
|
m++;
|
||||||
p += de->d_reclen;
|
p += de->d_reclen;
|
||||||
|
|
@ -59,7 +59,7 @@ dirpackage(int fd, char *buf, int n, Dir **dp)
|
||||||
for(i=0; i<n; i++){
|
for(i=0; i<n; i++){
|
||||||
de = (struct dirent*)p;
|
de = (struct dirent*)p;
|
||||||
if(stat(de->d_name, &st) < 0)
|
if(stat(de->d_name, &st) < 0)
|
||||||
de->d_namlen = 0;
|
de->d_name[0] = 0;
|
||||||
else
|
else
|
||||||
nstr += _p9dir(&st, de->d_name, nil, nil, nil);
|
nstr += _p9dir(&st, de->d_name, nil, nil, nil);
|
||||||
p += de->d_reclen;
|
p += de->d_reclen;
|
||||||
|
|
@ -78,7 +78,7 @@ dirpackage(int fd, char *buf, int n, Dir **dp)
|
||||||
m = 0;
|
m = 0;
|
||||||
for(i=0; i<n; i++){
|
for(i=0; i<n; i++){
|
||||||
de = (struct dirent*)p;
|
de = (struct dirent*)p;
|
||||||
if(de->d_namlen != 0 && stat(de->d_name, &st) >= 0)
|
if(de->d_name[0] != 0 && stat(de->d_name, &st) >= 0)
|
||||||
_p9dir(&st, de->d_name, &d[m++], &str, estr);
|
_p9dir(&st, de->d_name, &d[m++], &str, estr);
|
||||||
p += de->d_reclen;
|
p += de->d_reclen;
|
||||||
}
|
}
|
||||||
|
|
@ -108,7 +108,7 @@ dirread(int fd, Dir **dp)
|
||||||
if(buf == nil)
|
if(buf == nil)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
n = getdents(fd, buf, st.st_blksize);
|
n = getdents(fd, (struct dirent*)buf, st.st_blksize);
|
||||||
if(n < 0){
|
if(n < 0){
|
||||||
free(buf);
|
free(buf);
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -141,7 +141,7 @@ dirreadall(int fd, Dir **d)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
buf = nbuf;
|
buf = nbuf;
|
||||||
n = getdents(fd, buf+ts, st.st_blksize);
|
n = getdents(fd, (struct dirent*)(buf+ts), st.st_blksize);
|
||||||
if(n <= 0)
|
if(n <= 0)
|
||||||
break;
|
break;
|
||||||
ts += n;
|
ts += n;
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ OFILES=\
|
||||||
getuser.$O\
|
getuser.$O\
|
||||||
getwd.$O\
|
getwd.$O\
|
||||||
jmp.$O\
|
jmp.$O\
|
||||||
jmp-FreeBSD.$O\
|
jmp-$SYSNAME.$O\
|
||||||
lock.$O\
|
lock.$O\
|
||||||
main.$O\
|
main.$O\
|
||||||
malloctag.$O\
|
malloctag.$O\
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ p9rfork(int flags)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if(flags&RFNOTEG){
|
if(flags&RFNOTEG){
|
||||||
setpgrp(0, 0);
|
setpgid(0, getpid());
|
||||||
flags &= ~RFNOTEG;
|
flags &= ~RFNOTEG;
|
||||||
}
|
}
|
||||||
if(flags){
|
if(flags){
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ testmkmk:V:
|
||||||
ls -l ../bin/mk
|
ls -l ../bin/mk
|
||||||
|
|
||||||
testcvs:V:
|
testcvs:V:
|
||||||
cvs up -dAP
|
(cd ..; cvs up -dAP)
|
||||||
cp ../bin/_mk ../bin/mk
|
cp ../bin/_mk ../bin/mk
|
||||||
mk clean
|
mk clean
|
||||||
rm ../lib/*.a
|
rm ../lib/*.a
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,18 @@ SYSNAME=`uname`
|
||||||
OBJTYPE=`uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g'`
|
OBJTYPE=`uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g'`
|
||||||
|
|
||||||
X11=/usr/X11R6
|
X11=/usr/X11R6
|
||||||
LDFLAGS=
|
CC=9c
|
||||||
|
LD=9l
|
||||||
|
AS=9a
|
||||||
CFLAGS=
|
CFLAGS=
|
||||||
|
LDFLAGS=
|
||||||
AFLAGS=
|
AFLAGS=
|
||||||
|
O=o
|
||||||
|
|
||||||
BIN=$PLAN9/bin
|
BIN=$PLAN9/bin
|
||||||
LIBDIR=$PLAN9/lib
|
LIBDIR=$PLAN9/lib
|
||||||
|
|
||||||
<|sed -E '"s/(.*)\+=/\1=$\1 /g"' $PLAN9/src/Make.$SYSNAME-$OBJTYPE
|
<$PLAN9/src/mk.$SYSNAME-$OBJTYPE
|
||||||
|
|
||||||
OS=$O
|
OS=$O
|
||||||
LD=9l
|
LD=9l
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue