1
6
7
8
9
10
11
12
13
14
18
19
23
24
34
35
45
46
/* ... */
#include "sdkconfig.h"
#ifdef CONFIG_VFS_SUPPORT_TERMIOS
#include <sys/termios.h>
#include <sys/errno.h>
speed_t cfgetispeed(const struct termios *p)
{
return p ? p->c_ispeed : B0;
}{ ... }
speed_t cfgetospeed(const struct termios *p)
{
return p ? p->c_ospeed : B0;
}{ ... }
int cfsetispeed(struct termios *p, speed_t sp)
{
if (p) {
p->c_ispeed = sp;
return 0;
}{...} else {
errno = EINVAL;
return -1;
}{...}
}{ ... }
int cfsetospeed(struct termios *p, speed_t sp)
{
if (p) {
p->c_ospeed = sp;
return 0;
}{...} else {
errno = EINVAL;
return -1;
}{...}
}{ ... }
/* ... */#endif