diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-04-04 09:05:51 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2012-04-04 09:05:51 (GMT) |
commit | 9d18f21a9b72dcd0b9d2bd5f29b80390560e1952 (patch) | |
tree | 65cab1f3b3d6a018af1926ded98137478d1bd3c1 /generic/tclIOSock.c | |
parent | 2693c54806793a6cb5395149bdad83c3c9ade146 (diff) | |
parent | a81b482049e1a4a1892c10aaa66830f925d14b34 (diff) | |
download | tcl-9d18f21a9b72dcd0b9d2bd5f29b80390560e1952.zip tcl-9d18f21a9b72dcd0b9d2bd5f29b80390560e1952.tar.gz tcl-9d18f21a9b72dcd0b9d2bd5f29b80390560e1952.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 ec4a9d9..7233646 100644 --- a/generic/tclIOSock.c +++ b/generic/tclIOSock.c @@ -81,25 +81,30 @@ TclSockGetPort( *---------------------------------------------------------------------- */ +#undef TclSockMinimumBuffers +#ifndef _WIN32 +# define SOCKET int +#endif + int TclSockMinimumBuffers( - 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; } |