diff --git a/lang/pc/libpc/catch.c b/lang/pc/libpc/catch.c index 311936bb7..616a18d59 100644 --- a/lang/pc/libpc/catch.c +++ b/lang/pc/libpc/catch.c @@ -88,10 +88,8 @@ extern char **_penvp; extern char *_hol0(); extern _trp(); -extern exit(); -extern int open(); -extern int read(); -extern int write(); +extern _exit(); +extern int _write(); _catch(erno) unsigned erno; { register struct errm *ep = &errors[0]; @@ -146,10 +144,10 @@ _catch(erno) unsigned erno; { p = q; while (*p) p++; - if (write(2,q,p-q) < 0) + if (_write(2,q,p-q) < 0) ; } - exit(erno); + _exit(erno); error: _trp(erno); } diff --git a/lang/pc/libpc/clock.c b/lang/pc/libpc/clock.c index d790ddd10..f5847696a 100644 --- a/lang/pc/libpc/clock.c +++ b/lang/pc/libpc/clock.c @@ -20,7 +20,7 @@ /* function clock:integer; extern; */ -extern int times(); +extern int _times(); struct tbuf { long utime; @@ -36,7 +36,7 @@ struct tbuf { int clock() { struct tbuf t; - times(&t); + _times(&t); return( (int)(t.utime + t.stime) & #if EM_WSIZE <= 2 077777 diff --git a/lang/pc/libpc/cls.c b/lang/pc/libpc/cls.c index 2234e1988..f891a3658 100644 --- a/lang/pc/libpc/cls.c +++ b/lang/pc/libpc/cls.c @@ -25,7 +25,7 @@ extern struct file *_curfil; extern _trp(); extern _flush(); extern _outcpt(); -extern int close(); +extern int _close(); _xcls(f) struct file *f; { @@ -61,7 +61,7 @@ _cls(f) struct file *f; { return; #endif _xcls(f); - if (close(f->ufd) != 0) + if (_close(f->ufd) != 0) _trp(ECLOSE); f->flags = 0; } diff --git a/lang/pc/libpc/hlt.c b/lang/pc/libpc/hlt.c index 99cf68cd3..0c04c592e 100644 --- a/lang/pc/libpc/hlt.c +++ b/lang/pc/libpc/hlt.c @@ -23,7 +23,7 @@ extern struct file **_extfl; extern int _extflc; extern _cls(); -extern exit(); +extern _exit(); _hlt(ecode) int ecode; { int i; @@ -31,5 +31,5 @@ _hlt(ecode) int ecode; { for (i = 0; i < _extflc; i++) if (_extfl[i] != (struct file *) 0) _cls(_extfl[i]); - exit(ecode); + _exit(ecode); } diff --git a/lang/pc/libpc/incpt.c b/lang/pc/libpc/incpt.c index 9ba7495b8..5818a8604 100644 --- a/lang/pc/libpc/incpt.c +++ b/lang/pc/libpc/incpt.c @@ -25,7 +25,7 @@ extern int errno; extern _trp(); -extern int read(); +extern int _read(); _incpt(f) struct file *f; { @@ -40,7 +40,7 @@ _incpt(f) struct file *f; { if (f->count == 0) { f->ptr = f->bufadr; for(;;) { - f->count=read(f->ufd,f->bufadr,f->buflen); + f->count=_read(f->ufd,f->bufadr,f->buflen); if ( f->count<0 ) { if (errno != EINTR) _trp(EREAD) ; continue ; diff --git a/lang/pc/libpc/ini.c b/lang/pc/libpc/ini.c index a6211634c..774846493 100644 --- a/lang/pc/libpc/ini.c +++ b/lang/pc/libpc/ini.c @@ -24,7 +24,7 @@ extern (*_sig())(); extern _catch(); #ifndef CPM -extern int gtty(); +extern int _gtty(); #endif struct file **_extfl; @@ -34,6 +34,7 @@ struct file *_curfil; /* points to file struct in case of errors */ int _pargc; char **_pargv; char **_penvp; +int _fp_hook = 1; /* This is for Minix, but does not harm others */ _ini(args,c,p,mainlb) char *args,*mainlb; int c; struct file **p; { struct file *f; @@ -65,7 +66,7 @@ _ini(args,c,p,mainlb) char *args,*mainlb; int c; struct file **p; { #ifdef CPM f->count = 1; #else - f->count = (gtty(1,buf) >= 0 ? 1 : PC_BUFLEN); + f->count = (_gtty(1,buf) >= 0 ? 1 : PC_BUFLEN); #endif f->buflen = f->count; } diff --git a/lang/pc/libpc/opn.c b/lang/pc/libpc/opn.c index 3cb933ed3..40aebee71 100644 --- a/lang/pc/libpc/opn.c +++ b/lang/pc/libpc/opn.c @@ -31,32 +31,32 @@ extern char **_penvp; extern _cls(); extern _xcls(); extern _trp(); -extern int getpid(); -extern int creat(); -extern int open(); -extern int close(); -extern int unlink(); -extern long lseek(); +extern int _getpid(); +extern int _creat(); +extern int _open(); +extern int _close(); +extern int _unlink(); +extern long _lseek(); static int tmpfil() { int i; char *p,*q; - i = getpid(); + i = _getpid(); p = "/usr/tmp/plf.xxxxx"; q = p + 13; do *q++ = (i & 07) + '0'; while (i >>= 3); *q = '\0'; - if ((i = creat(p,0644)) < 0) - if ((i = creat(p += 4,0644)) < 0) - if ((i = creat(p += 5,0644)) < 0) + if ((i = _creat(p,0644)) < 0) + if ((i = _creat(p += 4,0644)) < 0) + if ((i = _creat(p += 5,0644)) < 0) goto error; - if (close(i) != 0) + if (_close(i) != 0) goto error; - if ((i = open(p,2)) < 0) + if ((i = _open(p,2)) < 0) goto error; - if (unlink(p) != 0) + if (_unlink(p) != 0) error: _trp(EREWR); return(i); } @@ -76,7 +76,7 @@ static int initfl(descr,sz,f) int descr; int sz; struct file *f; { f->fname = "LOCAL"; if ((descr & WRBIT) == 0 && (f->flags & 0377) == MAGIC) { _xcls(f); - if (lseek(f->ufd,(long)0,0) == -1) + if (_lseek(f->ufd,(long)0,0) == -1) _trp(ERESET); } else { _cls(f); @@ -90,10 +90,10 @@ static int initfl(descr,sz,f) int descr; int sz; struct file *f; { f->fname = _pargv[i]; _cls(f); if ((descr & WRBIT) == 0) { - if ((f->ufd = open(f->fname,0)) < 0) + if ((f->ufd = _open(f->fname,0)) < 0) _trp(ERESET); } else { - if ((f->ufd = creat(f->fname,0644)) < 0) + if ((f->ufd = _creat(f->fname,0644)) < 0) _trp(EREWR); } } diff --git a/lang/pc/libpc/outcpt.c b/lang/pc/libpc/outcpt.c index 8717317b3..98b02e5b3 100644 --- a/lang/pc/libpc/outcpt.c +++ b/lang/pc/libpc/outcpt.c @@ -25,7 +25,7 @@ extern int errno; extern _trp(); -extern int write(); +extern int _write(); _flush(f) struct file *f; { int i,n; @@ -35,7 +35,7 @@ _flush(f) struct file *f; { if (n <= 0) return; f->count = f->buflen; - if ((i = write(f->ufd,f->bufadr,n)) < 0 && errno == EINTR) + if ((i = _write(f->ufd,f->bufadr,n)) < 0 && errno == EINTR) return; if (i != n) _trp(EWRITE); diff --git a/lang/pc/libpc/pcreat.c b/lang/pc/libpc/pcreat.c index 7e3935a7f..f1190b922 100644 --- a/lang/pc/libpc/pcreat.c +++ b/lang/pc/libpc/pcreat.c @@ -23,7 +23,7 @@ extern _cls(); extern _trp(); -extern int creat(); +extern int _creat(); /* procedure pcreat(var f:text; s:string); */ @@ -36,6 +36,6 @@ pcreat(f,s) struct file *f; char *s; { f->size = 1; f->count = PC_BUFLEN; f->buflen = PC_BUFLEN; - if ((f->ufd = creat(s,0644)) < 0) + if ((f->ufd = _creat(s,0644)) < 0) _trp(EREWR); } diff --git a/lang/pc/libpc/popen.c b/lang/pc/libpc/popen.c index 7baac96ce..b542c7ee3 100644 --- a/lang/pc/libpc/popen.c +++ b/lang/pc/libpc/popen.c @@ -23,7 +23,7 @@ extern _cls(); extern _trp(); -extern int open(); +extern int _open(); /* procedure popen(var f:text; s:string); */ @@ -36,6 +36,6 @@ popen(f,s) struct file *f; char *s; { f->size = 1; f->count = 0; f->buflen = PC_BUFLEN; - if ((f->ufd = open(s,0)) < 0) + if ((f->ufd = _open(s,0)) < 0) _trp(ERESET); } diff --git a/lang/pc/libpc/rcka.c b/lang/pc/libpc/rcka.c index d384013a9..b08b6b0be 100644 --- a/lang/pc/libpc/rcka.c +++ b/lang/pc/libpc/rcka.c @@ -8,7 +8,7 @@ #include -extern trp(); +extern _trp(); struct array_descr { int lbound; @@ -21,5 +21,5 @@ struct array_descr *descr; { if( index < descr->lbound || index > (int) descr->n_elts_min_one + descr->lbound ) - _trp(ERANGE); + _trp(EARRAY); } diff --git a/lang/pc/libpc/uread.c b/lang/pc/libpc/uread.c index 5e504eb25..ce700470e 100644 --- a/lang/pc/libpc/uread.c +++ b/lang/pc/libpc/uread.c @@ -18,8 +18,8 @@ /* function uread(fd:integer; var b:buf; n:integer):integer; */ -extern int read(); +extern int _read(); int uread(fd,b,n) char *b; int fd,n; { - return(read(fd,b,n)); + return(_read(fd,b,n)); } diff --git a/lang/pc/libpc/uwrite.c b/lang/pc/libpc/uwrite.c index 7cf7d557a..1a1a20c0a 100644 --- a/lang/pc/libpc/uwrite.c +++ b/lang/pc/libpc/uwrite.c @@ -18,8 +18,8 @@ /* function uwrite(fd:integer; var b:buf; n:integer):integer; */ -extern int write(); +extern int _write(); int uwrite(fd,b,n) char *b; int fd,n; { - return(write(fd,b,n)); + return(_write(fd,b,n)); }