FreeCalypso > hg > freecalypso-tools
annotate libserial-newlnx/nonblock.c @ 516:8bdbae4c0e53
target-utils/helloapp: build boot-ROM-based and fixed-UART versions
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Wed, 29 May 2019 05:40:51 +0000 |
parents | 6984b76f3def |
children |
rev | line source |
---|---|
254
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 /* |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 * This module contains the set_serial_nonblock() function. |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 */ |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 #include <sys/types.h> |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 #include <sys/ioctl.h> |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
7 #include <unistd.h> |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 extern int target_fd; |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 set_serial_nonblock(state) |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12 int state; |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 { |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14 ioctl(target_fd, FIONBIO, &state); |
6984b76f3def
beginning of libserial-newlnx: copy of libserial-orig
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 } |