write function requires unistd.h on Unix, what about windows?

陌路散爱 提交于 2019-12-06 06:05:15

Your best bet is to use MinGW to compile the program, which includes (among other things) GCC (and its headers). Try installing that and then compiling your program and see if everything works OK.

read, write and close are in <io.h>, just like they traditionally were on Unix.

Offhand, I don't know of a bzero being included on Windows at all -- if you care at all about portability, you normally want to use memset instead.

socklen_t isn't normally used on Windows -- most things that would be socklen_t on Unix use either size_t or int on Windows (socklen_t on Unix is currently another reference to the same underlying type as size_t, added in case it might be useful someday -- aka, a solution in search of a problem).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!