mirror of
https://github.com/apache/nuttx.git
synced 2026-09-28 15:54:57 +08:00
libc: Implement terminal api regardless of CONFIG_SERIAL_TERMIOS setting
since many functions aren't related to termios directly Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Gustavo Henrique Nihei
parent
228442ee23
commit
4262b09cbf
@@ -56,9 +56,7 @@ namespace std
|
||||
|
||||
// Terminal I/O
|
||||
|
||||
#ifdef CONFIG_SERIAL_TERMIOS
|
||||
using ::isatty;
|
||||
#endif
|
||||
|
||||
// Memory management
|
||||
|
||||
|
||||
@@ -31,9 +31,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <errno.h>
|
||||
#ifdef CONFIG_SERIAL_TERMIOS
|
||||
# include <termios.h>
|
||||
#endif
|
||||
#include <termios.h>
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/semaphore.h>
|
||||
|
||||
@@ -29,8 +29,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef CONFIG_SERIAL_TERMIOS
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
@@ -319,5 +317,4 @@ int tcsetattr(int fd, int options, FAR const struct termios *termiosp);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_SERIAL_TERMIOS */
|
||||
#endif /* __INCLUDE_TERMIOS_H */
|
||||
|
||||
@@ -327,14 +327,12 @@ ssize_t pwrite(int fd, FAR const void *buf, size_t nbytes, off_t offset);
|
||||
int ftruncate(int fd, off_t length);
|
||||
int fchown(int fd, uid_t owner, gid_t group);
|
||||
|
||||
#ifdef CONFIG_SERIAL_TERMIOS
|
||||
/* Check if a file descriptor corresponds to a terminal I/O file */
|
||||
|
||||
int isatty(int fd);
|
||||
|
||||
FAR char *ttyname(int fd);
|
||||
int ttyname_r(int fd, FAR char *buf, size_t buflen);
|
||||
#endif
|
||||
|
||||
/* Memory management */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user