Skip to content

Instantly share code, notes, and snippets.

@waitman
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waitman/f572053c0307a39f11e2 to your computer and use it in GitHub Desktop.
Save waitman/f572053c0307a39f11e2 to your computer and use it in GitHub Desktop.
test.c
#include <stdio.h>
#include <stdlib.h>
#include <err.h>
#include <fcntl.h>
#include <kvm.h>
#include <limits.h>
#include <nlist.h>
static struct nlist nl[] = {
#define N_HCI_RAW 0
{ "_ng_btsocket_hci_raw_sockets" },
};
int
main(int argc, char *argv[])
{
kvm_t *kvmd = NULL;
char errbuf[_POSIX2_LINE_MAX];
kvmd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf);
kvm_nlist(kvmd, nl);
if (nl[0].n_type == 0) {
printf("error: %s\n",kvm_geterr(kvmd));
}
return(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment