diff --git a/src/sys/kernel/syscall.c b/src/sys/kernel/syscall.c index a0e0869..ae9c6b6 100644 --- a/src/sys/kernel/syscall.c +++ b/src/sys/kernel/syscall.c @@ -65,27 +65,32 @@ ); void sysGetpid(int *pid) { - *pid = _current->id; + if (pid) + *pid = _current->id; return; } void sysGetUid(int *uid) { - *uid = _current->uid; + if (uid) + *uid = _current->uid; return; } void sysGetGid(int *gid) { - *gid = _current->gid; + if (gid) + *gid = _current->gid; return; } void sysSetUid(int uid,int *status) { if (_current->uid == 0x0) { _current->uid = uid; - *status = 0x0; + if (status) + *status = 0x0; } else { - *status = 1; + if (status) + *status = 1; } return; } @@ -93,10 +98,12 @@ void sysSetGid(int gid,int *status) { if (_current->gid == 0x0) { _current->gid = gid; - *status = 0x0; + if (status) + *status = 0x0; } else { - *status = 1; + if (status) + *status = 1; } return; } @@ -120,28 +127,33 @@ ************************************************************************/ void sysGetFreePage(long *ptr,int count) { - *ptr = (long) vmmGetFreeVirtualPage(_current->id,count); + if (ptr) + *ptr = (long) vmmGetFreeVirtualPage(_current->id,count); return; } void sysGetDrives(uInt32 *ptr) { - *ptr = 0x0;//(uInt32)devices; + if (ptr) + *ptr = 0x0;//(uInt32)devices; return; } void sysGetUptime(uInt32 *ptr) { - *ptr = systemVitals->sysTicks; + if (ptr) + *ptr = systemVitals->sysTicks; return; } void sysGetTime(uInt32 *ptr) { - *ptr = systemVitals->sysUptime + systemVitals->timeStart; + if (ptr) + *ptr = systemVitals->sysUptime + systemVitals->timeStart; return; } void sysGetCwd(char *data,int len) { - sprintf(data,_current->oInfo.cwd); + if (data) + sprintf(data,_current->oInfo.cwd); return; } @@ -162,32 +174,40 @@ } void sysMpiCreateMbox(uInt32 *status,char *name) { - *status = mpiCreateMbox(name); + if (status && name) + *status = mpiCreateMbox(name); return; } void sysMpiDestroyMbox(uInt32 *status,char *name) { - *status = mpiDestroyMbox(name); + if (status && name) + *status = mpiDestroyMbox(name); return; } void sysMpiPostMessage(char *name,uInt32 *type,void *data) { - *type = mpiPostMessage(name,*type,data); + if (type && name && data) + *type = mpiPostMessage(name,*type,data); return; } void sysMpiFetchMessage(char *name,mpiMessage_t *msg,uInt32 *status) { - *status = mpiFetchMessage(name,msg); + if (status && name && msg) + *status = mpiFetchMessage(name,msg); return; } void sysMpiSpam(uInt32 type,void *data,uInt32 *status) { - *status = mpiSpam(type,data); + if (status && data) + *status = mpiSpam(type,data); return; } /*** $Log$ + Revision 1.21 2004/07/21 20:55:10 reddawg + fixed invalidSyscall + Revision 1.20 2004/07/21 20:36:55 reddawg New syscall interface