Convert os_unix.c to C++