aboutsummaryrefslogtreecommitdiff
path: root/lib/libcasper/services/cap_netdb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcasper/services/cap_netdb')
-rw-r--r--lib/libcasper/services/cap_netdb/Makefile7
-rw-r--r--lib/libcasper/services/cap_netdb/Makefile.depend17
-rw-r--r--lib/libcasper/services/cap_netdb/cap_netdb.39
-rw-r--r--lib/libcasper/services/cap_netdb/cap_netdb.c4
-rw-r--r--lib/libcasper/services/cap_netdb/cap_netdb.h2
-rw-r--r--lib/libcasper/services/cap_netdb/tests/Makefile2
-rw-r--r--lib/libcasper/services/cap_netdb/tests/netdb_test.c5
7 files changed, 28 insertions, 18 deletions
diff --git a/lib/libcasper/services/cap_netdb/Makefile b/lib/libcasper/services/cap_netdb/Makefile
index 5070976d2e25..853052e78d04 100644
--- a/lib/libcasper/services/cap_netdb/Makefile
+++ b/lib/libcasper/services/cap_netdb/Makefile
@@ -1,6 +1,4 @@
-# $FreeBSD$
-
-SHLIBDIR?= /lib/casper
+SHLIBDIR?= /lib
.include <src.opts.mk>
@@ -30,3 +28,6 @@ MLINKS+=cap_netdb.3 libcap_netdb.3
MLINKS+=cap_netdb.3 cap_getprotobyname.3
.include <bsd.lib.mk>
+
+# GCC 13 complains incorrectly about free after failed realloc: GCC bug #110501
+CFLAGS.cap_netdb.c+= ${NO_WUSE_AFTER_FREE}
diff --git a/lib/libcasper/services/cap_netdb/Makefile.depend b/lib/libcasper/services/cap_netdb/Makefile.depend
new file mode 100644
index 000000000000..02bae00eb04d
--- /dev/null
+++ b/lib/libcasper/services/cap_netdb/Makefile.depend
@@ -0,0 +1,17 @@
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcasper/libcasper \
+ lib/libcompiler_rt \
+ lib/libnv \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/lib/libcasper/services/cap_netdb/cap_netdb.3 b/lib/libcasper/services/cap_netdb/cap_netdb.3
index 6df34559224c..1f587c2057e7 100644
--- a/lib/libcasper/services/cap_netdb/cap_netdb.3
+++ b/lib/libcasper/services/cap_netdb/cap_netdb.3
@@ -21,9 +21,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd May 12, 2020
+.Dd December 6, 2023
.Dt CAP_NETDB 3
.Os
.Sh NAME
@@ -38,7 +36,6 @@
.Ft "struct protoent *"
.Fn cap_getprotobyname "const cap_channel_t *chan" "const char *name"
.Sh DESCRIPTION
-.Bf -symbolic
The function
.Fn cap_getprotobyname
is equivalent to
@@ -46,6 +43,10 @@ is equivalent to
except that the connection to the
.Nm system.netdb
service needs to be provided.
+It is reentrant but not thread-safe.
+That is, it may be called from separate threads only with different
+.Vt cap_channel_t
+arguments or with synchronization.
.Sh EXAMPLES
The following example first opens a capability to casper and then uses this
capability to create the
diff --git a/lib/libcasper/services/cap_netdb/cap_netdb.c b/lib/libcasper/services/cap_netdb/cap_netdb.c
index e07deb93a798..7f46f9b4ff40 100644
--- a/lib/libcasper/services/cap_netdb/cap_netdb.c
+++ b/lib/libcasper/services/cap_netdb/cap_netdb.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2020 Ryan Moeller <freqlabs@FreeBSD.org>
*
@@ -26,8 +26,6 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/dnv.h>
#include <sys/nv.h>
#include <netinet/in.h>
diff --git a/lib/libcasper/services/cap_netdb/cap_netdb.h b/lib/libcasper/services/cap_netdb/cap_netdb.h
index 4dc33c351520..4a89797e33cc 100644
--- a/lib/libcasper/services/cap_netdb/cap_netdb.h
+++ b/lib/libcasper/services/cap_netdb/cap_netdb.h
@@ -21,8 +21,6 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
#ifndef _CAP_NETDB_H_
diff --git a/lib/libcasper/services/cap_netdb/tests/Makefile b/lib/libcasper/services/cap_netdb/tests/Makefile
index eb7bc45d960d..bc5e04578323 100644
--- a/lib/libcasper/services/cap_netdb/tests/Makefile
+++ b/lib/libcasper/services/cap_netdb/tests/Makefile
@@ -1,5 +1,3 @@
-# $FreeBSD$
-
.include <src.opts.mk>
ATF_TESTS_C= netdb_test
diff --git a/lib/libcasper/services/cap_netdb/tests/netdb_test.c b/lib/libcasper/services/cap_netdb/tests/netdb_test.c
index afe43b575572..5b984a8f6bd2 100644
--- a/lib/libcasper/services/cap_netdb/tests/netdb_test.c
+++ b/lib/libcasper/services/cap_netdb/tests/netdb_test.c
@@ -1,5 +1,5 @@
/*-
- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ * SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2020 Ryan Moeller <freqlabs@FreeBSD.org>
*
@@ -25,9 +25,6 @@
* SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include <sys/capsicum.h>
#include <sys/nv.h>