MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / tcgetattr

Function tcgetattr

components/libc/posix/io/termios/termios.c:30–37  ·  view source on GitHub ↗

* @brief Gets the current attributes of a terminal device. * @param fd File descriptor of the terminal device. * @param tio Pointer to a struct termios where the attributes will be stored. * @return Upon successful completion, returns 0; otherwise, returns -1. * * @note This function retrieves the current attributes of a terminal device specified by the file descriptor fd. *

Source from the content-addressed store, hash-verified

28 * If the ioctl operation fails, the function returns -1 to indicate an error.
29 */
30int tcgetattr(int fd, struct termios *tio)
31{
32 /* Get the current serial port settings. */
33 if (ioctl(fd, TCGETA, tio))
34 return -1;
35
36 return 0;
37}
38
39/**
40 * @brief Sets the attributes of a terminal device.

Callers 3

configureSerialFunction · 0.85
configureSerialFunction · 0.85
set_sttyFunction · 0.85

Calls 1

ioctlFunction · 0.50

Tested by

no test coverage detected