FreeCalypso > hg > fc-pcm-if
annotate sw/libserial/nonblock.c @ 10:c1d9b5d128f5
fc-mcsi-rxtx: implement print-rx command
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 28 Oct 2024 06:11:23 +0000 |
parents | a4918a161d2e |
children |
rev | line source |
---|---|
2
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module contains the set_serial_nonblock() function. |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <sys/types.h> |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <sys/ioctl.h> |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <unistd.h> |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 extern int target_fd; |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 set_serial_nonblock(state) |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 int state; |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 { |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 ioctl(target_fd, FIONBIO, &state); |
a4918a161d2e
sw: starting with libserial, copied from fc-sim-sniff
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 } |