Revision db1a4972 cutils.c
b/cutils.c | ||
---|---|---|
233 | 233 |
count -= copy; |
234 | 234 |
} |
235 | 235 |
} |
236 |
|
|
237 |
#ifndef _WIN32 |
|
238 |
/* Sets a specific flag */ |
|
239 |
int fcntl_setfl(int fd, int flag) |
|
240 |
{ |
|
241 |
int flags; |
|
242 |
|
|
243 |
flags = fcntl(fd, F_GETFL); |
|
244 |
if (flags == -1) |
|
245 |
return -errno; |
|
246 |
|
|
247 |
if (fcntl(fd, F_SETFL, flags | flag) == -1) |
|
248 |
return -errno; |
|
249 |
|
|
250 |
return 0; |
|
251 |
} |
|
252 |
#endif |
|
253 |
|
Also available in: Unified diff