OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [sys/] [linux/] [termios.c] - Diff between revs 1010 and 1765

Only display areas with differences | Details | Blame | View Log

Rev 1010 Rev 1765
/* libc/sys/linux/termios.c - Terminal control */
/* libc/sys/linux/termios.c - Terminal control */
 
 
/* Written 2000 by Werner Almesberger */
/* Written 2000 by Werner Almesberger */
 
 
 
 
#include <errno.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/termios.h>
#include <sys/termios.h>
#include <sys/ioctl.h>
#include <sys/ioctl.h>
 
 
 
 
int tcgetattr(int fd,struct termios *termios_p)
int tcgetattr(int fd,struct termios *termios_p)
{
{
    return ioctl(fd,TCGETS,termios_p);
    return ioctl(fd,TCGETS,termios_p);
}
}
 
 
 
 
int tcsetattr(int fd,int optional_actions,const struct termios *termios_p)
int tcsetattr(int fd,int optional_actions,const struct termios *termios_p)
{
{
    int cmd;
    int cmd;
 
 
    switch (optional_actions) {
    switch (optional_actions) {
        case TCSANOW:
        case TCSANOW:
            cmd = TCSETS;
            cmd = TCSETS;
            break;
            break;
        case TCSADRAIN:
        case TCSADRAIN:
            cmd = TCSETSW;
            cmd = TCSETSW;
            break;
            break;
        case TCSAFLUSH:
        case TCSAFLUSH:
            cmd = TCSETSF;
            cmd = TCSETSF;
            break;
            break;
        default:
        default:
            errno = EINVAL;
            errno = EINVAL;
            return -1;
            return -1;
    }
    }
    return ioctl(fd,cmd,termios_p);
    return ioctl(fd,cmd,termios_p);
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.