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

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [sys/] [linux/] [termios.c] - Rev 1773

Go to most recent revision | Compare with Previous | Blame | View Log

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

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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