Date: Sun, 02 Jan 2022 16:04:40 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 257222] Cannot use libzfs.h from user space programs due to missing libnvpair.h and other dependencies Message-ID: <bug-257222-227-CMWTN1GSpB@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-257222-227@https.bugs.freebsd.org/bugzilla/>
index | next in thread | previous in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257222 --- Comment #3 from Michael Gmelin <grembo@FreeBSD.org> --- Simple working example: ``` $ cat >test.c <<EOF #include <sys/stdtypes.h> #include <libzfs_core.h> int main(int argc, char** argv) { if (argc != 2) { fprintf(stderr, "Invalid arguments\n"); return 101; } if (libzfs_core_init() != 0) { fprintf(stderr, "Can't init libzfs\n"); return 101; } int exists = lzc_exists(argv[1]); printf("%s %s\n", argv[1], exists ? "exists" : "doesn't exist"); libzfs_core_fini(); return exists ? 0 : 1; } EOF $ cc \ -I/usr/src/sys/contrib/openzfs/include \ -I/usr/src/sys/contrib/openzfs/lib/libspl/include \ -lzfs_core -lzfs -o test test.c $ ./test zroot zroot exists ``` -- You are receiving this mail because: You are the assignee for the bug.home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-257222-227-CMWTN1GSpB>
