socket: implement SOCK_CLOEXEC and SOCK_NONBLOCK

Change-Id: I3fa36fa999c82a192d402cb4d913bd397e106e53
This commit is contained in:
Thomas Veerman
2013-02-25 11:36:29 +00:00
parent fd610ba1b0
commit fa78dc389f
7 changed files with 89 additions and 41 deletions

View File

@@ -73,7 +73,9 @@
* restart
*/
#define O_CLOEXEC 020000 /* close on exec */
#if defined(_NETBSD_SOURCE)
#define O_NOSIGPIPE 040000 /* don't deliver sigpipe */
#endif
#ifndef __minix /* NOT SUPPORTED! */
#if defined(_NETBSD_SOURCE)
@@ -126,6 +128,10 @@
#define F_SETLK 6 /* set record locking information */
#define F_SETLKW 7 /* set record locking info; wait if blocked */
#define F_FREESP 8 /* free a section of a regular file */
#if defined(_NETBSD_SOURCE)
#define F_GETNOSIGPIPE 9
#define F_SETNOSIGPIPE 10
#endif
/* File descriptor flags used for fcntl(). POSIX Table 6-2. */
#define FD_CLOEXEC 1 /* close on exec flag for third arg of fcntl */