about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/powerpc/aix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-05-05 20:03:03 +0000
committerUlrich Drepper <drepper@redhat.com>2000-05-05 20:03:03 +0000
commit3c38e028f36115cb4b5621380dc95b0d247ca011 (patch)
tree4750c46e2a3262f71aafa1c98dbba335331d22fc /sysdeps/unix/sysv/linux/powerpc/aix
parentf1d86a931b2c51a24540e7ea3cda60dc154e064a (diff)
downloadglibc-3c38e028f36115cb4b5621380dc95b0d247ca011.tar.gz
glibc-3c38e028f36115cb4b5621380dc95b0d247ca011.tar.xz
glibc-3c38e028f36115cb4b5621380dc95b0d247ca011.zip
Update.
2000-05-05  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/unix/sysv/aix/linux/errnoconv.c: Moved to...
	* sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c: ...here.
	* sysdeps/unix/sysv/aix/linux/statconv.c: Moved to...
	* sysdeps/unix/sysv/linux/powerpc/aix/statconv.c: ...here.
	* sysdeps/unix/sysv/aix/linux/direntconv.c: Moved to...
	* sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c: ...here.

	* sysdeps/unix/sysv/aix/linux/linux-errno.h: Removed.
	* sysdeps/unix/sysv/aix/linux/linux-stat.h: Removed
	* sysdeps/unix/sysv/aix/linux/linux-dirent.h: Removed.

	* sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h: New file.
	* sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h: New file.
	* sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h: New file.
	* sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h: New file.

	* sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c: New file.
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/aix')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h19
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h125
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h76
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h84
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c49
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c143
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/aix/statconv.c53
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c171
8 files changed, 720 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h b/sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h
new file mode 100644
index 0000000000..c18e9fa4bf
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/aix/aix-dirent.h
@@ -0,0 +1,19 @@
+#include "aix-types.h"
+
+struct aixdirent
+  {
+    aixino_t d_ino;
+    aixoff_t d_off;
+    unsigned short int d_reclen;
+    unsigned short int d_namlen;
+    char d_name[256];           /* We must not include limits.h! */
+  };
+
+struct aixdirent64
+  {
+    aixino64_t d_ino;
+    aixoff64_t d_off;
+    unsigned short int d_reclen;
+    unsigned short int d_namlen;
+    char d_name[256];           /* We must not include limits.h! */
+  };
diff --git a/sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h b/sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h
new file mode 100644
index 0000000000..c81d609d86
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/aix/aix-errno.h
@@ -0,0 +1,125 @@
+/* Copyright (C) 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.  */
+
+#define AIX_EPERM		1
+#define AIX_ENOENT		2
+#define AIX_ESRCH		3
+#define AIX_EINTR		4
+#define AIX_EIO			5
+#define AIX_ENXIO		6
+#define AIX_E2BIG		7
+#define AIX_ENOEXEC		8
+#define AIX_EBADF		9
+#define AIX_ECHILD		10
+#define AIX_EAGAIN		11
+#define AIX_ENOMEM		12
+#define AIX_EACCES		13
+#define AIX_EFAULT		14
+#define AIX_ENOTBLK		15
+#define AIX_EBUSY		16
+#define AIX_EEXIST		17
+#define AIX_EXDEV		18
+#define AIX_ENODEV		19
+#define AIX_ENOTDIR		20
+#define AIX_EISDIR		21
+#define AIX_EINVAL		22
+#define AIX_ENFILE		23
+#define AIX_EMFILE		24
+#define AIX_ENOTTY		25
+#define AIX_ETXTBSY		26
+#define AIX_EFBIG		27
+#define AIX_ENOSPC		28
+#define AIX_ESPIPE		29
+#define AIX_EROFS		30
+#define AIX_EMLINK		31
+#define AIX_EPIPE		32
+#define AIX_EDOM		33
+#define AIX_ERANGE		34
+#define AIX_ENOMSG		35
+#define AIX_EIDRM		36
+#define AIX_ECHRNG		37
+#define AIX_EL2NSYNC		38
+#define AIX_EL3HLT		39
+#define AIX_EL3RST		40
+#define AIX_ELNRNG		41
+#define AIX_EUNATCH		42
+#define AIX_ENOCSI		43
+#define AIX_EL2HLT		44
+#define AIX_EDEADLK		45
+#define AIX_ENOTREADY		46
+#define AIX_EWRPROTECT		47
+#define AIX_EFORMAT		48
+#define AIX_ENOLCK		49
+#define AIX_ENOCONNECT		50
+#define AIX_ESTALE		52
+#define AIX_EDIST		53
+#define AIX_EWOULDBLOCK		54
+#define AIX_EINPROGRESS		55
+#define AIX_EALREADY		56
+#define AIX_ENOTSOCK		57
+#define AIX_EDESTADDRREQ	58
+#define AIX_EMSGSIZE		59
+#define AIX_EPROTOTYPE		60
+#define AIX_ENOPROTOOPT		61
+#define AIX_EPROTONOSUPPORT	62
+#define AIX_ESOCKTNOSUPPORT	63
+#define AIX_EOPNOTSUPP		64
+#define AIX_EPFNOSUPPORT	65
+#define AIX_EAFNOSUPPORT	66
+#define AIX_EADDRINUSE		67
+#define AIX_EADDRNOTAVAIL	68
+#define AIX_ENETDOWN		69
+#define AIX_ENETUNREACH		70
+#define AIX_ENETRESET		71
+#define AIX_ECONNABORTED	72
+#define AIX_ECONNRESET		73
+#define AIX_ENOBUFS		74
+#define AIX_EISCONN		75
+#define AIX_ENOTCONN		76
+#define AIX_ESHUTDOWN		77
+#define AIX_ETIMEDOUT		78
+#define AIX_ECONNREFUSED	79
+#define AIX_EHOSTDOWN		80
+#define AIX_EHOSTUNREACH	81
+#define AIX_ERESTART		82
+#define AIX_EPROCLIM		83
+#define AIX_EUSERS		84
+#define AIX_ELOOP		85
+#define AIX_ENAMETOOLONG	86
+#define AIX_EDQUOT		88
+#define AIX_ECORRUPT		89
+#define AIX_EREMOTE		93
+#define AIX_ENOSYS		109
+#define AIX_EMEDIA		110
+#define AIX_ESOFT		111
+#define AIX_ENOATTR		112
+#define AIX_ESAD		113
+#define AIX_ENOTRUST		114
+#define AIX_ETOOMANYREFS	115
+#define AIX_EILSEQ		116
+#define AIX_ECANCELED		117
+#define AIX_ENOSR		118
+#define AIX_ETIME		119
+#define AIX_EBADMSG		120
+#define AIX_EPROTO		121
+#define AIX_ENODATA		122
+#define AIX_ENOSTR		123
+#define AIX_ENOTSUP		124
+#define AIX_EMULTIHOP		125
+#define AIX_ENOLINK		126
+#define AIX_EOVERFLOW		127
diff --git a/sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h b/sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h
new file mode 100644
index 0000000000..3bead8fad9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/aix/aix-stat.h
@@ -0,0 +1,76 @@
+/* Copyright (C) 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.  */
+
+struct aixstat
+  {
+    aixdev_t st_dev;
+    aixino_t st_ino;
+    aixmode_t st_mode;
+    aixnlink_t st_nlink;
+    unsigned short int st_flag;
+    aixuid_t st_uid;
+    aixgid_t st_gid;
+    aixdev_t st_rdev;
+    aixoff_t st_size;
+    aixtime_t st_atime;
+    unsigned long int __unused1;
+    aixtime_t st_mtime;
+    unsigned long int __unused2;
+    aixtime_t st_ctime;
+    unsigned long int __unused3;
+    aixblksize_t st_blksize;
+    aixblkcnt_t st_blocks;
+    int st_vfstype;
+    unsigned int st_vfs;
+    unsigned int st_type;
+    unsigned int st_gen;
+
+#define _STATBUF_RESERVED_SPACE 9
+    unsigned int st_reserved[_STATBUF_RESERVED_SPACE];
+  };
+
+struct aixstat64
+  {
+    aixdev_t st_dev;
+    aixino64_t st_ino;
+    aixmode_t st_mode;
+    aixnlink_t st_nlink;
+    unsigned short int st_flag;
+    aixuid_t st_uid;
+    aixgid_t st_gid;
+    aixdev_t st_rdev;
+    int st_ssize;
+    aixtime_t st_atime;
+    unsigned long int __unused1;
+    aixtime_t st_mtime;
+    unsigned long int __unused2;
+    aixtime_t st_ctime;
+    unsigned long int __unused3;
+    aixblksize_t st_blksize;
+    aixblkcnt64_t st_blocks;
+    int st_vfstype;
+    unsigned int st_vfs;
+    unsigned int st_type;
+    unsigned int st_gen;
+    unsigned int st_reserved[_STATBUF_RESERVED_SPACE];
+    unsigned int st_padto_ll;
+    aixoff64_t st_size;
+  };
+
+#define aix_major(x)	(int) ((unsigned int) (x) >> 16)
+#define aix_minor(x)	(int) ((x) & 0xFFFF)
diff --git a/sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h b/sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h
new file mode 100644
index 0000000000..9bb301c486
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/aix/aix-termios.h
@@ -0,0 +1,84 @@
+/* Copyright (C) 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 "aix-types.h"
+
+#define AIX_NCCS 16
+struct aixtermios
+{
+  aixtcflag_t c_iflag;
+  aixtcflag_t c_oflag;
+  aixtcflag_t c_cflag;
+  aixtcflag_t c_lflag;
+  aixcc_t c_line;
+  aixcc_t c_cc[AIX_NCCS];
+  aixspeed_t c_ispeed;
+  aixspeed_t c_ospeed;
+};
+
+#define AIX_VINTR	0
+#define AIX_VQUIT	1
+#define AIX_VERASE	2
+#define AIX_VKILL	3
+#define AIX_VEOF	4
+#define AIX_VEOL	5
+#define AIX_VEOL2	6
+#define AIX_VSTART	7
+#define AIX_VSTOP	8
+#define AIX_VSUSP	9
+#define AIX_VDSUSP	10
+#define AIX_VREPRINT	11
+#define AIX_VDISCRD	12
+#define AIX_VWERSE	13
+#define AIX_VLNEXT	14
+
+#define AIX_IUCLC	0x00000800
+#define AIX_IXANY	0x00001000
+#define AIX_IMAXBE	0x00010000
+
+#define AIX_OLCUC	0x00000002
+#define AIX_ONLCR	0x00000004
+#define AIX_TABDLY	0x00000c00
+#define AIX_TAB0	0x00000000
+#define AIX_TAB1	0x00000400
+#define AIX_TAB2	0x00000800
+#define AIX_TAB3	0x00000c00
+#define AIX_BSDLY	0x00001000
+#define AIX_BS0		0x00000000
+#define AIX_BS1		0x00001000
+#define AIX_FFDLY	0x00002000
+#define AIX_FF0		0x00000000
+#define AIX_FF1		0x00002000
+#define AIX_NLDLY	0x00004000
+#define AIX_NL0		0x00000000
+#define AIX_NL1		0x00004000
+#define AIX_VTDLY	0x00008000
+#define AIX_VT0		0x00000000
+#define AIX_VT1		0x00008000
+
+#define AIX_CSIZE	0x00000030
+#define AIX_CS5		0x00000000
+#define AIX_CS6		0x00000010
+#define AIX_CS7		0x00000020
+#define AIX_CS8		0x00000030
+#define AIX_CSTOPB	0x00000040
+#define AIX_CREAD	0x00000080
+#define AIX_PARENB	0x00000100
+#define AIX_PARODD	0x00000200
+#define AIX_HUPCL	0x00000400
+#define AIX_CLOCAL	0x00000800
diff --git a/sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c b/sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c
new file mode 100644
index 0000000000..2cd50f6bac
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/aix/direntconv.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 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 <dirent.h>
+#include <string.h>
+#include "linux-dirent.h"
+
+#ifndef DT_UNKNOWN
+# define DT_UNKNOWN 0
+#endif
+
+
+void
+__dirent_aix_to_linux (const struct aixdirent *aixdir,
+		       struct dirent *linuxdir)
+{
+  linuxdir->d_ino = aixdir->d_ino;
+  linuxdir->d_off = aixdir->d_off;
+  linuxdir->d_reclen = aixdir->d_reclen;
+  linuxdir->d_type = DT_UNKNOWN;
+  memcpy (linuxdir->d_name, aixdir->d_name, aixdir->d_namlen + 1);
+}
+
+
+void
+__dirent64_aix_to_linux (const struct aixdirent64 *aixdir,
+			 struct dirent64 *linuxdir)
+{
+  linuxdir->d_ino = aixdir->d_ino;
+  linuxdir->d_off = aixdir->d_off;
+  linuxdir->d_reclen = aixdir->d_reclen;
+  linuxdir->d_type = DT_UNKNOWN;
+  memcpy (linuxdir->d_name, aixdir->d_name, aixdir->d_namlen + 1);
+}
diff --git a/sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c b/sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c
new file mode 100644
index 0000000000..83f0562dc9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/aix/errnoconv.c
@@ -0,0 +1,143 @@
+/* Convert the error number the AIX kernel returns to what the Linux
+   application expects.
+   Copyright (C) 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 <errno.h>
+#include "linux-errno.h"
+
+
+static int mapping[] =
+{
+  [AIX_EPERM] = EPERM,
+  [AIX_ENOENT] = ENOENT,
+  [AIX_ESRCH] = ESRCH,
+  [AIX_EINTR] = EINTR,
+  [AIX_EIO] = EIO,
+  [AIX_ENXIO] = ENXIO,
+  [AIX_E2BIG] = E2BIG,
+  [AIX_ENOEXEC] = ENOEXEC,
+  [AIX_EBADF] = EBADF,
+  [AIX_ECHILD] = ECHILD,
+  [AIX_EAGAIN] = EAGAIN,
+  [AIX_ENOMEM] = ENOMEM,
+  [AIX_EACCES] = EACCES,
+  [AIX_EFAULT] = EFAULT,
+  [AIX_ENOTBLK] = ENOTBLK,
+  [AIX_EBUSY] = EBUSY,
+  [AIX_EEXIST] = EEXIST,
+  [AIX_EXDEV] = EXDEV,
+  [AIX_ENODEV] = ENODEV,
+  [AIX_ENOTDIR] = ENOTDIR,
+  [AIX_EISDIR] = EISDIR,
+  [AIX_EINVAL] = EINVAL,
+  [AIX_ENFILE] = ENFILE,
+  [AIX_EMFILE] = EMFILE,
+  [AIX_ENOTTY] = ENOTTY,
+  [AIX_ETXTBSY] = ETXTBSY,
+  [AIX_EFBIG] = EFBIG,
+  [AIX_ENOSPC] = ENOSPC,
+  [AIX_EIDRM] = EIDRM,
+  [AIX_ECHRNG] = ECHRNG,
+  [AIX_EL2NSYNC] = EL2NSYNC,
+  [AIX_EL3HLT] = EL3HLT,
+  [AIX_EL3RST] = EL3RST,
+  [AIX_ELNRNG] = ELNRNG,
+  [AIX_EUNATCH] = EUNATCH,
+  [AIX_ENOCSI] = ENOCSI,
+  [AIX_EL2HLT] = EL2HLT,
+  [AIX_EDEADLK] = EDEADLK,
+  [AIX_ENOTREADY] = ENOTREADY,
+  // EWPROTECT: no Linux equivalent
+  // EFORMAT: no Linux equivalent
+  [AIX_ENOLCK] = ENOLCK,
+  // ENOCONNECT: No Linux equivalent
+  [AIX_ESTALE] = ESTALE,
+  // EDIST: no Linux equivalent
+  [54] = EAGAIN,		// EWOULDBLOCK
+  [AIX_EINPROGRESS] = EINPROGRESS,
+  [AIX_EALREADY] = EALREADY,
+  [AIX_ENOTSOCK] = ENOTSOCK,
+  [AIX_EDESTADDRREQ] = EDESTADDRREQ,
+  [AIX_EMSGSIZE] = EMSGSIZE,
+  [AIX_EPROTOTYPE] = EPROTOTYPE,
+  [AIX_ENOPROTOOPT] = ENOPROTOOPT,
+  [AIX_EPROTONOSUPPORT] = EPROTONOSUPPORT,
+  [AIX_ESOCKTNOSUPPORT] = ESOCKTNOSUPPORT,
+  [AIX_EOPNOTSUPP] = EOPNOTSUPP,
+  [AIX_EPFNOSUPPORT] = EPFNOSUPPORT,
+  [AIX_EAFNOSUPPORT] = EAFNOSUPPORT,
+  [AIX_EADDRINUSE] = EADDRINUSE,
+  [AIX_EADDRNOTAVAIL] = EADDRNOTAVAIL,
+  [AIX_ENETDOWN] = ENETDOWN,
+  [AIX_ENETUNREACH] = ENETUNREACH,
+  [AIX_ENETRESET] = ENETRESET,
+  [AIX_ECONNABORTED] = ECONNABORTED,
+  [AIX_ECONNRESET] = ECONNRESET,
+  [AIX_ENOBUFS] = ENOBUFS,
+  [AIX_EISCONN] = EISCONN,
+  [AIX_ENOTCONN] = ENOTCONN,
+  [AIX_ESHUTDOWN] = ESHUTDOWN,
+  [AIX_ETIMEDOUT] = ETIMEDOUT,
+  [AIX_ECONNREFUSED] = ECONNREFUSED,
+  [AIX_EHOSTDOWN] = EHOSTDOWN,
+  [AIX_EHOSTUNREACH] = EHOSTUNREACH,
+  [AIX_ERESTART] = ERESTART,
+  [AIX_EPROCLIM] = EPROCLIM,
+  [AIX_EUSERS] = EUSERS,
+  [AIX_ELOOP] = ELOOP,
+  [AIX_ENAMETOOLONG] = ENAMETOOLONG,
+  [87] = ENOTEMPTY,		// ENOTEMPTY
+  [AIX_EDQUOT] = EDQUOT,
+  [AIX_ECORRUPT] = ECORRUPT,
+  [AIX_EREMOTE] = EREMOTE,
+  [AIX_ENOSYS] = ENOSYS,
+  [AIX_EMEDIA] = EMEDIA,
+  [AIX_ESOFT] = ESOFT,
+  [AIX_ENOATTR] = ENOATTR,
+  [AIX_ESAD] = ESAD,
+  // ENOTRUST: no Linux equivalent
+  [AIX_ETOOMANYREFS] = ETOOMANYREFS,
+  [AIX_EILSEQ] = EILSEQ,
+  [AIX_ECANCELED] = ECANCELED,
+  [AIX_ENOSR] = ENOSR,
+  [AIX_ETIME] = ETIME,
+  [AIX_EBADMSG] = EBADMSG,
+  [AIX_EPROTO] = EPROTO,
+  [AIX_ENODATA] = ENODATA,
+  [AIX_ENOSTR] = ENOSTR,
+  [AIX_ENOTSUP] = ENOTSUP,
+  [AIX_EMULTIHOP] = EMULTIHOP,
+  [AIX_ENOLINK] = ENOLINK,
+  [AIX_EOVERFLOW] = EOVERFLOW
+};
+
+
+int
+__errno_aix_to_linux (int err)
+{
+  int conv;
+
+  if (err >= 0 && err < (sizeof (mapping) / sizeof (mapping[0]))
+      && ((conv = mapping[err]) != 0 || err == 0))
+    return conv;
+
+  /* The error value is not known.  Create a special value which can
+     be easily recognized as an invalid result.  */
+  return 512 + err;
+}
diff --git a/sysdeps/unix/sysv/linux/powerpc/aix/statconv.c b/sysdeps/unix/sysv/linux/powerpc/aix/statconv.c
new file mode 100644
index 0000000000..3810eb6543
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/aix/statconv.c
@@ -0,0 +1,53 @@
+/* Copyright (C) 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.  */
+
+void
+__stat_aix_to_linux (const struct aixstat *aixstat, struct stat *linuxstat)
+{
+  linuxstat->st_dev = makedev (aix_major (aixstat->st_dev),
+			       aix_minor (aixstat->st_dev));
+  linuxstat->st_ino = aixstat->st_ino;
+  /* The following assumes that the mode values are the same on AIX
+     and Linux which is true in the moment.  */
+  linuxstat->st_mode = aixstat->st_mode;
+  linuxstat->st_nlink = aixstat->st_nlink;
+  /* There is no st_flag field in Linux.  */
+  linuxstat->st_uid = aixstat->st_uid;
+  linuxstat->st_gid = aixstat->st_gid;
+  linuxstat->st_rdev = makedev (aix_major (aixstat->st_rdev),
+				aix_minor (aixstat->st_rdev));
+  linuxstat->st_size = aixstat->st_size;
+  linuxstat->st_atime = aixstat->st_atime;
+  linuxstat->st_mtime = aixstat->st_mtime;
+  linuxstat->st_ctime = aixstat->st_ctime;
+  linuxstat->st_blksize = aixstat->st_blksize;
+  linuxstat->st_blocks = aixstat->st_blocks;
+  /* There is no st_vfstype in Linux.  */
+  /* There is no st_vfs in Linux.  */
+  /* There is no st_type in Linux.  */
+  /* There is no st_gen in Linux.  */
+
+  /* File in the padding values with repeatable values.  */
+  linuxstat->__pad1 = 0;
+  linuxstat->__pad2 = 0;
+  linuxstat->__unused1 = 0;
+  linuxstat->__unused2 = 0;
+  linuxstat->__unused3 = 0;
+  linuxstat->__unused4 = 0;
+  linuxstat->__unused5 = 0;
+}
diff --git a/sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c b/sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c
new file mode 100644
index 0000000000..bf3b2d638c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/powerpc/aix/tcsetattr.c
@@ -0,0 +1,171 @@
+/* Copyright (C) 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 <errno.h>
+#include <termios.h>
+#include "aix-termios.h"
+
+int
+tcsetattr (fd, optional_actions, linuxtermios_p)
+     int fd;
+     int optional_actions;
+     const struct termios *linuxtermios_p;
+{
+  struct aixtermios aixtermios;
+  int result;
+
+  /* `optional_actions' does not have to be changed, AIX uses the
+     same values as Linux.  */
+
+  aixtermios.c_cc[AIX_VINTR] = linuxtermios_p->c_cc[VINTR];
+  aixtermios.c_cc[AIX_VQUIT] = linuxtermios_p->c_cc[VQUIT];
+  aixtermios.c_cc[AIX_VERASE] = linuxtermios_p->c_cc[VERASE];
+  aixtermios.c_cc[AIX_VKILL] = linuxtermios_p->c_cc[VKILL];
+  aixtermios.c_cc[AIX_VEOF] = linuxtermios_p->c_cc[VEOF];
+  // XXX VMIN has the same value as VEOF !?
+  aixtermios.c_cc[AIX_VEOL] = linuxtermios_p->c_cc[VEOL];
+  // XXX VTIME has the same value as VEOL !?
+  aixtermios.c_cc[AIX_VEOL2] = linuxtermios_p->c_cc[VEOL2];
+  aixtermios.c_cc[AIX_VSTART] = linuxtermios_p->c_cc[VSTART];
+  aixtermios.c_cc[AIX_VSTOP] = linuxtermios_p->c_cc[VSTOP];
+  aixtermios.c_cc[AIX_VSUSP] = linuxtermios_p->c_cc[VSUSP];
+  aixtermios.c_cc[AIX_VDSUSP] = 0; // XXX No Linux equivalent !?
+  aixtermios.c_cc[AIX_VREPRINT] = linuxtermios_p->c_cc[VREPRINT];
+  aixtermios.c_cc[AIX_VDISCARD] = linuxtermios_p->c_cc[VDISCARD];
+  aixtermios.c_cc[AIX_VWERASE] = linuxtermios_p->c_cc[VWERASE];
+  aixtermios.c_cc[AIX_VLNEXT] = linuxtermios_p->c_cc[VLNEXT];
+
+  /* AIX has not all the speeds (the high one) Linux supports.  The
+     symbol names and values used for the speeds are fortunately the
+     same.  */
+  if ((linuxtermios_p->c_cflag & CBAUD) > B38400)
+    {
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  aixtermios.c_c_flag = linuxtermios_p->c_cflag & CBAUD;
+
+  /* Only the IUCLC, IXANY, and IMAXBEL values are different in the
+     c_iflag member.  */
+  aixtermios.c_iflag = linuxtermios_p->c_iflag & 0x7ff;
+  if (linuxtermios_p->c_iflag & IXANY)
+    aixtermios.c_iflag |= AIX_IXANY;
+  if (linuxtermios_p->c_iflag & IUCLC)
+    aixtermios.c_iflag |= AIX_IUCLC;
+  if (linuxtermios_p->c_iflag & IMAXBEL)
+    aixtermios.c_iflag |= AIX_IMAXBEL;
+
+  /* Many of the c_oflag files differ.  Bummer.  */
+  aixtermios.c_oflag = (linuxtermios_p->c_oflag
+			& (OPOST | OCRNL | ONOCR | ONLRET | OFILL
+			   | OFDEL | TABDLY));
+  if (linuxtermios_p->c_oflag & OLCUC)
+    aixtermios.c_oflag |= AIX_OLCUC;
+  if (linuxtermios_p->c_oflag & ONLCR)
+    aixtermios.c_oflag |= AIX_ONLCR;
+  if (linuxtermios_p->c_oflag & NLDLY)
+    {
+      if ((linuxtermios_p->c_oflag & NLDLY) >= NL2)
+	{
+	  __set_errno (EINVAL);
+	  return -1;
+	}
+
+      if (linuxtermios_p->c_oflag & NLDLY)
+	aixtermios.c_oflag |= AIX_NL1;
+    }
+  if (linuxtermios_p->c_oflag & TABDLY)
+    {
+#define offset 2
+#if TAB0 >> offset != AIX_TAB1 || TAB1 >> offset != AIX_TAB3
+# error "Check the offset"
+#endif
+      aixtermios.c_oflag |= (linuxtermios_p->c_oflag >> offset) & AIX_TABDLY;
+#undef offset
+    }
+  if (linuxtermios_p->c_oflag & FFDLY)
+    aixtermios.c_oflag |= AIX_FF1;
+  if (linuxtermios_p->c_oflag & BSDLY)
+    aixtermios.c_oflag |= AIX_BS1;
+  if (linuxtermios_p->c_oflag & VTDLY)
+    aixtermios.c_oflag |= AIX_VT1;
+
+  /* A lot of the c_cflag member is also different.  */
+  if (linuxtermios_p->c_cflag & CSIZE)
+    {
+#define offset 4
+#if LINUX_CSIZE >> offset != AIX_CSIZE
+# error "Check the offset"
+#endif
+      aixtermios.c_cflag |= (linuxtermios_p->c_cflag >> offset) & AIX_CSIZE;
+#undef offset
+    }
+
+  if (linuxtermios_p->c_cflag & STOPB)
+    aixtermios.c_cflag |= AIX_STOPB;
+  if (linuxtermios_p->c_cflag & CREAD)
+    aixtermios.c_cflag |= AIX_CREAD;
+  if (linuxtermios_p->c_cflag & PARENB)
+    aixtermios.c_cflag |= AIX_PARENB;
+  if (linuxtermios_p->c_cflag & PARODD)
+    aixtermios.c_cflag |= AIX_PARODD;
+  if (linuxtermios_p->c_cflag & HUPCL)
+    aixtermios.c_cflag |= AIX_HUPCL;
+  if (linuxtermios_p->c_cflag & CLOCAL)
+    aixtermios.c_cflag |= AIX_CLOCAL;
+
+  /* The c_lflag is information is also different.  */
+  aixtermios.c_lflag = 0;
+  if (linuxtermios_p->c_lflag & ISIG)
+    aixtermios.c_lflag |= AIX_ISIG;
+  if (linuxtermios_p->c_lflag & ICANON)
+    aixtermios.c_lflag |= AIX_ICANON;
+  if (linuxtermios_p->c_lflag & XCASE)
+    aixtermios.c_lflag |= AIX_XCASE;
+  if (linuxtermios_p->c_lflag & ECHO)
+    aixtermios.c_lflag |= AIX_ECHO;
+  if (linuxtermios_p->c_lflag & ECHOE)
+    aixtermios.c_lflag |= AIX_ECHOE;
+  if (linuxtermios_p->c_lflag & ECHOK)
+    aixtermios.c_lflag |= AIX_ECHOK;
+  if (linuxtermios_p->c_lflag & ECHONL)
+    aixtermios.c_lflag |= AIX_ECHONL;
+  if (linuxtermios_p->c_lflag & NOFLSH)
+    aixtermios.c_lflag |= AIX_NOFLSH;
+  if (linuxtermios_p->c_lflag & TOSTOP)
+    aixtermios.c_lflag |= AIX_TOSTOP;
+  if (linuxtermios_p->c_lflag & ECHOCTL)
+    aixtermios.c_lflag |= AIX_ECHOCTL;
+  if (linuxtermios_p->c_lflag & ECHOPRT)
+    aixtermios.c_lflag |= AIX_ECHOPRT;
+  if (linuxtermios_p->c_lflag & ECHOKE)
+    aixtermios.c_lflag |= AIX_ECHOKE;
+  if (linuxtermios_p->c_lflag & FLUSHO)
+    aixtermios.c_lflag |= AIX_FLUSHO;
+  if (linuxtermios_p->c_lflag & PENDIN)
+    aixtermios.c_lflag |= AIX_PENDIN;
+  if (linuxtermios_p->c_lflag & IEXTEN)
+    aixtermios.c_lflag |= AIX_IEXTEN;
+
+  result = /* XXX syscall */;
+
+  // Convert error here or in syscall.
+
+  return result;
+}