diff options
Diffstat (limited to 'libavformat/os_support.c')
-rw-r--r-- | libavformat/os_support.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libavformat/os_support.c b/libavformat/os_support.c index da303be49c..abee749aac 100644 --- a/libavformat/os_support.c +++ b/libavformat/os_support.c @@ -114,6 +114,14 @@ int resolve_host(struct in_addr *sin_addr, const char *hostname) } return 0; } + +int ff_socket_nonblock(int socket, int enable) +{ + if (enable) + return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) | O_NONBLOCK); + else + return fcntl(socket, F_SETFL, fcntl(socket, F_GETFL) & ~O_NONBLOCK); +} #endif /* CONFIG_NETWORK */ #ifdef CONFIG_FFSERVER |