The example reads: #include <err.h> #include <libgpio.h> gpio_handle_t handle; handle = gpio_open(0); if (handle == GPIO_HANDLE_INVALID) err(1, "gpio_open failed"); GPIO_HANDLE_INVALID should be GPIO_INVALID_HANDLE as defined in libgpio.h also, libgpio uses uint32_t but does not #include <sys/types.h> so for the example to build, must have #include <sys/types.h>
A commit references this bug: Author: brueffer Date: Wed Jul 1 09:25:23 UTC 2015 New revision: 284997 URL: https://svnweb.freebsd.org/changeset/base/284997 Log: Make the example code actually work. PR: 199440 Submitted by: waitman@waitman.net Reviewed by: loos MFC after: 1 week Changes: head/lib/libgpio/gpio.3
Committed to HEAD, I will merge this to the STABLE branch soon. Thanks for the submission!
Turns out no merge necessary, since libgpio is only in HEAD. Thanks again!