Module Name: src Committed By: maya Date: Wed Feb 8 18:01:24 UTC 2017
Modified Files: src/lib/libc/sys: accept.2 Log Message: Document accept4 in accept(2) To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/lib/libc/sys/accept.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/sys/accept.2 diff -u src/lib/libc/sys/accept.2:1.31 src/lib/libc/sys/accept.2:1.32 --- src/lib/libc/sys/accept.2:1.31 Fri Aug 2 20:13:09 2013 +++ src/lib/libc/sys/accept.2 Wed Feb 8 18:01:24 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: accept.2,v 1.31 2013/08/02 20:13:09 wiz Exp $ +.\" $NetBSD: accept.2,v 1.32 2017/02/08 18:01:24 maya Exp $ .\" .\" Copyright (c) 1983, 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,11 +29,12 @@ .\" .\" @(#)accept.2 8.2 (Berkeley) 12/11/93 .\" -.Dd March 19, 2012 +.Dd February 8, 2017 .Dt ACCEPT 2 .Os .Sh NAME .Nm accept , +.Nm accept4 , .Nm paccept .Nd accept a connection on a socket .Sh LIBRARY @@ -43,6 +44,8 @@ .Ft int .Fn accept "int s" "struct sockaddr * restrict addr" "socklen_t * restrict addrlen" .Ft int +.Fn accept4 "int s" "struct sockaddr * restrict addr" "socklen_t * restrict addrlen" "int flags" +.Ft int .Fn paccept "int s" "struct sockaddr * restrict addr" "socklen_t * restrict addrlen" "const sigset_t * restrict sigmask" "int flags" .Sh DESCRIPTION The argument @@ -136,6 +139,11 @@ or by calling .Xr setsockopt 2 . .Pp The +.Fn accept4 +function is equivalent to paccept with sigmask +.Dv NULL . +.Pp +The .Fn paccept function behaves exactly like .Fn accept , @@ -184,6 +192,10 @@ It's a traditional behaviour for BSD der On the other hand, there are implementations which don't do so. Linux is an example of such implementations. Portable programs should not rely on either of the behaviours. +The +.Pp +.Fn accept4 +function is compatible with the Linux implementation. .Sh ERRORS The .Fn accept @@ -233,6 +245,10 @@ The function appeared in .Bx 4.2 . The +.Fn accept4 +function matches Linux semantics and appeared in +.Nx 8.0 . +The .Fn paccept function is inspired from Linux and appeared in .Nx 6.0 .