systemf icon indicating copy to clipboard operation
systemf copied to clipboard

Not able to call all syscalls

Open redfast00 opened this issue 9 years ago • 4 comments

We're currently using this as our production HTTP server :wink:. Since tape overflowing is implemented correctly, if you increment a cell that holds 255, it will wrap back to 0. This means that we aren't able to call all Linux syscalls, only those under 255.

redfast00 avatar Dec 13 '16 19:12 redfast00

Please feel free to make a pull request on this; we may need to do some discussion on implementation since this will have to be a breaking change and the example library will most likely have to be rewritten.

ajyoon avatar Dec 14 '16 00:12 ajyoon

A quick idea: if the instuction cell is 255, we look to the next cell and add that number to 255 and then call the syscall with the sum. We'll be able to get 512 syscalls with this, and it (mostly) doesn't break the examples, except if they use inotify_rm_watch.

redfast00 avatar Dec 14 '16 07:12 redfast00

This wouldn't be consistent with the way large numbers are handled in multi-byte argument values, where large cells are combined as big endian values. To be consistent with that, the argument form would have to change to something like:

  • first cell -> arg value cell length (n) (or some flag for 1 vs 2 cells)
  • nth cell -> arg value
  • rest as before

On the other hand, given how uncommon it would be to use those higher-value syscalls, maybe this as a weird edge-case would be fine.

ajyoon avatar Dec 14 '16 07:12 ajyoon