Update:
My patch was accepted into the Torsocks source code. If you are getting an error for unsupported syscall 217, get the newest Torsocks code: https://gitweb.torproject.org/torsocks.git.
If you are getting an error for a different unsupported syscall, please make a ticket on the bugtracker: https://trac.torproject.org/projects/tor/newticket
A patch was recently developed to make torsocks support exactly this syscall (217: getdents64). The patch hasn't been accepted into the main build yet but you can easily build it yourself. Just clone this git repo: https://github.com/seisvelas/torsocks and follow the build instructions.
The patch should (hopefully) be a part of official torsocks very soon. You can follow the bug report on the tracker here:
https://trac.torproject.org/projects/tor/ticket/28861
If you're wondering why this happens, it's because torsocks has a whitelist of which syscalls are allowed. Version 3 of torsocks hopefully should address this problem by using seccomp/pledge but is currently very early in development. In the meantime, syscalls that don't represent security issues can be manually added to the whitelist. Since getdents and getdents64 (the latter being the syscall that gave OP his issue) seem unproblematic to me I developed the linked patch and am currently awaiting its acceptance into the main torsocks codebase.