*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: cap_netdb | Section: 3 | Source: FreeBSD | File: cap_netdb.3.gz
CAP_NETDB(3) FreeBSD Library Functions Manual CAP_NETDB(3) NAME cap_getprotobyname, - library for getting network proto entry in capability mode LIBRARY library "libcap_netdb" SYNOPSIS #include <sys/nv.h> #include <libcasper.h> #include <casper/cap_netdb.h> struct protoent * cap_getprotobyname(const cap_channel_t *chan, const char *name); DESCRIPTION The function cap_getprotobyname() is equivalent to getprotobyname(3) except that the connection to the 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 cap_channel_t arguments or with synchronization. EXAMPLES The following example first opens a capability to casper and then uses this capability to create the system.netdb casper service and uses it to look up a protocol by name. cap_channel_t *capcas, *capnetdb; struct protoent *ent; /* Open capability to Casper. */ capcas = cap_init(); if (capcas == NULL) err(1, "Unable to contact Casper"); /* Enter capability mode sandbox. */ if (caph_enter() < 0) err(1, "Unable to enter capability mode"); /* Use Casper capability to create capability to the system.netdb service. */ capnetdb = cap_service_open(capcas, "system.netdb"); if (capnetdb == NULL) err(1, "Unable to open system.netdb service"); /* Close Casper capability, we don't need it anymore. */ cap_close(capcas); ent = cap_getprotobyname(capnetdb, "http"); if (ent == NULL) errx(1, "cap_getprotobyname failed to find http proto"); SEE ALSO cap_enter(2), caph_enter(3), err(3), getprotobyname(3), capsicum(4), nv(9) AUTHORS The cap_netdb service was implemented by Ryan Moeller <[email protected]>. FreeBSD 14.1-RELEASE-p8 December 6, 2023 FreeBSD 14.1-RELEASE-p8

Navigation Options