* cygwin.din (accept4): Export.

* fhandler.h (fhandler_socket::accept4): Rename from accept.  Take
	additional flag parameter.
	* fhandler_socket.cc (fhandler_socket::accept4): Ditto.  Handle
	SOCK_NONBLOCK and SOCK_CLOEXEC flags.
	* net.cc (cygwin_socket): Handle SOCK_NONBLOCK and SOCK_CLOEXEC flags
	in type.  Check for invalid flag values.
	(socketpair): Ditto.
	(cygwin_accept): Accommodate renaming of fhandler_socket::accept
	function to accept4.
	(accept4): New function.
	* posix.sgml: Mention accept4 as GNU extensions.
	* include/cygwin/socket.h (SOCK_NONBLOCK): Define.
	(SOCK_CLOEXEC): Define.
	(_SOCK_FLAG_MASK): Define when building Cygwin.
	* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
	* include/sys/socket.h (accept4): Declare.
This commit is contained in:
Corinna Vinschen
2010-01-15 15:40:05 +00:00
parent 14c800a5ba
commit 0d6531551b
9 changed files with 102 additions and 12 deletions

View File

@ -1,6 +1,7 @@
/* sys/socket.h
Copyright 1996-2001 Red Hat, Inc.
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2005, 2006,
2009, 2010 Red Hat, Inc.
This file is part of Cygwin.
@ -27,6 +28,7 @@ extern "C"
#ifndef __INSIDE_CYGWIN_NET__
int accept (int, struct sockaddr *__peer, socklen_t *);
int accept4 (int, struct sockaddr *__peer, socklen_t *, int flags);
int bind (int, const struct sockaddr *__my_addr, socklen_t __addrlen);
int connect (int, const struct sockaddr *, socklen_t);
int getpeername (int, struct sockaddr *__peer, socklen_t *);