Il 28/03/2017 12:34, LacaK ha scritto:
This technique is used in fcl-net which should be cross-platform.
So I am right, when I say that also in Linux invald socket = -1
(in other words: in case of error syscall() returns always -1)
Becuase in other place I see another test "if socket < 0 then ..."
(which may mean that any negative value can be returned)
Most likely this is only because "socket < 0" is faster to write than
"socket = -1" :-)
From Linux man page for socket:
RETURN VALUE
On success, a file descriptor for the new socket is returned. On
error, -1 is returned, and errno is set appropriately.
Giuliano
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal