forsyth20121205-174063a80cc13 years agoHistory
114 lines · 968 B · C
RawDownload
#include	"cc.h" void*mysbrk(ulong size){	return sbrk(size);} intmycreat(char *n, int p){ 	return create(n, 1, p);} intmywait(int *s){	int p;	Waitmsg *w; 	if((w = wait()) == nil)		return -1;	else{		p = w->pid;		*s = 0;		if(w->msg[0])			*s = 1;		free(w);		return p;	}} intmydup(int f1, int f2){	return dup(f1,f2);} intmypipe(int *fd){	return pipe(fd);} intsystemtype(int sys){ 	return sys&Plan9;} intpathchar(void){	return '/';} char*mygetwd(char *path, int len){	return getwd(path, len);} intmyexec(char *path, char *argv[]){	return exec(path, argv);} intmyfork(void){	return fork();} /* * fake mallocs */void*malloc(ulong n){	return alloc(n);} void*calloc(ulong m, ulong n){	return alloc(m*n);} void*realloc(void*, ulong){	fprint(2, "realloc called\n");	abort();	return 0;} voidfree(void*){} intmyaccess(char *f){	return access(f, AEXIST);} voidsetmalloctag(void*, ulong){}