annotate calypso/nonblock.c @ 98:2972f00622c7

scripts/fcsim1-defprog: clear the upper bits of the mystery byte following Grcard's official "personalization" script
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 05 May 2021 04:15:15 +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 }