FreeCalypso > hg > fc-sim-sniff
annotate sw/libserial/nonblock.c @ 35:695ca51e1564
doc/Sniffer-FPGA-design: update for finished work
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 30 Aug 2023 01:09:00 +0000 |
parents | c4346cdc9641 |
children |
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 } |