From a70d09955b8fe499a1368b1701971f206cf6d752 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 15 Oct 2001 22:22:32 +0000 Subject: Merged patch from pre-glibc-2.2.4 files --- libc/sysdeps/linux/powerpc/bits/dirent.h | 13 +++++- libc/sysdeps/linux/powerpc/bits/dlfcn.h | 2 + libc/sysdeps/linux/powerpc/bits/errno.h | 6 +++ libc/sysdeps/linux/powerpc/bits/sigset.h | 3 ++ libc/sysdeps/linux/powerpc/bits/sigthread.h | 4 ++ libc/sysdeps/linux/powerpc/bits/sockaddr.h | 3 ++ libc/sysdeps/linux/powerpc/bits/socket.h | 4 ++ libc/sysdeps/linux/powerpc/bits/stdio_lim.h | 2 +- libc/sysdeps/linux/powerpc/bits/termios.h | 65 ++++++++++------------------- libc/sysdeps/linux/powerpc/bits/types.h | 8 ++-- 10 files changed, 62 insertions(+), 48 deletions(-) (limited to 'libc/sysdeps') diff --git a/libc/sysdeps/linux/powerpc/bits/dirent.h b/libc/sysdeps/linux/powerpc/bits/dirent.h index 76794b08d..81562a8c4 100644 --- a/libc/sysdeps/linux/powerpc/bits/dirent.h +++ b/libc/sysdeps/linux/powerpc/bits/dirent.h @@ -16,6 +16,16 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +/* + * June 25, 2001 + * + * Removed d_type support for dirent and undefined _DIRENT_HAVE_D_TYPE; + * i.e. match the kernel structs and avoid any translation for now. + * Note: glibc fakes d_type for the dirent case. + * Note: dirent64 still has the d_type field. + */ + + #ifndef _DIRENT_H # error "Never use directly; include instead." #endif @@ -30,7 +40,6 @@ struct dirent __off64_t d_off; #endif unsigned short int d_reclen; - unsigned char d_type; char d_name[256]; /* We must not include limits.h! */ }; @@ -50,4 +59,4 @@ struct dirent64 #undef _DIRENT_HAVE_D_NAMLEN #define _DIRENT_HAVE_D_RECLEN #define _DIRENT_HAVE_D_OFF -#define _DIRENT_HAVE_D_TYPE +#undef _DIRENT_HAVE_D_TYPE diff --git a/libc/sysdeps/linux/powerpc/bits/dlfcn.h b/libc/sysdeps/linux/powerpc/bits/dlfcn.h index 2525fa3d9..2ebee8fbf 100644 --- a/libc/sysdeps/linux/powerpc/bits/dlfcn.h +++ b/libc/sysdeps/linux/powerpc/bits/dlfcn.h @@ -55,5 +55,7 @@ (_dl_mcount_wrapper_check (fctp), (*(fctp)) args) /* This function calls the profiling functions. */ +__BEGIN_DECLS extern void _dl_mcount_wrapper_check (void *__selfpc) __THROW; +__END_DECLS #endif diff --git a/libc/sysdeps/linux/powerpc/bits/errno.h b/libc/sysdeps/linux/powerpc/bits/errno.h index ac59d4c9d..e1300321d 100644 --- a/libc/sysdeps/linux/powerpc/bits/errno.h +++ b/libc/sysdeps/linux/powerpc/bits/errno.h @@ -32,6 +32,9 @@ # define ECANCELED 125 # ifndef __ASSEMBLER__ + +__BEGIN_DECLS + /* We now need a declaration of the `errno' variable. */ extern int errno; @@ -47,6 +50,9 @@ extern int *__errno_location (void) __THROW __attribute__ ((__const__)); /* When using threads, errno is a per-thread value. */ # define errno (*__errno_location ()) # endif + +__END_DECLS + # endif /* !__ASSEMBLER__ */ #endif /* _ERRNO_H */ diff --git a/libc/sysdeps/linux/powerpc/bits/sigset.h b/libc/sysdeps/linux/powerpc/bits/sigset.h index 7ccadda45..900deadac 100644 --- a/libc/sysdeps/linux/powerpc/bits/sigset.h +++ b/libc/sysdeps/linux/powerpc/bits/sigset.h @@ -97,6 +97,8 @@ typedef struct # endif # endif +__BEGIN_DECLS + /* These functions needn't check for a bogus signal number -- error checking is done in the non __ versions. */ @@ -121,5 +123,6 @@ __SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), ) # undef __SIGSETFN # endif +__END_DECLS #endif /* ! _SIGSET_H_fns. */ diff --git a/libc/sysdeps/linux/powerpc/bits/sigthread.h b/libc/sysdeps/linux/powerpc/bits/sigthread.h index b86e75f20..8ca688c59 100644 --- a/libc/sysdeps/linux/powerpc/bits/sigthread.h +++ b/libc/sysdeps/linux/powerpc/bits/sigthread.h @@ -24,6 +24,8 @@ # error "Never include this file directly. Use instead" #endif +__BEGIN_DECLS + /* Functions for handling signals. */ /* Modify the signal mask for the calling thread. The arguments have @@ -35,4 +37,6 @@ extern int pthread_sigmask (int __how, /* Send signal SIGNO to the given thread. */ extern int pthread_kill (pthread_t __thread, int __signo) __THROW; +__END_DECLS + #endif /* bits/sigthread.h */ diff --git a/libc/sysdeps/linux/powerpc/bits/sockaddr.h b/libc/sysdeps/linux/powerpc/bits/sockaddr.h index 3e1d1312d..51325f9ed 100644 --- a/libc/sysdeps/linux/powerpc/bits/sockaddr.h +++ b/libc/sysdeps/linux/powerpc/bits/sockaddr.h @@ -24,6 +24,7 @@ #ifndef _BITS_SOCKADDR_H #define _BITS_SOCKADDR_H 1 +__BEGIN_DECLS /* POSIX.1g specifies this type name for the `sa_family' member. */ typedef unsigned short int sa_family_t; @@ -37,4 +38,6 @@ typedef unsigned short int sa_family_t; #define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int)) +__END_DECLS + #endif /* bits/sockaddr.h */ diff --git a/libc/sysdeps/linux/powerpc/bits/socket.h b/libc/sysdeps/linux/powerpc/bits/socket.h index 6ad4a5ed9..a7e4040e4 100644 --- a/libc/sysdeps/linux/powerpc/bits/socket.h +++ b/libc/sysdeps/linux/powerpc/bits/socket.h @@ -24,6 +24,8 @@ # error "Never include directly; use instead." #endif +__BEGIN_DECLS + #define __need_size_t #define __need_NULL #include @@ -311,4 +313,6 @@ struct linger int l_linger; /* Time to linger. */ }; +__END_DECLS + #endif /* bits/socket.h */ diff --git a/libc/sysdeps/linux/powerpc/bits/stdio_lim.h b/libc/sysdeps/linux/powerpc/bits/stdio_lim.h index ea6d693f5..c0aabd398 100644 --- a/libc/sysdeps/linux/powerpc/bits/stdio_lim.h +++ b/libc/sysdeps/linux/powerpc/bits/stdio_lim.h @@ -23,7 +23,7 @@ #ifdef _STDIO_H # define L_tmpnam 20 # define TMP_MAX 238328 -# define FILENAME_MAX 4095 +# define FILENAME_MAX 255 # ifdef __USE_POSIX # define L_ctermid 9 diff --git a/libc/sysdeps/linux/powerpc/bits/termios.h b/libc/sysdeps/linux/powerpc/bits/termios.h index f7b89ae59..758684824 100644 --- a/libc/sysdeps/linux/powerpc/bits/termios.h +++ b/libc/sysdeps/linux/powerpc/bits/termios.h @@ -1,20 +1,20 @@ -/* Copyright (C) 1997, 1999, 2001 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + Library General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #ifndef _TERMIOS_H # error "Never include directly; use instead." @@ -24,28 +24,24 @@ typedef unsigned char cc_t; typedef unsigned int speed_t; typedef unsigned int tcflag_t; -/* - * termios type and macro definitions. Be careful about adding stuff - * to this file since it's used in GNU libc and there are strict rules - * concerning namespace pollution. - */ +/* note: this is fixed to be the same as the kernel, not glibc */ -#define NCCS 32 +#define NCCS 19 struct termios { tcflag_t c_iflag; /* input mode flags */ tcflag_t c_oflag; /* output mode flags */ tcflag_t c_cflag; /* control mode flags */ tcflag_t c_lflag; /* local mode flags */ - cc_t c_line; /* line discipline (== c_cc[19]) */ cc_t c_cc[NCCS]; /* control characters */ + cc_t c_line; /* line discipline */ speed_t c_ispeed; /* input speed */ speed_t c_ospeed; /* output speed */ }; /* c_cc characters */ -#define VINTR 0 -#define VQUIT 1 -#define VERASE 2 +#define VINTR 0 +#define VQUIT 1 +#define VERASE 2 #define VKILL 3 #define VEOF 4 #define VMIN 5 @@ -54,9 +50,9 @@ struct termios { #define VEOL2 8 #define VSWTC 9 -#define VWERASE 10 +#define VWERASE 10 #define VREPRINT 11 -#define VSUSP 12 +#define VSUSP 12 #define VSTART 13 #define VSTOP 14 #define VLNEXT 15 @@ -74,9 +70,12 @@ struct termios { #define ICRNL 0000400 #define IXON 0001000 #define IXOFF 0002000 -#define IXANY 0004000 -#define IUCLC 0010000 -#define IMAXBEL 0020000 +/* POSIX.1 doesn't want these... */ +#ifdef __USE_BSD +# define IXANY 0004000 +# define IUCLC 0010000 +# define IMAXBEL 0020000 +#endif /* c_oflag bits */ #define OPOST 0000001 @@ -236,23 +235,6 @@ struct ltchars { #define TIOCPKT_NOSTOP 16 #define TIOCPKT_DOSTOP 32 -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define NCC 10 -struct termio { - unsigned short c_iflag; /* input mode flags */ - unsigned short c_oflag; /* output mode flags */ - unsigned short c_cflag; /* control mode flags */ - unsigned short c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - /* c_cc characters */ #define _VINTR 0 #define _VQUIT 1 @@ -297,4 +279,3 @@ struct termio { #define N_SMSBLOCK 12 /* SMS block mode */ #define N_HDLC 13 /* synchronous HDLC */ #define N_SYNC_PPP 14 /* synchronous PPP */ -#define N_HCI 15 /* Bluetooth HCI UART */ diff --git a/libc/sysdeps/linux/powerpc/bits/types.h b/libc/sysdeps/linux/powerpc/bits/types.h index bdda9388a..0ad16b969 100644 --- a/libc/sysdeps/linux/powerpc/bits/types.h +++ b/libc/sysdeps/linux/powerpc/bits/types.h @@ -58,12 +58,14 @@ __extension__ typedef unsigned long long int __uint64_t; #endif typedef __quad_t *__qaddr_t; -typedef __u_quad_t __dev_t; /* Type of device numbers. */ +/* These types are modified from glibc to be more compatible with + * the kernel. */ +typedef __u_int __dev_t; /* Type of device numbers. */ typedef __u_int __uid_t; /* Type of user identifications. */ typedef __u_int __gid_t; /* Type of group identifications. */ -typedef __u_long __ino_t; /* Type of file serial numbers. */ +typedef __u_int __ino_t; /* Type of file serial numbers. */ typedef __u_int __mode_t; /* Type of file attribute bitmasks. */ -typedef __u_int __nlink_t; /* Type of file link counts. */ +typedef __u_short __nlink_t; /* Type of file link counts. */ typedef long int __off_t; /* Type of file sizes and offsets. */ typedef __quad_t __loff_t; /* Type of file sizes and offsets. */ typedef int __pid_t; /* Type of process identifications. */ -- cgit v1.2.3