diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-04-04 08:36:18 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-04-04 08:36:18 (GMT) |
commit | 5cc8272056a2950e552b579f4717b123a9578bdc (patch) | |
tree | 2e90215cbb2831726d370df96220fde56b84545c /generic/tclIOSock.c | |
parent | c784b1f0894524685e6439e53ae4c96c1064f805 (diff) | |
parent | 4b80a508c87df4ea40e979f3c5fcef1de2c4afcf (diff) | |
download | tcl-5cc8272056a2950e552b579f4717b123a9578bdc.zip tcl-5cc8272056a2950e552b579f4717b123a9578bdc.tar.gz tcl-5cc8272056a2950e552b579f4717b123a9578bdc.tar.bz2 |
[Bug 510001]: TclSockMinimumBuffers needs plat imp
Diffstat (limited to 'generic/tclIOSock.c')
-rw-r--r-- | generic/tclIOSock.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/generic/tclIOSock.c b/generic/tclIOSock.c index f311912..159f3da 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -83,25 +83,30 @@ TclSockGetPort(interp, string, proto, portPtr) *---------------------------------------------------------------------- */ +#undef TclSockMinimumBuffers +#ifndef _WIN32 +# define SOCKET int +#endif + int TclSockMinimumBuffers(sock, size) - int sock; /* Socket file descriptor */ + void *sock; /* Socket file descriptor */ int size; /* Minimum buffer size */ { int current; socklen_t len; len = sizeof(int); - getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)¤t, &len); + getsockopt((SOCKET)sock, SOL_SOCKET, SO_SNDBUF, (char *)¤t, &len); if (current < size) { len = sizeof(int); - setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (char *)&size, len); + setsockopt((SOCKET)sock, SOL_SOCKET, SO_SNDBUF, (char *)&size, len); } len = sizeof(int); - getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)¤t, &len); + getsockopt((SOCKET)sock, SOL_SOCKET, SO_RCVBUF, (char *)¤t, &len); if (current < size) { len = sizeof(int); - setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&size, len); + setsockopt((SOCKET)sock, SOL_SOCKET, SO_RCVBUF, (char *)&size, len); } return TCL_OK; } |