Tip: Returning a System Call - ANLAB-KAIST/KENSv3 GitHub Wiki
TCPAssignment::systemCallback
method does not have a return value. Those system calls that may not return immediately, such as accept()
, need to be blocked until ready. You should store the corresponding UUID to return it later. For all system calls to return a value, you must use a returnSystemCall
method.
Note that returning systemCallback
without calling returnSystemCall
will block the application.
Example
void TCPAssignment::systemCallback(UUID syscallUUID, int pid,
const SystemCallParameter ¶m) {
this->returnSystemCall(syscallUUID, -ENOSYS); // returns -ENOSYS (Function not implemented) from system call `syscallUUID`
}