• R/O
  • HTTP
  • SSH
  • HTTPS

提交

標籤
無標籤

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修訂7ed8c421f71f89978da0ba30b19df245c7c02e39 (tree)
時間2019-10-01 02:25:00
作者Adhemerval Zanella <azanella@linu...>
CommiterWaldemar Brodkorb

Log Message

PowerPC: Fix termios definitions

This patch fixes the incorrect guard by USE_MISC of struct winsize and
struct termio in powerpc termios header. Current states leads to build
failures if the program defines _XOPEN_SOURCE, but not _DEFAULT_SOURCE
or either _BSD_SOURCE or _SVID_SOURCE. Without any definition,
USE_MISC will not be defined and neither the struct definitions.

This patch copies the default Linux ioctl-types.h by adjusting only the
character control field (c_cc) size in struct termio.

Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
[Vadim: adopted for uclibc ]

Change Summary

差異

--- a/libc/sysdeps/linux/powerpc/bits/ioctl-types.h
+++ b/libc/sysdeps/linux/powerpc/bits/ioctl-types.h
@@ -1,5 +1,77 @@
1+/* Structure types for pre-termios terminal ioctls. Linux/powerpc version.
2+ Copyright (C) 2014-2019 Free Software Foundation, Inc.
3+ This file is part of the GNU C Library.
4+
5+ The GNU C Library is free software; you can redistribute it and/or
6+ modify it under the terms of the GNU Lesser General Public
7+ License as published by the Free Software Foundation; either
8+ version 2.1 of the License, or (at your option) any later version.
9+
10+ The GNU C Library is distributed in the hope that it will be useful,
11+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13+ Lesser General Public License for more details.
14+
15+ You should have received a copy of the GNU Lesser General Public
16+ License along with the GNU C Library; if not, see
17+ <http://www.gnu.org/licenses/>. */
18+
119 #ifndef _SYS_IOCTL_H
220 # error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
321 #endif
422
5-#include <termios.h>
23+/* Get definition of constants for use with `ioctl'. */
24+#include <asm/ioctls.h>
25+
26+
27+struct winsize
28+ {
29+ unsigned short int ws_row;
30+ unsigned short int ws_col;
31+ unsigned short int ws_xpixel;
32+ unsigned short int ws_ypixel;
33+ };
34+
35+#define NCC 10
36+struct termio
37+ {
38+ unsigned short int c_iflag; /* input mode flags */
39+ unsigned short int c_oflag; /* output mode flags */
40+ unsigned short int c_cflag; /* control mode flags */
41+ unsigned short int c_lflag; /* local mode flags */
42+ unsigned char c_line; /* line discipline */
43+ unsigned char c_cc[NCC]; /* control characters */
44+};
45+
46+/* modem lines */
47+#define TIOCM_LE 0x001
48+#define TIOCM_DTR 0x002
49+#define TIOCM_RTS 0x004
50+#define TIOCM_ST 0x008
51+#define TIOCM_SR 0x010
52+#define TIOCM_CTS 0x020
53+#define TIOCM_CAR 0x040
54+#define TIOCM_RNG 0x080
55+#define TIOCM_DSR 0x100
56+#define TIOCM_CD TIOCM_CAR
57+#define TIOCM_RI TIOCM_RNG
58+
59+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
60+
61+/* line disciplines */
62+#define N_TTY 0
63+#define N_SLIP 1
64+#define N_MOUSE 2
65+#define N_PPP 3
66+#define N_STRIP 4
67+#define N_AX25 5
68+#define N_X25 6 /* X.25 async */
69+#define N_6PACK 7
70+#define N_MASC 8 /* Mobitex module */
71+#define N_R3964 9 /* Simatic R3964 module */
72+#define N_PROFIBUS_FDL 10 /* Profibus */
73+#define N_IRDA 11 /* Linux IR */
74+#define N_SMSBLOCK 12 /* SMS block mode */
75+#define N_HDLC 13 /* synchronous HDLC */
76+#define N_SYNC_PPP 14 /* synchronous PPP */
77+#define N_HCI 15 /* Bluetooth HCI UART */
--- a/libc/sysdeps/linux/powerpc/bits/termios.h
+++ b/libc/sysdeps/linux/powerpc/bits/termios.h
@@ -256,23 +256,6 @@ struct ltchars {
256256 #define TIOCPKT_NOSTOP 16
257257 #define TIOCPKT_DOSTOP 32
258258
259-struct winsize {
260- unsigned short ws_row;
261- unsigned short ws_col;
262- unsigned short ws_xpixel;
263- unsigned short ws_ypixel;
264-};
265-
266-#define NCC 10
267-struct termio {
268- unsigned short c_iflag; /* input mode flags */
269- unsigned short c_oflag; /* output mode flags */
270- unsigned short c_cflag; /* control mode flags */
271- unsigned short c_lflag; /* local mode flags */
272- unsigned char c_line; /* line discipline */
273- unsigned char c_cc[NCC]; /* control characters */
274-};
275-
276259 /* c_cc characters */
277260 #define _VINTR 0
278261 #define _VQUIT 1
@@ -285,36 +268,5 @@ struct termio {
285268 #define _VEOL2 8
286269 #define _VSWTC 9
287270
288-/* modem lines */
289-#define TIOCM_LE 0x001
290-#define TIOCM_DTR 0x002
291-#define TIOCM_RTS 0x004
292-#define TIOCM_ST 0x008
293-#define TIOCM_SR 0x010
294-#define TIOCM_CTS 0x020
295-#define TIOCM_CAR 0x040
296-#define TIOCM_RNG 0x080
297-#define TIOCM_DSR 0x100
298-#define TIOCM_CD TIOCM_CAR
299-#define TIOCM_RI TIOCM_RNG
300-
301271 /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
302272 #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
303-
304-/* line disciplines */
305-#define N_TTY 0
306-#define N_SLIP 1
307-#define N_MOUSE 2
308-#define N_PPP 3
309-#define N_STRIP 4
310-#define N_AX25 5
311-#define N_X25 6 /* X.25 async */
312-#define N_6PACK 7
313-#define N_MASC 8 /* Mobitex module */
314-#define N_R3964 9 /* Simatic R3964 module */
315-#define N_PROFIBUS_FDL 10 /* Profibus */
316-#define N_IRDA 11 /* Linux IR */
317-#define N_SMSBLOCK 12 /* SMS block mode */
318-#define N_HDLC 13 /* synchronous HDLC */
319-#define N_SYNC_PPP 14 /* synchronous PPP */
320-#define N_HCI 15 /* Bluetooth HCI UART */