summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-03-16 01:06:29 +0000
committerEric Andersen <andersen@codepoet.org>2001-03-16 01:06:29 +0000
commit39f83819e26ed9c63386bdf254d2f6751f54cce9 (patch)
tree45ffe8236f3641ca0b5a9704b5c2b32d52e19d95
parentaed7ad54eb30fc388b95f98ad4980e8133975656 (diff)
Add powerpc port done by David Schleef <ds@schleef.org>
-rw-r--r--libc/sysdeps/linux/powerpc/Makefile76
-rw-r--r--libc/sysdeps/linux/powerpc/bits/byteswap.h64
-rw-r--r--libc/sysdeps/linux/powerpc/bits/confname.h411
-rw-r--r--libc/sysdeps/linux/powerpc/bits/dirent.h53
-rw-r--r--libc/sysdeps/linux/powerpc/bits/endian.h8
-rw-r--r--libc/sysdeps/linux/powerpc/bits/fcntl.h141
-rw-r--r--libc/sysdeps/linux/powerpc/bits/in.h128
-rw-r--r--libc/sysdeps/linux/powerpc/bits/ioctl-types.h77
-rw-r--r--libc/sysdeps/linux/powerpc/bits/ioctls.h108
-rw-r--r--libc/sysdeps/linux/powerpc/bits/ipc.h50
-rw-r--r--libc/sysdeps/linux/powerpc/bits/local_lim.h55
-rw-r--r--libc/sysdeps/linux/powerpc/bits/poll.h51
-rw-r--r--libc/sysdeps/linux/powerpc/bits/posix1_lim.h141
-rw-r--r--libc/sysdeps/linux/powerpc/bits/posix2_lim.h100
-rw-r--r--libc/sysdeps/linux/powerpc/bits/posix_opt.h110
-rw-r--r--libc/sysdeps/linux/powerpc/bits/select.h35
-rw-r--r--libc/sysdeps/linux/powerpc/bits/setjmp.h47
-rw-r--r--libc/sysdeps/linux/powerpc/bits/shm.h84
-rw-r--r--libc/sysdeps/linux/powerpc/bits/sigaction.h77
-rw-r--r--libc/sysdeps/linux/powerpc/bits/sigcontext.h29
-rw-r--r--libc/sysdeps/linux/powerpc/bits/siginfo.h279
-rw-r--r--libc/sysdeps/linux/powerpc/bits/signum.h80
-rw-r--r--libc/sysdeps/linux/powerpc/bits/sigset.h125
-rw-r--r--libc/sysdeps/linux/powerpc/bits/sigstack.h55
-rw-r--r--libc/sysdeps/linux/powerpc/bits/sigthread.h37
-rw-r--r--libc/sysdeps/linux/powerpc/bits/sockaddr.h44
-rw-r--r--libc/sysdeps/linux/powerpc/bits/socket.h305
-rw-r--r--libc/sysdeps/linux/powerpc/bits/stat.h127
-rw-r--r--libc/sysdeps/linux/powerpc/bits/statfs.h61
-rw-r--r--libc/sysdeps/linux/powerpc/bits/stdio_lim.h37
-rw-r--r--libc/sysdeps/linux/powerpc/bits/syscall.h196
-rw-r--r--libc/sysdeps/linux/powerpc/bits/termios.h212
-rw-r--r--libc/sysdeps/linux/powerpc/bits/time.h59
-rw-r--r--libc/sysdeps/linux/powerpc/bits/types.h153
-rw-r--r--libc/sysdeps/linux/powerpc/bits/uio.h46
-rw-r--r--libc/sysdeps/linux/powerpc/bits/waitflags.h30
-rw-r--r--libc/sysdeps/linux/powerpc/bits/waitstatus.h104
-rw-r--r--libc/sysdeps/linux/powerpc/bits/wordsize.h19
-rw-r--r--libc/sysdeps/linux/powerpc/bits/xopen_lim.h96
-rw-r--r--libc/sysdeps/linux/powerpc/crt0.S58
-rw-r--r--libc/sysdeps/linux/powerpc/crt0.c43
-rw-r--r--libc/sysdeps/linux/powerpc/fork.c33
-rw-r--r--libc/sysdeps/linux/powerpc/longjmp.S75
-rw-r--r--libc/sysdeps/linux/powerpc/ppc_asm.h115
-rw-r--r--libc/sysdeps/linux/powerpc/setjmp.S79
-rw-r--r--libc/sysdeps/linux/powerpc/vfork.S41
46 files changed, 4354 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/powerpc/Makefile b/libc/sysdeps/linux/powerpc/Makefile
new file mode 100644
index 000000000..c738d449b
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/Makefile
@@ -0,0 +1,76 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000 by Lineo, inc.
+#
+# This program is free software; you can redistribute it and/or 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.
+#
+# This program 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 Library General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Derived in part from the Linux-8086 C library, the GNU C Library, and several
+# other sundry sources. Files within this library are copyright by their
+# respective copyright holders.
+
+USE_CRT0_C=y
+
+TOPDIR=../../../
+include $(TOPDIR)Rules.mak
+LIBC=$(TOPDIR)libc.a
+ASFLAGS=$(CFLAGS)
+
+TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
+
+ifeq ($(USE_CRT0_C),y)
+CRT0=crt0.c
+else
+CRT0=crt0.S
+endif
+
+CRT0_OBJ=crt0.o
+
+SSRC=longjmp.S setjmp.S vfork.S
+SOBJS=$(patsubst %.S,%.o, $(SSRC))
+
+#CSRC=ptrace.c
+CSRC=
+COBJS=$(patsubst %.c,%.o, $(CSRC))
+
+OBJS=$(SOBJS) $(MOBJ) $(COBJS)
+
+
+all: $(OBJS) $(LIBC)
+
+$(LIBC): ar-target
+
+ar-target: $(OBJS) $(CRT0_OBJ)
+ $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+ cp $(CRT0_OBJ) $(TOPDIR)crt0.o
+
+ifeq ($(USE_CRT0_C),y)
+$(CRT0_OBJ): %.o : %.c
+else
+$(CRT0_OBJ): %.o : %.S
+endif
+ $(CC) $(CFLAGS) -c $< -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
+
+$(SOBJS): %.o : %.S
+ $(CC) $(CFLAGS) -c $< -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
+
+$(COBJS): %.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
+
+clean:
+ rm -f *.[oa] *~ core
+
diff --git a/libc/sysdeps/linux/powerpc/bits/byteswap.h b/libc/sysdeps/linux/powerpc/bits/byteswap.h
new file mode 100644
index 000000000..6b5115658
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/byteswap.h
@@ -0,0 +1,64 @@
+/* Macros to swap the order of bytes in integer values.
+ Copyright (C) 1997, 1998 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
+#endif
+
+/* Swap bytes in 16 bit value. */
+#ifdef __GNUC__
+# define __bswap_16(x) \
+ (__extension__ \
+ ({ unsigned short int __bsx = (x); \
+ ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8)); }))
+#else
+static __inline unsigned short int
+__bswap_16 (unsigned short int __bsx)
+{
+ return ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8));
+}
+#endif
+
+/* Swap bytes in 32 bit value. */
+#ifdef __GNUC__
+# define __bswap_32(x) \
+ (__extension__ \
+ ({ unsigned int __bsx = (x); \
+ ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) | \
+ (((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24)); }))
+#else
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+ return ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) |
+ (((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24));
+}
+#endif
+
+#if defined __GNUC__ && __GNUC__ >= 2
+/* Swap bytes in 64 bit value. */
+# define __bswap_64(x) \
+ (__extension__ \
+ ({ union { unsigned long long int __ll; \
+ unsigned long int __l[2]; } __v, __r; \
+ __v.__ll = (x); \
+ __r.__l[0] = __bswap_32 (__v.__l[1]); \
+ __r.__l[1] = __bswap_32 (__v.__l[0]); \
+ __r.__ll; }))
+#endif
diff --git a/libc/sysdeps/linux/powerpc/bits/confname.h b/libc/sysdeps/linux/powerpc/bits/confname.h
new file mode 100644
index 000000000..a649e52f2
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/confname.h
@@ -0,0 +1,411 @@
+/* `sysconf', `pathconf', and `confstr' NAME values. Generic version.
+ Copyright (C) 1993, 1995, 1996, 1997, 1998 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 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
+ Library General Public License for more details.
+
+ 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 _UNISTD_H
+# error "Never use <bits/confname.h> directly; include <unistd.h> instead."
+#endif
+
+/* Values for the NAME argument to `pathconf' and `fpathconf'. */
+enum
+ {
+ _PC_LINK_MAX,
+#define _PC_LINK_MAX _PC_LINK_MAX
+ _PC_MAX_CANON,
+#define _PC_MAX_CANON _PC_MAX_CANON
+ _PC_MAX_INPUT,
+#define _PC_MAX_INPUT _PC_MAX_INPUT
+ _PC_NAME_MAX,
+#define _PC_NAME_MAX _PC_NAME_MAX
+ _PC_PATH_MAX,
+#define _PC_PATH_MAX _PC_PATH_MAX
+ _PC_PIPE_BUF,
+#define _PC_PIPE_BUF _PC_PIPE_BUF
+ _PC_CHOWN_RESTRICTED,
+#define _PC_CHOWN_RESTRICTED _PC_CHOWN_RESTRICTED
+ _PC_NO_TRUNC,
+#define _PC_NO_TRUNC _PC_NO_TRUNC
+ _PC_VDISABLE,
+#define _PC_VDISABLE _PC_VDISABLE
+ _PC_SYNC_IO,
+#define _PC_SYNC_IO _PC_SYNC_IO
+ _PC_ASYNC_IO,
+#define _PC_ASYNC_IO _PC_ASYNC_IO
+ _PC_PRIO_IO,
+#define _PC_PRIO_IO _PC_PRIO_IO
+ _PC_SOCK_MAXBUF,
+#define _PC_SOCK_MAXBUF _PC_SOCK_MAXBUF
+ _PC_FILESIZEBITS
+#define _PC_FILESIZEBITS _PC_FILESIZEBITS
+ };
+
+/* Values for the argument to `sysconf'. */
+enum
+ {
+ _SC_ARG_MAX,
+#define _SC_ARG_MAX _SC_ARG_MAX
+ _SC_CHILD_MAX,
+#define _SC_CHILD_MAX _SC_CHILD_MAX
+ _SC_CLK_TCK,
+#define _SC_CLK_TCK _SC_CLK_TCK
+ _SC_NGROUPS_MAX,
+#define _SC_NGROUPS_MAX _SC_NGROUPS_MAX
+ _SC_OPEN_MAX,
+#define _SC_OPEN_MAX _SC_OPEN_MAX
+ _SC_STREAM_MAX,
+#define _SC_STREAM_MAX _SC_STREAM_MAX
+ _SC_TZNAME_MAX,
+#define _SC_TZNAME_MAX _SC_TZNAME_MAX
+ _SC_JOB_CONTROL,
+#define _SC_JOB_CONTROL _SC_JOB_CONTROL
+ _SC_SAVED_IDS,
+#define _SC_SAVED_IDS _SC_SAVED_IDS
+ _SC_REALTIME_SIGNALS,
+#define _SC_REALTIME_SIGNALS _SC_REALTIME_SIGNALS
+ _SC_PRIORITY_SCHEDULING,
+#define _SC_PRIORITY_SCHEDULING _SC_PRIORITY_SCHEDULING
+ _SC_TIMERS,
+#define _SC_TIMERS _SC_TIMERS
+ _SC_ASYNCHRONOUS_IO,
+#define _SC_ASYNCHRONOUS_IO _SC_ASYNCHRONOUS_IO
+ _SC_PRIORITIZED_IO,
+#define _SC_PRIORITIZED_IO _SC_PRIORITIZED_IO
+ _SC_SYNCHRONIZED_IO,
+#define _SC_SYNCHRONIZED_IO _SC_SYNCHRONIZED_IO
+ _SC_FSYNC,
+#define _SC_FSYNC _SC_FSYNC
+ _SC_MAPPED_FILES,
+#define _SC_MAPPED_FILES _SC_MAPPED_FILES
+ _SC_MEMLOCK,
+#define _SC_MEMLOCK _SC_MEMLOCK
+ _SC_MEMLOCK_RANGE,
+#define _SC_MEMLOCK_RANGE _SC_MEMLOCK_RANGE
+ _SC_MEMORY_PROTECTION,
+#define _SC_MEMORY_PROTECTION _SC_MEMORY_PROTECTION
+ _SC_MESSAGE_PASSING,
+#define _SC_MESSAGE_PASSING _SC_MESSAGE_PASSING
+ _SC_SEMAPHORES,
+#define _SC_SEMAPHORES _SC_SEMAPHORES
+ _SC_SHARED_MEMORY_OBJECTS,
+#define _SC_SHARED_MEMORY_OBJECTS _SC_SHARED_MEMORY_OBJECTS
+ _SC_AIO_LISTIO_MAX,
+#define _SC_AIO_LISTIO_MAX _SC_AIO_LISTIO_MAX
+ _SC_AIO_MAX,
+#define _SC_AIO_MAX _SC_AIO_MAX
+ _SC_AIO_PRIO_DELTA_MAX,
+#define _SC_AIO_PRIO_DELTA_MAX _SC_AIO_PRIO_DELTA_MAX
+ _SC_DELAYTIMER_MAX,
+#define _SC_DELAYTIMER_MAX _SC_DELAYTIMER_MAX
+ _SC_MQ_OPEN_MAX,
+#define _SC_MQ_OPEN_MAX _SC_MQ_OPEN_MAX
+ _SC_MQ_PRIO_MAX,
+#define _SC_MQ_PRIO_MAX _SC_MQ_PRIO_MAX
+ _SC_VERSION,
+#define _SC_VERSION _SC_VERSION
+ _SC_PAGESIZE,
+#define _SC_PAGESIZE _SC_PAGESIZE
+#define _SC_PAGE_SIZE _SC_PAGESIZE
+ _SC_RTSIG_MAX,
+#define _SC_RTSIG_MAX _SC_RTSIG_MAX
+ _SC_SEM_NSEMS_MAX,
+#define _SC_SEM_NSEMS_MAX _SC_SEM_NSEMS_MAX
+ _SC_SEM_VALUE_MAX,
+#define _SC_SEM_VALUE_MAX _SC_SEM_VALUE_MAX
+ _SC_SIGQUEUE_MAX,
+#define _SC_SIGQUEUE_MAX _SC_SIGQUEUE_MAX
+ _SC_TIMER_MAX,
+#define _SC_TIMER_MAX _SC_TIMER_MAX
+
+ /* Values for the argument to `sysconf'
+ corresponding to _POSIX2_* symbols. */
+ _SC_BC_BASE_MAX,
+#define _SC_BC_BASE_MAX _SC_BC_BASE_MAX
+ _SC_BC_DIM_MAX,
+#define _SC_BC_DIM_MAX _SC_BC_DIM_MAX
+ _SC_BC_SCALE_MAX,
+#define _SC_BC_SCALE_MAX _SC_BC_SCALE_MAX
+ _SC_BC_STRING_MAX,
+#define _SC_BC_STRING_MAX _SC_BC_STRING_MAX
+ _SC_COLL_WEIGHTS_MAX,
+#define _SC_COLL_WEIGHTS_MAX _SC_COLL_WEIGHTS_MAX
+ _SC_EQUIV_CLASS_MAX,
+#define _SC_EQUIV_CLASS_MAX _SC_EQUIV_CLASS_MAX
+ _SC_EXPR_NEST_MAX,
+#define _SC_EXPR_NEST_MAX _SC_EXPR_NEST_MAX
+ _SC_LINE_MAX,
+#define _SC_LINE_MAX _SC_LINE_MAX
+ _SC_RE_DUP_MAX,
+#define _SC_RE_DUP_MAX _SC_RE_DUP_MAX
+ _SC_CHARCLASS_NAME_MAX,
+#define _SC_CHARCLASS_NAME_MAX _SC_CHARCLASS_NAME_MAX
+
+ _SC_2_VERSION,
+#define _SC_2_VERSION _SC_2_VERSION
+ _SC_2_C_BIND,
+#define _SC_2_C_BIND _SC_2_C_BIND
+ _SC_2_C_DEV,
+#define _SC_2_C_DEV _SC_2_C_DEV
+ _SC_2_FORT_DEV,
+#define _SC_2_FORT_DEV _SC_2_FORT_DEV
+ _SC_2_FORT_RUN,
+#define _SC_2_FORT_RUN _SC_2_FORT_RUN
+ _SC_2_SW_DEV,
+#define _SC_2_SW_DEV _SC_2_SW_DEV
+ _SC_2_LOCALEDEF,
+#define _SC_2_LOCALEDEF _SC_2_LOCALEDEF
+
+ _SC_PII,
+#define _SC_PII _SC_PII
+ _SC_PII_XTI,
+#define _SC_PII_XTI _SC_PII_XTI
+ _SC_PII_SOCKET,
+#define _SC_PII_SOCKET _SC_PII_SOCKET
+ _SC_PII_INTERNET,
+#define _SC_PII_INTERNET _SC_PII_INTERNET
+ _SC_PII_OSI,
+#define _SC_PII_OSI _SC_PII_OSI
+ _SC_POLL,
+#define _SC_POLL _SC_POLL
+ _SC_SELECT,
+#define _SC_SELECT _SC_SELECT
+ _SC_UIO_MAXIOV,
+#define _SC_UIO_MAXIOV _SC_UIO_MAXIOV
+ _SC_PII_INTERNET_STREAM,
+#define _SC_PII_INTERNET_STREAM _SC_PII_INTERNET_STREAM
+ _SC_PII_INTERNET_DGRAM,
+#define _SC_PII_INTERNET_DGRAM _SC_PII_INTERNET_DGRAM
+ _SC_PII_OSI_COTS,
+#define _SC_PII_OSI_COTS _SC_PII_OSI_COTS
+ _SC_PII_OSI_CLTS,
+#define _SC_PII_OSI_CLTS _SC_PII_OSI_CLTS
+ _SC_PII_OSI_M,
+#define _SC_PII_OSI_M _SC_PII_OSI_M
+ _SC_T_IOV_MAX,
+#define _SC_T_IOV_MAX _SC_T_IOV_MAX
+
+ /* Values according to POSIX 1003.1c (POSIX threads). */
+ _SC_THREADS,
+#define _SC_THREADS _SC_THREADS
+ _SC_THREAD_SAFE_FUNCTIONS,
+#define _SC_THREAD_SAFE_FUNCTIONS _SC_THREAD_SAFE_FUNCTIONS
+ _SC_GETGR_R_SIZE_MAX,
+#define _SC_GETGR_R_SIZE_MAX _SC_GETGR_R_SIZE_MAX
+ _SC_GETPW_R_SIZE_MAX,
+#define _SC_GETPW_R_SIZE_MAX _SC_GETPW_R_SIZE_MAX
+ _SC_LOGIN_NAME_MAX,
+#define _SC_LOGIN_NAME_MAX _SC_LOGIN_NAME_MAX
+ _SC_TTY_NAME_MAX,
+#define _SC_TTY_NAME_MAX _SC_TTY_NAME_MAX
+ _SC_THREAD_DESTRUCTOR_ITERATIONS,
+#define _SC_THREAD_DESTRUCTOR_ITERATIONS _SC_THREAD_DESTRUCTOR_ITERATIONS
+ _SC_THREAD_KEYS_MAX,
+#define _SC_THREAD_KEYS_MAX _SC_THREAD_KEYS_MAX
+ _SC_THREAD_STACK_MIN,
+#define _SC_THREAD_STACK_MIN _SC_THREAD_STACK_MIN
+ _SC_THREAD_THREADS_MAX,
+#define _SC_THREAD_THREADS_MAX _SC_THREAD_THREADS_MAX
+ _SC_THREAD_ATTR_STACKADDR,
+#define _SC_THREAD_ATTR_STACKADDR _SC_THREAD_ATTR_STACKADDR
+ _SC_THREAD_ATTR_STACKSIZE,
+#define _SC_THREAD_ATTR_STACKSIZE _SC_THREAD_ATTR_STACKSIZE
+ _SC_THREAD_PRIORITY_SCHEDULING,
+#define _SC_THREAD_PRIORITY_SCHEDULING _SC_THREAD_PRIORITY_SCHEDULING
+ _SC_THREAD_PRIO_INHERIT,
+#define _SC_THREAD_PRIO_INHERIT _SC_THREAD_PRIO_INHERIT
+ _SC_THREAD_PRIO_PROTECT,
+#define _SC_THREAD_PRIO_PROTECT _SC_THREAD_PRIO_PROTECT
+ _SC_THREAD_PROCESS_SHARED,
+#define _SC_THREAD_PROCESS_SHARED _SC_THREAD_PROCESS_SHARED
+
+ _SC_NPROCESSORS_CONF,
+#define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF
+ _SC_NPROCESSORS_ONLN,
+#define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN
+ _SC_PHYS_PAGES,
+#define _SC_PHYS_PAGES _SC_PHYS_PAGES
+ _SC_AVPHYS_PAGES,
+#define _SC_AVPHYS_PAGES _SC_AVPHYS_PAGES
+ _SC_ATEXIT_MAX,
+#define _SC_ATEXIT_MAX _SC_ATEXIT_MAX
+ _SC_PASS_MAX,
+#define _SC_PASS_MAX _SC_PASS_MAX
+
+ _SC_XOPEN_VERSION,
+#define _SC_XOPEN_VERSION _SC_XOPEN_VERSION
+ _SC_XOPEN_XCU_VERSION,
+#define _SC_XOPEN_XCU_VERSION _SC_XOPEN_XCU_VERSION
+ _SC_XOPEN_UNIX,
+#define _SC_XOPEN_UNIX _SC_XOPEN_UNIX
+ _SC_XOPEN_CRYPT,
+#define _SC_XOPEN_CRYPT _SC_XOPEN_CRYPT
+ _SC_XOPEN_ENH_I18N,
+#define _SC_XOPEN_ENH_I18N _SC_XOPEN_ENH_I18N
+ _SC_XOPEN_SHM,
+#define _SC_XOPEN_SHM _SC_XOPEN_SHM
+
+ _SC_2_CHAR_TERM,
+#define _SC_2_CHAR_TERM _SC_2_CHAR_TERM
+ _SC_2_C_VERSION,
+#define _SC_2_C_VERSION _SC_2_C_VERSION
+ _SC_2_UPE,
+#define _SC_2_UPE _SC_2_UPE
+
+ _SC_XOPEN_XPG2,
+#define _SC_XOPEN_XPG2 _SC_XOPEN_XPG2
+ _SC_XOPEN_XPG3,
+#define _SC_XOPEN_XPG3 _SC_XOPEN_XPG3
+ _SC_XOPEN_XPG4,
+#define _SC_XOPEN_XPG4 _SC_XOPEN_XPG4
+
+ _SC_CHAR_BIT,
+#define _SC_CHAR_BIT _SC_CHAR_BIT
+ _SC_CHAR_MAX,
+#define _SC_CHAR_MAX _SC_CHAR_MAX
+ _SC_CHAR_MIN,
+#define _SC_CHAR_MIN _SC_CHAR_MIN
+ _SC_INT_MAX,
+#define _SC_INT_MAX _SC_INT_MAX
+ _SC_INT_MIN,
+#define _SC_INT_MIN _SC_INT_MIN
+ _SC_LONG_BIT,
+#define _SC_LONG_BIT _SC_LONG_BIT
+ _SC_WORD_BIT,
+#define _SC_WORD_BIT _SC_WORD_BIT
+ _SC_MB_LEN_MAX,
+#define _SC_MB_LEN_MAX _SC_MB_LEN_MAX
+ _SC_NZERO,
+#define _SC_NZERO _SC_NZERO
+ _SC_SSIZE_MAX,
+#define _SC_SSIZE_MAX _SC_SSIZE_MAX
+ _SC_SCHAR_MAX,
+#define _SC_SCHAR_MAX _SC_SCHAR_MAX
+ _SC_SCHAR_MIN,
+#define _SC_SCHAR_MIN _SC_SCHAR_MIN
+ _SC_SHRT_MAX,
+#define _SC_SHRT_MAX _SC_SHRT_MAX
+ _SC_SHRT_MIN,
+#define _SC_SHRT_MIN _SC_SHRT_MIN
+ _SC_UCHAR_MAX,
+#define _SC_UCHAR_MAX _SC_UCHAR_MAX
+ _SC_UINT_MAX,
+#define _SC_UINT_MAX _SC_UINT_MAX
+ _SC_ULONG_MAX,
+#define _SC_ULONG_MAX _SC_ULONG_MAX
+ _SC_USHRT_MAX,
+#define _SC_USHRT_MAX _SC_USHRT_MAX
+
+ _SC_NL_ARGMAX,
+#define _SC_NL_ARGMAX _SC_NL_ARGMAX
+ _SC_NL_LANGMAX,
+#define _SC_NL_LANGMAX _SC_NL_LANGMAX
+ _SC_NL_MSGMAX,
+#define _SC_NL_MSGMAX _SC_NL_MSGMAX
+ _SC_NL_NMAX,
+#define _SC_NL_NMAX _SC_NL_NMAX
+ _SC_NL_SETMAX,
+#define _SC_NL_SETMAX _SC_NL_SETMAX
+ _SC_NL_TEXTMAX,
+#define _SC_NL_TEXTMAX _SC_NL_TEXTMAX
+
+ _SC_XBS5_ILP32_OFF32,
+#define _SC_XBS5_ILP32_OFF32 _SC_XBS5_ILP32_OFF32
+ _SC_XBS5_ILP32_OFFBIG,
+#define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG
+ _SC_XBS5_LP64_OFF64,
+#define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64
+ _SC_XBS5_LPBIG_OFFBIG,
+#define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG
+
+ _SC_XOPEN_LEGACY,
+#define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY
+ _SC_XOPEN_REALTIME,
+#define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME
+ _SC_XOPEN_REALTIME_THREADS,
+#define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS
+
+ /* MUST BE LAST VALUE!!! */
+ _UCLIBC_SYSCONF_NUM_VALID_ARGS
+ };
+
+#if (defined __USE_POSIX2 || defined __USE_UNIX98 \
+ || defined __USE_FILE_OFFSET64 || defined __USE_LARGEFILE64 \
+ || defined __USE_LARGEFILE)
+/* Values for the NAME argument to `confstr'. */
+enum
+ {
+ _CS_PATH /* The default search path. */
+#define _CS_PATH _CS_PATH
+
+#if (defined __USE_FILE_OFFSET64 || defined __USE_LARGEFILE64 \
+ || defined __USE_LARGEFILE)
+ ,
+ _CS_LFS_CFLAGS = 1000,
+# define _CS_LFS_CFLAGS _CS_LFS_CFLAGS
+ _CS_LFS_LDFLAGS,
+# define _CS_LFS_LDFLAGS _CS_LFS_LDFLAGS
+ _CS_LFS_LIBS,
+# define _CS_LFS_LIBS _CS_LFS_LIBS
+ _CS_LFS_LINTFLAGS,
+# define _CS_LFS_LINTFLAGS _CS_LFS_LINTFLAGS
+ _CS_LFS64_CFLAGS,
+# define _CS_LFS64_CFLAGS _CS_LFS64_CFLAGS
+ _CS_LFS64_LDFLAGS,
+# define _CS_LFS64_LDFLAGS _CS_LFS64_LDFLAGS
+ _CS_LFS64_LIBS,
+# define _CS_LFS64_LIBS _CS_LFS64_LIBS
+ _CS_LFS64_LINTFLAGS
+# define _CS_LFS64_LINTFLAGS _CS_LFS64_LINTFLAGS
+#endif
+
+#ifdef __USE_UNIX98
+ ,
+ _CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
+# define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_XBS5_ILP32_OFF32_CFLAGS
+ _CS_XBS5_ILP32_OFF32_LDFLAGS,
+# define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_XBS5_ILP32_OFF32_LDFLAGS
+ _CS_XBS5_ILP32_OFF32_LIBS,
+# define _CS_XBS5_ILP32_OFF32_LIBS _CS_XBS5_ILP32_OFF32_LIBS
+ _CS_XBS5_ILP32_OFF32_LINTFLAGS,
+# define _CS_XBS5_ILP32_OFF32_LINTFLAGS _CS_XBS5_ILP32_OFF32_LINTFLAGS
+ _CS_XBS5_ILP32_OFFBIG_CFLAGS,
+# define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_XBS5_ILP32_OFFBIG_CFLAGS
+ _CS_XBS5_ILP32_OFFBIG_LDFLAGS,
+# define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_XBS5_ILP32_OFFBIG_LDFLAGS
+ _CS_XBS5_ILP32_OFFBIG_LIBS,
+# define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_XBS5_ILP32_OFFBIG_LIBS
+ _CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
+# define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS _CS_XBS5_ILP32_OFFBIG_LINTFLAGS
+ _CS_XBS5_LP64_OFF64_CFLAGS,
+# define _CS_XBS5_LP64_OFF64_CFLAGS _CS_XBS5_LP64_OFF64_CFLAGS
+ _CS_XBS5_LP64_OFF64_LDFLAGS,
+# define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_XBS5_LP64_OFF64_LDFLAGS
+ _CS_XBS5_LP64_OFF64_LIBS,
+# define _CS_XBS5_LP64_OFF64_LIBS _CS_XBS5_LP64_OFF64_LIBS
+ _CS_XBS5_LP64_OFF64_LINTFLAGS,
+# define _CS_XBS5_LP64_OFF64_LINTFLAGS _CS_XBS5_LP64_OFF64_LINTFLAGS
+ _CS_XBS5_LPBIG_OFFBIG_CFLAGS,
+# define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_XBS5_LPBIG_OFFBIG_CFLAGS
+ _CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
+# define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_XBS5_LPBIG_OFFBIG_LDFLAGS
+ _CS_XBS5_LPBIG_OFFBIG_LIBS,
+# define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_XBS5_LPBIG_OFFBIG_LIBS
+ _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+# define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS
+#endif
+ };
+#endif
diff --git a/libc/sysdeps/linux/powerpc/bits/dirent.h b/libc/sysdeps/linux/powerpc/bits/dirent.h
new file mode 100644
index 000000000..30e020328
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/dirent.h
@@ -0,0 +1,53 @@
+/* Copyright (C) 1996, 1997 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 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
+ Library General Public License for more details.
+
+ 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 _DIRENT_H
+# error "Never use <bits/dirent.h> directly; include <dirent.h> instead."
+#endif
+
+struct dirent
+ {
+#ifndef __USE_FILE_OFFSET64
+ __ino_t d_ino;
+ __off_t d_off;
+#else
+ __ino64_t d_ino;
+ __off64_t d_off;
+#endif
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ char d_name[256]; /* We must not include limits.h! */
+ };
+
+#ifdef __USE_LARGEFILE64
+struct dirent64
+ {
+ __ino64_t d_ino;
+ __off64_t d_off;
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ char d_name[256]; /* We must not include limits.h! */
+ };
+#endif
+
+#define d_fileno d_ino /* Backwards compatibility. */
+
+#undef _DIRENT_HAVE_D_NAMLEN
+#define _DIRENT_HAVE_D_RECLEN
+#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
diff --git a/libc/sysdeps/linux/powerpc/bits/endian.h b/libc/sysdeps/linux/powerpc/bits/endian.h
new file mode 100644
index 000000000..43b54a35d
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/endian.h
@@ -0,0 +1,8 @@
+/* powerpc is big endian */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __BIG_ENDIAN
+
diff --git a/libc/sysdeps/linux/powerpc/bits/fcntl.h b/libc/sysdeps/linux/powerpc/bits/fcntl.h
new file mode 100644
index 000000000..0c94c6b9a
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/fcntl.h
@@ -0,0 +1,141 @@
+/* O_*, F_*, FD_* bit values for Linux.
+ Copyright (C) 1995, 1996, 1997, 1998 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 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
+ Library General Public License for more details.
+
+ 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 _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+
+#include <sys/types.h>
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+ located on an ext2 file system */
+#define O_ACCMODE 0003
+#define O_RDONLY 00
+#define O_WRONLY 01
+#define O_RDWR 02
+#define O_CREAT 0100 /* not fcntl */
+#define O_EXCL 0200 /* not fcntl */
+#define O_NOCTTY 0400 /* not fcntl */
+#define O_TRUNC 01000 /* not fcntl */
+#define O_APPEND 02000
+#define O_NONBLOCK 04000
+#define O_NDELAY O_NONBLOCK
+#define O_SYNC 010000
+#define O_FSYNC O_SYNC
+#define O_ASYNC 020000
+
+#ifdef __USE_GNU
+# define O_DIRECTORY 040000 /* Must be a directory. */
+# define O_NOFOLLOW 0100000 /* Do not follow links. */
+#endif
+
+/* XXX missing */
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE 0
+#endif
+
+/* For now Linux has synchronisity options for data and read operations.
+ We define the symbols here but let them do the same as O_SYNC since
+ this is a superset. */
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC O_SYNC /* Synchronize data. */
+# define O_RSYNC O_SYNC /* Synchronize read operations. */
+#endif
+
+/* Values for the second argument to `fcntl'. */
+#define F_DUPFD 0 /* Duplicate file descriptor. */
+#define F_GETFD 1 /* Get file descriptor flags. */
+#define F_SETFD 2 /* Set file descriptor flags. */
+#define F_GETFL 3 /* Get file status flags. */
+#define F_SETFL 4 /* Set file status flags. */
+#define F_GETLK 5 /* Get record locking info. */
+#define F_SETLK 6 /* Set record locking info (non-blocking). */
+#define F_SETLKW 7 /* Set record locking info (blocking). */
+
+/* XXX missing */
+#define F_GETLK64 5 /* Get record locking info. */
+#define F_SETLK64 6 /* Set record locking info (non-blocking). */
+#define F_SETLKW64 7 /* Set record locking info (blocking). */
+
+#ifdef __USE_BSD
+# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
+# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETSIG 10 /* Set number of signal to be sent. */
+# define F_GETSIG 11 /* Get number of signal to be sent. */
+#endif
+
+/* For F_[GET|SET]FL. */
+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
+#define F_RDLCK 0 /* Read lock. */
+#define F_WRLCK 1 /* Write lock. */
+#define F_UNLCK 2 /* Remove lock. */
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
+
+#ifdef __USE_BSD
+/* Operations for bsd flock(), also used by the kernel implementation */
+# define LOCK_SH 1 /* shared lock */
+# define LOCK_EX 2 /* exclusive lock */
+# define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+# define LOCK_UN 8 /* remove lock */
+#endif
+
+struct flock
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+#ifndef __USE_FILE_OFFSET64
+ __off_t l_start; /* Offset where the lock begins. */
+ __off_t l_len; /* Size of the locked area; zero means until EOF. */
+#else
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+#endif
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+#endif
+
+/* Define some more compatibility macros to be backward compatible with
+ BSD systems which did not managed to hide these kernel macros. */
+#ifdef __USE_BSD
+# define FAPPEND O_APPEND
+# define FFSYNC O_FSYNC
+# define FASYNC O_ASYNC
+# define FNONBLOCK O_NONBLOCK
+# define FNDELAY O_NDELAY
+#endif /* Use BSD. */
diff --git a/libc/sysdeps/linux/powerpc/bits/in.h b/libc/sysdeps/linux/powerpc/bits/in.h
new file mode 100644
index 000000000..38e2a2e00
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/in.h
@@ -0,0 +1,128 @@
+/* Copyright (C) 1991,92,93,94,95,96,97,98,99 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+/* Linux version. */
+
+#ifndef _NETINET_IN_H
+# error "Never use <bits/in.h> directly; include <netinet/in.h> instead."
+#endif
+
+/* Options for use with `getsockopt' and `setsockopt' at the IP level.
+ The first word in the comment at the right is the data type used;
+ "bool" means a boolean value stored in an `int'. */
+#define IP_TOS 1 /* int; IP type of service and precedence. */
+#define IP_TTL 2 /* int; IP time to live. */
+#define IP_HDRINCL 3 /* int; Header is included with data. */
+#define IP_OPTIONS 4 /* ip_opts; IP per-packet options. */
+#define IP_ROUTER_ALERT 5 /* bool */
+#define IP_RECVOPTS 6 /* bool */
+#define IP_RETOPTS 7 /* bool */
+#define IP_PKTINFO 8 /* bool */
+#define IP_PKTOPTIONS 9
+#define IP_PMTUDISC 10 /* obsolete name? */
+#define IP_MTU_DISCOVER 10 /* int; see below */
+#define IP_RECVERR 11 /* bool */
+#define IP_RECVTTL 12 /* bool */
+#define IP_RECVTOS 13 /* bool */
+#define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */
+#define IP_MULTICAST_TTL 33 /* u_char; set/get IP multicast ttl */
+#define IP_MULTICAST_LOOP 34 /* i_char; set/get IP multicast loopback */
+#define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */
+#define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */
+
+/* For BSD compatibility. */
+#define IP_RECVRETOPTS IP_RETOPTS
+
+/* IP_MTU_DISCOVER arguments. */
+#define IP_PMTUDISC_DONT 0 /* Never send DF frames. */
+#define IP_PMTUDISC_WANT 1 /* Use per route hints. */
+#define IP_PMTUDISC_DO 2 /* Always DF. */
+
+/* To select the IP level. */
+#define SOL_IP 0
+
+#define IP_DEFAULT_MULTICAST_TTL 1
+#define IP_DEFAULT_MULTICAST_LOOP 1
+#define IP_MAX_MEMBERSHIPS 20
+
+/* Structure used to describe IP options for IP_OPTIONS. The `ip_dst'
+ field is used for the first-hop gateway when using a source route
+ (this gets put into the header proper). */
+struct ip_opts
+ {
+ struct in_addr ip_dst; /* First hop; zero without source route. */
+ char ip_opts[40]; /* Actually variable in size. */
+ };
+
+/* Structure used for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. */
+struct ip_mreq
+ {
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_interface; /* local IP address of interface */
+ };
+
+/* As above but including interface specification by index. */
+struct ip_mreqn
+ {
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_address; /* local IP address of interface */
+ int imr_ifindex; /* Interface index */
+ };
+
+/* Structure used for IP_PKTINFO. */
+struct in_pktinfo
+ {
+ int ipi_ifindex; /* Interface index */
+ struct in_addr ipi_spec_dst; /* Routing destination address */
+ struct in_addr ipi_addr; /* Header destination address */
+ };
+
+/* Options for use with `getsockopt' and `setsockopt' at the IPv6 level.
+ The first word in the comment at the right is the data type used;
+ "bool" means a boolean value stored in an `int'. */
+#define IPV6_ADDRFORM 1
+#define IPV6_PKTINFO 2
+#define IPV6_HOPOPTS 3
+#define IPV6_DSTOPTS 4
+#define IPV6_RXSRCRT 5
+#define IPV6_PKTOPTIONS 6
+#define IPV6_CHECKSUM 7
+#define IPV6_HOPLIMIT 8
+#define IPV6_NEXTHOP 9
+#define IPV6_AUTHHDR 10
+#define IPV6_UNICAST_HOPS 16
+#define IPV6_MULTICAST_IF 17
+#define IPV6_MULTICAST_HOPS 18
+#define IPV6_MULTICAST_LOOP 19
+#define IPV6_ADD_MEMBERSHIP 20
+#define IPV6_DROP_MEMBERSHIP 21
+#define IPV6_ROUTER_ALERT 22
+
+#define SCM_SRCRT IPV6_RXSRCRT
+
+#define IPV6_RXHOPOPTS IPV6_HOPOPTS /* obsolete name */
+#define IPV6_RXDSTOPTS IPV6_DSTOPTS /* obsolete name */
+
+/* IPV6_MTU_DISCOVER values. */
+#define IPV6_PMTUDISC_DONT 0 /* Never send DF frames. */
+#define IPV6_PMTUDISC_WANT 1 /* Use per route hints. */
+#define IPV6_PMTUDISC_DO 2 /* Always DF. */
+
+/* Socket level values for IPv6. */
+#define SOL_IPV6 41
+#define SOL_ICMPV6 58
diff --git a/libc/sysdeps/linux/powerpc/bits/ioctl-types.h b/libc/sysdeps/linux/powerpc/bits/ioctl-types.h
new file mode 100644
index 000000000..59c79df81
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/ioctl-types.h
@@ -0,0 +1,77 @@
+/* Structure types for pre-termios terminal ioctls. Linux version.
+ Copyright (C) 1996, 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 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
+ Library General Public License for more details.
+
+ 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 _SYS_IOCTL_H
+# error "Never use <bits/ioctl-types.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Get definition of constants for use with `ioctl'. */
+#include <asm/ioctls.h>
+
+
+struct winsize
+ {
+ unsigned short int ws_row;
+ unsigned short int ws_col;
+ unsigned short int ws_xpixel;
+ unsigned short int ws_ypixel;
+ };
+
+#define NCC 8
+struct termio
+ {
+ unsigned short int c_iflag; /* input mode flags */
+ unsigned short int c_oflag; /* output mode flags */
+ unsigned short int c_cflag; /* control mode flags */
+ unsigned short int c_lflag; /* local mode flags */
+ unsigned char c_line; /* line discipline */
+ unsigned char c_cc[NCC]; /* control characters */
+};
+
+/* modem lines */
+#define TIOCM_LE 0x001
+#define TIOCM_DTR 0x002
+#define TIOCM_RTS 0x004
+#define TIOCM_ST 0x008
+#define TIOCM_SR 0x010
+#define TIOCM_CTS 0x020
+#define TIOCM_CAR 0x040
+#define TIOCM_RNG 0x080
+#define TIOCM_DSR 0x100
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RI TIOCM_RNG
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+
+/* line disciplines */
+#define N_TTY 0
+#define N_SLIP 1
+#define N_MOUSE 2
+#define N_PPP 3
+#define N_STRIP 4
+#define N_AX25 5
+#define N_X25 6 /* X.25 async */
+#define N_6PACK 7
+#define N_MASC 8 /* Mobitex module */
+#define N_R3964 9 /* Simatic R3964 module */
+#define N_PROFIBUS_FDL 10 /* Profibus */
+#define N_IRDA 11 /* Linux IR */
+#define N_SMSBLOCK 12 /* SMS block mode */
+#define N_HDLC 13 /* synchronous HDLC */
+#define N_SYNC_PPP 14 /* synchronous PPP */
diff --git a/libc/sysdeps/linux/powerpc/bits/ioctls.h b/libc/sysdeps/linux/powerpc/bits/ioctls.h
new file mode 100644
index 000000000..c103645f6
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/ioctls.h
@@ -0,0 +1,108 @@
+/* Copyright (C) 1996, 1997, 1998 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 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
+ Library General Public License for more details.
+
+ 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 _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/* Use the definitions from the kernel header files. */
+#include <asm/ioctls.h>
+
+/* Routing table calls. */
+#define SIOCADDRT 0x890B /* add routing table entry */
+#define SIOCDELRT 0x890C /* delete routing table entry */
+#define SIOCRTMSG 0x890D /* call to routing system */
+
+/* Socket configuration controls. */
+#define SIOCGIFNAME 0x8910 /* get iface name */
+#define SIOCSIFLINK 0x8911 /* set iface channel */
+#define SIOCGIFCONF 0x8912 /* get iface list */
+#define SIOCGIFFLAGS 0x8913 /* get flags */
+#define SIOCSIFFLAGS 0x8914 /* set flags */
+#define SIOCGIFADDR 0x8915 /* get PA address */
+#define SIOCSIFADDR 0x8916 /* set PA address */
+#define SIOCGIFDSTADDR 0x8917 /* get remote PA address */
+#define SIOCSIFDSTADDR 0x8918 /* set remote PA address */
+#define SIOCGIFBRDADDR 0x8919 /* get broadcast PA address */
+#define SIOCSIFBRDADDR 0x891a /* set broadcast PA address */
+#define SIOCGIFNETMASK 0x891b /* get network PA mask */
+#define SIOCSIFNETMASK 0x891c /* set network PA mask */
+#define SIOCGIFMETRIC 0x891d /* get metric */
+#define SIOCSIFMETRIC 0x891e /* set metric */
+#define SIOCGIFMEM 0x891f /* get memory address (BSD) */
+#define SIOCSIFMEM 0x8920 /* set memory address (BSD) */
+#define SIOCGIFMTU 0x8921 /* get MTU size */
+#define SIOCSIFMTU 0x8922 /* set MTU size */
+#define SIOCSIFHWADDR 0x8924 /* set hardware address */
+#define SIOCGIFENCAP 0x8925 /* get/set encapsulations */
+#define SIOCSIFENCAP 0x8926
+#define SIOCGIFHWADDR 0x8927 /* Get hardware address */
+#define SIOCGIFSLAVE 0x8929 /* Driver slaving support */
+#define SIOCSIFSLAVE 0x8930
+#define SIOCADDMULTI 0x8931 /* Multicast address lists */
+#define SIOCDELMULTI 0x8932
+#define SIOCGIFINDEX 0x8933 /* name -> if_index mapping */
+#define SIOGIFINDEX SIOCGIFINDEX /* misprint compatibility :-) */
+#define SIOCSIFPFLAGS 0x8934 /* set/get extended flags set */
+#define SIOCGIFPFLAGS 0x8935
+#define SIOCDIFADDR 0x8936 /* delete PA address */
+#define SIOCSIFHWBROADCAST 0x8937 /* set hardware broadcast addr */
+#define SIOCGIFCOUNT 0x8938 /* get number of devices */
+
+#define SIOCGIFBR 0x8940 /* Bridging support */
+#define SIOCSIFBR 0x8941 /* Set bridging options */
+
+#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
+#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
+
+
+/* ARP cache control calls. */
+ /* 0x8950 - 0x8952 * obsolete calls, don't re-use */
+#define SIOCDARP 0x8953 /* delete ARP table entry */
+#define SIOCGARP 0x8954 /* get ARP table entry */
+#define SIOCSARP 0x8955 /* set ARP table entry */
+
+/* RARP cache control calls. */
+#define SIOCDRARP 0x8960 /* delete RARP table entry */
+#define SIOCGRARP 0x8961 /* get RARP table entry */
+#define SIOCSRARP 0x8962 /* set RARP table entry */
+
+/* Driver configuration calls */
+
+#define SIOCGIFMAP 0x8970 /* Get device parameters */
+#define SIOCSIFMAP 0x8971 /* Set device parameters */
+
+/* DLCI configuration calls */
+
+#define SIOCADDDLCI 0x8980 /* Create new DLCI device */
+#define SIOCDELDLCI 0x8981 /* Delete DLCI device */
+
+/* Device private ioctl calls. */
+
+/* These 16 ioctls are available to devices via the do_ioctl() device
+ vector. Each device should include this file and redefine these
+ names as their own. Because these are device dependent it is a good
+ idea _NOT_ to issue them to random objects and hope. */
+
+#define SIOCDEVPRIVATE 0x89F0 /* to 89FF */
+
+/*
+ * These 16 ioctl calls are protocol private
+ */
+
+#define SIOCPROTOPRIVATE 0x89E0 /* to 89EF */
diff --git a/libc/sysdeps/linux/powerpc/bits/ipc.h b/libc/sysdeps/linux/powerpc/bits/ipc.h
new file mode 100644
index 000000000..c4e37358e
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/ipc.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1995, 1996, 1997, 1998 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 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
+ Library General Public License for more details.
+
+ 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 _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'. */
+#define IPC_CREAT 01000 /* Create key if key does not exist. */
+#define IPC_EXCL 02000 /* Fail if key exists. */
+#define IPC_NOWAIT 04000 /* Return error on wait. */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'. */
+#define IPC_RMID 0 /* Remove identifier. */
+#define IPC_SET 1 /* Set `ipc_perm' options. */
+#define IPC_STAT 2 /* Get `ipc_perm' options. */
+#define IPC_INFO 3 /* See ipcs. */
+
+/* Special key values. */
+#define IPC_PRIVATE ((__key_t) 0) /* Private key. */
+
+
+/* Data structure used to pass permission information to IPC operations. */
+struct ipc_perm
+ {
+ __key_t __key; /* Key. */
+ unsigned short int uid; /* Owner's user ID. */
+ unsigned short int gid; /* Owner's group ID. */
+ unsigned short int cuid; /* Creator's user ID. */
+ unsigned short int cgid; /* Creator's group ID. */
+ unsigned short int mode; /* Read/write permission. */
+ unsigned short int __seq; /* Sequence number. */
+ };
diff --git a/libc/sysdeps/linux/powerpc/bits/local_lim.h b/libc/sysdeps/linux/powerpc/bits/local_lim.h
new file mode 100644
index 000000000..545a90b2e
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/local_lim.h
@@ -0,0 +1,55 @@
+/* Minimum guaranteed maximum values for system limits. Linux version.
+ Copyright (C) 1993, 94, 95, 96, 97, 98 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+/* The kernel header pollutes the namespace with the NR_OPEN symbol.
+ Remove this after including the header if necessary. */
+#ifndef NR_OPEN
+# define __undef_NR_OPEN
+#endif
+
+/* The kernel sources contain a file with all the needed information. */
+#include <linux/limits.h>
+
+/* Have to remove NR_OPEN? */
+#ifdef __undef_NR_OPEN
+# undef NR_OPEN
+# undef __undef_NR_OPEN
+#endif
+
+/* The number of data keys per process. */
+#define _POSIX_THREAD_KEYS_MAX 128
+/* This is the value this implementation supports. */
+#define PTHREAD_KEYS_MAX 1024
+
+/* Controlling the iterations of destructors for thread-specific data. */
+#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
+/* Number of iterations this implementation does. */
+#define PTHREAD_DESTRUCTOR_ITERATIONS _POSIX_THREAD_DESTRUCTOR_ITERATIONS
+
+/* The number of threads per process. */
+#define _POSIX_THREAD_THREADS_MAX 64
+/* This is the value this implementation supports. */
+#define PTHREAD_THREADS_MAX 1024
+
+/* Maximum amount by which a process can descrease its asynchronous I/O
+ priority level. */
+#define AIO_PRIO_DELTA_MAX 20
+
+/* Minimum size for a thread. We are free to choose a reasonable value. */
+#define PTHREAD_STACK_MIN 16384
diff --git a/libc/sysdeps/linux/powerpc/bits/poll.h b/libc/sysdeps/linux/powerpc/bits/poll.h
new file mode 100644
index 000000000..4aec021fe
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/poll.h
@@ -0,0 +1,51 @@
+/* Copyright (C) 1997 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 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
+ Library General Public License for more details.
+
+ 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 _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for. These bits may be set in `events'
+ to indicate the interesting event types; they will appear in `revents'
+ to indicate the status of the file descriptor. */
+#define POLLIN 0x001 /* There is data to read. */
+#define POLLPRI 0x002 /* There is urgent data to read. */
+#define POLLOUT 0x004 /* Writing now will not block. */
+
+#ifdef __USE_XOPEN
+/* These values are defined in XPG4.2. */
+# define POLLRDNORM 0x040 /* Normal data may be read. */
+# define POLLRDBAND 0x080 /* Priority data may be read. */
+# define POLLWRNORM 0x100 /* Writing now will not block. */
+# define POLLWRBAND 0x200 /* Priority data may be written. */
+#endif
+
+#ifdef __USE_GNU
+/* This is an extension for Linux. */
+# define POLLMSG 0x400
+#endif
+
+/* Event types always implicitly polled for. These bits need not be set in
+ `events', but they will appear in `revents' to indicate the status of
+ the file descriptor. */
+#define POLLERR 0x008 /* Error condition. */
+#define POLLHUP 0x010 /* Hung up. */
+#define POLLNVAL 0x020 /* Invalid polling request. */
+
+/* Canonical number of polling requests to read in at a time in poll. */
+#define NPOLLFILE 30
diff --git a/libc/sysdeps/linux/powerpc/bits/posix1_lim.h b/libc/sysdeps/linux/powerpc/bits/posix1_lim.h
new file mode 100644
index 000000000..ee84b94a7
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/posix1_lim.h
@@ -0,0 +1,141 @@
+/* Copyright (C) 1991, 1992, 1993, 1996, 1998 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+/*
+ * POSIX Standard: 2.9.2 Minimum Values Added to <limits.h>
+ *
+ * Never include this file directly; use <limits.h> instead.
+ */
+
+#ifndef _BITS_POSIX1_LIM_H
+#define _BITS_POSIX1_LIM_H 1
+
+
+/* These are the standard-mandated minimum values. */
+
+/* Minimum number of operations in one list I/O call. */
+#define _POSIX_AIO_LISTIO_MAX 2
+
+/* Minimal number of outstanding asynchronous I/O operations. */
+#define _POSIX_AIO_MAX 1
+
+/* Maximum length of arguments to `execve', including environment. */
+#define _POSIX_ARG_MAX 4096
+
+/* Maximum simultaneous processes per real user ID. */
+#define _POSIX_CHILD_MAX 6
+
+/* Minimal number of timer expiration overruns. */
+#define _POSIX_DELAYTIMER_MAX 32
+
+/* Maximum link count of a file. */
+#define _POSIX_LINK_MAX 8
+
+/* Number of bytes in a terminal canonical input queue. */
+#define _POSIX_MAX_CANON 255
+
+/* Number of bytes for which space will be
+ available in a terminal input queue. */
+#define _POSIX_MAX_INPUT 255
+
+/* Maximum number of message queues open for a process. */
+#define _POSIX_MQ_OPEN_MAX 8
+
+/* Maximum number of supported message priorities. */
+#define _POSIX_MQ_PRIO_MAX 32
+
+/* Number of simultaneous supplementary group IDs per process. */
+#define _POSIX_NGROUPS_MAX 0
+
+/* Number of files one process can have open at once. */
+#define _POSIX_OPEN_MAX 16
+
+/* Number of descriptors that a process may examine with `pselect' or
+ `select'. */
+#define _POSIX_FD_SETSIZE _POSIX_OPEN_MAX
+
+/* Number of bytes in a filename. */
+#define _POSIX_NAME_MAX 14
+
+/* Number of bytes in a pathname. */
+#define _POSIX_PATH_MAX 255
+
+/* Number of bytes than can be written atomically to a pipe. */
+#define _POSIX_PIPE_BUF 512
+
+/* Minimal number of realtime signals reserved for the application. */
+#define _POSIX_RTSIG_MAX 8
+
+/* Number of semaphores a process can have. */
+#define _POSIX_SEM_NSEMS_MAX 256
+
+/* Maximal value of a semaphore. */
+#define _POSIX_SEM_VALUE_MAX 32767
+
+/* Number of pending realtime signals. */
+#define _POSIX_SIGQUEUE_MAX 32
+
+/* Largest value of a `ssize_t'. */
+#define _POSIX_SSIZE_MAX 32767
+
+/* Number of streams a process can have open at once. */
+#define _POSIX_STREAM_MAX 8
+
+/* Maximum length of a timezone name (element of `tzname'). */
+#define _POSIX_TZNAME_MAX 3
+
+/* Maximum number of connections that can be queued on a socket. */
+#define _POSIX_QLIMIT 1
+
+/* Maximum number of bytes that can be buffered on a socket for send
+ or receive. */
+#define _POSIX_HIWAT _POSIX_PIPE_BUF
+
+/* Maximum number of elements in an `iovec' array. */
+#define _POSIX_UIO_MAXIOV 16
+
+/* Maximum number of characters in a tty name. */
+#define _POSIX_TTY_NAME_MAX 9
+
+/* Number of timer for a process. */
+#define _POSIX_TIMER_MAX 32
+
+/* Maximum length of login name. */
+#define _POSIX_LOGIN_NAME_MAX 9
+
+/* Maximum clock resolution in nanoseconds. */
+#define _POSIX_CLOCKRES_MIN 20000000
+
+
+/* Get the implementation-specific values for the above. */
+#include <bits/local_lim.h>
+
+
+#ifndef SSIZE_MAX
+# define SSIZE_MAX INT_MAX
+#endif
+
+
+/* This value is a guaranteed minimum maximum.
+ The current maximum can be got from `sysconf'. */
+
+#ifndef NGROUPS_MAX
+# define NGROUPS_MAX _POSIX_NGROUPS_MAX
+#endif
+
+#endif /* bits/posix1_lim.h */
diff --git a/libc/sysdeps/linux/powerpc/bits/posix2_lim.h b/libc/sysdeps/linux/powerpc/bits/posix2_lim.h
new file mode 100644
index 000000000..eaaf67129
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/posix2_lim.h
@@ -0,0 +1,100 @@
+/* Copyright (C) 1991, 1996, 2000 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+/*
+ * Never include this file directly; include <limits.h> instead.
+ */
+
+#ifndef _BITS_POSIX2_LIM_H
+#define _BITS_POSIX2_LIM_H 1
+
+
+/* The maximum `ibase' and `obase' values allowed by the `bc' utility. */
+#define _POSIX2_BC_BASE_MAX 99
+
+/* The maximum number of elements allowed in an array by the `bc' utility. */
+#define _POSIX2_BC_DIM_MAX 2048
+
+/* The maximum `scale' value allowed by the `bc' utility. */
+#define _POSIX2_BC_SCALE_MAX 99
+
+/* The maximum length of a string constant accepted by the `bc' utility. */
+#define _POSIX2_BC_STRING_MAX 1000
+
+/* The maximum number of weights that can be assigned to an entry of
+ the LC_COLLATE `order' keyword in the locale definition file.
+ We have no fixed limit, 255 is very high. */
+#define _POSIX2_COLL_WEIGHTS_MAX 255
+
+/* The maximum number of weights that can be assigned to an entry of
+ the LC_COLLATE category `order' keyword in a locale definition.
+ We have no fixed limit, 255 is a high number. */
+#define _POSIX2_EQUIV_CLASS_MAX 255
+
+/* The maximum number of expressions that can be nested
+ within parentheses by the `expr' utility. */
+#define _POSIX2_EXPR_NEST_MAX 32
+
+/* The maximum length, in bytes, of an input line. */
+#define _POSIX2_LINE_MAX 2048
+
+/* The maximum number of repeated occurrences of a regular expression
+ permitted when using the interval notation `\{M,N\}'. */
+#define _POSIX2_RE_DUP_MAX 255
+
+/* The maximum number of bytes in a character class name. We have no
+ fixed limit, 2048 is a high number. */
+#define _POSIX2_CHARCLASS_NAME_MAX 2048
+
+
+/* These values are implementation-specific,
+ and may vary within the implementation.
+ Their precise values can be obtained from sysconf. */
+
+#ifndef BC_BASE_MAX
+#define BC_BASE_MAX _POSIX2_BC_BASE_MAX
+#endif
+#ifndef BC_DIM_MAX
+#define BC_DIM_MAX _POSIX2_BC_DIM_MAX
+#endif
+#ifndef BC_SCALE_MAX
+#define BC_SCALE_MAX _POSIX2_BC_SCALE_MAX
+#endif
+#ifndef BC_STRING_MAX
+#define BC_STRING_MAX _POSIX2_BC_STRING_MAX
+#endif
+#ifndef COLL_WEIGHTS_MAX
+#define COLL_WEIGHTS_MAX _POSIX2_COLL_WEIGHTS_MAX
+#endif
+#ifndef EQUIV_CLASS_MAX
+#define EQUIV_CLASS_MAX _POSIX2_EQUIV_CLASS_MAX
+#endif
+#ifndef EXPR_NEST_MAX
+#define EXPR_NEST_MAX _POSIX2_EXPR_NEST_MAX
+#endif
+#ifndef LINE_MAX
+#define LINE_MAX _POSIX2_LINE_MAX
+#endif
+#ifndef CHARCLASS_NAME_MAX
+#define CHARCLASS_NAME_MAX _POSIX2_CHARCLASS_NAME_MAX
+#endif
+
+/* This value is defined like this in regex.h. */
+#define RE_DUP_MAX (0x7fff)
+
+#endif /* bits/posix2_lim.h */
diff --git a/libc/sysdeps/linux/powerpc/bits/posix_opt.h b/libc/sysdeps/linux/powerpc/bits/posix_opt.h
new file mode 100644
index 000000000..15683b77e
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/posix_opt.h
@@ -0,0 +1,110 @@
+/* Define POSIX options for Linux.
+ Copyright (C) 1996, 1997, 1998, 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 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
+ Library General Public License for more details.
+
+ 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 _POSIX_OPT_H
+#define _POSIX_OPT_H 1
+
+/* Job control is supported. */
+#define _POSIX_JOB_CONTROL 1
+
+/* Processes have a saved set-user-ID and a saved set-group-ID. */
+#define _POSIX_SAVED_IDS 1
+
+/* Priority scheduling is supported. */
+#define _POSIX_PRIORITY_SCHEDULING 1
+
+/* Synchronizing file data is supported. */
+#define _POSIX_SYNCHRONIZED_IO 1
+
+/* The fsync function is present. */
+#define _POSIX_FSYNC 1
+
+/* Mapping of files to memory is supported. */
+#define _POSIX_MAPPED_FILES 1
+
+/* Locking of all memory is supported. */
+#define _POSIX_MEMLOCK 1
+
+/* Locking of ranges of memory is supported. */
+#define _POSIX_MEMLOCK_RANGE 1
+
+/* Setting of memory protections is supported. */
+#define _POSIX_MEMORY_PROTECTION 1
+
+/* Implementation supports `poll' function. */
+#define _POSIX_POLL 1
+
+/* Implementation supports `select' and `pselect' functions. */
+#define _POSIX_SELECT 1
+
+/* Only root can change owner of file. */
+#define _POSIX_CHOWN_RESTRICTED 1
+
+/* `c_cc' member of 'struct termios' structure can be disabled by
+ using the value _POSIX_VDISABLE. */
+#define _POSIX_VDISABLE '\0'
+
+/* Filenames are not silently truncated. */
+#define _POSIX_NO_TRUNC 1
+
+/* X/Open realtime support is available. */
+#define _XOPEN_REALTIME 1
+
+/* X/Open realtime thread support is available. */
+#define _XOPEN_REALTIME_THREADS 1
+
+/* XPG4.2 shared memory is supported. */
+#define _XOPEN_SHM 1
+
+/* Tell we have POSIX threads. */
+#define _POSIX_THREADS 1
+
+/* We have the reentrant functions described in POSIX. */
+#define _POSIX_REENTRANT_FUNCTIONS 1
+#define _POSIX_THREAD_SAFE_FUNCTIONS 1
+
+/* We provide priority scheduling for threads. */
+#define _POSIX_THREAD_PRIORITY_SCHEDULING 1
+
+/* We support user-defined stack sizes. */
+#define _POSIX_THREAD_ATTR_STACKSIZE 1
+
+/* We support user-defined stacks. */
+#define _POSIX_THREAD_ATTR_STACKADDR 1
+
+/* We support POSIX.1b semaphores, but only the non-shared form for now. */
+/*#define _POSIX_SEMAPHORES 1 XXX We are not quite there now. */
+
+/* Real-time signals are supported. */
+#define _POSIX_REALTIME_SIGNALS 1
+
+/* We support asynchronous I/O. */
+#define _POSIX_ASYNCHRONOUS_IO 1
+/* Alternative name for Unix98. */
+#define _LFS_ASYNCHRONOUS_IO 1
+
+/* The LFS support in asynchronous I/O is also available. */
+#define _LFS64_ASYNCHRONOUS_IO 1
+
+/* The rest of the LFS is also available. */
+#define _LFS_LARGEFILE 1
+#define _LFS64_LARGEFILE 1
+#define _LFS64_STDIO 1
+
+#endif /* posix_opt.h */
diff --git a/libc/sysdeps/linux/powerpc/bits/select.h b/libc/sysdeps/linux/powerpc/bits/select.h
new file mode 100644
index 000000000..4513135af
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/select.h
@@ -0,0 +1,35 @@
+/* Copyright (C) 1997, 1998 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 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
+ Library General Public License for more details.
+
+ 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 _SYS_SELECT_H
+# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
+#endif
+
+
+/* We don't use `memset' because this would require a prototype and
+ the array isn't too big. */
+#define __FD_ZERO(s) \
+ do { \
+ unsigned int __i; \
+ __fd_set *__arr = (s); \
+ for (__i = 0; __i < sizeof (__fd_set) / sizeof (__fd_mask); ++__i) \
+ __FDS_BITS (__arr)[__i] = 0; \
+ } while (0)
+#define __FD_SET(d, s) (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
+#define __FD_CLR(d, s) (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d))
+#define __FD_ISSET(d, s) ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0)
diff --git a/libc/sysdeps/linux/powerpc/bits/setjmp.h b/libc/sysdeps/linux/powerpc/bits/setjmp.h
new file mode 100644
index 000000000..da3f4379d
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/setjmp.h
@@ -0,0 +1,47 @@
+/* Copyright (C) 1997, 1998, 2000 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+/* Define the machine-dependent type `jmp_buf'. PowerPC version. */
+
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+/* The previous bits/setjmp.h had __jmp_buf defined as a structure.
+ We use an array of 'long int' instead, to make writing the
+ assembler easier. Naturally, user code should not depend on
+ either representation. */
+
+#if defined __USE_MISC || defined _ASM
+# define JB_GPR1 0 /* Also known as the stack pointer */
+# define JB_GPR2 1
+# define JB_LR 2 /* The address we will return to */
+# define JB_GPRS 3 /* GPRs 14 through 31 are saved, 18 in total */
+# define JB_CR 21 /* Condition code registers. */
+# define JB_FPRS 22 /* FPRs 14 through 31 are saved, 18*2 words total */
+# define JB_SIZE (58*4)
+#endif
+
+#ifndef _ASM
+typedef long int __jmp_buf[58];
+#endif
+
+/* Test if longjmp to JMPBUF would unwind the frame
+ containing a local variable at ADDRESS. */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+ ((void *) (address) < (void *) (jmpbuf)[JB_GPR1])
diff --git a/libc/sysdeps/linux/powerpc/bits/shm.h b/libc/sysdeps/linux/powerpc/bits/shm.h
new file mode 100644
index 000000000..c7070595b
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/shm.h
@@ -0,0 +1,84 @@
+/* Copyright (C) 1995, 1996, 1997 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 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
+ Library General Public License for more details.
+
+ 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 _SYS_SHM_H
+# error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Permission flag for shmget. */
+#define SHM_R 0400 /* or S_IRUGO from <linux/stat.h> */
+#define SHM_W 0200 /* or S_IWUGO from <linux/stat.h> */
+
+/* Flags for `shmat'. */
+#define SHM_RDONLY 010000 /* attach read-only else read-write */
+#define SHM_RND 020000 /* round attach address to SHMLBA */
+#define SHM_REMAP 040000 /* take-over region on attach */
+
+/* Commands for `shmctl'. */
+#define SHM_LOCK 11 /* lock segment (root only) */
+#define SHM_UNLOCK 12 /* unlock segment (root only) */
+
+
+/* Data structure describing a set of semaphores. */
+struct shmid_ds
+ {
+ struct ipc_perm shm_perm; /* operation permission struct */
+ int shm_segsz; /* size of segment in bytes */
+ __time_t shm_atime; /* time of last shmat() */
+ __time_t shm_dtime; /* time of last shmdt() */
+ __time_t shm_ctime; /* time of last change by shmctl() */
+ __ipc_pid_t shm_cpid; /* pid of creator */
+ __ipc_pid_t shm_lpid; /* pid of last shmop */
+ unsigned short int shm_nattch; /* number of current attaches */
+ unsigned short int __shm_npages; /* size of segment (pages) */
+ unsigned long int *__shm_pages; /* array of ptrs to frames -> SHMMAX */
+ struct vm_area_struct *__attaches; /* descriptors for attaches */
+ };
+
+#ifdef __USE_MISC
+
+/* ipcs ctl commands */
+# define SHM_STAT 13
+# define SHM_INFO 14
+
+/* shm_mode upper byte flags */
+# define SHM_DEST 01000 /* segment will be destroyed on last detach */
+# define SHM_LOCKED 02000 /* segment will not be swapped */
+
+struct shminfo
+ {
+ int shmmax;
+ int shmmin;
+ int shmmni;
+ int shmseg;
+ int shmall;
+ };
+
+struct shm_info
+ {
+ int used_ids;
+ unsigned long int shm_tot; /* total allocated shm */
+ unsigned long int shm_rss; /* total resident shm */
+ unsigned long int shm_swp; /* total swapped shm */
+ unsigned long int swap_attempts;
+ unsigned long int swap_successes;
+ };
+
+#endif /* __USE_MISC */
diff --git a/libc/sysdeps/linux/powerpc/bits/sigaction.h b/libc/sysdeps/linux/powerpc/bits/sigaction.h
new file mode 100644
index 000000000..e721183b9
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/sigaction.h
@@ -0,0 +1,77 @@
+/* The proper definitions for Linux's sigaction.
+ Copyright (C) 1993, 94, 95, 96, 97, 98, 2000 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 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
+ Library General Public License for more details.
+
+ 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 _SIGNAL_H
+# error "Never include <bits/sigaction.h> directly; use <signal.h> instead."
+#endif
+
+/* Structure describing the action to be taken when a signal arrives. */
+struct sigaction
+ {
+ /* Signal handler. */
+#ifdef __USE_POSIX199309
+ union
+ {
+ /* Used if SA_SIGINFO is not set. */
+ __sighandler_t sa_handler;
+ /* Used if SA_SIGINFO is set. */
+ void (*sa_sigaction) __P ((int, siginfo_t *, void *));
+ }
+ __sigaction_handler;
+# define sa_handler __sigaction_handler.sa_handler
+# define sa_sigaction __sigaction_handler.sa_sigaction
+#else
+ __sighandler_t sa_handler;
+#endif
+
+ /* Additional set of signals to be blocked. */
+ __sigset_t sa_mask;
+
+ /* Special flags. */
+ int sa_flags;
+
+ /* Restore handler. */
+ void (*sa_restorer) __P ((void));
+ };
+
+/* Bits in `sa_flags'. */
+#define SA_NOCLDSTOP 1 /* Don't send SIGCHLD when children stop. */
+#define SA_NOCLDWAIT 2 /* Don't create zombie on child death. */
+#define SA_SIGINFO 4 /* Invoke signal-catching function with
+ three arguments instead of one. */
+#if defined __USE_UNIX98 || defined __USE_MISC
+# define SA_ONSTACK 0x08000000 /* Use signal stack by using `sa_restorer'. */
+# define SA_RESTART 0x10000000 /* Restart syscall on signal return. */
+# define SA_NODEFER 0x40000000 /* Don't automatically block the signal when
+ its handler is being executed. */
+# define SA_RESETHAND 0x80000000 /* Reset to SIG_DFL on entry to handler. */
+#endif
+#ifdef __USE_MISC
+# define SA_INTERRUPT 0x20000000 /* Historical no-op. */
+
+/* Some aliases for the SA_ constants. */
+# define SA_NOMASK SA_NODEFER
+# define SA_ONESHOT SA_RESETHAND
+# define SA_STACK SA_ONSTACK
+#endif
+
+/* Values for the HOW argument to `sigprocmask'. */
+#define SIG_BLOCK 0 /* Block signals. */
+#define SIG_UNBLOCK 1 /* Unblock signals. */
+#define SIG_SETMASK 2 /* Set the set of blocked signals. */
diff --git a/libc/sysdeps/linux/powerpc/bits/sigcontext.h b/libc/sysdeps/linux/powerpc/bits/sigcontext.h
new file mode 100644
index 000000000..97cbf4b30
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/sigcontext.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 1996, 1997, 1998 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+#if !defined _SIGNAL_H && !defined _SYS_UCONTEXT_H
+# error "Never use <bits/sigcontext.h> directly; include <signal.h> instead."
+#endif
+
+#ifndef sigcontext_struct
+/* Kernel headers before 2.1.1 define a struct sigcontext_struct, but
+ we need sigcontext. */
+# define sigcontext_struct sigcontext
+
+# include <asm/sigcontext.h>
+#endif
diff --git a/libc/sysdeps/linux/powerpc/bits/siginfo.h b/libc/sysdeps/linux/powerpc/bits/siginfo.h
new file mode 100644
index 000000000..0ed54f267
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/siginfo.h
@@ -0,0 +1,279 @@
+/* siginfo_t, sigevent and constants. Linux version.
+ Copyright (C) 1997, 1998 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+#if !defined _SIGNAL_H && !defined __need_siginfo_t
+# error "Never include this file directly. Use <signal.h> instead"
+#endif
+
+#if (!defined __have_siginfo_t \
+ && (defined _SIGNAL_H || defined __need_siginfo_t))
+# define __have_siginfo_t 1
+
+/* Type for data associated with a signal. */
+typedef union sigval
+ {
+ int sival_int;
+ void *sival_ptr;
+ } sigval_t;
+
+# define __SI_MAX_SIZE 128
+# define __SI_PAD_SIZE ((__SI_MAX_SIZE / sizeof (int)) - 3)
+
+typedef struct siginfo
+ {
+ int si_signo; /* Signal number. */
+ int si_errno; /* If non-zero, an errno value associated with
+ this signal, as defined in <errno.h>. */
+ int si_code; /* Signal code. */
+
+ union
+ {
+ int _pad[__SI_PAD_SIZE];
+
+ /* kill(). */
+ struct
+ {
+ __pid_t si_pid; /* Sending process ID. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ } _kill;
+
+ /* POSIX.1b timers. */
+ struct
+ {
+ unsigned int _timer1;
+ unsigned int _timer2;
+ } _timer;
+
+ /* POSIX.1b signals. */
+ struct
+ {
+ __pid_t si_pid; /* Sending process ID. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ sigval_t si_sigval; /* Signal value. */
+ } _rt;
+
+ /* SIGCHLD. */
+ struct
+ {
+ __pid_t si_pid; /* Which child. */
+ __uid_t si_uid; /* Real user ID of sending process. */
+ int si_status; /* Exit value or signal. */
+ __clock_t si_utime;
+ __clock_t si_stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS. */
+ struct
+ {
+ void *si_addr; /* Faulting insn/memory ref. */
+ } _sigfault;
+
+ /* SIGPOLL. */
+ struct
+ {
+ int si_band; /* Band event for SIGPOLL. */
+ int si_fd;
+ } _sigpoll;
+ } _sifields;
+ } siginfo_t;
+
+
+/* X/Open requires some more fields with fixed names. */
+# define si_pid _sifields._kill.si_pid
+# define si_uid _sifields._kill.si_uid
+# define si_status _sifields._sigchld.si_status
+# define si_utime _sifields._sigchld.si_utime
+# define si_stime _sifields._sigchld.si_stime
+# define si_value _sifields._rt.si_sigval
+# define si_int _sifields._rt.si_sigval.sival_int
+# define si_ptr _sifields._rt.si_sigval.sival_ptr
+# define si_addr _sifields._sigfault.si_addr
+# define si_band _sifields._sigpoll.si_band
+# define si_fd _sifields._sigpoll.si_fd
+
+
+/* Values for `si_code'. Positive values are reserved for kernel-generated
+ signals. */
+enum
+{
+ SI_SIGIO = -5, /* Sent by queued SIGIO. */
+# define SI_SIGIO SI_SIGIO
+ SI_ASYNCIO, /* Sent by AIO completion. */
+# define SI_ASYNCIO SI_ASYNCIO
+ SI_MESGQ, /* Sent by real time mesq state change. */
+# define SI_MESGQ SI_MESGQ
+ SI_TIMER, /* Sent by timer expiration. */
+# define SI_TIMER SI_TIMER
+ SI_QUEUE, /* Sent by sigqueue. */
+# define SI_QUEUE SI_QUEUE
+ SI_USER /* Sent by kill, sigsend, raise. */
+# define SI_USER SI_USER
+};
+
+
+/* `si_code' values for SIGILL signal. */
+enum
+{
+ ILL_ILLOPC = 1, /* Illegal opcode. */
+# define ILL_ILLOPC ILL_ILLOPC
+ ILL_ILLOPN, /* Illegal operand. */
+# define ILL_ILLOPN ILL_ILLOPN
+ ILL_ILLADR, /* Illegal addressing mode. */
+# define ILL_ILLADR ILL_ILLADR
+ ILL_ILLTRP, /* Illegal trap. */
+# define ILL_ILLTRP ILL_ILLTRP
+ ILL_PRVOPC, /* Privileged opcode. */
+# define ILL_PRVOPC ILL_PRVOPC
+ ILL_PRVREG, /* Privileged register. */
+# define ILL_PRVREG ILL_PRVREG
+ ILL_COPROC, /* Coprocessor error. */
+# define ILL_COPROC ILL_COPROC
+ ILL_BADSTK /* Internal stack error. */
+# define ILL_BADSTK ILL_BADSTK
+};
+
+/* `si_code' values for SIGFPE signal. */
+enum
+{
+ FPE_INTDIV = 1, /* Integer divide by zero. */
+# define FPE_INTDIV FPE_INTDIV
+ FPE_INTOVF, /* Integer overflow. */
+# define FPE_INTOVF FPE_INTOVF
+ FPE_FLTDIV, /* Floating point divide by zero. */
+# define FPE_FLTDIV FPE_FLTDIV
+ FPE_FLTOVF, /* Floating point overflow. */
+# define FPE_FLTOVF FPE_FLTOVF
+ FPE_FLTUND, /* Floating point underflow. */
+# define FPE_FLTUND FPE_FLTUND
+ FPE_FLTRES, /* Floating point inexact result. */
+# define FPE_FLTRES FPE_FLTRES
+ FPE_FLTINV, /* Floating point invalid operation. */
+# define FPE_FLTINV FPE_FLTINV
+ FPE_FLTSUB /* Subscript out of range. */
+# define FPE_FLTSUB FPE_FLTSUB
+};
+
+/* `si_code' values for SIGSEGV signal. */
+enum
+{
+ SEGV_MAPERR = 1, /* Address not mapped to object. */
+# define SEGV_MAPERR SEGV_MAPERR
+ SEGV_ACCERR /* Invalid permissions for mapped object. */
+# define SEGV_ACCERR SEGV_ACCERR
+};
+
+/* `si_code' values for SIGBUS signal. */
+enum
+{
+ BUS_ADRALN = 1, /* Invalid address alignment. */
+# define BUS_ADRALN BUS_ADRALN
+ BUS_ADRERR, /* Non-existant physical address. */
+# define BUS_ADRERR BUS_ADRERR
+ BUS_OBJERR /* Object specific hardware error. */
+# define BUS_OBJERR BUS_OBJERR
+};
+
+/* `si_code' values for SIGTRAP signal. */
+enum
+{
+ TRAP_BRKPT = 1, /* Process breakpoint. */
+# define TRAP_BRKPT TRAP_BRKPT
+ TRAP_TRACE /* Process trace trap. */
+# define TRAP_TRACE TRAP_TRACE
+};
+
+/* `si_code' values for SIGCHLD signal. */
+enum
+{
+ CLD_EXITED = 1, /* Child has exited. */
+# define CLD_EXITED CLD_EXITED
+ CLD_KILLED, /* Child was killed. */
+# define CLD_KILLED CLD_KILLED
+ CLD_DUMPED, /* Child terminated abnormally. */
+# define CLD_DUMPED CLD_DUMPED
+ CLD_TRAPPED, /* Traced child has trapped. */
+# define CLD_TRAPPED CLD_TRAPPED
+ CLD_STOPPED, /* Child has stopped. */
+# define CLD_STOPPED CLD_STOPPED
+ CLD_CONTINUED /* Stopped child has continued. */
+# define CLD_CONTINUED CLD_CONTINUED
+};
+
+/* `si_code' values for SIGPOLL signal. */
+enum
+{
+ POLL_IN = 1, /* Data input available. */
+# define POLL_IN POLL_IN
+ POLL_OUT, /* Output buffers available. */
+# define POLL_OUT POLL_OUT
+ POLL_MSG, /* Input message available. */
+# define POLL_MSG POLL_MSG
+ POLL_ERR, /* I/O error. */
+# define POLL_ERR POLL_ERR
+ POLL_PRI, /* High priority input available. */
+# define POLL_PRI POLL_PRI
+ POLL_HUP /* Device disconnected. */
+# define POLL_HUP POLL_HUP
+};
+
+# undef __need_siginfo_t
+#endif /* !have siginfo_t && (have _SIGNAL_H || need siginfo_t). */
+
+
+#if defined _SIGNAL_H && !defined __have_sigevent_t
+# define __have_sigevent_t 1
+
+/* Structure to transport application-defined values with signals. */
+# define __SIGEV_MAX_SIZE 64
+# define __SIGEV_PAD_SIZE ((__SIGEV_MAX_SIZE / sizeof (int)) - 3)
+
+typedef struct sigevent
+ {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+
+ union
+ {
+ int _pad[__SIGEV_PAD_SIZE];
+
+ struct
+ {
+ void (*_function) __P ((sigval_t)); /* Function to start. */
+ void *_attribute; /* Really pthread_attr_t. */
+ } _sigev_thread;
+ } _sigev_un;
+ } sigevent_t;
+
+/* POSIX names to access some of the members. */
+# define sigev_notify_function _sigev_un._sigev_thread._function
+# define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+/* `sigev_notify' values. */
+enum
+{
+ SIGEV_SIGNAL = 0, /* Notify via signal. */
+# define SIGEV_SIGNAL SIGEV_SIGNAL
+ SIGEV_NONE, /* Other notification: meaningless. */
+# define SIGEV_NONE SIGEV_NONE
+ SIGEV_THREAD /* Deliver via thread creation. */
+# define SIGEV_THREAD SIGEV_THREAD
+};
+
+#endif /* have _SIGNAL_H. */
diff --git a/libc/sysdeps/linux/powerpc/bits/signum.h b/libc/sysdeps/linux/powerpc/bits/signum.h
new file mode 100644
index 000000000..fb26703d0
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/signum.h
@@ -0,0 +1,80 @@
+/* Signal number definitions. Linux version.
+ Copyright (C) 1995, 1996, 1997, 1998, 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+#ifdef _SIGNAL_H
+
+/* Fake signal functions. */
+#define SIG_ERR ((__sighandler_t) -1) /* Error return. */
+#define SIG_DFL ((__sighandler_t) 0) /* Default action. */
+#define SIG_IGN ((__sighandler_t) 1) /* Ignore signal. */
+
+#ifdef __USE_UNIX98
+# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
+#endif
+
+
+/* Signals. */
+#define SIGHUP 1 /* Hangup (POSIX). */
+#define SIGINT 2 /* Interrupt (ANSI). */
+#define SIGQUIT 3 /* Quit (POSIX). */
+#define SIGILL 4 /* Illegal instruction (ANSI). */
+#define SIGTRAP 5 /* Trace trap (POSIX). */
+#define SIGABRT 6 /* Abort (ANSI). */
+#define SIGIOT 6 /* IOT trap (4.2 BSD). */
+#define SIGBUS 7 /* BUS error (4.2 BSD). */
+#define SIGFPE 8 /* Floating-point exception (ANSI). */
+#define SIGKILL 9 /* Kill, unblockable (POSIX). */
+#define SIGUSR1 10 /* User-defined signal 1 (POSIX). */
+#define SIGSEGV 11 /* Segmentation violation (ANSI). */
+#define SIGUSR2 12 /* User-defined signal 2 (POSIX). */
+#define SIGPIPE 13 /* Broken pipe (POSIX). */
+#define SIGALRM 14 /* Alarm clock (POSIX). */
+#define SIGTERM 15 /* Termination (ANSI). */
+#define SIGSTKFLT 16 /* Stack fault. */
+#define SIGCLD SIGCHLD /* Same as SIGCHLD (System V). */
+#define SIGCHLD 17 /* Child status has changed (POSIX). */
+#define SIGCONT 18 /* Continue (POSIX). */
+#define SIGSTOP 19 /* Stop, unblockable (POSIX). */
+#define SIGTSTP 20 /* Keyboard stop (POSIX). */
+#define SIGTTIN 21 /* Background read from tty (POSIX). */
+#define SIGTTOU 22 /* Background write to tty (POSIX). */
+#define SIGURG 23 /* Urgent condition on socket (4.2 BSD). */
+#define SIGXCPU 24 /* CPU limit exceeded (4.2 BSD). */
+#define SIGXFSZ 25 /* File size limit exceeded (4.2 BSD). */
+#define SIGVTALRM 26 /* Virtual alarm clock (4.2 BSD). */
+#define SIGPROF 27 /* Profiling alarm clock (4.2 BSD). */
+#define SIGWINCH 28 /* Window size change (4.3 BSD, Sun). */
+#define SIGPOLL SIGIO /* Pollable event occurred (System V). */
+#define SIGIO 29 /* I/O now possible (4.2 BSD). */
+#define SIGPWR 30 /* Power failure restart (System V). */
+#define SIGSYS 31 /* Bad system call. */
+#define SIGUNUSED 31
+
+#define _NSIG 64 /* Biggest signal number + 1
+ (including real-time signals). */
+
+#define SIGRTMIN (__libc_current_sigrtmin ())
+#define SIGRTMAX (__libc_current_sigrtmax ())
+
+/* These are the hard limits of the kernel. These values should not be
+ used directly at user level. */
+#define __SIGRTMIN 32
+#define __SIGRTMAX (_NSIG - 1)
+
+#endif /* <signal.h> included. */
diff --git a/libc/sysdeps/linux/powerpc/bits/sigset.h b/libc/sysdeps/linux/powerpc/bits/sigset.h
new file mode 100644
index 000000000..66a9c51c5
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/sigset.h
@@ -0,0 +1,125 @@
+/* __sig_atomic_t, __sigset_t, and related definitions. Linux version.
+ Copyright (C) 1991, 1992, 1994, 1996, 1997 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 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
+ Library General Public License for more details.
+
+ 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 _SIGSET_H_types
+# define _SIGSET_H_types 1
+
+typedef int __sig_atomic_t;
+
+/* A `sigset_t' has a bit for each signal. */
+
+# define _SIGSET_NWORDS (1024 / (8 * sizeof (unsigned long int)))
+typedef struct
+ {
+ unsigned long int __val[_SIGSET_NWORDS];
+ } __sigset_t;
+
+#endif
+
+
+/* We only want to define these functions if <signal.h> was actually
+ included; otherwise we were included just to define the types. Since we
+ are namespace-clean, it wouldn't hurt to define extra macros. But
+ trouble can be caused by functions being defined (e.g., any global
+ register vars declared later will cause compilation errors). */
+
+#if !defined _SIGSET_H_fns && defined _SIGNAL_H
+# define _SIGSET_H_fns 1
+
+# ifndef _EXTERN_INLINE
+# define _EXTERN_INLINE extern __inline
+# endif
+
+/* Return a mask that includes the bit for SIG only. */
+# define __sigmask(sig) \
+ (((unsigned long int) 1) << (((sig) - 1) % (8 * sizeof (unsigned long int))))
+
+/* Return the word index for SIG. */
+# define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned long int)))
+
+# if defined __GNUC__ && __GNUC__ >= 2
+# define __sigemptyset(set) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__set = (set); \
+ while (--__cnt >= 0) __set->__val[__cnt] = 0; \
+ 0; }))
+# define __sigfillset(set) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__set = (set); \
+ while (--__cnt >= 0) __set->__val[__cnt] = ~0UL; \
+ 0; }))
+
+# ifdef __USE_GNU
+/* The POSIX does not specify for handling the whole signal set in one
+ command. This is often wanted and so we define three more functions
+ here. */
+# define __sigisemptyset(set) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ const sigset_t *__set = (set); \
+ int __ret = __set->__val[--__cnt]; \
+ while (!__ret && --__cnt >= 0) \
+ __ret = __set->__val[__cnt]; \
+ __ret == 0; }))
+# define __sigandset(dest, left, right) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__dest = (dest); \
+ const sigset_t *__left = (left); \
+ const sigset_t *__right = (right); \
+ while (--__cnt >= 0) \
+ __dest->__val[__cnt] = (__left->__val[__cnt] \
+ & __right->__val[__cnt]); \
+ 0; }))
+# define __sigorset(dest, left, right) \
+ (__extension__ ({ int __cnt = _SIGSET_NWORDS; \
+ sigset_t *__dest = (dest); \
+ const sigset_t *__left = (left); \
+ const sigset_t *__right = (right); \
+ while (--__cnt >= 0) \
+ __dest->__val[__cnt] = (__left->__val[__cnt] \
+ | __right->__val[__cnt]); \
+ 0; }))
+# endif
+# endif
+
+/* These functions needn't check for a bogus signal number -- error
+ checking is done in the non __ versions. */
+
+extern int __sigismember (__const __sigset_t *, int);
+extern int __sigaddset (__sigset_t *, int);
+extern int __sigdelset (__sigset_t *, int);
+
+# ifdef __USE_EXTERN_INLINES
+# define __SIGSETFN(NAME, BODY, CONST) \
+ _EXTERN_INLINE int \
+ NAME (CONST __sigset_t *__set, int __sig) \
+ { \
+ unsigned long int __mask = __sigmask (__sig); \
+ unsigned long int __word = __sigword (__sig); \
+ return BODY; \
+ }
+
+__SIGSETFN (__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, __const)
+__SIGSETFN (__sigaddset, ((__set->__val[__word] |= __mask), 0), )
+__SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), )
+
+# undef __SIGSETFN
+# endif
+
+
+#endif /* ! _SIGSET_H_fns. */
diff --git a/libc/sysdeps/linux/powerpc/bits/sigstack.h b/libc/sysdeps/linux/powerpc/bits/sigstack.h
new file mode 100644
index 000000000..905e87fd9
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/sigstack.h
@@ -0,0 +1,55 @@
+/* sigstack, sigaltstack definitions.
+ Copyright (C) 1998 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 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
+ Library General Public License for more details.
+
+ 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 _SIGNAL_H
+# error "Never include this file directly. Use <signal.h> instead"
+#endif
+
+
+/* Structure describing a signal stack (obsolete). */
+struct sigstack
+ {
+ __ptr_t ss_sp; /* Signal stack pointer. */
+ int ss_onstack; /* Nonzero if executing on this stack. */
+ };
+
+
+/* Possible values for `ss_flags.'. */
+enum
+{
+ SS_ONSTACK = 1,
+#define SS_ONSTACK SS_ONSTACK
+ SS_DISABLE
+#define SS_DISABLE SS_DISABLE
+};
+
+/* Minimum stack size for a signal handler. */
+#define MINSIGSTKSZ 2048
+
+/* System default stack size. */
+#define SIGSTKSZ 8192
+
+
+/* Alternate, preferred interface. */
+typedef struct sigaltstack
+ {
+ __ptr_t ss_sp;
+ int ss_flags;
+ size_t ss_size;
+ } stack_t;
diff --git a/libc/sysdeps/linux/powerpc/bits/sigthread.h b/libc/sysdeps/linux/powerpc/bits/sigthread.h
new file mode 100644
index 000000000..c9b1dcf1b
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/sigthread.h
@@ -0,0 +1,37 @@
+/* Signal handling function for threaded programs.
+ Copyright (C) 1998 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 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
+ Library General Public License for more details.
+
+ 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 _BITS_SIGTHREAD_H
+#define _BITS_SIGTHREAD_H 1
+
+#if !defined _SIGNAL_H && !defined _PTHREAD_H
+# error "Never include this file directly. Use <pthread.h> instead"
+#endif
+
+/* Functions for handling signals. */
+
+/* Modify the signal mask for the calling thread. The arguments have
+ the same meaning as for sigprocmask(2). */
+extern int pthread_sigmask __P ((int __how, __const __sigset_t *__newmask,
+ __sigset_t *__oldmask));
+
+/* Send signal SIGNO to the given thread. */
+extern int pthread_kill __P ((pthread_t __thread, int __signo));
+
+#endif /* bits/sigthread.h */
diff --git a/libc/sysdeps/linux/powerpc/bits/sockaddr.h b/libc/sysdeps/linux/powerpc/bits/sockaddr.h
new file mode 100644
index 000000000..1c523444b
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/sockaddr.h
@@ -0,0 +1,44 @@
+/* Definition of `struct sockaddr_*' common members. Generic/4.2 BSD version.
+ Copyright (C) 1995, 1996, 1997, 1998 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+/*
+ * Never include this file directly; use <sys/socket.h> instead.
+ */
+
+#ifndef _BITS_SOCKADDR_H
+#define _BITS_SOCKADDR_H 1
+
+
+/* POSIX.1g specifies this type name for the `sa_family' member. */
+typedef unsigned short int sa_family_t;
+
+/* This macro is used to declare the initial common members
+ of the data types used for socket addresses, `struct sockaddr',
+ `struct sockaddr_in', `struct sockaddr_un', etc. */
+
+#define __SOCKADDR_COMMON(sa_prefix) \
+ sa_family_t sa_prefix##family
+
+#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int))
+
+/* Return the length of a `sockaddr' structure. */
+#define SA_LEN(_x) __libc_sa_len((_x)->sa_family)
+extern int __libc_sa_len __P ((sa_family_t __af));
+
+#endif /* bits/sockaddr.h */
diff --git a/libc/sysdeps/linux/powerpc/bits/socket.h b/libc/sysdeps/linux/powerpc/bits/socket.h
new file mode 100644
index 000000000..491b133b7
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/socket.h
@@ -0,0 +1,305 @@
+/* System-specific socket constants and types. Linux version.
+ Copyright (C) 1991,92,94,95,96,97,98,99 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 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
+ Library General Public License for more details.
+
+ 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 __BITS_SOCKET_H
+#define __BITS_SOCKET_H
+
+#if !defined _SYS_SOCKET_H && !defined _NETINET_IN_H
+# error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+#define __need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+#include <limits.h>
+#include <sys/types.h>
+
+/* Type for length arguments in socket calls. */
+typedef unsigned int socklen_t;
+
+/* Types of sockets. */
+enum __socket_type
+{
+ SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
+ byte streams. */
+#define SOCK_STREAM SOCK_STREAM
+ SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
+ of fixed maximum length. */
+#define SOCK_DGRAM SOCK_DGRAM
+ SOCK_RAW = 3, /* Raw protocol interface. */
+#define SOCK_RAW SOCK_RAW
+ SOCK_RDM = 4, /* Reliably-delivered messages. */
+#define SOCK_RDM SOCK_RDM
+ SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
+ datagrams of fixed maximum length. */
+#define SOCK_SEQPACKET SOCK_SEQPACKET
+ SOCK_PACKET = 10 /* Linux specific way of getting packets
+ at the dev level. For writing rarp and
+ other similar things on the user level. */
+#define SOCK_PACKET SOCK_PACKET
+};
+
+/* Protocol families. */
+#define PF_UNSPEC 0 /* Unspecified. */
+#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
+#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */
+#define PF_FILE PF_LOCAL /* Another non-standard name for PF_LOCAL. */
+#define PF_INET 2 /* IP protocol family. */
+#define PF_AX25 3 /* Amateur Radio AX.25. */
+#define PF_IPX 4 /* Novell Internet Protocol. */
+#define PF_APPLETALK 5 /* Appletalk DDP. */
+#define PF_NETROM 6 /* Amateur radio NetROM. */
+#define PF_BRIDGE 7 /* Multiprotocol bridge. */
+#define PF_ATMPVC 8 /* ATM PVCs. */
+#define PF_X25 9 /* Reserved for X.25 project. */
+#define PF_INET6 10 /* IP version 6. */
+#define PF_ROSE 11 /* Amateur Radio X.25 PLP. */
+#define PF_DECnet 12 /* Reserved for DECnet project. */
+#define PF_NETBEUI 13 /* Reserved for 802.2LLC project. */
+#define PF_SECURITY 14 /* Security callback pseudo AF. */
+#define PF_KEY 15 /* PF_KEY key management API. */
+#define PF_NETLINK 16
+#define PF_ROUTE PF_NETLINK /* Alias to emulate 4.4BSD. */
+#define PF_PACKET 17 /* Packet family. */
+#define PF_ASH 18 /* Ash. */
+#define PF_ECONET 19 /* Acorn Econet. */
+#define PF_ATMSVC 20 /* ATM SVCs. */
+#define PF_SNA 22 /* Linux SNA Project */
+#define PF_IRDA 23 /* IRDA sockets. */
+#define PF_MAX 32 /* For now.. */
+
+/* Address families. */
+#define AF_UNSPEC PF_UNSPEC
+#define AF_LOCAL PF_LOCAL
+#define AF_UNIX PF_UNIX
+#define AF_FILE PF_FILE
+#define AF_INET PF_INET
+#define AF_AX25 PF_AX25
+#define AF_IPX PF_IPX
+#define AF_APPLETALK PF_APPLETALK
+#define AF_NETROM PF_NETROM
+#define AF_BRIDGE PF_BRIDGE
+#define AF_ATMPVC PF_ATMPVC
+#define AF_X25 PF_X25
+#define AF_INET6 PF_INET6
+#define AF_ROSE PF_ROSE
+#define AF_DECnet PF_DECnet
+#define AF_NETBEUI PF_NETBEUI
+#define AF_SECURITY PF_SECURITY
+#define AF_KEY PF_KEY
+#define AF_NETLINK PF_NETLINK
+#define AF_ROUTE PF_ROUTE
+#define AF_PACKET PF_PACKET
+#define AF_ASH PF_ASH
+#define AF_ECONET PF_ECONET
+#define AF_ATMSVC PF_ATMSVC
+#define AF_SNA PF_SNA
+#define AF_IRDA PF_IRDA
+#define AF_MAX PF_MAX
+
+/* Socket level values. Others are defined in the appropriate headers.
+
+ XXX These definitions also should go into the appropriate headers as
+ far as they are available. */
+#define SOL_RAW 255
+#define SOL_DECNET 261
+#define SOL_X25 262
+#define SOL_PACKET 263
+#define SOL_ATM 264 /* ATM layer (cell level). */
+#define SOL_AAL 265 /* ATM Adaption Layer (packet level). */
+#define SOL_IRDA 266
+
+/* Maximum queue length specifiable by listen. */
+#define SOMAXCONN 128
+
+/* Get the definition of the macro to define the common sockaddr members. */
+#include <bits/sockaddr.h>
+
+/* Structure describing a generic socket address. */
+struct sockaddr
+ {
+ __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
+ char sa_data[14]; /* Address data. */
+ };
+
+
+/* Structure large enough to hold any socket address (with the historical
+ exception of AF_UNIX). We reserve 128 bytes. */
+#if ULONG_MAX > 0xffffffff
+# define __ss_aligntype __uint64_t
+#else
+# define __ss_aligntype __uint32_t
+#endif
+#define _SS_SIZE 128
+#define _SS_PADSIZE (_SS_SIZE - (2 * sizeof (__ss_aligntype)))
+
+struct sockaddr_storage
+ {
+ __SOCKADDR_COMMON (__ss_); /* Address family, etc. */
+ __ss_aligntype __ss_align; /* Force desired alignment. */
+ char __ss_padding[_SS_PADSIZE];
+ };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al. */
+enum
+ {
+ MSG_OOB = 0x01, /* Process out-of-band data. */
+#define MSG_OOB MSG_OOB
+ MSG_PEEK = 0x02, /* Peek at incoming messages. */
+#define MSG_PEEK MSG_PEEK
+ MSG_DONTROUTE = 0x04, /* Don't use local routing. */
+#define MSG_DONTROUTE MSG_DONTROUTE
+#ifdef __USE_GNU
+ /* DECnet uses a different name. */
+ MSG_TRYHARD = MSG_DONTROUTE,
+# define MSG_TRYHARD MSG_DONTROUTE
+#endif
+ MSG_CTRUNC = 0x08, /* Control data lost before delivery. */
+#define MSG_CTRUNC MSG_CTRUNC
+ MSG_PROXY = 0x10, /* Supply or ask second address. */
+#define MSG_PROXY MSG_PROXY
+ MSG_TRUNC = 0x20,
+#define MSG_TRUNC MSG_TRUNC
+ MSG_DONTWAIT = 0x40, /* Nonblocking IO. */
+#define MSG_DONTWAIT MSG_DONTWAIT
+ MSG_EOR = 0x80, /* End of record. */
+#define MSG_EOR MSG_EOR
+ MSG_WAITALL = 0x100, /* Wait for a full request. */
+#define MSG_WAITALL MSG_WAITALL
+ MSG_FIN = 0x200,
+#define MSG_FIN MSG_FIN
+ MSG_SYN = 0x400,
+#define MSG_SYN MSG_SYN
+ MSG_URG = 0x800,
+#define MSG_URG MSG_URG
+ MSG_RST = 0x1000,
+#define MSG_RST MSG_RST
+ MSG_ERRQUEUE = 0x2000, /* Fetch message from error queue. */
+#define MSG_ERRQUEUE MSG_ERRQUEUE
+ MSG_NOSIGNAL = 0x4000 /* Do not generate SIGPIPE. */
+#define MSG_NOSIGNAL MSG_NOSIGNAL
+ };
+
+
+/* Structure describing messages sent by
+ `sendmsg' and received by `recvmsg'. */
+struct msghdr
+ {
+ __ptr_t msg_name; /* Address to send to/receive from. */
+ socklen_t msg_namelen; /* Length of address data. */
+
+ struct iovec *msg_iov; /* Vector of data to send/receive into. */
+ size_t msg_iovlen; /* Number of elements in the vector. */
+
+ __ptr_t msg_control; /* Ancillary data (eg BSD filedesc passing). */
+ size_t msg_controllen; /* Ancillary data buffer length. */
+
+ int msg_flags; /* Flags on received message. */
+ };
+
+/* Structure used for storage of ancillary data object information. */
+struct cmsghdr
+ {
+ size_t cmsg_len; /* Length of data in cmsg_data plus length
+ of cmsghdr structure. */
+ int cmsg_level; /* Originating protocol. */
+ int cmsg_type; /* Protocol specific type. */
+#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
+ unsigned char __cmsg_data[0]; /* Ancillary data. */
+ /* XXX Perhaps this should be removed. */
+#endif
+ };
+
+/* Ancillary data object manipulation macros. */
+#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
+#else
+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
+#endif
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
+#define CMSG_FIRSTHDR(mhdr) \
+ ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
+ ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+#define CMSG_ALIGN(len) (((len) + sizeof (size_t) - 1) \
+ & ~(sizeof (size_t) - 1))
+#define CMSG_SPACE(len) (CMSG_ALIGN (len) \
+ + CMSG_ALIGN (sizeof (struct cmsghdr)))
+#define CMSG_LEN(len) (CMSG_ALIGN (sizeof (struct cmsghdr)) + (len))
+
+extern struct cmsghdr *__cmsg_nxthdr __P ((struct msghdr *__mhdr,
+ struct cmsghdr *__cmsg));
+#ifdef __USE_EXTERN_INLINES
+# ifndef _EXTERN_INLINE
+# define _EXTERN_INLINE extern __inline
+# endif
+_EXTERN_INLINE struct cmsghdr *
+__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg) __THROW
+{
+ if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+ /* The kernel header does this so there may be a reason. */
+ return 0;
+
+ __cmsg = (struct cmsghdr *) ((unsigned char *) __cmsg
+ + CMSG_ALIGN (__cmsg->cmsg_len));
+ if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control
+ + __mhdr->msg_controllen)
+ || ((unsigned char *) __cmsg + CMSG_ALIGN (__cmsg->cmsg_len)
+ >= ((unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)))
+ /* No more entries. */
+ return 0;
+ return __cmsg;
+}
+#endif /* Use `extern inline'. */
+
+/* Socket level message types. This must match the definitions in
+ <linux/socket.h>. */
+enum
+ {
+ SCM_RIGHTS = 0x01, /* Transfer file descriptors. */
+#define SCM_RIGHTS SCM_RIGHTS
+#ifdef __USE_BSD
+ SCM_CREDENTIALS = 0x02, /* Credentials passing. */
+# define SCM_CREDENTIALS SCM_CREDENTIALS
+#endif
+ __SCM_CONNECT = 0x03 /* Data array is `struct scm_connect'. */
+ };
+
+/* User visible structure for SCM_CREDENTIALS message */
+
+struct ucred
+{
+ pid_t pid; /* PID of sending process. */
+ uid_t uid; /* UID of sending process. */
+ gid_t gid; /* GID of sending process. */
+};
+
+/* Get socket manipulation related informations from kernel headers. */
+#include <asm/socket.h>
+
+
+/* Structure used to manipulate the SO_LINGER option. */
+struct linger
+ {
+ int l_onoff; /* Nonzero to linger on close. */
+ int l_linger; /* Time to linger. */
+ };
+
+#endif /* bits/socket.h */
diff --git a/libc/sysdeps/linux/powerpc/bits/stat.h b/libc/sysdeps/linux/powerpc/bits/stat.h
new file mode 100644
index 000000000..c175668a0
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/stat.h
@@ -0,0 +1,127 @@
+/* Copyright (C) 1992, 1995, 1996, 1997, 1998 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 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
+ Library General Public License for more details.
+
+ 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 _SYS_STAT_H
+# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
+#endif
+
+/* Versions of the `struct stat' data structure. */
+#define _STAT_VER_LINUX_OLD 1
+#define _STAT_VER_KERNEL 1
+#define _STAT_VER_SVR4 2
+#define _STAT_VER_LINUX 3
+#define _STAT_VER _STAT_VER_LINUX /* The one defined below. */
+
+/* Versions of the `xmknod' interface. */
+#define _MKNOD_VER_LINUX 1
+#define _MKNOD_VER_SVR4 2
+#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */
+
+
+struct stat
+ {
+ __dev_t st_dev; /* Device. */
+ unsigned short int __pad1;
+#ifndef __USE_FILE_OFFSET64
+ __ino_t st_ino; /* File serial number. */
+#else
+ __ino64_t st_ino; /* File serial number. */
+#endif
+ __mode_t st_mode; /* File mode. */
+ __nlink_t st_nlink; /* Link count. */
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+ __dev_t st_rdev; /* Device number, if device. */
+ unsigned short int __pad2;
+#ifndef __USE_FILE_OFFSET64
+ __off_t st_size; /* Size of file, in bytes. */
+#else
+ __off64_t st_size; /* Size of file, in bytes. */
+#endif
+ unsigned long int st_blksize; /* Optimal block size for I/O. */
+
+#ifndef __USE_FILE_OFFSET64
+ __blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
+#else
+ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
+#endif
+ __time_t st_atime; /* Time of last access. */
+ unsigned long int __unused1;
+ __time_t st_mtime; /* Time of last modification. */
+ unsigned long int __unused2;
+ __time_t st_ctime; /* Time of last status change. */
+ unsigned long int __unused3;
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+ };
+
+#ifdef __USE_LARGEFILE64
+struct stat64
+ {
+ __dev_t st_dev; /* Device. */
+ unsigned short int __pad1;
+
+ __ino64_t st_ino; /* File serial number. */
+ __mode_t st_mode; /* File mode. */
+ __nlink_t st_nlink; /* Link count. */
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+ __dev_t st_rdev; /* Device number, if device. */
+ unsigned short int __pad2;
+ __off64_t st_size; /* Size of file, in bytes. */
+ unsigned long int st_blksize; /* Optimal block size for I/O. */
+
+ __blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
+ __time_t st_atime; /* Time of last access. */
+ unsigned long int __unused1;
+ __time_t st_mtime; /* Time of last modification. */
+ unsigned long int __unused2;
+ __time_t st_ctime; /* Time of last status change. */
+ unsigned long int __unused3;
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+ };
+#endif
+
+/* Tell code we have these members. */
+#define _STATBUF_ST_BLKSIZE
+#define _STATBUF_ST_RDEV
+
+/* Encoding of the file mode. */
+
+#define __S_IFMT 0170000 /* These bits determine file type. */
+
+/* File types. */
+#define __S_IFDIR 0040000 /* Directory. */
+#define __S_IFCHR 0020000 /* Character device. */
+#define __S_IFBLK 0060000 /* Block device. */
+#define __S_IFREG 0100000 /* Regular file. */
+#define __S_IFIFO 0010000 /* FIFO. */
+
+/* These don't actually exist on System V, but having them doesn't hurt. */
+#define __S_IFLNK 0120000 /* Symbolic link. */
+#define __S_IFSOCK 0140000 /* Socket. */
+
+/* Protection bits. */
+
+#define __S_ISUID 04000 /* Set user ID on execution. */
+#define __S_ISGID 02000 /* Set group ID on execution. */
+#define __S_ISVTX 01000 /* Save swapped text after use (sticky). */
+#define __S_IREAD 0400 /* Read by owner. */
+#define __S_IWRITE 0200 /* Write by owner. */
+#define __S_IEXEC 0100 /* Execute by owner. */
diff --git a/libc/sysdeps/linux/powerpc/bits/statfs.h b/libc/sysdeps/linux/powerpc/bits/statfs.h
new file mode 100644
index 000000000..31ae564b4
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/statfs.h
@@ -0,0 +1,61 @@
+/* Copyright (C) 1997, 1998 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 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
+ Library General Public License for more details.
+
+ 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 _SYS_STATFS_H
+# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
+#endif
+
+#include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/
+
+struct statfs
+ {
+ int f_type;
+ int f_bsize;
+#ifndef __USE_FILE_OFFSET64
+ __fsblkcnt_t f_blocks;
+ __fsblkcnt_t f_bfree;
+ __fsblkcnt_t f_bavail;
+ __fsfilcnt_t f_files;
+ __fsfilcnt_t f_ffree;
+#else
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+#endif
+ __fsid_t f_fsid;
+ int f_namelen;
+ int f_spare[6];
+ };
+
+#ifdef __USE_LARGEFILE64
+struct statfs64
+ {
+ int f_type;
+ int f_bsize;
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __fsid_t f_fsid;
+ int f_namelen;
+ int f_spare[6];
+ };
+#endif
diff --git a/libc/sysdeps/linux/powerpc/bits/stdio_lim.h b/libc/sysdeps/linux/powerpc/bits/stdio_lim.h
new file mode 100644
index 000000000..bf79f2062
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/stdio_lim.h
@@ -0,0 +1,37 @@
+/* Copyright (C) 1994, 1997, 1998 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+#if !defined _STDIO_H && !defined __need_FOPEN_MAX
+# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
+#endif
+
+#ifdef _STDIO_H
+# define L_tmpnam 20
+# define TMP_MAX 238328
+# define FILENAME_MAX 4095
+
+# ifdef __USE_POSIX
+# define L_ctermid 9
+# define L_cuserid 9
+# endif
+#endif
+
+#if defined __need_FOPEN_MAX || defined _STDIO_H
+# undef FOPEN_MAX
+# define FOPEN_MAX 256
+#endif
diff --git a/libc/sysdeps/linux/powerpc/bits/syscall.h b/libc/sysdeps/linux/powerpc/bits/syscall.h
new file mode 100644
index 000000000..ece3880be
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/syscall.h
@@ -0,0 +1,196 @@
+/* Generated at libc build time from kernel syscall list. */
+
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscall.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#define SYS_write __NR_write
+#define SYS_setrlimit __NR_setrlimit
+#define SYS_getdents __NR_getdents
+#define SYS_umount __NR_umount
+#define SYS_munlock __NR_munlock
+#define SYS_delete_module __NR_delete_module
+#define SYS_fstat __NR_fstat
+#define SYS_getpgid __NR_getpgid
+#define SYS_rt_sigaction __NR_rt_sigaction
+#define SYS_setfsgid __NR_setfsgid
+#define SYS_chroot __NR_chroot
+#define SYS_modify_ldt __NR_modify_ldt
+#define SYS_times __NR_times
+#define SYS_rt_sigsuspend __NR_rt_sigsuspend
+#define SYS_setpgid __NR_setpgid
+#define SYS_getpgrp __NR_getpgrp
+#define SYS_break __NR_break
+#define SYS_query_module __NR_query_module
+#define SYS_pause __NR_pause
+#define SYS_writev __NR_writev
+#define SYS_rename __NR_rename
+#define SYS_truncate __NR_truncate
+#define SYS_profil __NR_profil
+#define SYS_waitpid __NR_waitpid
+#define SYS_sigreturn __NR_sigreturn
+#define SYS_setresgid __NR_setresgid
+#define SYS_readdir __NR_readdir
+#define SYS_fsync __NR_fsync
+#define SYS_sigaltstack __NR_sigaltstack
+#define SYS_lstat __NR_lstat
+#define SYS_dup2 __NR_dup2
+#define SYS_clone __NR_clone
+#define SYS_getppid __NR_getppid
+#define SYS_umount2 __NR_umount2
+#define SYS_close __NR_close
+#define SYS_setgid __NR_setgid
+#define SYS_bdflush __NR_bdflush
+#define SYS_statfs __NR_statfs
+#define SYS_mount __NR_mount
+#define SYS_sgetmask __NR_sgetmask
+#define SYS_idle __NR_idle
+#define SYS_sigaction __NR_sigaction
+#define SYS_wait4 __NR_wait4
+#define SYS_fork __NR_fork
+#define SYS_setfsuid __NR_setfsuid
+#define SYS_settimeofday __NR_settimeofday
+#define SYS_pwrite __NR_pwrite
+#define SYS_ssetmask __NR_ssetmask
+#define SYS_rt_sigpending __NR_rt_sigpending
+#define SYS_oldfstat __NR_oldfstat
+#define SYS_afs_syscall __NR_afs_syscall
+#define SYS_exit __NR_exit
+#define SYS_sysinfo __NR_sysinfo
+#define SYS_symlink __NR_symlink
+#define SYS_ioctl __NR_ioctl
+#define SYS_ftruncate __NR_ftruncate
+#define SYS_sched_getparam __NR_sched_getparam
+#define SYS_creat __NR_creat
+#define SYS_lchown __NR_lchown
+#define SYS_setresuid __NR_setresuid
+#define SYS_sched_rr_get_interval __NR_sched_rr_get_interval
+#define SYS_fcntl __NR_fcntl
+#define SYS_setsid __NR_setsid
+#define SYS_mprotect __NR_mprotect
+#define SYS_setuid __NR_setuid
+#define SYS_gtty __NR_gtty
+#define SYS_oldlstat __NR_oldlstat
+#define SYS_umask __NR_umask
+#define SYS_iopl __NR_iopl
+#define SYS_SYSCALL_BASE __NR_SYSCALL_BASE
+#define SYS_kill __NR_kill
+#define SYS_vfork __NR_vfork
+#define SYS_nanosleep __NR_nanosleep
+#define SYS_uname __NR_uname
+#define SYS_stime __NR_stime
+#define SYS_signal __NR_signal
+#define SYS_getitimer __NR_getitimer
+#define SYS_readv __NR_readv
+#define SYS_getcwd __NR_getcwd
+#define SYS_getpriority __NR_getpriority
+#define SYS_msync __NR_msync
+#define SYS_link __NR_link
+#define SYS_sched_setparam __NR_sched_setparam
+#define SYS_getgid __NR_getgid
+#define SYS__newselect __NR__newselect
+#define SYS_getrusage __NR_getrusage
+#define SYS_lock __NR_lock
+#define SYS__llseek __NR__llseek
+#define SYS_sched_yield __NR_sched_yield
+#define SYS_nice __NR_nice
+#define SYS_mmap __NR_mmap
+#define SYS_get_kernel_syms __NR_get_kernel_syms
+#define SYS_setgroups __NR_setgroups
+#define SYS_ulimit __NR_ulimit
+#define SYS_munmap __NR_munmap
+#define SYS_quotactl __NR_quotactl
+#define SYS_getrlimit __NR_getrlimit
+#define SYS_brk __NR_brk
+#define SYS_sched_getscheduler __NR_sched_getscheduler
+#define SYS_personality __NR_personality
+#define SYS_getpid __NR_getpid
+#define SYS_vhangup __NR_vhangup
+#define SYS_ioperm __NR_ioperm
+#define SYS_mremap __NR_mremap
+#define SYS_ptrace __NR_ptrace
+#define SYS_dup __NR_dup
+#define SYS_getsid __NR_getsid
+#define SYS_getegid __NR_getegid
+#define SYS_uselib __NR_uselib
+#define SYS_rt_sigprocmask __NR_rt_sigprocmask
+#define SYS_olduname __NR_olduname
+#define SYS_getuid __NR_getuid
+#define SYS_init_module __NR_init_module
+#define SYS_ipc __NR_ipc
+#define SYS_capget __NR_capget
+#define SYS_getresgid __NR_getresgid
+#define SYS_pipe __NR_pipe
+#define SYS_read __NR_read
+#define SYS_open __NR_open
+#define SYS_setdomainname __NR_setdomainname
+#define SYS_setregid __NR_setregid
+#define SYS_mpx __NR_mpx
+#define SYS_alarm __NR_alarm
+#define SYS_pread __NR_pread
+#define SYS_poll __NR_poll
+#define SYS_flock __NR_flock
+#define SYS_sigsuspend __NR_sigsuspend
+#define SYS_fdatasync __NR_fdatasync
+#define SYS_prctl __NR_prctl
+#define SYS_prof __NR_prof
+#define SYS_sysfs __NR_sysfs
+#define SYS_sethostname __NR_sethostname
+#define SYS_geteuid __NR_geteuid
+#define SYS_swapon __NR_swapon
+#define SYS_capset __NR_capset
+#define SYS_vm86 __NR_vm86
+#define SYS_create_module __NR_create_module
+#define SYS_execve __NR_execve
+#define SYS_utime __NR_utime
+#define SYS_reboot __NR_reboot
+#define SYS_socketcall __NR_socketcall
+#define SYS_fchdir __NR_fchdir
+#define SYS_getresuid __NR_getresuid
+#define SYS_sendfile __NR_sendfile
+#define SYS_time __NR_time
+#define SYS_setreuid __NR_setreuid
+#define SYS_select __NR_select
+#define SYS_ustat __NR_ustat
+#define SYS_mkdir __NR_mkdir
+#define SYS_rmdir __NR_rmdir
+#define SYS_adjtimex __NR_adjtimex
+#define SYS_acct __NR_acct
+#define SYS_sched_setscheduler __NR_sched_setscheduler
+#define SYS_mlockall __NR_mlockall
+#define SYS_fstatfs __NR_fstatfs
+#define SYS_stat __NR_stat
+#define SYS_sigpending __NR_sigpending
+#define SYS_setup __NR_setup
+#define SYS_chdir __NR_chdir
+#define SYS_swapoff __NR_swapoff
+#define SYS_rt_sigtimedwait __NR_rt_sigtimedwait
+#define SYS_rt_sigqueueinfo __NR_rt_sigqueueinfo
+#define SYS_syslog __NR_syslog
+#define SYS_syscall __NR_syscall
+#define SYS_fchmod __NR_fchmod
+#define SYS_nfsservctl __NR_nfsservctl
+#define SYS_oldstat __NR_oldstat
+#define SYS_readlink __NR_readlink
+#define SYS_munlockall __NR_munlockall
+#define SYS_stty __NR_stty
+#define SYS_sync __NR_sync
+#define SYS_setitimer __NR_setitimer
+#define SYS_fchown __NR_fchown
+#define SYS_access __NR_access
+#define SYS_sched_get_priority_max __NR_sched_get_priority_max
+#define SYS_gettimeofday __NR_gettimeofday
+#define SYS_mknod __NR_mknod
+#define SYS_sched_get_priority_min __NR_sched_get_priority_min
+#define SYS_oldolduname __NR_oldolduname
+#define SYS_getgroups __NR_getgroups
+#define SYS_chmod __NR_chmod
+#define SYS_mlock __NR_mlock
+#define SYS_unlink __NR_unlink
+#define SYS__sysctl __NR__sysctl
+#define SYS_sigprocmask __NR_sigprocmask
+#define SYS_rt_sigreturn __NR_rt_sigreturn
+#define SYS_lseek __NR_lseek
+#define SYS_setpriority __NR_setpriority
+#define SYS_ftime __NR_ftime
+#define SYS_chown __NR_chown
diff --git a/libc/sysdeps/linux/powerpc/bits/termios.h b/libc/sysdeps/linux/powerpc/bits/termios.h
new file mode 100644
index 000000000..a5ba1d258
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/termios.h
@@ -0,0 +1,212 @@
+/* termios type and macro definitions. Linux version.
+ Copyright (C) 1993, 94, 95, 96, 97, 98, 99 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 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
+ Library General Public License for more details.
+
+ 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 <bits/termios.h> directly; use <termios.h> instead."
+#endif
+
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+#define NCCS 32
+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 */
+ cc_t c_cc[NCCS]; /* control characters */
+ 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 VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* c_iflag bits */
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK 0000020
+#define ISTRIP 0000040
+#define INLCR 0000100
+#define IGNCR 0000200
+#define ICRNL 0000400
+#define IUCLC 0001000
+#define IXON 0002000
+#define IXANY 0004000
+#define IXOFF 0010000
+#define IMAXBEL 0020000
+
+/* c_oflag bits */
+#define OPOST 0000001
+#define OLCUC 0000002
+#define ONLCR 0000004
+#define OCRNL 0000010
+#define ONOCR 0000020
+#define ONLRET 0000040
+#define OFILL 0000100
+#define OFDEL 0000200
+#if defined __USE_MISC || defined __USE_XOPEN
+# define NLDLY 0000400
+# define NL0 0000000
+# define NL1 0000400
+# define CRDLY 0003000
+# define CR0 0000000
+# define CR1 0001000
+# define CR2 0002000
+# define CR3 0003000
+# define TABDLY 0014000
+# define TAB0 0000000
+# define TAB1 0004000
+# define TAB2 0010000
+# define TAB3 0014000
+# define BSDLY 0020000
+# define BS0 0000000
+# define BS1 0020000
+# define FFDLY 0100000
+# define FF0 0000000
+# define FF1 0100000
+#endif
+
+#define VTDLY 0040000
+#define VT0 0000000
+#define VT1 0040000
+
+#ifdef __USE_MISC
+# define XTABS 0014000
+#endif
+
+/* c_cflag bit meaning */
+#ifdef __USE_MISC
+# define CBAUD 0010017
+#endif
+#define B0 0000000 /* hang up */
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+#ifdef __USE_MISC
+# define EXTA B19200
+# define EXTB B38400
+#endif
+#define CSIZE 0000060
+#define CS5 0000000
+#define CS6 0000020
+#define CS7 0000040
+#define CS8 0000060
+#define CSTOPB 0000100
+#define CREAD 0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL 0002000
+#define CLOCAL 0004000
+#ifdef __USE_MISC
+# define CBAUDEX 0010000
+#endif
+#define B57600 0010001
+#define B115200 0010002
+#define B230400 0010003
+#define B460800 0010004
+#define B500000 0010005
+#define B576000 0010006
+#define B921600 0010007
+#define B1000000 0010010
+#define B1152000 0010011
+#define B1500000 0010012
+#define B2000000 0010013
+#define B2500000 0010014
+#define B3000000 0010015
+#define B3500000 0010016
+#define B4000000 0010017
+#ifdef __USE_MISC
+# define CIBAUD 002003600000 /* input baud rate (not used) */
+# define CRTSCTS 020000000000 /* flow control */
+#endif
+
+/* c_lflag bits */
+#define ISIG 0000001
+#define ICANON 0000002
+#if defined __USE_MISC || defined __USE_XOPEN
+# define XCASE 0000004
+#endif
+#define ECHO 0000010
+#define ECHOE 0000020
+#define ECHOK 0000040
+#define ECHONL 0000100
+#define NOFLSH 0000200
+#define TOSTOP 0000400
+#ifdef __USE_MISC
+# define ECHOCTL 0001000
+# define ECHOPRT 0002000
+# define ECHOKE 0004000
+# define FLUSHO 0010000
+# define PENDIN 0040000
+#endif
+#define IEXTEN 0100000
+
+/* tcflow() and TCXONC use these */
+#define TCOOFF 0
+#define TCOON 1
+#define TCIOFF 2
+#define TCION 3
+
+/* tcflush() and TCFLSH use these */
+#define TCIFLUSH 0
+#define TCOFLUSH 1
+#define TCIOFLUSH 2
+
+/* tcsetattr uses these */
+#define TCSANOW 0
+#define TCSADRAIN 1
+#define TCSAFLUSH 2
+
+
+#define _IOT_termios /* Hurd ioctl type field. */ \
+ _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/libc/sysdeps/linux/powerpc/bits/time.h b/libc/sysdeps/linux/powerpc/bits/time.h
new file mode 100644
index 000000000..274d61677
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/time.h
@@ -0,0 +1,59 @@
+/* System-dependent timing definitions. Linux version.
+ Copyright (C) 1996, 1997 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+/*
+ * Never include this file directly; use <time.h> instead.
+ */
+
+#ifndef __need_timeval
+# ifndef _BITS_TIME_H
+# define _BITS_TIME_H 1
+
+/* ISO/IEC 9899:1990 7.12.1: <time.h>
+ The macro `CLOCKS_PER_SEC' is the number per second of the value
+ returned by the `clock' function. */
+/* CAE XSH, Issue 4, Version 2: <time.h>
+ The value of CLOCKS_PER_SEC is required to be 1 million on all
+ XSI-conformant systems. */
+# define CLOCKS_PER_SEC 1000000
+
+# ifndef __STRICT_ANSI__
+/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
+ presents the real value for clock ticks per second for the system. */
+# define CLK_TCK 100
+# endif
+
+# endif /* bits/time.h */
+#endif
+
+#ifdef __need_timeval
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+# define _STRUCT_TIMEVAL 1
+# include <bits/types.h>
+
+/* A time value that is accurate to the nearest
+ microsecond but also has a range of years. */
+struct timeval
+ {
+ __time_t tv_sec; /* Seconds. */
+ __time_t tv_usec; /* Microseconds. */
+ };
+# endif /* struct timeval */
+#endif /* need timeval */
diff --git a/libc/sysdeps/linux/powerpc/bits/types.h b/libc/sysdeps/linux/powerpc/bits/types.h
new file mode 100644
index 000000000..2b6504d91
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/types.h
@@ -0,0 +1,153 @@
+/* Copyright (C) 1991,92,94,95,96,97,98,99 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+/*
+ * Never include this file directly; use <sys/types.h> instead.
+ */
+
+#ifndef _BITS_TYPES_H
+#define _BITS_TYPES_H 1
+
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+/* Convenience types. */
+typedef unsigned char __u_char;
+typedef unsigned short __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long __u_long;
+#ifdef __GNUC__
+__extension__ typedef unsigned long long int __u_quad_t;
+__extension__ typedef long long int __quad_t;
+#else
+typedef struct
+ {
+ long int __val[2];
+ } __quad_t;
+typedef struct
+ {
+ __u_long __val[2];
+ } __u_quad_t;
+#endif
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+#ifdef __GNUC__
+__extension__ typedef signed long long int __int64_t;
+__extension__ typedef unsigned long long int __uint64_t;
+#endif
+typedef __quad_t *__qaddr_t;
+
+typedef __u_quad_t __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 __mode_t; /* Type of file attribute bitmasks. */
+typedef __u_int __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. */
+typedef int __ssize_t; /* Type of a byte count, or error. */
+typedef __u_long __rlim_t; /* Type of resource counts. */
+typedef __u_quad_t __rlim64_t; /* Type of resource counts (LFS). */
+typedef __u_int __id_t; /* General type for ID. */
+
+typedef struct
+ {
+ int __val[2];
+ } __fsid_t; /* Type of file system IDs. */
+
+/* Everythin' else. */
+typedef int __daddr_t; /* The type of a disk address. */
+typedef char *__caddr_t;
+typedef long int __time_t;
+typedef long int __swblk_t; /* Type of a swap block maybe? */
+
+typedef long int __clock_t;
+
+/* One element in the file descriptor mask array. */
+typedef unsigned long int __fd_mask;
+
+/* Number of descriptors that can fit in an `fd_set'. */
+#define __FD_SETSIZE 1024
+
+/* It's easier to assume 8-bit bytes than to get CHAR_BIT. */
+#define __NFDBITS (8 * sizeof (__fd_mask))
+#define __FDELT(d) ((d) / __NFDBITS)
+#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
+
+/* fd_set for select and pselect. */
+typedef struct
+ {
+ /* XPG4.2 requires this member name. Otherwise avoid the name
+ from the global namespace. */
+#ifdef __USE_XOPEN
+ __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
+# define __FDS_BITS(set) ((set)->fds_bits)
+#else
+ __fd_mask __fds_bits[__FD_SETSIZE / __NFDBITS];
+# define __FDS_BITS(set) ((set)->__fds_bits)
+#endif
+ } __fd_set;
+
+
+typedef int __key_t;
+
+/* Used in `struct shmid_ds'. */
+typedef unsigned short int __ipc_pid_t;
+
+
+/* Types from the Large File Support interface. */
+
+/* Type to count number os disk blocks. */
+typedef long int __blkcnt_t;
+typedef __quad_t __blkcnt64_t;
+
+/* Type to count file system blocks. */
+typedef __u_long __fsblkcnt_t;
+typedef __u_quad_t __fsblkcnt64_t;
+
+/* Type to count file system inodes. */
+typedef __u_long __fsfilcnt_t;
+typedef __u_quad_t __fsfilcnt64_t;
+
+/* Type of file serial numbers. */
+typedef __u_long __ino64_t;
+
+/* Type of file sizes and offsets. */
+typedef __loff_t __off64_t;
+
+/* Used in XTI. */
+typedef long int __t_scalar_t;
+typedef unsigned long int __t_uscalar_t;
+
+/* Duplicates info from stdint.h but this is used in unistd.h. */
+typedef int __intptr_t;
+
+
+/* Now add the thread types. */
+#ifdef __USE_UNIX98
+# include <bits/pthreadtypes.h>
+#endif
+
+#endif /* bits/types.h */
diff --git a/libc/sysdeps/linux/powerpc/bits/uio.h b/libc/sysdeps/linux/powerpc/bits/uio.h
new file mode 100644
index 000000000..38ac17baa
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/uio.h
@@ -0,0 +1,46 @@
+/* Copyright (C) 1996, 1997 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 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
+ Library General Public License for more details.
+
+ 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 _SYS_UIO_H
+# error "Never include <bits/uio.h> directly; use <sys/uio.h> instead."
+#endif
+
+
+#include <sys/types.h>
+
+
+/* We should normally use the Linux kernel header file to define this
+ type and macros but this calls for trouble because of the header
+ includes other kernel headers. */
+
+/* Size of object which can be written atomically.
+
+ This macro has different values in different kernel versions. The
+ latest versions of ther kernel use 1024 and this is good choice. Since
+ the C library implementation of readv/writev is able to emulate the
+ functionality even if the currently running kernel does not support
+ this large value the readv/writev call will not fail because of this. */
+#define UIO_MAXIOV 1024
+
+
+/* Structure for scatter/gather I/O. */
+struct iovec
+ {
+ void *iov_base; /* Pointer to data. */
+ size_t iov_len; /* Length of data. */
+ };
diff --git a/libc/sysdeps/linux/powerpc/bits/waitflags.h b/libc/sysdeps/linux/powerpc/bits/waitflags.h
new file mode 100644
index 000000000..afc8b2229
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/waitflags.h
@@ -0,0 +1,30 @@
+/* Definitions of flag bits for `waitpid' et al.
+ Copyright (C) 1992, 1996, 1997, 2000 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 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
+ Library General Public License for more details.
+
+ 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 _SYS_WAIT_H
+# error "Never include <bits/waitflags.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Bits in the third argument to `waitpid'. */
+#define WNOHANG 1 /* Don't block waiting. */
+#define WUNTRACED 2 /* Report status of stopped children. */
+
+#define __WALL 0x40000000 /* Wait for any child. */
+#define __WCLONE 0x80000000 /* Wait for cloned process. */
diff --git a/libc/sysdeps/linux/powerpc/bits/waitstatus.h b/libc/sysdeps/linux/powerpc/bits/waitstatus.h
new file mode 100644
index 000000000..1ec55107f
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/waitstatus.h
@@ -0,0 +1,104 @@
+/* Definitions of status bits for `wait' et al.
+ Copyright (C) 1992, 1994, 1996, 1997 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 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
+ Library General Public License for more details.
+
+ 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 _SYS_WAIT_H
+# error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
+#endif
+
+
+/* Everything extant so far uses these same bits. */
+
+
+/* If WIFEXITED(STATUS), the low-order 8 bits of the status. */
+#define __WEXITSTATUS(status) (((status) & 0xff00) >> 8)
+
+/* If WIFSIGNALED(STATUS), the terminating signal. */
+#define __WTERMSIG(status) ((status) & 0x7f)
+
+/* If WIFSTOPPED(STATUS), the signal that stopped the child. */
+#define __WSTOPSIG(status) __WEXITSTATUS(status)
+
+/* Nonzero if STATUS indicates normal termination. */
+#define __WIFEXITED(status) (__WTERMSIG(status) == 0)
+
+/* Nonzero if STATUS indicates termination by a signal. */
+#ifdef __GNUC__
+# define __WIFSIGNALED(status) \
+ (__extension__ ({ int __status = (status); \
+ !__WIFSTOPPED(__status) && !__WIFEXITED(__status); }))
+#else /* Not GCC. */
+# define __WIFSIGNALED(status) (!__WIFSTOPPED(status) && !__WIFEXITED(status))
+#endif /* GCC. */
+
+/* Nonzero if STATUS indicates the child is stopped. */
+#define __WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
+
+/* Nonzero if STATUS indicates the child dumped core. */
+#define __WCOREDUMP(status) ((status) & __WCOREFLAG)
+
+/* Macros for constructing status values. */
+#define __W_EXITCODE(ret, sig) ((ret) << 8 | (sig))
+#define __W_STOPCODE(sig) ((sig) << 8 | 0x7f)
+#define __WCOREFLAG 0x80
+
+
+#ifdef __USE_BSD
+
+# include <endian.h>
+
+union wait
+ {
+ int w_status;
+ struct
+ {
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int __w_termsig:7; /* Terminating signal. */
+ unsigned int __w_coredump:1; /* Set if dumped core. */
+ unsigned int __w_retcode:8; /* Return code if exited normally. */
+ unsigned int:16;
+# endif /* Little endian. */
+# if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int:16;
+ unsigned int __w_retcode:8;
+ unsigned int __w_coredump:1;
+ unsigned int __w_termsig:7;
+# endif /* Big endian. */
+ } __wait_terminated;
+ struct
+ {
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+ unsigned int __w_stopval:8; /* W_STOPPED if stopped. */
+ unsigned int __w_stopsig:8; /* Stopping signal. */
+ unsigned int:16;
+# endif /* Little endian. */
+# if __BYTE_ORDER == __BIG_ENDIAN
+ unsigned int:16;
+ unsigned int __w_stopsig:8; /* Stopping signal. */
+ unsigned int __w_stopval:8; /* W_STOPPED if stopped. */
+# endif /* Big endian. */
+ } __wait_stopped;
+ };
+
+# define w_termsig __wait_terminated.__w_termsig
+# define w_coredump __wait_terminated.__w_coredump
+# define w_retcode __wait_terminated.__w_retcode
+# define w_stopsig __wait_stopped.__w_stopsig
+# define w_stopval __wait_stopped.__w_stopval
+
+#endif /* Use BSD. */
diff --git a/libc/sysdeps/linux/powerpc/bits/wordsize.h b/libc/sysdeps/linux/powerpc/bits/wordsize.h
new file mode 100644
index 000000000..62dad0c71
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/wordsize.h
@@ -0,0 +1,19 @@
+/* Copyright (C) 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+#define __WORDSIZE 32
diff --git a/libc/sysdeps/linux/powerpc/bits/xopen_lim.h b/libc/sysdeps/linux/powerpc/bits/xopen_lim.h
new file mode 100644
index 000000000..9f22e44e2
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/bits/xopen_lim.h
@@ -0,0 +1,96 @@
+/* Copyright (C) 1996, 1997 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+/*
+ * Never include this file directly; use <limits.h> instead.
+ */
+
+/* Additional definitions from X/Open Portability Guide, Issue 4, Version 2
+ System Interfaces and Headers, 4.16 <limits.h>
+
+ Please note only the values which are not greater than the minimum
+ stated in the standard document are listed. The `sysconf' functions
+ should be used to obtain the actual value. */
+
+#ifndef _XOPEN_LIM_H
+#define _XOPEN_LIM_H 1
+
+#define __need_FOPEN_MAX
+#include <bits/stdio_lim.h>
+
+/* We do not provide fixed values for
+
+ ARG_MAX Maximum length of argument to the `exec' function
+ including environment data.
+
+ ATEXIT_MAX Maximum number of functions that may be registered
+ with `atexit'.
+
+ CHILD_MAX Maximum number of simultaneous processes per real
+ user ID.
+
+ OPEN_MAX Maximum number of files that one process can have open
+ at anyone time.
+
+ PAGESIZE
+ PAGE_SIZE Size of bytes of a page.
+
+ PASS_MAX Maximum number of significant bytes in a password.
+*/
+
+
+/* Maximum number of `iovec' structures that one process has available
+ for use with `readv' or writev'. */
+#define IOV_MAX _XOPEN_IOV_MAX
+
+/* The number of streams that one process can have open at one time. */
+#define STREAM_MAX FOPEN_MAX
+
+/* Maximum number of bytes supported for the name of a time zone. */
+#define TZNAME_MAX _POSIX_TZNAME_MAX
+
+
+/* Maximum number of `iovec' structures that one process has available
+ for use with `readv' or writev'. */
+#define _XOPEN_IOV_MAX _POSIX_UIO_MAXIOV
+
+
+/* Maximum value of `digit' in calls to the `printf' and `scanf'
+ functions. We have no limit, so return a reasonable value. */
+#define NL_ARGMAX _POSIX_ARG_MAX
+
+/* Maximum number of bytes in a `LANG' name. We have no limit. */
+#define NL_LANGMAX _POSIX2_LINE_MAX
+
+/* Maximum message number. We have no limit. */
+#define NL_MSGMAX INT_MAX
+
+/* Maximum number of bytes in N-to-1 collation mapping. We have no
+ limit. */
+#define NL_NMAX INT_MAX
+
+/* Maximum set number. We have no limit. */
+#define NL_SETMAX INT_MAX
+
+/* Maximum number of bytes in a message. We have no limit. */
+#define NL_TEXTMAX INT_MAX
+
+/* Default process priority. */
+#define NZERO 20
+
+#endif /* bits/xopen_lim.h */
diff --git a/libc/sysdeps/linux/powerpc/crt0.S b/libc/sysdeps/linux/powerpc/crt0.S
new file mode 100644
index 000000000..9eed91ebf
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/crt0.S
@@ -0,0 +1,58 @@
+/*
+ * uC-libc/sysdeps/linux/powerpc/crt0.S
+ * process init code for powerpc
+ *
+ * Copyright (C) 2001 by Lineo, Inc.
+ * Author: David A. Schleef <ds@schleef.org>
+ *
+ * This program is free software; you can redistribute it and/or 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.
+ *
+ * This program 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 Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+/*
+ _start is called with the following registers initialized:
+
+ r1 null stack frame
+ r3 argc
+ r4 argv
+ r5 envp
+ r6 auxiliary vector. ignored.
+ r7 function pointer to jump to when main() exits. If
+ this is non-zero, it should be registered with atexit().
+ Linux always (?) sets r7 to NULL, so it is not implemented
+ here.
+ */
+
+
+.text
+ .global _start
+ .global __uClibc_main
+
+ .type _start,%function
+ .type __uClibc_main,%function
+
+_start:
+ /* create 2 empty stack frames */
+ stwu 1,-32(1)
+
+ lwz 3,32(1)
+ addi 4,1,36
+ addi 5,1,40
+ rlwinm 0,3,2,0,29
+ add 5,5,0
+
+ bl __uClibc_main
+
+
diff --git a/libc/sysdeps/linux/powerpc/crt0.c b/libc/sysdeps/linux/powerpc/crt0.c
new file mode 100644
index 000000000..c16bde89f
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/crt0.c
@@ -0,0 +1,43 @@
+/*
+ * uC-libc/sysdeps/linux/powerpc/crt0.S
+ * process init code for powerpc
+ *
+ * Copyright (C) 2001 by Lineo, Inc.
+ * Author: David A. Schleef <ds@schleef.org>
+ *
+ * This program is free software; you can redistribute it and/or 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.
+ *
+ * This program 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 Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+asm(
+ "\t.global _start\n"
+ "\t_start:\n"
+ "\tstwu 1,-32(1)\n"
+ "\tb _start2\n");
+
+void __uClibc_main(int argc,void *argv,void *envp);
+
+void _start2(void)
+{
+ void **p;
+ int argc;
+
+ p=__builtin_frame_address(2);
+
+ argc=*(int *)p;
+
+ __uClibc_main(argc,p+1,p+2+argc);
+}
+
diff --git a/libc/sysdeps/linux/powerpc/fork.c b/libc/sysdeps/linux/powerpc/fork.c
new file mode 100644
index 000000000..43ac47ac0
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/fork.c
@@ -0,0 +1,33 @@
+/*
+ * uC-libc/sysdeps/linux/powerpc/fork.c
+ * fork() implementation for powerpc
+ *
+ * Copyright (C) 2001 by Lineo, Inc.
+ * Author: David A. Schleef <ds@schleef.org>
+ *
+ * This program is free software; you can redistribute it and/or 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.
+ *
+ * This program 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 Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include <errno.h>
+#include <features.h>
+#include <sys/syscall.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+
+_syscall0(pid_t,fork);
+
+
diff --git a/libc/sysdeps/linux/powerpc/longjmp.S b/libc/sysdeps/linux/powerpc/longjmp.S
new file mode 100644
index 000000000..e30f7fd26
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/longjmp.S
@@ -0,0 +1,75 @@
+/* longjmp for PowerPC.
+ Copyright (C) 1995, 1996, 1997, 1999, 2000 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+/* So we can use r3, r4, instead of 3, 4 */
+#include "ppc_asm.h"
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+.global longjmp;
+.align 4;
+
+longjmp:
+ lwz r1,(JB_GPR1*4)(r3)
+ lwz r2,(JB_GPR2*4)(r3)
+ lwz r0,(JB_LR*4)(r3)
+ lwz r14,((JB_GPRS+0)*4)(r3)
+ lfd fr14,((JB_FPRS+0*2)*4)(r3)
+ lwz r15,((JB_GPRS+1)*4)(r3)
+ lfd fr15,((JB_FPRS+1*2)*4)(r3)
+ lwz r16,((JB_GPRS+2)*4)(r3)
+ lfd fr16,((JB_FPRS+2*2)*4)(r3)
+ lwz r17,((JB_GPRS+3)*4)(r3)
+ lfd fr17,((JB_FPRS+3*2)*4)(r3)
+ lwz r18,((JB_GPRS+4)*4)(r3)
+ lfd fr18,((JB_FPRS+4*2)*4)(r3)
+ lwz r19,((JB_GPRS+5)*4)(r3)
+ lfd fr19,((JB_FPRS+5*2)*4)(r3)
+ lwz r20,((JB_GPRS+6)*4)(r3)
+ lfd fr20,((JB_FPRS+6*2)*4)(r3)
+ mtlr r0
+ lwz r21,((JB_GPRS+7)*4)(r3)
+ lfd fr21,((JB_FPRS+7*2)*4)(r3)
+ lwz r22,((JB_GPRS+8)*4)(r3)
+ lfd fr22,((JB_FPRS+8*2)*4)(r3)
+ lwz r0,(JB_CR*4)(r3)
+ lwz r23,((JB_GPRS+9)*4)(r3)
+ lfd fr23,((JB_FPRS+9*2)*4)(r3)
+ lwz r24,((JB_GPRS+10)*4)(r3)
+ lfd fr24,((JB_FPRS+10*2)*4)(r3)
+ lwz r25,((JB_GPRS+11)*4)(r3)
+ lfd fr25,((JB_FPRS+11*2)*4)(r3)
+ mtcrf 0xFF,r0
+ lwz r26,((JB_GPRS+12)*4)(r3)
+ lfd fr26,((JB_FPRS+12*2)*4)(r3)
+ lwz r27,((JB_GPRS+13)*4)(r3)
+ lfd fr27,((JB_FPRS+13*2)*4)(r3)
+ lwz r28,((JB_GPRS+14)*4)(r3)
+ lfd fr28,((JB_FPRS+14*2)*4)(r3)
+ lwz r29,((JB_GPRS+15)*4)(r3)
+ lfd fr29,((JB_FPRS+15*2)*4)(r3)
+ lwz r30,((JB_GPRS+16)*4)(r3)
+ lfd fr30,((JB_FPRS+16*2)*4)(r3)
+ lwz r31,((JB_GPRS+17)*4)(r3)
+ lfd fr31,((JB_FPRS+17*2)*4)(r3)
+ mr r3,r4
+ blr
+.size longjmp,.-longjmp;
diff --git a/libc/sysdeps/linux/powerpc/ppc_asm.h b/libc/sysdeps/linux/powerpc/ppc_asm.h
new file mode 100644
index 000000000..c35192bb4
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/ppc_asm.h
@@ -0,0 +1,115 @@
+/* Condition Register Bit Fields */
+
+#define cr0 0
+#define cr1 1
+#define cr2 2
+#define cr3 3
+#define cr4 4
+#define cr5 5
+#define cr6 6
+#define cr7 7
+
+
+/* General Purpose Registers (GPRs) */
+
+#define r0 0
+#define r1 1
+#define r2 2
+#define r3 3
+#define r4 4
+#define r5 5
+#define r6 6
+#define r7 7
+#define r8 8
+#define r9 9
+#define r10 10
+#define r11 11
+#define r12 12
+#define r13 13
+#define r14 14
+#define r15 15
+#define r16 16
+#define r17 17
+#define r18 18
+#define r19 19
+#define r20 20
+#define r21 21
+#define r22 22
+#define r23 23
+#define r24 24
+#define r25 25
+#define r26 26
+#define r27 27
+#define r28 28
+#define r29 29
+#define r30 30
+#define r31 31
+
+
+/* Floating Point Registers (FPRs) */
+
+#define fr0 0
+#define fr1 1
+#define fr2 2
+#define fr3 3
+#define fr4 4
+#define fr5 5
+#define fr6 6
+#define fr7 7
+#define fr8 8
+#define fr9 9
+#define fr10 10
+#define fr11 11
+#define fr12 12
+#define fr13 13
+#define fr14 14
+#define fr15 15
+#define fr16 16
+#define fr17 17
+#define fr18 18
+#define fr19 19
+#define fr20 20
+#define fr21 21
+#define fr22 22
+#define fr23 23
+#define fr24 24
+#define fr25 25
+#define fr26 26
+#define fr27 27
+#define fr28 28
+#define fr29 29
+#define fr30 30
+#define fr31 31
+
+#define vr0 0
+#define vr1 1
+#define vr2 2
+#define vr3 3
+#define vr4 4
+#define vr5 5
+#define vr6 6
+#define vr7 7
+#define vr8 8
+#define vr9 9
+#define vr10 10
+#define vr11 11
+#define vr12 12
+#define vr13 13
+#define vr14 14
+#define vr15 15
+#define vr16 16
+#define vr17 17
+#define vr18 18
+#define vr19 19
+#define vr20 20
+#define vr21 21
+#define vr22 22
+#define vr23 23
+#define vr24 24
+#define vr25 25
+#define vr26 26
+#define vr27 27
+#define vr28 28
+#define vr29 29
+#define vr30 30
+#define vr31 31
diff --git a/libc/sysdeps/linux/powerpc/setjmp.S b/libc/sysdeps/linux/powerpc/setjmp.S
new file mode 100644
index 000000000..290669cec
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/setjmp.S
@@ -0,0 +1,79 @@
+/* setjmp for PowerPC.
+ Copyright (C) 1995, 1996, 1997, 1999, 2000 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 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
+ Library General Public License for more details.
+
+ 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. */
+
+#include "ppc_asm.h"
+
+#define _ASM
+#define _SETJMP_H
+#include <bits/setjmp.h>
+
+.global __setjmp
+.type __setjmp,@function
+.align 4
+__setjmp:
+ li r4,0
+.global __sigsetjmp
+.type __sigsetjmp,@function
+.align 4
+__sigsetjmp:
+ stw r1,(JB_GPR1*4)(3)
+ mflr r0
+ stw r2,(JB_GPR2*4)(3)
+ stw r14,((JB_GPRS+0)*4)(3)
+ stfd fr14,((JB_FPRS+0*2)*4)(3)
+ stw r0,(JB_LR*4)(3)
+ stw r15,((JB_GPRS+1)*4)(3)
+ stfd fr15,((JB_FPRS+1*2)*4)(3)
+ mfcr r0
+ stw r16,((JB_GPRS+2)*4)(3)
+ stfd fr16,((JB_FPRS+2*2)*4)(3)
+ stw r0,(JB_CR*4)(3)
+ stw r17,((JB_GPRS+3)*4)(3)
+ stfd fr17,((JB_FPRS+3*2)*4)(3)
+ stw r18,((JB_GPRS+4)*4)(3)
+ stfd fr18,((JB_FPRS+4*2)*4)(3)
+ stw r19,((JB_GPRS+5)*4)(3)
+ stfd fr19,((JB_FPRS+5*2)*4)(3)
+ stw r20,((JB_GPRS+6)*4)(3)
+ stfd fr20,((JB_FPRS+6*2)*4)(3)
+ stw r21,((JB_GPRS+7)*4)(3)
+ stfd fr21,((JB_FPRS+7*2)*4)(3)
+ stw r22,((JB_GPRS+8)*4)(3)
+ stfd fr22,((JB_FPRS+8*2)*4)(3)
+ stw r23,((JB_GPRS+9)*4)(3)
+ stfd fr23,((JB_FPRS+9*2)*4)(3)
+ stw r24,((JB_GPRS+10)*4)(3)
+ stfd fr24,((JB_FPRS+10*2)*4)(3)
+ stw r25,((JB_GPRS+11)*4)(3)
+ stfd fr25,((JB_FPRS+11*2)*4)(3)
+ stw r26,((JB_GPRS+12)*4)(3)
+ stfd fr26,((JB_FPRS+12*2)*4)(3)
+ stw r27,((JB_GPRS+13)*4)(3)
+ stfd fr27,((JB_FPRS+13*2)*4)(3)
+ stw r28,((JB_GPRS+14)*4)(3)
+ stfd fr28,((JB_FPRS+14*2)*4)(3)
+ stw r29,((JB_GPRS+15)*4)(3)
+ stfd fr29,((JB_FPRS+15*2)*4)(3)
+ stw r30,((JB_GPRS+16)*4)(3)
+ stfd fr30,((JB_FPRS+16*2)*4)(3)
+ stw r31,((JB_GPRS+17)*4)(3)
+ stfd fr31,((JB_FPRS+17*2)*4)(3)
+ b __sigjmp_save
+.size __sigsetjmp,.-__sigsetjmp
+
diff --git a/libc/sysdeps/linux/powerpc/vfork.S b/libc/sysdeps/linux/powerpc/vfork.S
new file mode 100644
index 000000000..842bad1a7
--- /dev/null
+++ b/libc/sysdeps/linux/powerpc/vfork.S
@@ -0,0 +1,41 @@
+/*
+ * uC-libc/sysdeps/linux/powerpc/vfork.S
+ * vfork implementation for powerpc
+ *
+ * Copyright (C) 2001 by Lineo, Inc.
+ * Author: David A. Schleef <ds@schleef.org>
+ *
+ * This program is free software; you can redistribute it and/or 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.
+ *
+ * This program 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 Library General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ */
+
+#include "ppc_asm.h"
+
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+
+.global vfork;
+.align 4;
+
+vfork:
+ /* XXX not implemented */
+
+ /* return -1 */
+ li r3,-1
+ blr
+
+.size vfork,.-vfork;