git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Framework for exporting system header to user space (#59)
[lunaix-os.git]
/
lunaix-os
/
usr
/
libc
/
includes
/
termios.h
diff --git
a/lunaix-os/usr/libc/includes/termios.h
b/lunaix-os/usr/libc/includes/termios.h
index 42ad0ac86ed0b2cc85c97ba7015c00b91a70596b..aa4478dc06a540f1b2430bc1cfe031cf5de48cbb 100644
(file)
--- a/
lunaix-os/usr/libc/includes/termios.h
+++ b/
lunaix-os/usr/libc/includes/termios.h
@@
-1,5
+1,5
@@
-#ifndef __LUNA
IX
_TERMIOS_H
-#define __LUNA
IX
_TERMIOS_H
+#ifndef __LUNA
LIBC
_TERMIOS_H
+#define __LUNA
LIBC
_TERMIOS_H
#include <lunaix/term.h>
#include <lunaix/term.h>
@@
-89,12
+89,20
@@
static inline speed_t cfgetospeed(const struct termios* termios) { return termio
static inline int cfsetispeed(struct termios* termios, speed_t baud)
{
static inline int cfsetispeed(struct termios* termios, speed_t baud)
{
+ if (baud > B38400) {
+ return -1;
+ }
+
termios->c_baud = baud;
return 0;
}
static inline int cfsetospeed(struct termios* termios, speed_t baud)
{
termios->c_baud = baud;
return 0;
}
static inline int cfsetospeed(struct termios* termios, speed_t baud)
{
+ if (baud > B38400) {
+ return -1;
+ }
+
termios->c_baud = baud;
return 0;
}
termios->c_baud = baud;
return 0;
}
@@
-110,5
+118,4
@@
int tcgetattr(int, struct termios *);
int tcsendbreak(int, int);
int tcsetattr(int, int, const struct termios *);
int tcsendbreak(int, int);
int tcsetattr(int, int, const struct termios *);
-
-#endif /* __LUNAIX_TERMIOS_H */
+#endif /* __LUNALIBC_TERMIOS_H */