next up previous index
Next: System Call Error Codes Up: Appendix A: Making System Previous: Appendix A: Making System   Index

System Call Interface

The system calls are implemented as a user toolset, tool number 3. These tools are called the same way regular system tools (such as QuickDraw) are called, except that you must JSL to $E10008 instead of to $E10000 (or to $E1000C instead of to $E10004 for the alternate entry point). The function numbers for the currently defined tools are as follows:

getpid * $0903 kill $0A03
fork $0B03 swait $0D03
ssignal $0E03 screate $0F03
sdelete $1003 kvm_open $1103
kvm_close $1203 kvm_getproc $1303
kvm_nextproc $1403 kvm_setproc $1503
signal $1603 wait $1703
tcnewpgrp $1803 settpgrp $1903
tctpgrp $1A03 sigsetmask $1B03
sigblock $1C03 execve $1D03
alarm $1E03 setdebug * $1F03
setsystemvector * $2003 sigpause $2103
dup $2203 dup2 $2303
pipe $2403 getpgrp $2503
ioctl $2603 stat $2703
fstat $2803 lstat $2903
getuid $2A03 getgid $2B03
geteuid $2C03 getegid $2D03
setuid $2E03 setgid $2F03
procsend $3003 procreceive $3103
procrecvclr $3203 procrecvtim $3303
setpgrp $3403 times $3503
pcreate $3603 psend $3703
preceive $3803 pdelete $3903
preset $3A03 pbind $3B03
pgetport $3C03 pgetcount $3D03
scount $3E03 fork2 $3F03
getppid $4003 SetGNOQuitRec $4103
alarm10 $4203    

The following system calls are new to GNO v2.0.6:

select $4303 InstallNetDriver $4403
socket $4503 bind $4603
connect $4703 listen $4803
accept $4903 recvfrom $4A03
sendto $4B03 recv $4C03
send $4D03 getpeername $4E03
getsockname $4F03 getsockopt $5003
setsockopt $5103 shutdown $5203
setreuid $5303 setregid $5403

Parameters should be pushed onto the stack in the same order as defined by the C prototypes outlines in the synopsis section of the manual pages; that is, left-to-right. In addition to those parameters, all of the functions (except those denoted by a *) take an integer pointer parameter errno. This is a pointer to a word value which will contain the errno code returned by the function if an error occurs, and should be pushed onto the stack after all the other parameters. The calls do not clear this code to 0 if no error occurs; thus, you must check the return value of the function to see if an error occurred, and then check errno to get the actual error code.

Do not forget to also push space on the stack (before the parameters) for the call to store its return value.

These low-level system call interfaces are not to be used in general programming. It is assumed the programmer will use the libraries provided, or use this information to create a new library. The system call interface is subject to change without notice; any changes will, of course, be documented in future versions of GNO/ME.


next up previous index
Next: System Call Error Codes Up: Appendix A: Making System Previous: Appendix A: Making System   Index
Feedback