FreeCalypso > hg > fc-pcm-if
annotate sw/libserial/nonblock.c @ 6:a10657f8024e
sw: move initflush.c module into libserial
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 12 Oct 2024 19:42:19 +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 } |