This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
[PATCH] ppc64 changes common powerpc/bits headers
- From: Steve Munroe <sjmunroe at vnet dot ibm dot com>
- To: libc-alpha at sources dot redhat dot com
- Cc: aj at suse dot de, geoffk at geoffk dot org, roland at frob dot com
- Date: Fri, 27 Sep 2002 12:57:19 -0500
- Subject: [PATCH] ppc64 changes common powerpc/bits headers
The following patches complete the glibc support PowerPC64. Since this is our
last chance to change the kernel/glibc interface (for PPC64) and clean out
any cruft (required for PPC32 backward compatibility but irrelevant to PPC64),
we decided to "fix a few things".
For example: Normalize the kernel and glibc to a single struct stat and
eliminate kernel_stat for PPC64. Eliminate unnecessary padding from
the ipc structs PPC64. And finally fix a few latent bugs we found in LTP
testing.
These changes require a new Linux 2.4.19 kernel to match these structs
and execute the corresponding syscalls correctly.
2002-09-27 Steven Munroe <sjmunroe@us.ibm.com>
* README: Minimum Linux kernel for powerpc64 is 2.4.19.
* sysdeps/unix/sysv/linux/powerpc/bits/ipc.h [__WORDSIZE]: Adjust size
and alignment of fields in struct ipc_perm for 64-bit.
* sysdeps/unix/sysv/linux/powerpc/bits/msq.h [__WORDSIZE]: Only 32-bit
requires padding for struct msqid_ds.
* sysdeps/unix/sysv/linux/powerpc/bits/sem.h [__WORDSIZE]: Only 32-bit
requires padding for struct semid_ds.
* sysdeps/unix/sysv/linux/powerpc/bits/shm.h [__WORDSIZE]: Only 32-bit
requires padding for struct shmid_ds.
* sysdeps/unix/sysv/linux/powerpc/bits/socket.h: New file.
* sysdeps/unix/sysv/linux/powerpc/bits/stat.h [__WORDSIZE]: Only 32-bit
requires padding for structs stat and stat64.
* sysdeps/unix/sysv/linux/powerpc/bits/statfs.h: New file.
* sysdeps/unix/sysv/linux/powerpc/bits/statvfs.h: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/fxstat.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/fxstat64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/lxstat.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/lxstat64.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/xstat.c: New file.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/xstat64.c: New file.
diff -rupPN libc23-cvstip-20020923/README libc23-ppc64-stat/README
--- libc23-cvstip-20020923/README Thu Sep 19 00:41:32 2002
+++ libc23-ppc64-stat/README Fri Sep 27 10:59:18 2002
@@ -10,7 +10,7 @@ configurations:
m68k-*-linux-gnu Linux-2.x on Motorola 680x0
alpha*-*-linux-gnu Linux-2.x on DEC Alpha
powerpc-*-linux-gnu Linux and MkLinux on PowerPC systems
- powerpc64-*-linux-gnu Linux-2.4+ on 64-bit PowerPC systems
+ powerpc64-*-linux-gnu Linux-2.4.19 on 64-bit PowerPC systems
sparc-*-linux-gnu Linux-2.x on SPARC
sparc64-*-linux-gnu Linux-2.x on UltraSPARC 64-bit
arm-*-none ARM standalone systems
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/ipc.h libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/ipc.h
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/ipc.h Thu Jul 5 23:56:19 2001
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/ipc.h Tue Sep 24 09:52:42 2002
@@ -48,10 +48,17 @@ struct ipc_perm
__uid_t cuid; /* Creator's user ID. */
__gid_t cgid; /* Creator's group ID. */
__mode_t mode; /* Read/write permission. */
+#if __WORDSIZE == 32
unsigned long int __seq; /* Sequence number. */
unsigned int __pad1;
unsigned long long int __unused1;
unsigned long long int __unused2;
+#else
+ unsigned int __seq; /* Sequence number. */
+ unsigned int __pad1;
+ unsigned long int __unused1;
+ unsigned long int __unused2;
+#endif
};
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/msq.h libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/msq.h
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/msq.h Thu Jul 5 23:56:19 2001
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/msq.h Fri Sep 27 10:44:30 2002
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 2000, 2002 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
@@ -38,11 +38,17 @@ typedef unsigned long int msglen_t;
struct msqid_ds
{
struct ipc_perm msg_perm; /* structure describing operation permission */
+#if __WORDSIZE == 32
unsigned int __unused1;
+#endif
__time_t msg_stime; /* time of last msgsnd command */
+#if __WORDSIZE == 32
unsigned int __unused2;
+#endif
__time_t msg_rtime; /* time of last msgrcv command */
+#if __WORDSIZE == 32
unsigned int __unused3;
+#endif
__time_t msg_ctime; /* time of last change */
unsigned long __msg_cbytes; /* current number of bytes on queue */
msgqnum_t msg_qnum; /* number of messages currently on queue */
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/sem.h libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/sem.h
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/sem.h Thu Jul 5 23:56:19 2001
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/sem.h Fri Sep 27 10:45:18 2002
@@ -1,4 +1,5 @@
-/* Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002
+ 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
@@ -39,9 +40,13 @@
struct semid_ds
{
struct ipc_perm sem_perm; /* operation permission struct */
+#if __WORDSIZE == 32
unsigned int __unused1;
+#endif
__time_t sem_otime; /* last semop() time */
+#if __WORDSIZE == 32
unsigned int __unused2;
+#endif
__time_t sem_ctime; /* last time changed by semctl() */
unsigned long int sem_nsems; /* number of semaphores in set */
unsigned long __unused3;
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/shm.h libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/shm.h
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/shm.h Fri Aug 23 17:26:25 2002
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/shm.h Tue Sep 24 10:21:15 2002
@@ -47,13 +47,21 @@ typedef unsigned long int shmatt_t;
struct shmid_ds
{
struct ipc_perm shm_perm; /* operation permission struct */
+#if __WORDSIZE == 32
unsigned int __unused1;
+#endif
__time_t shm_atime; /* time of last shmat() */
+#if __WORDSIZE == 32
unsigned int __unused2;
+#endif
__time_t shm_dtime; /* time of last shmdt() */
+#if __WORDSIZE == 32
unsigned int __unused3;
- __time_t shm_ctime; /* time of last change by shmctl() */
+#endif
+ __time_t shm_ctime; /* time of last change by shmctl() */
+#if __WORDSIZE == 32
unsigned int __unused4;
+#endif
size_t shm_segsz; /* size of segment in bytes */
__pid_t shm_cpid; /* pid of creator */
__pid_t shm_lpid; /* pid of last shmop */
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/socket.h libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/socket.h
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/socket.h Wed Dec 31 18:00:00 1969
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/socket.h Tue Sep 24 09:52:42 2002
@@ -0,0 +1,320 @@
+/* System-specific socket constants and types. Linux/PowerPC64 version.
+ Copyright (C) 1991,1992,1994-1999,2000,2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#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. */
+#ifndef __socklen_t_defined
+typedef __socklen_t socklen_t;
+# define __socklen_t_defined
+#endif
+
+/* 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_PPPOX 24 /* PPPoX sockets. */
+#define PF_WANPIPE 25 /* Wanpipe API sockets. */
+#define PF_BLUETOOTH 31 /* Bluetooth 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_PPPOX PF_PPPOX
+#define AF_WANPIPE PF_WANPIPE
+#define AF_BLUETOOTH PF_BLUETOOTH
+#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_CONFIRM = 0x800, /* Confirm path validity. */
+#define MSG_CONFIRM MSG_CONFIRM
+ 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
+ MSG_MORE = 0x8000 /* Sender will send more. */
+#define MSG_MORE MSG_MORE
+ };
+
+
+/* Structure describing messages sent by
+ `sendmsg' and received by `recvmsg'. */
+struct msghdr
+ {
+ void *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. */
+
+ void *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__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+ __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */
+#endif
+ };
+
+/* Ancillary data object manipulation macros. */
+#if (!defined __STRICT_ANSI__ && __GNUC__ >= 2) || __STDC_VERSION__ >= 199901L
+# 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) \
+ & (size_t) ~(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 (struct msghdr *__mhdr,
+ struct cmsghdr *__cmsg) __THROW;
+#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));
+#ifdef __powerpc64__
+ if ((unsigned char *) (__cmsg + 1) >= ((unsigned char *) __mhdr->msg_control
+ + __mhdr->msg_controllen)
+# else
+ if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) __mhdr->msg_control
+ + __mhdr->msg_controllen)
+# endif /* __powerpc64__ */
+ || ((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 -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/stat.h libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/stat.h Thu Jul 5 23:56:19 2001
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/stat.h Fri Sep 27 10:47:01 2002
@@ -1,4 +1,5 @@
-/* Copyright (C) 1992,95,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+ 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
@@ -33,44 +34,47 @@
#define _MKNOD_VER _MKNOD_VER_LINUX /* The bits defined below. */
+#if __WORDSIZE == 32
+
struct stat
{
__dev_t st_dev; /* Device. */
-#ifndef __USE_FILE_OFFSET64
+# ifndef __USE_FILE_OFFSET64
unsigned short int __pad1;
__ino_t st_ino; /* File serial number. */
-#else
+# else
__ino64_t st_ino; /* File serial number. */
-#endif
+# 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
+# ifndef __USE_FILE_OFFSET64
__off_t st_size; /* Size of file, in bytes. */
-#else
+# else
__off64_t st_size; /* Size of file, in bytes. */
-#endif
+# endif
__blksize_t st_blksize; /* Optimal block size for I/O. */
-#ifndef __USE_FILE_OFFSET64
+# ifndef __USE_FILE_OFFSET64
__blkcnt_t st_blocks; /* Number 512-byte blocks allocated. */
-#else
+# else
__blkcnt64_t st_blocks; /* Number 512-byte blocks allocated. */
-#endif
+# endif
__time_t st_atime; /* Time of last access. */
- unsigned long int __unused1;
+ unsigned long int __unused1; /* Reserved for atime.nanoseconds. */
__time_t st_mtime; /* Time of last modification. */
- unsigned long int __unused2;
+ unsigned long int __unused2; /* Reserved for mtime.nanoseconds. */
__time_t st_ctime; /* Time of last status change. */
- unsigned long int __unused3;
+ unsigned long int __unused3; /* Reserved for ctime.nanoseconds. */
unsigned long int __unused4;
unsigned long int __unused5;
};
-#ifdef __USE_LARGEFILE64
+
+# ifdef __USE_LARGEFILE64
struct stat64
{
__dev_t st_dev; /* Device. */
@@ -83,18 +87,84 @@ struct stat64
unsigned short int __pad2;
__off64_t st_size; /* Size of file, in bytes. */
__blksize_t 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; /* Reserved for atime.nanoseconds. */
+ __time_t st_mtime; /* Time of last modification. */
+ unsigned long int __unused2; /* Reserved for mtime.nanoseconds. */
+ __time_t st_ctime; /* Time of last status change. */
+ unsigned long int __unused3; /* Reserved for ctime.nanoseconds. */
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+ };
+# endif /* __USE_LARGEFILE64 */
+
+#else /* __WORDSIZE == 32 */
+
+struct stat
+ {
+ __dev_t st_dev; /* Device. */
+# ifndef __USE_FILE_OFFSET64
+ __ino_t st_ino; /* File serial number. */
+# else
+ __ino64_t st_ino; /* File serial number. */
+# endif
+ __nlink_t st_nlink; /* Link count. */
+ __mode_t st_mode; /* File mode. */
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+ int __pad1;
+ __dev_t st_rdev; /* Device number, if device. */
+# ifndef __USE_FILE_OFFSET64
+ __off_t st_size; /* Size of file, in bytes. */
+# else
+ __off64_t st_size; /* Size of file, in bytes. */
+# endif
+ __blksize_t 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; /* Reserved for atime.nanoseconds. */
+ __time_t st_mtime; /* Time of last modification. */
+ unsigned long int __unused2; /* Reserved for mtime.nanoseconds. */
+ __time_t st_ctime; /* Time of last status change. */
+ unsigned long int __unused3; /* Reserved for ctime.nanoseconds. */
+ unsigned long int __unused4;
+ unsigned long int __unused5;
+ unsigned long int __unused6;
+ };
+# ifdef __USE_LARGEFILE64
+struct stat64
+ {
+ __dev_t st_dev; /* Device. */
+ __ino64_t st_ino; /* File serial number. */
+ __nlink_t st_nlink; /* Link count. */
+ __mode_t st_mode; /* File mode. */
+ __uid_t st_uid; /* User ID of the file's owner. */
+ __gid_t st_gid; /* Group ID of the file's group.*/
+ int __pad1;
+ __dev_t st_rdev; /* Device number, if device. */
+ __off64_t st_size; /* Size of file, in bytes. */
+ __blksize_t 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;
+ unsigned long int __unused1; /* Reserved for atime.nanoseconds. */
__time_t st_mtime; /* Time of last modification. */
- unsigned long int __unused2;
+ unsigned long int __unused2; /* Reserved for mtime.nanoseconds. */
__time_t st_ctime; /* Time of last status change. */
- unsigned long int __unused3;
+ unsigned long int __unused3; /* Reserved for ctime.nanoseconds. */
unsigned long int __unused4;
unsigned long int __unused5;
+ unsigned long int __unused6;
};
+# endif /* __USE_LARGEFILE64 */
#endif
+
/* Tell code we have these members. */
#define _STATBUF_ST_BLKSIZE
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/statfs.h libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/statfs.h
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/statfs.h Wed Dec 31 18:00:00 1969
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/statfs.h Tue Sep 24 09:52:42 2002
@@ -0,0 +1,67 @@
+/* Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* File sysdeps/generic/bits/statfs.h does not match powerpc64 kernel. So
+ copied from sysdeps/unix/sysv/linux/sparc/bits which does. */
+
+#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
+ {
+ long int f_type;
+ long 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;
+ long int f_namelen;
+ long int f_spare[6];
+ };
+
+#ifdef __USE_LARGEFILE64
+struct statfs64
+ {
+ long int f_type;
+ long 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;
+ long int f_namelen;
+ long int f_spare[6];
+ };
+#endif
+
+/* Tell code we have these members. */
+#define _STATFS_F_NAMELEN
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/statvfs.h libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/statvfs.h
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/bits/statvfs.h Wed Dec 31 18:00:00 1969
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/bits/statvfs.h Tue Sep 24 09:52:42 2002
@@ -0,0 +1,110 @@
+/* Copyright (C) 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* File sysdeps/generic/bits/statvfs.h does not match powerpc64 kernel. So
+ copied from sysdeps/unix/sysv/linux/sparc/bits which does. */
+
+#ifndef _SYS_STATVFS_H
+# error "Never include <bits/statvfs.h> directly; use <sys/statvfs.h> instead."
+#endif
+
+#include <bits/types.h> /* For __fsblkcnt_t and __fsfilcnt_t. */
+
+#if __WORDSIZE == 32
+#define _STATVFSBUF_F_UNUSED
+#endif
+
+struct statvfs
+ {
+ unsigned long int f_bsize;
+ unsigned long int f_frsize;
+#ifndef __USE_FILE_OFFSET64
+ __fsblkcnt_t f_blocks;
+ __fsblkcnt_t f_bfree;
+ __fsblkcnt_t f_bavail;
+ __fsfilcnt_t f_files;
+ __fsfilcnt_t f_ffree;
+ __fsfilcnt_t f_favail;
+#else
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __fsfilcnt64_t f_favail;
+#endif
+ unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+ int __f_unused;
+#endif
+ unsigned long int f_flag;
+ unsigned long int f_namemax;
+ int __f_spare[6];
+ };
+
+#ifdef __USE_LARGEFILE64
+struct statvfs64
+ {
+ unsigned long int f_bsize;
+ unsigned long int f_frsize;
+ __fsblkcnt64_t f_blocks;
+ __fsblkcnt64_t f_bfree;
+ __fsblkcnt64_t f_bavail;
+ __fsfilcnt64_t f_files;
+ __fsfilcnt64_t f_ffree;
+ __fsfilcnt64_t f_favail;
+ unsigned long int f_fsid;
+#ifdef _STATVFSBUF_F_UNUSED
+ int __f_unused;
+#endif
+ unsigned long int f_flag;
+ unsigned long int f_namemax;
+ int __f_spare[6];
+ };
+#endif
+
+/* Definitions for the flag in `f_flag'. These definitions should be
+ kept in sync with the definitions in <sys/mount.h>. */
+enum
+{
+ ST_RDONLY = 1, /* Mount read-only. */
+#define ST_RDONLY ST_RDONLY
+ ST_NOSUID = 2 /* Ignore suid and sgid bits. */
+#define ST_NOSUID ST_NOSUID
+#ifdef __USE_GNU
+ ,
+ ST_NODEV = 4, /* Disallow access to device special files. */
+# define ST_NODEV ST_NODEV
+ ST_NOEXEC = 8, /* Disallow program execution. */
+# define ST_NOEXEC ST_NOEXEC
+ ST_SYNCHRONOUS = 16, /* Writes are synced at once. */
+# define ST_SYNCHRONOUS ST_SYNCHRONOUS
+ ST_MANDLOCK = 64, /* Allow mandatory locks on an FS. */
+# define ST_MANDLOCK ST_MANDLOCK
+ ST_WRITE = 128, /* Write on file/directory/symlink. */
+# define ST_WRITE ST_WRITE
+ ST_APPEND = 256, /* Append-only file. */
+# define ST_APPEND ST_APPEND
+ ST_IMMUTABLE = 512, /* Immutable file. */
+# define ST_IMMUTABLE ST_IMMUTABLE
+ ST_NOATIME = 1024, /* Do not update access times. */
+# define ST_NOATIME ST_NOATIME
+ ST_NODIRATIME = 2048 /* Do not update directory access times. */
+# define ST_NODIRATIME ST_NODIRATIME
+#endif /* Use GNU. */
+};
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/powerpc64/fxstat.c libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/powerpc64/fxstat.c
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/powerpc64/fxstat.c Wed Dec 31 18:00:00 1969
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/powerpc64/fxstat.c Thu Sep 26 14:34:43 2002
@@ -0,0 +1,45 @@
+/* fxstat using old-style Unix fstat system call.
+ Copyright (C) 1991,95,96,97,98,2000,2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Ho hum, since xstat == xstat64 we must get rid of the prototype or gcc
+ will complain since they don't strictly match. */
+#define __fxstat64 __fxstat64_disable
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+extern int __syscall_fstat (int, struct stat *__unbounded);
+
+/* Get information about the file FD in BUF. */
+int
+__fxstat (int vers, int fd, struct stat *buf)
+{
+ return INLINE_SYSCALL (fstat, 2, fd, CHECK_1 (buf));
+}
+
+hidden_def (__fxstat)
+weak_alias (__fxstat, _fxstat);
+#undef __fxstat64
+strong_alias (__fxstat, __fxstat64);
+hidden_ver (__fxstat, __fxstat64)
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/powerpc64/fxstat64.c libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/powerpc64/fxstat64.c
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/powerpc64/fxstat64.c Wed Dec 31 18:00:00 1969
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/powerpc64/fxstat64.c Tue Sep 24 10:54:39 2002
@@ -0,0 +1 @@
+/* fxstat64 is in fxstat.c */
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/powerpc64/lxstat.c libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/powerpc64/lxstat.c
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/powerpc64/lxstat.c Wed Dec 31 18:00:00 1969
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/powerpc64/lxstat.c Thu Sep 26 14:34:50 2002
@@ -0,0 +1,45 @@
+/* lxstat using old-style Unix fstat system call.
+ Copyright (C) 1991,95,96,97,98,2000,2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Ho hum, since xstat == xstat64 we must get rid of the prototype or gcc
+ will complain since they don't strictly match. */
+#define __lxstat64 __lxstat64_disable
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+extern int __syscall_lstat (const char *__unbounded, struct stat *__unbounded);
+
+/* Get information about the file FD in BUF. */
+int
+__lxstat (int vers, const char *name, struct stat *buf)
+{
+ return INLINE_SYSCALL (lstat, 2, CHECK_STRING (name), CHECK_1 (buf));
+}
+
+hidden_def (__lxstat)
+weak_alias (__lxstat, _lxstat);
+#undef __lxstat64
+strong_alias (__lxstat, __lxstat64);
+hidden_ver (__lxstat, __lxstat64)
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/powerpc64/lxstat64.c libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/powerpc64/lxstat64.c
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/powerpc64/lxstat64.c Wed Dec 31 18:00:00 1969
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/powerpc64/lxstat64.c Tue Sep 24 10:54:39 2002
@@ -0,0 +1 @@
+/* lxstat64 is in lxstat.c */
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/powerpc64/xstat.c libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/powerpc64/xstat.c
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/powerpc64/xstat.c Wed Dec 31 18:00:00 1969
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/powerpc64/xstat.c Thu Sep 26 14:34:55 2002
@@ -0,0 +1,44 @@
+/* xstat using old-style Unix stat system call.
+ Copyright (C) 1991,95,96,97,98,2000,2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* Ho hum, since xstat == xstat64 we must get rid of the prototype or gcc
+ will complain since they don't strictly match. */
+#define __xstat64 __xstat64_disable
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+
+#include <sysdep.h>
+#include <sys/syscall.h>
+#include <bp-checks.h>
+
+extern int __syscall_stat (const char *__unbounded, struct stat *__unbounded);
+
+/* Get information about the file NAME in BUF. */
+int
+__xstat (int vers, const char *name, struct stat *buf)
+{
+ return INLINE_SYSCALL (stat, 2, name, CHECK_1 (buf));
+}
+hidden_def (__xstat)
+weak_alias (__xstat, _xstat);
+#undef __xstat64
+strong_alias (__xstat, __xstat64);
+hidden_ver (__xstat, __xstat64)
diff -rupPN libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/powerpc64/xstat64.c libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/powerpc64/xstat64.c
--- libc23-cvstip-20020923/sysdeps/unix/sysv/linux/powerpc/powerpc64/xstat64.c Wed Dec 31 18:00:00 1969
+++ libc23-ppc64-stat/sysdeps/unix/sysv/linux/powerpc/powerpc64/xstat64.c Tue Sep 24 10:54:39 2002
@@ -0,0 +1 @@
+/* xstat64 is in xstat.c */