[Linux manuál]
Návod, kniha: POSIX Programmer's Manual
int tcsetattr(int fildes, int
optional_actions ,
const struct termios *
termios_p);
tcsetattr: nastavit parametry spojené s terminálem
Originální popis anglicky: tcsetattr - set the parameters associated with the terminalNávod, kniha: POSIX Programmer's Manual
STRUČNĚ
#include <termios.h>POPIS / INSTRUKCE
The tcsetattr() function shall set the parameters associated with the terminal referred to by the open file descriptor fildes (an open file descriptor associated with a terminal) from the termios structure referenced by termios_p as follows:- *
- If optional_actions is TCSANOW, the change shall occur immediately.
- *
- If optional_actions is TCSADRAIN, the change shall occur after all output written to fildes is transmitted. This function should be used when changing parameters that affect output.
- *
- If optional_actions is TCSAFLUSH, the change shall occur after all output written to fildes is transmitted, and all input so far received but not read shall be discarded before the change is made.
- *
- If the calling process is blocking or ignoring SIGTTOU signals, the operation completes normally and no signal is sent.
- *
- Otherwise, a SIGTTOU signal shall be sent to the process group.
NÁVRATOVÁ HODNOTA
Upon successful completion, 0 shall be returned. Otherwise, -1 shall be returned and errno set to indicate the error.CHYBY / ERRORY
The tcsetattr() function shall fail if:- EBADF
- The fildes argument is not a valid file descriptor.
- EINTR
- A signal interrupted tcsetattr().
- EINVAL
- The optional_actions argument is not a supported value, or an attempt was made to change an attribute represented in the termios structure to an unsupported value.
- ENOTTY
- The file associated with fildes is not a terminal.
- EIO
- The process group of the writing process is orphaned, and
the writing process is not ignoring or blocking SIGTTOU.
PŘÍKLADY POUŽITÍ
None.APPLICATION USAGE
If trying to change baud rates, applications should call tcsetattr() then call tcgetattr() in order to determine what baud rates were actually selected.RATIONALE
The tcsetattr() function can be interrupted in the following situations:- *
- It is interrupted while waiting for output to drain.
- *
- It is called from a process in a background process group and SIGTTOU is caught.
FUTURE DIRECTIONS
Using an input baud rate of 0 to set the input rate equal to the output rate may not necessarily be supported in a future version of this volume of IEEE Std 1003.1-2001.SOUVISEJÍCÍ
cfgetispeed() , tcgetattr() , the Base Definitions volume of IEEE Std 1003.1-2001, Chapter 11, General Terminal Interface, <termios.h>, <unistd.h>COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .| 2003 | IEEE/The Open Group |