accept.2 (130950) | accept.2 (131504) |
---|---|
1.\" Copyright (c) 1983, 1990, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)accept.2 8.2 (Berkeley) 12/11/93 | 1.\" Copyright (c) 1983, 1990, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. --- 16 unchanged lines hidden (view full) --- 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)accept.2 8.2 (Berkeley) 12/11/93 |
33.\" $FreeBSD: head/lib/libc/sys/accept.2 130950 2004-06-23 00:20:46Z bms $ | 33.\" $FreeBSD: head/lib/libc/sys/accept.2 131504 2004-07-02 23:52:20Z ru $ |
34.\" 35.Dd December 11, 1993 36.Dt ACCEPT 2 37.Os 38.Sh NAME 39.Nm accept 40.Nd accept a connection on a socket 41.Sh LIBRARY --- 29 unchanged lines hidden (view full) --- 71blocks the caller until a connection is present. 72If the original socket 73is marked non-blocking and no pending 74connections are present on the queue, 75.Fn accept 76returns an error as described below. 77The accepted socket 78may not be used | 34.\" 35.Dd December 11, 1993 36.Dt ACCEPT 2 37.Os 38.Sh NAME 39.Nm accept 40.Nd accept a connection on a socket 41.Sh LIBRARY --- 29 unchanged lines hidden (view full) --- 71blocks the caller until a connection is present. 72If the original socket 73is marked non-blocking and no pending 74connections are present on the queue, 75.Fn accept 76returns an error as described below. 77The accepted socket 78may not be used |
79to accept more connections. The original socket | 79to accept more connections. 80The original socket |
80.Fa s 81remains open. 82.Pp 83The argument 84.Fa addr 85is a result argument that is filled-in with 86the address of the connecting entity, 87as known to the communications layer. --- 37 unchanged lines hidden (view full) --- 125Confirmation can be implied by a normal read or write on the new 126file descriptor, and rejection can be implied by closing the 127new socket. 128.Pp 129For some applications, performance may be enhanced by using an 130.Xr accept_filter 9 131to pre-process incoming connections. 132.Sh RETURN VALUES | 81.Fa s 82remains open. 83.Pp 84The argument 85.Fa addr 86is a result argument that is filled-in with 87the address of the connecting entity, 88as known to the communications layer. --- 37 unchanged lines hidden (view full) --- 126Confirmation can be implied by a normal read or write on the new 127file descriptor, and rejection can be implied by closing the 128new socket. 129.Pp 130For some applications, performance may be enhanced by using an 131.Xr accept_filter 9 132to pre-process incoming connections. 133.Sh RETURN VALUES |
133The call returns \-1 on error. If it succeeds, it returns a non-negative | 134The call returns \-1 on error. 135If it succeeds, it returns a non-negative |
134integer that is a descriptor for the accepted socket. 135.Sh ERRORS 136The 137.Fn accept 138system call will fail if: 139.Bl -tag -width Er 140.It Bq Er EBADF 141The descriptor is invalid. --- 38 unchanged lines hidden --- | 136integer that is a descriptor for the accepted socket. 137.Sh ERRORS 138The 139.Fn accept 140system call will fail if: 141.Bl -tag -width Er 142.It Bq Er EBADF 143The descriptor is invalid. --- 38 unchanged lines hidden --- |