| 136 return ret; |
136 return ret; |
| 137 } |
137 } |
| 138 |
138 |
| 139 /* fcntl.h */ |
139 /* fcntl.h */ |
| 140 /* This is not a full implementation of fcntl. Update as needed.. */ |
140 /* This is not a full implementation of fcntl. Update as needed.. */ |
| 141 int wpurple_fcntl(int socket, int command, int val) { |
141 int wpurple_fcntl(int socket, int command, ...) { |
| |
142 |
| 142 switch( command ) { |
143 switch( command ) { |
| |
144 case F_GETFL: |
| |
145 return 0; |
| |
146 |
| 143 case F_SETFL: |
147 case F_SETFL: |
| 144 { |
148 { |
| |
149 va_list args; |
| |
150 int val; |
| 145 int ret=0; |
151 int ret=0; |
| |
152 |
| |
153 va_start(args, command); |
| |
154 val = va_arg(args, int); |
| |
155 va_end(args); |
| 146 |
156 |
| 147 switch( val ) { |
157 switch( val ) { |
| 148 case O_NONBLOCK: |
158 case O_NONBLOCK: |
| 149 { |
159 { |
| 150 u_long imode=1; |
160 u_long imode=1; |
| 151 ret = ioctlsocket(socket, FIONBIO, &imode); |
161 ret = ioctlsocket(socket, FIONBIO, &imode); |
| 152 break; |
162 break; |
| 153 } |
163 } |
| 154 case 0: |
164 case 0: |
| 155 { |
165 { |
| 156 u_long imode=0; |
166 u_long imode=0; |
| 157 ret = ioctlsocket(socket, FIONBIO, &imode); |
167 ret = ioctlsocket(socket, FIONBIO, &imode); |
| 158 break; |
168 break; |
| 159 } |
169 } |
| 160 default: |
170 default: |