From b4b754045385326dfbde9f29605ad4075dc29b6b Mon Sep 17 00:00:00 2001 From: Oliver Lehmann Date: Mon, 19 May 2008 20:10:19 +0000 Subject: [PATCH] STATUS: 74% done 0000 T _gtime compatible 000e T _ftime compatible 00a4 T _stime compatible 00d2 T _setuid compatible 012e T _getuid compatible 0148 T _setgid compatible 019a T _getgid compatible 01b4 T _getpid compatible 01d0 T _setpgrp compatible 0206 T _sync compatible 020e T _nice compatible 027c T _unlink compatible 038e T _chdir compatible 0398 T _chroot compatible 03ac T _chdirec compatible 042a T _chmod compatible 04a0 T _chown compatible 04fa T _ssig not compatible 0612 T _kill not compatible 0722 T _times not compatible 077a T _profil compatible 07ac T _sprofil not existent 0872 T _alarm compatible 08aa T _pause compatible 08bc T _umask compatible 08e0 T _utime not compatible 09ee T _nosys compatible 09f8 T _nullsys compatible 09fa T _bpt not existent 0a0a T _utssys not compatible 0b0a T _ulimit nearly compatible --- WEGA/src/uts/sys/sys4.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/WEGA/src/uts/sys/sys4.c b/WEGA/src/uts/sys/sys4.c index 83d63e5..5fca1dd 100644 --- a/WEGA/src/uts/sys/sys4.c +++ b/WEGA/src/uts/sys/sys4.c @@ -53,18 +53,21 @@ ftime() } *uap; struct timeb t; register unsigned ms; + extern int Timezone; + extern int Dstflag; uap = (struct a *)u.u_ap; dvi(); t.time = time; ms = lbolt; + evi(); if (ms > HZ) { ms -= HZ; t.time++; } t.millitm = (1000*ms)/HZ; - t.timezone = TIMEZONE; - t.dstflag = DSTFLAG; + t.timezone = Timezone; + t.dstflag = Dstflag; if (copyout((caddr_t)&t, (caddr_t)uap->tp, sizeof(t)) < 0) u.u_error = EFAULT; } @@ -572,7 +575,7 @@ ulimit() int cmd; long arg; } *uap; - register brk, stk; + register stk, j, brk, i; uap = (struct a *)u.u_ap; switch(uap->cmd) { @@ -585,12 +588,19 @@ ulimit() break; case 3: - brk = 1024 - u.u_dsize - - ((u.u_ssize + btoct(8*1024) - 1)/btoct(8*1024)) - * btoct(8*1024); - if ((stk = btoct(8*1024) - u.u_ssize % btoct(8*1024)) < USIZE) - brk -= USIZE - stk; - u.u_r.r_off = ctob((long)brk); + if (u.u_segmented) { + brk = u.u_segno[u.u_nsegs - 1]; + stk = 256; + } else { + brk = 0; + stk = 256 - u.u_ssize; + } + i = umemory-USIZE-u.u_tsize-u.u_ssize-u.u_dsize; + + u.u_r.r_val1 = brk; + u.u_r.r_val2 = min(i,stk)<<8; + break; } + }