| Main index | Section 3 | Options |
#include <sys/nv.h>
#include <libcasper.h>
#include <casper/cap_netdb.h>
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");
| CAP_NETDB (3) | December 6, 2023 |
| Main index | Section 3 | Options |
Please direct any comments about this manual page service to Ben Bullock. Privacy policy.
| “ | This philosophy, in the hands of amateurs, leads to inexplicably mind-numbing botches like the existence of two programs, “head” and “tail,” which print the first part or the last part of a file, depending. Even though their operations are duals of one another, “head” and “tail” are different programs, written by different authors, and take different options! | ” |
| — The Unix Haters' handbook | ||