Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

osx sys/io.h not found

I'd like to compile a c programm developed for linux using cc under os x. It includes the header sys/io.h. When compiling I get the error that this file could not be found? Isn't there any sys/io.h header file under os x?

Any help would be really appreciated!

Thanks!

like image 593
ioh Avatar asked Dec 22 '22 03:12

ioh


1 Answers

Include <sys/uio.h> instead.

or why not both?

#ifdef __APPLE__
        #include <sys/uio.h>
#else
        #include <sys/io.h>
#endif

In case of Apple OS (OSX/iOS) the code will know compile with <sys/uio.h>

like image 129
bibor Avatar answered Dec 24 '22 16:12

bibor