From 45a20ab721a513710138340faff3d59a31c3e01e Mon Sep 17 00:00:00 2001 From: forsyth Date: Mon, 3 Jun 2013 21:01:14 +0000 Subject: sync compilers with Plan 9 remove 1[acl] 2[acl] --- utils/kl/Posix.c | 80 -------------------------------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 utils/kl/Posix.c (limited to 'utils/kl/Posix.c') diff --git a/utils/kl/Posix.c b/utils/kl/Posix.c deleted file mode 100644 index 7c3a661f..00000000 --- a/utils/kl/Posix.c +++ /dev/null @@ -1,80 +0,0 @@ -#include "l.h" -#include -#include -#undef getwd -#include /* For sysconf() and _SC_CLK_TCK */ - -/* - * fake malloc - */ -void* -malloc(size_t n) -{ - void *p; - - while(n & 7) - n++; - while(nhunk < n) - gethunk(); - p = hunk; - nhunk -= n; - hunk += n; - return p; -} - -void -free(void *p) -{ - USED(p); -} - -void* -calloc(size_t m, size_t n) -{ - void *p; - - n *= m; - p = malloc(n); - memset(p, 0, n); - return p; -} - -void* -realloc(void *p, size_t n) -{ - fprint(2, "realloc called\n", p, n); - abort(); - return 0; -} - -void* -mysbrk(ulong size) -{ - return (void*)sbrk(size); -} - -double -cputime(void) -{ - - struct tms tmbuf; - double ret_val; - - /* - * times() only fials if &tmbuf is invalid. - */ - (void)times(&tmbuf); - /* - * Return the total time (in system clock ticks) - * spent in user code and system - * calls by both the calling process and its children. - */ - ret_val = (double)(tmbuf.tms_utime + tmbuf.tms_stime + - tmbuf.tms_cutime + tmbuf.tms_cstime); - /* - * Convert to seconds. - */ - ret_val *= sysconf(_SC_CLK_TCK); - return ret_val; - -} -- cgit v1.2.3