For syscalls that the PS4 doesn't have available, we currently punt by always returning -1. There seems to be two broad categories for how we can usually do this better, though:
Syscalls that really have no equivalent at all, like fanotify_init, should set errno to ENOSYS, so that the caller will have a clue about why it actually failed, instead of getting a random unrelated error.
Syscalls that can be emulated in userspace with only slight degradation, like pipe2, should do that instead of failing entirely. In fact, in that case it looks like the code to do that is already there; we just #ifdef'ed out a bit too much.
For point #2, I handled the pipe2 instance, however I'll try to take another pass to see which other syscalls can be done this way. If you can think of any other ones, feel free to mention them :)
For syscalls that the PS4 doesn't have available, we currently punt by always returning -1. There seems to be two broad categories for how we can usually do this better, though:
fanotify_init
, should seterrno
toENOSYS
, so that the caller will have a clue about why it actually failed, instead of getting a random unrelated error.pipe2
, should do that instead of failing entirely. In fact, in that case it looks like the code to do that is already there; we just#ifdef
'ed out a bit too much.