unistd.c 487 字节
Newer Older
mysterywolf's avatar
mysterywolf 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
/*
 * Copyright (c) 2006-2018, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2020-09-01     Meco Man     First Version
 */

#include <unistd.h>

#ifdef RT_USING_POSIX_TERMIOS
14
#include "termios.h"
15

mysterywolf's avatar
mysterywolf 已提交
16 17 18 19 20 21 22 23 24 25 26
int isatty(int fd)
{
    struct termios ts;
    return(tcgetattr(fd,&ts) != -1);/*true if no error (is a tty)*/
}
#endif

char *ttyname(int fd)
{
    return "/dev/tty0"; /*TODO: need to add more specific*/
}