I have some (presumably stable) legacy C code that uses POSIX system calls to read binary files. It's nothing more than creat()
, read()
, and write()
. The program doesn't sit close to the metal at all (it loads string data into memory), so it seems wrong that it's using syscalls. I think I can refactor it easily to use more standard functions.
But, given that my code doesn't need to be portable, I can't think of a good reason to rewrite it. Am I missing something, or should I leave the code be?
syscalls
? here is the synopsis for asyscall()
: #define _GNU_SOURCE /* See feature_test_macros(7) / #include <unistd.h> #include <sys/syscall.h> / For SYS_xxx definitions */ int syscall(int number, ...); Note: the...
is a variable list of parameters for the called function