| FIDO_DEV_SET_IO_FUNCTIONS(3) | DragonFly Library Functions Manual | FIDO_DEV_SET_IO_FUNCTIONS(3) |
fido_dev_set_io_functions,
fido_dev_set_sigmask —
#include <fido.h>
typedef void *fido_dev_io_open_t(const char *);
typedef void fido_dev_io_close_t(void *);
typedef int fido_dev_io_read_t(void *, unsigned char *, size_t, int);
typedef int fido_dev_io_write_t(void *, const unsigned char *, size_t);
typedef struct fido_dev_io {
fido_dev_io_open_t *open;
fido_dev_io_close_t *close;
fido_dev_io_read_t *read;
fido_dev_io_write_t *write;
} fido_dev_io_t;
#ifdef _WIN32
typedef int fido_sigset_t;
#else
typedef sigset_t fido_sigset_t;
#endif
fido_dev_set_io_functions(fido_dev_t
*dev, const fido_dev_io_t
*io);
int
fido_dev_set_sigmask(fido_dev_t
*dev, const fido_sigset_t
*sigmask);
fido_dev_set_io_functions() function sets the I/O
handlers used by libfido2 to talk to
dev. By default, these handlers are set to the operating
system's native HID or NFC interfaces. They are defined as follows:
When calling fido_dev_set_io_functions(),
the open, close,
read, and write fields of
io may not be NULL.
No references to io are held by
fido_dev_set_io_functions().
The fido_dev_set_sigmask() function may be
used to specify a non-NULL signal mask sigmask to be
used while libfido2's default I/O handlers wait on
dev. On UNIX-like operating systems,
fido_sigset_t is defined as
sigset_t. On Windows,
fido_sigset_t is defined as int
and fido_dev_set_sigmask() is a no-op.
No references to sigmask are held by
fido_dev_set_sigmask().
fido_dev_set_io_functions() and
fido_dev_set_sigmask() return
FIDO_OK. On error, a different error code defined in
<fido/err.h> is returned.
| May 25, 2018 | Yubico AB |