summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/lib/tcflow.c
blob: ea460f36206481598214cb98ba26b2312dec4847 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "dietfeatures.h"
#include <errno.h>
#include <termios.h>
#include <sys/ioctl.h>

int  tcflow ( int fd, int action )
{
#if TCOOFF==0  &&  TCOON==1  &&  TCIOFF==2  &&  TCION==3

    if ( (unsigned int)action < 4u )
	return ioctl ( fd, TCXONC, action );

    errno = EINVAL;
    return -1;

#else

    int  arg = 0;
    
    switch (action) {
    case TCION: 
	arg++;
    case TCIOFF: 
	arg++;
    case TCOON:   
	arg++;
    case TCOOFF:
	return ioctl ( fd, TCXONC, arg );
    default:
        errno = EINVAL;
        return -1;
    }

#endif
}