annotate calypso/nonblock.c @ 101:1888d88478c4

fc-simtool write-hplmn-timer new command
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 14 May 2022 22:54:19 +0000
parents f6b03af63bf7
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This module contains the set_serial_nonblock() function.
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include <sys/types.h>
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include <sys/ioctl.h>
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 #include <unistd.h>
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 extern int target_fd;
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 set_serial_nonblock(state)
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 int state;
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 {
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 ioctl(target_fd, FIONBIO, &state);
f6b03af63bf7 fcsim-calypso-be: add FIONBIO setting to 0
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 }