The Linux code should also work on any other platform which supports Berkeley sockets.
Really, that isn't Linux code. It is just Berkeley socket code.
Likewise, the Windows code could technically work on any other platform which supports WinSock.
Any code which truly depends on the platform should be labelled as such.