annotate sw/libserial/nonblock.c @ 31:ab37fcb71744

fpga/sniffer-pps: add actual F/D control
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 29 Aug 2023 21:22:37 +0000
parents c4346cdc9641
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This module contains the set_serial_nonblock() function.
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include <sys/types.h>
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include <sys/ioctl.h>
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <unistd.h>
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 extern int target_fd;
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 set_serial_nonblock(state)
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 int state;
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 {
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 ioctl(target_fd, FIONBIO, &state);
c4346cdc9641 sw/libserial: based on FC host tools version
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 }