Skip to content

Instantly share code, notes, and snippets.

@qrilka
Last active June 14, 2020 19:06
Show Gist options
  • Save qrilka/a910e6aab6250190319913a9d1cf0138 to your computer and use it in GitHub Desktop.
Save qrilka/a910e6aab6250190319913a9d1cf0138 to your computer and use it in GitHub Desktop.
ZuriHac 2020 hatrace: syscalls to implement

Easy

FS

  • change directory: chdir, fchdir
  • change permissions: chmod, fchmod, fchmodat
  • change ownership: chown, fchown, lchown, fchownat
  • duplicate file descriptors: dup, dup2, dup3
  • create file descriptor for even notifications: eventfd, eventfd2, the latter is used by GHC RTS
  • FS synchronization: fdatasync, fsync, sync, syncfs - could be useful for checking if writes done by a program are durable
  • truncate file: truncate, ftruncate
  • create directory: mkdir, mkdirat
  • remove directory: rmdir
  • reposition file offset: lseek
  • get current working directory: getcwd
  • open an epoll file descriptor: epoll_create, epoll_create1, used by GHC RTS, makes sense to implement with epoll_wait/epoll_ctl

Misc

  • getting/setting user/group ids: getuid, setuid, getgid, setgid
  • getting effective user/group ids: geteuid, getegid

Medium

FS

  • directory entries: getdents, getdents64
  • locking: futex, used by GHC RTS

Networking

  • help Stefan with his connect PR so some other syscalls could reuse some data types

Misc

  • resource usage: getrusage, used by GHC RTS

Hard

FS

  • control interface for an epoll file descriptor: epoll_ctl, used by GHC RTS, see also epoll_create and epoll_wait
  • wait for an I/O event on an epoll file descriptor: epoll_wait/epoll_pwait, used by GHC RTS, see also epoll_create and epoll_ctl

Misc

  • execute BPF program: bpf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment