113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
#if !defined(_WIN32) && !defined(__CYGWIN__)
# define SOCKET int
#endif
int
TclSockMinimumBuffers(
void *sock, /* Socket file descriptor */
size_t size1) /* Minimum buffer size */
{
int current;
socklen_t len;
int size = size1;
if ((size_t)size != size1) {
return TCL_ERROR;
}
len = sizeof(int);
getsockopt((SOCKET)(size_t) sock, SOL_SOCKET, SO_SNDBUF,
(char *) ¤t, &len);
if (current < size) {
len = sizeof(int);
|
|
|
|
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
#if !defined(_WIN32) && !defined(__CYGWIN__)
# define SOCKET int
#endif
int
TclSockMinimumBuffers(
void *sock, /* Socket file descriptor */
Tcl_Size size1) /* Minimum buffer size */
{
int current;
socklen_t len;
int size = size1;
if (size != size1) {
return TCL_ERROR;
}
len = sizeof(int);
getsockopt((SOCKET)(size_t) sock, SOL_SOCKET, SO_SNDBUF,
(char *) ¤t, &len);
if (current < size) {
len = sizeof(int);
|