STATUS: 71% done

0000 T _gtime		compatible
    000e T _ftime		not 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 existent
    0b0a T _ulimit		not compatible
This commit is contained in:
Oliver Lehmann 2008-05-19 17:34:43 +00:00
parent 3c2a73daf3
commit 5ff6e8b5e0
1 changed files with 93 additions and 12 deletions

View File

@ -28,7 +28,10 @@ char sys4wstr[] = "@[$]sys4.c Rev : 4.2 09/26/83 22:15:02";
#include <sys/proc.h>
#include <sys/s.out.h>
#include <sys/user.h>
#include <sys/utsname.h>
#include <sys/timeb.h>
#include <sys/filsys.h>
#include <sys/mount.h>
/*
* Everything in this file is a routine implementing a system call.
@ -39,20 +42,46 @@ gtime()
u.u_r.r_time = time;
}
/*
* New time entry-- return TOD with milliseconds, timezone,
* DST flag
*/
ftime()
{
register struct a {
struct timeb *tp;
} *uap;
struct timeb t;
register unsigned ms;
uap = (struct a *)u.u_ap;
dvi();
t.time = time;
ms = lbolt;
if (ms > HZ) {
ms -= HZ;
t.time++;
}
t.millitm = (1000*ms)/HZ;
t.timezone = TIMEZONE;
t.dstflag = DSTFLAG;
if (copyout((caddr_t)&t, (caddr_t)uap->tp, sizeof(t)) < 0)
u.u_error = EFAULT;
}
/*
* Set the time
*/
stime()
{
register unsigned i;
register struct a {
time_t time;
} *uap;
uap = (struct a *)u.u_ap;
if (suser()) {
logtchg(uap->time);
if(suser())
time = uap->time;
}
}
setuid()
{
register uid;
@ -199,8 +228,7 @@ unlink()
u.u_dent.d_ino = 0;
u.u_segflg = 1;
writei(pp);
if (u.u_error)
goto out;
u.u_segflg = 0;
ip->i_nlink--;
ip->i_flag |= ICHG;
@ -263,11 +291,8 @@ chmod()
if ((ip = owner()) == NULL)
return;
ip->i_mode &= ~07777;
if (u.u_uid) {
if (u.u_uid)
uap->fmode &= ~ISVTX;
if (u.u_gid != ip->i_gid)
uap->fmode &= ~ISGID;
}
ip->i_mode |= uap->fmode&07777;
ip->i_flag |= ICHG;
if (ip->i_flag&ITEXT && (ip->i_mode&ISVTX)==0)
@ -485,6 +510,62 @@ utime()
iput(ip);
}
/*
* nonexistent system call-- signal bad system call.
*/
nosys()
{
u.u_error = EINVAL;
}
/*
* Ignored system call
*/
nullsys()
{
}
utssys()
{
register i;
register struct a {
char *cbuf;
int mv;
int type;
} *uap;
uap = (struct a *)u.u_ap;
switch(uap->type) {
case 0: /* uname */
if (copyout(&utsname, uap->cbuf, sizeof(struct utsname)))
u.u_error = EFAULT;
return;
/* case 1 was umask */
case 2: /* ustat */
for(i=0; i<NMOUNT; i++) {
register struct mount *mp;
mp = &mount[i];
if(mp->m_flags == MINUSE && mp->m_dev==uap->mv) {
register struct filsys *fp;
fp = mp->m_bufp->b_un.b_filsys;
if(copyout(&fp->s_tfree, uap->cbuf, 18))
u.u_error = EFAULT;
return;
}
}
u.u_error = EINVAL;
return;
default:
u.u_error = EFAULT;
}
}
ulimit()
{
register struct a {