From nobody Mon Jun 20 05:39:48 2022 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id B297785BDE0; Mon, 20 Jun 2022 05:39:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LRJPc4d3Gz4Yqf; Mon, 20 Jun 2022 05:39:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655703588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ndvXqYdSsS0AXpvjckj3ALP/1qrj2S6Wv1VgZekATO4=; b=Fg8XpxVByTR7mz1+7Acvzdmz0elFxz5VaCVAUtnMEyi5tTMOKcDOkGEpqt1zvmxxI2mb0Z RO+wi0I3/DEz/aqXZn+7/vxQy7rBLVRdHFlXU5MZIIWAvsVH6YH+lFXKD0XAjm0lg/wRxl /gLYwt+jlfDRij6L1PIs6q/Imabpx27BwyJRduS35FckBTpNciU6VX/Z/o7sf4f/Vj1Wwp yX/IQLyeVL0M5IhavplA/EpsD0WtH+buruymu+imWM1xRTh3wNCcCBAr8GtUP/WjlsmpiY rtoZImGBtpVNLU3/kyhtaHtIxNEu6MFIxd6tN4NPqZUb5DmMNyMerMcdvvXFww== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7AE5B17816; Mon, 20 Jun 2022 05:39:48 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 25K5dmt3018816; Mon, 20 Jun 2022 05:39:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25K5dmAI018815; Mon, 20 Jun 2022 05:39:48 GMT (envelope-from git) Date: Mon, 20 Jun 2022 05:39:48 GMT Message-Id: <202206200539.25K5dmAI018815@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Fernando=20Apestegu=C3=ADa?= Subject: git: 9acb1d7b2c93 - main - getnetent(3): Add documentation for missing reentrant functions List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9acb1d7b2c932c48c64345c589c0e0733c7918fd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655703588; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ndvXqYdSsS0AXpvjckj3ALP/1qrj2S6Wv1VgZekATO4=; b=QQ6jlg4vgHn03LgAFGVQFmBqGLuJhG2VTlDBiedq3XT9ZozhBbyrSaWELf3y+9787VpApa TY76LHilDnDnr7IDkwkqMjbkR1z21CoAd5YW6MzuKJPgc1xaUJOzbOd2P4VRaLkexGQZvI e0fEt47DJykE3NXf+8cQojdiYzCY4qmlrHMi586ixRvhBR5QAgrfR5CRNOQDn6rfoa7KOL kfxS5RTLeT/6mCpAbKHOYChONskN4ujmXAq4IynoguFUkDLVVW1j2wEchuNzc4L8Orozkk sWugriTQWWzpDiWh4PXaVCpj5Fr4lqyiZp/eeMQT9ohiWuVf9xq5lJ4PCZSNUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655703588; a=rsa-sha256; cv=none; b=lDc0nA6inuW0DXDAH+tYelQtxleCUz04e2J67I23+mT8BwtultQezUZeWQUtiOGjmtA18b LgwAZn2JSlUAoU/AgymrQDJBPWKzGJBwoWQPPrvoBkQtz6ZRw22j3JVvf7EEa4W95E0SYS 2Yc6FIbdTKsViExYxNMiRs7Mn2qqBeRfiax8WLrU2oUfIqt/mOSwisgkGibi0vdKbLqvl+ jnufP0zFvNHpd4CezN35GXJ+vQ6eKo8SYZyFiBcXshqMVa2g9IpG3wCiDTgbkz4AsJVjzh SclwLfyWlZthjXUhULzPdoyvdunUez1AkCsXVINThAzRFxCGAt39KorM8XG16Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fernape (doc, ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=9acb1d7b2c932c48c64345c589c0e0733c7918fd commit 9acb1d7b2c932c48c64345c589c0e0733c7918fd Author: Fernando ApesteguĂ­a AuthorDate: 2021-05-26 12:34:49 +0000 Commit: Fernando ApesteguĂ­a CommitDate: 2022-06-20 05:30:38 +0000 getnetent(3): Add documentation for missing reentrant functions Add gethostbyname_r, gethostbyname2_r and gethostbyaddr_r signatures and descriptions. PR: 249154 Reported by: asomers@ Approved by: manpages (imp@), Pau Amma Differential Revision: https://reviews.freebsd.org/D30385 --- lib/libc/net/Makefile.inc | 4 +++- lib/libc/net/getnetent.3 | 28 +++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/lib/libc/net/Makefile.inc b/lib/libc/net/Makefile.inc index 683e2826c401..755d44e6c5dd 100644 --- a/lib/libc/net/Makefile.inc +++ b/lib/libc/net/Makefile.inc @@ -67,7 +67,9 @@ MLINKS+=getifaddrs.3 freeifaddrs.3 MLINKS+=getifmaddrs.3 freeifmaddrs.3 MLINKS+=getipnodebyname.3 getipnodebyaddr.3 getipnodebyname.3 freehostent.3 MLINKS+=getnetent.3 endnetent.3 getnetent.3 getnetbyaddr.3 \ - getnetent.3 getnetbyname.3 getnetent.3 setnetent.3 + getnetent.3 getnetbyaddr_r.3 getnetent.3 getnetbyname.3 \ + getnetent.3 getnetbyname_r.3 getnetent.3 setnetent.3 \ + getnetent.3 getnetent_r.3 MLINKS+=getprotoent.3 endprotoent.3 getprotoent.3 getprotobyname.3 \ getprotoent.3 getprotobynumber.3 getprotoent.3 setprotoent.3 MLINKS+=getservent.3 endservent.3 getservent.3 getservbyname.3 \ diff --git a/lib/libc/net/getnetent.3 b/lib/libc/net/getnetent.3 index adf2760d132f..29eabdacd6bf 100644 --- a/lib/libc/net/getnetent.3 +++ b/lib/libc/net/getnetent.3 @@ -28,7 +28,7 @@ .\" @(#)getnetent.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd June 20, 2022 .Dt GETNETENT 3 .Os .Sh NAME @@ -52,6 +52,12 @@ .Fn setnetent "int stayopen" .Ft void .Fn endnetent void +.Ft int +.Fn getnetent_r "struct netent *ne" "char *buffer" "size_t buflen" "struct netent **result" "int *h_errnop" +.Ft int +.Fn getnetbyaddr_r "uint32_t net" "int type" "struct netent *ne" "char *buffer" "size_t buflen" "struct netent **result" int *h_errorp" +.Ft int +.Fn getnetbyname_r "const char *name" "struct netent *ne" "char *buffer" "size_t buflen" "struct netent **result" "int *h_errorp" .Sh DESCRIPTION The .Fn getnetent , @@ -135,6 +141,26 @@ argument must be .Dv AF_INET . Network numbers are supplied in host order. +.Pp +Functions with the +.Em _r +suffix provide reentrant versions of their respective counterparts. +The caller must supply five additional parameters: a +.Vt struct netent +variable to be filled on success, a +.Va buffer +of +.Va buflen +bytes in size, a +.Vt struct netent +.Va result +variable that will point to the result on success or be set to +.Dv NULL +on failure or if the name is not found. +The +.Va h_errnop +variable will be filled with the error code if any. +All these functions return 0 on success. .Sh FILES .Bl -tag -width /etc/nsswitch.conf -compact .It Pa /etc/networks