Skip to content

Adding SafePOSIX Implementation of Syscalls

kliu513 edited this page Nov 20, 2020 · 22 revisions

GlibC

To deliver the syscall to NaCl, add the interface of the syscall here:

  • Lind-GlibC/sysdeps/nacl/lind_syscalls.h
  • Lind-GlibC/sysdeps/nacl/lind_syscalls.c

Native Client

To pack the syscall and send it to Repy, add Remote Procedure Call (RPC) here:

  • native_client/src/shared/platform/lind_platform.h
  • native_client/src/shared/platform/lind_platform.c

To have SafePOSIX do the actual work, edit the syscall's NaCl implementation here:

  • native_client/src/trusted/service_runtime/nacl_syscall_common.c

Repy + SafePOSIX

This file is where RPC is accepted and syscalls are delivered to the dispatcher. Have the new syscall included here:

  • nacl_repy/seattlelib/lind_server.mix

To match the syscall with its Lind implementation, add a new pairing here:

  • nacl_repy/seattlelib/dispatcher.repy

Add the syscall's Lind implementation here:

  • nacl_repy/seattlelib/lind_fs_calls.py OR
  • nacl_repy/seattlelib/lind_net_calls.py

In this directory, you will also need to create a new .repy file that will act as the syscall's handler. There you do any mandatory checking and, after the syscall is implemented, pack the result back to NaCl.

Clone this wiki locally