Skip to content

Tip: Returning a System Call

Wonsup Yoon edited this page Mar 26, 2021 · 7 revisions

TCPAssignment::systemCallback method does not have a return value. Therefore, you must use a returnSystemCall method. It is because not all system calls are able to return immediately. Accept system calls, for example, need to be blocked until a new connection setup. Note that you should have to store system call’s UUID to return it later.

Example

void TCPAssignment::systemCallback(UUID syscallUUID, int pid,
                                   const SystemCallParameter &param) {

    this->returnSystemCall(syscallUUID, -ENOSYS); // returns -ENOSYS (Function not implemented) from system call `syscallUUID`
}