minix/lib/posix/_tcsetattr.c

30 lines
585 B
C
Raw Normal View History

2005-04-21 16:53:53 +02:00
/*
posix/_tcsetattr.c
Created: June 11, 1993 by Philip Homburg
*/
#define tcsetattr _tcsetattr
#define ioctl _ioctl
#include <errno.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <sys/types.h>
int tcsetattr(fd, opt_actions, termios_p)
int fd;
int opt_actions;
_CONST struct termios *termios_p;
{
int request;
switch(opt_actions)
{
case TCSANOW: request = TCSETS; break;
case TCSADRAIN: request = TCSETSW; break;
case TCSAFLUSH: request = TCSETSF; break;
default: errno = EINVAL; return(-1);
};
return(ioctl(fd, request, (void *) termios_p));
}