Last change
on this file was
80cf60e,
checked in by Sebastian Huber <sebastian.huber@…>, on Apr 15, 2020 at 7:48:32 AM
|
Canonicalize config.h include
Use the following variant which was already used by most source files:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
|
-
Property mode set to
100644
|
File size:
851 bytes
|
Line | |
---|
1 | /* |
---|
2 | * tcflush() - POSIX 1003.1b 7.2.2 - Line Control Functions |
---|
3 | * |
---|
4 | * COPYRIGHT (c) 1989-2010. |
---|
5 | * On-Line Applications Research Corporation (OAR). |
---|
6 | * |
---|
7 | * The license and distribution terms for this file may be |
---|
8 | * found in the file LICENSE in this distribution or at |
---|
9 | * http://www.rtems.org/license/LICENSE. |
---|
10 | */ |
---|
11 | |
---|
12 | #ifdef HAVE_CONFIG_H |
---|
13 | #include "config.h" |
---|
14 | #endif |
---|
15 | |
---|
16 | #include <sys/fcntl.h> |
---|
17 | #include <termios.h> |
---|
18 | #include <stdint.h> |
---|
19 | #include <sys/ioccom.h> |
---|
20 | #include <rtems/libio.h> |
---|
21 | #include <rtems/libio_.h> |
---|
22 | #include <rtems/seterr.h> |
---|
23 | |
---|
24 | int tcflush( int fd, int which ) |
---|
25 | { |
---|
26 | int com; |
---|
27 | |
---|
28 | switch (which) { |
---|
29 | case TCIFLUSH: |
---|
30 | com = FREAD; |
---|
31 | break; |
---|
32 | case TCOFLUSH: |
---|
33 | com = FWRITE; |
---|
34 | break; |
---|
35 | case TCIOFLUSH: |
---|
36 | com = FREAD | FWRITE; |
---|
37 | break; |
---|
38 | default: |
---|
39 | rtems_set_errno_and_return_minus_one( EINVAL ); |
---|
40 | } |
---|
41 | return ioctl( fd, TIOCFLUSH, &com ); |
---|
42 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.