1 /* unix/nonblock_on.c - Turn on non-blocking I/O mode on a fd
2 * Copyright (C) 2004,2005 Bruce Guenter <bruce@untroubled.org>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 #include <sys/types.h>
19 #include <fcntl.h>
20 #include "unix.h"
21
22 #ifndef O_NONBLOCK
23 #define O_NONBLOCK O_NDELAY
24 #endif
25
nonblock_on(int fd)26 int nonblock_on(int fd)
27 {
28 return fcntl_fl_on(fd, O_NONBLOCK);
29 }
30