FreeCalypso > hg > fc-pcm-if
annotate sw/libserial/nonblock.c @ 4:1dacfe7d5b3d
sw: add top Makefile
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Fri, 11 Oct 2024 23:56:48 +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 } |
