mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
apple
This commit is contained in:
parent
f462256db2
commit
a8ec4910fd
12 changed files with 18 additions and 12 deletions
|
@ -10,8 +10,10 @@ extern "C" {
|
||||||
#define _BSD_SOURCE 1
|
#define _BSD_SOURCE 1
|
||||||
#define _NETBSD_SOURCE 1 /* NetBSD */
|
#define _NETBSD_SOURCE 1 /* NetBSD */
|
||||||
#define _SVID_SOURCE 1
|
#define _SVID_SOURCE 1
|
||||||
#define _XOPEN_SOURCE 1000
|
#ifndef __APPLE__
|
||||||
#define _XOPEN_SOURCE_EXTENDED 1
|
# define _XOPEN_SOURCE 1000
|
||||||
|
# define _XOPEN_SOURCE_EXTENDED 1
|
||||||
|
#endif
|
||||||
#define _LARGEFILE64_SOURCE 1
|
#define _LARGEFILE64_SOURCE 1
|
||||||
#define _FILE_OFFSET_BITS 64
|
#define _FILE_OFFSET_BITS 64
|
||||||
|
|
||||||
|
@ -78,6 +80,7 @@ typedef long p9jmp_buf[sizeof(sigjmp_buf)/sizeof(long)];
|
||||||
# endif
|
# endif
|
||||||
# undef _ANSI_SOURCE
|
# undef _ANSI_SOURCE
|
||||||
# undef _POSIX_C_SOURCE
|
# undef _POSIX_C_SOURCE
|
||||||
|
# undef _XOPEN_SOURCE
|
||||||
# if !defined(NSIG)
|
# if !defined(NSIG)
|
||||||
# define NSIG 32
|
# define NSIG 32
|
||||||
# endif
|
# endif
|
||||||
|
|
|
@ -146,6 +146,7 @@ parseinfo(char *desc, char **pp)
|
||||||
Type *t;
|
Type *t;
|
||||||
char *attr;
|
char *attr;
|
||||||
|
|
||||||
|
n1 = n2 = 0;
|
||||||
parsenum(desc, &n1, &n2, &desc);
|
parsenum(desc, &n1, &n2, &desc);
|
||||||
t = typebynum(n1, n2);
|
t = typebynum(n1, n2);
|
||||||
if(*desc != '='){
|
if(*desc != '='){
|
||||||
|
|
|
@ -605,6 +605,7 @@ simpleaddr(void)
|
||||||
Addr addr;
|
Addr addr;
|
||||||
Addr *ap, *nap;
|
Addr *ap, *nap;
|
||||||
|
|
||||||
|
addr.num = 0;
|
||||||
addr.next = 0;
|
addr.next = 0;
|
||||||
addr.u.left = 0;
|
addr.u.left = 0;
|
||||||
switch(cmdskipbl()){
|
switch(cmdskipbl()){
|
||||||
|
|
|
@ -696,6 +696,8 @@ openfile(Text *t, Expand *e)
|
||||||
Rune *rp;
|
Rune *rp;
|
||||||
uint dummy;
|
uint dummy;
|
||||||
|
|
||||||
|
r.q0 = 0;
|
||||||
|
r.q1 = 0;
|
||||||
if(e->nname == 0){
|
if(e->nname == 0){
|
||||||
w = t->w;
|
w = t->w;
|
||||||
if(w == nil)
|
if(w == nil)
|
||||||
|
|
|
@ -83,6 +83,7 @@ kread(ulong addr, char *buf, int size)
|
||||||
void
|
void
|
||||||
xnet(int first)
|
xnet(int first)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
ulong out, in, outb, inb, err;
|
ulong out, in, outb, inb, err;
|
||||||
static ulong ifnetaddr;
|
static ulong ifnetaddr;
|
||||||
ulong addr;
|
ulong addr;
|
||||||
|
@ -123,6 +124,8 @@ xnet(int first)
|
||||||
Bprint(&bout, "ethererr %lud\n", err);
|
Bprint(&bout, "ethererr %lud\n", err);
|
||||||
Bprint(&bout, "ether %lud\n", in+out);
|
Bprint(&bout, "ether %lud\n", in+out);
|
||||||
Bprint(&bout, "etherb %lud\n", inb+outb);
|
Bprint(&bout, "etherb %lud\n", inb+outb);
|
||||||
|
#endif
|
||||||
|
USED(first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -929,7 +929,7 @@ callunix(void)
|
||||||
*p = 0;
|
*p = 0;
|
||||||
pid = fork();
|
pid = fork();
|
||||||
if(pid == 0) {
|
if(pid == 0) {
|
||||||
execlp("rc", "rc", "-c", buf, 0);
|
execlp("rc", "rc", "-c", buf, (char*)0);
|
||||||
sysfatal("exec failed: %r");
|
sysfatal("exec failed: %r");
|
||||||
exits("execl failed");
|
exits("execl failed");
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,7 +144,7 @@ ysearch(char *file)
|
||||||
print("diff %s %s\n", pair[toggle^1], pair[toggle]);
|
print("diff %s %s\n", pair[toggle^1], pair[toggle]);
|
||||||
switch(rfork(RFFDG|RFPROC)){
|
switch(rfork(RFFDG|RFPROC)){
|
||||||
case 0:
|
case 0:
|
||||||
execlp("diff", "diff", diffb ? "-cb" : "-c", pair[toggle], pair[toggle ^ 1], 0);
|
execlp("diff", "diff", diffb ? "-cb" : "-c", pair[toggle], pair[toggle ^ 1], (char*)0);
|
||||||
fprint(2, "can't exec diff: %r\n");
|
fprint(2, "can't exec diff: %r\n");
|
||||||
exits(0);
|
exits(0);
|
||||||
case -1:
|
case -1:
|
||||||
|
|
|
@ -144,11 +144,6 @@ void vgoto(double n)
|
||||||
vpos = n;
|
vpos = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
double fabs(double x)
|
|
||||||
{
|
|
||||||
return x < 0 ? -x : x;
|
|
||||||
}
|
|
||||||
|
|
||||||
void hvflush(void) /* get to proper point for output */
|
void hvflush(void) /* get to proper point for output */
|
||||||
{
|
{
|
||||||
if (fabs(hpos-htrue) >= 0.0005) {
|
if (fabs(hpos-htrue) >= 0.0005) {
|
||||||
|
|
|
@ -108,7 +108,7 @@ Bgetfield(Biobuf *bp, int type, void *thing, int size) {
|
||||||
while (!bailout && (r = Bgetrune(bp))>=0) {
|
while (!bailout && (r = Bgetrune(bp))>=0) {
|
||||||
switch (sindex++) {
|
switch (sindex++) {
|
||||||
case 0:
|
case 0:
|
||||||
if (*c == '0') {
|
if (r == '0') {
|
||||||
base = 8;
|
base = 8;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <sys/wait.h>
|
|
||||||
|
|
||||||
#ifndef WCOREDUMP /* not on Mac OS X Tiger */
|
#ifndef WCOREDUMP /* not on Mac OS X Tiger */
|
||||||
#define WCOREDUMP(status) 0
|
#define WCOREDUMP(status) 0
|
||||||
|
|
|
@ -91,6 +91,7 @@ auth_getinfo(AuthRpc *rpc)
|
||||||
|
|
||||||
if(auth_rpc(rpc, "authinfo", nil, 0) != ARok)
|
if(auth_rpc(rpc, "authinfo", nil, 0) != ARok)
|
||||||
return nil;
|
return nil;
|
||||||
|
a = nil;
|
||||||
if(convM2AI((uchar*)rpc->arg, rpc->narg, &a) == nil){
|
if(convM2AI((uchar*)rpc->arg, rpc->narg, &a) == nil){
|
||||||
werrstr("bad auth info from factotum");
|
werrstr("bad auth info from factotum");
|
||||||
return nil;
|
return nil;
|
||||||
|
|
|
@ -115,7 +115,7 @@ static struct {
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
nfs3errstr(SunStatus status)
|
nfs3errstr(Nfs3Status status)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue