From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4930 invoked by alias); 16 May 2012 10:57:51 -0000 Received: (qmail 4922 invoked by uid 22791); 16 May 2012 10:57:50 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 16 May 2012 10:57:18 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1SUbuw-0003I4-59 from joseph_myers@mentor.com for libc-ports@sourceware.org; Wed, 16 May 2012 03:57:18 -0700 Received: from digraph.polyomino.org.uk ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 16 May 2012 11:57:16 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.74) (envelope-from ) id 1SUbus-00041U-TV for libc-ports@sourceware.org; Wed, 16 May 2012 10:57:14 +0000 Date: Wed, 16 May 2012 10:57:00 -0000 From: "Joseph S. Myers" To: libc-ports@sourceware.org Subject: Declare MIPS stat nanoseconds fields similarly to other architectures Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00093.txt.bz2 I noticed that the MIPS bits/stat.h was different from other architectures in how it handled nanoseconds fields: in the case where struct timespec fields were not being declared, the nanoseconds were __reserved* instead of having st_atimensec etc. names. I've applied this patch to make MIPS consistent in the API provided with other architectures. (There are no layout issues since "unsigned long", the type used elsewhere for nanoseconds, is consistent with the type in struct timespec, and on n64 where the fields were "int" (32-bit) and now are "unsigned long" (64-bit) that "int" was always followed by 32 bits of padding since both __time_t and __blksize_t were 64-bit in that case.) diff --git a/ChangeLog.mips b/ChangeLog.mips index db20a78..db16b4b 100644 --- a/ChangeLog.mips +++ b/ChangeLog.mips @@ -1,3 +1,11 @@ +2012-05-16 Joseph Myers + + * sysdeps/unix/sysv/linux/mips/bits/stat.h (struct stat) + [!__USE_MISC && !__USE_XOPEN2K8]: Declare nanoseconds fields with + type unsigned long and names st_atimensec, st_mtimensec and + st_ctimensec. + (struct stat64) [!__USE_MISC && !__USE_XOPEN2K8]: Likewise. + 2012-05-14 Joseph Myers * sysdeps/unix/sysv/linux/mips/pread.c [!__ASSUME_PREAD_SYSCALL]: diff --git a/sysdeps/unix/sysv/linux/mips/bits/stat.h b/sysdeps/unix/sysv/linux/mips/bits/stat.h index 7c30b4d..f65bae4 100644 --- a/sysdeps/unix/sysv/linux/mips/bits/stat.h +++ b/sysdeps/unix/sysv/linux/mips/bits/stat.h @@ -1,5 +1,4 @@ -/* Copyright (C) 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, - 2007, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 1992-2012 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 @@ -77,12 +76,12 @@ struct stat # define st_mtime st_mtim.tv_sec # define st_ctime st_ctim.tv_sec #else - __time_t st_atime; /* Time of last access. */ - long int __reserved0; - __time_t st_mtime; /* Time of last modification. */ - long int __reserved1; - __time_t st_ctime; /* Time of last status change. */ - long int __reserved2; + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ #endif __blksize_t st_blksize; /* Optimal block size for I/O. */ #ifndef __USE_FILE_OFFSET64 @@ -118,12 +117,12 @@ struct stat64 struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ # else - __time_t st_atime; /* Time of last access. */ - long int __reserved0; - __time_t st_mtime; /* Time of last modification. */ - long int __reserved1; - __time_t st_ctime; /* Time of last status change. */ - long int __reserved2; + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif __blksize_t st_blksize; /* Optimal block size for I/O. */ long int st_pad3; @@ -168,12 +167,12 @@ struct stat # define st_mtime st_mtim.tv_sec # define st_ctime st_ctim.tv_sec #else - __time_t st_atime; - int __reserved0; - __time_t st_mtime; - int __reserved1; - __time_t st_ctime; - int __reserved2; + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ #endif __blksize_t st_blksize; unsigned int st_pad4; @@ -209,12 +208,12 @@ struct stat64 struct timespec st_mtim; /* Time of last modification. */ struct timespec st_ctim; /* Time of last status change. */ # else - __time_t st_atime; - int __reserved0; - __time_t st_mtime; - int __reserved1; - __time_t st_ctime; - int __reserved2; + __time_t st_atime; /* Time of last access. */ + unsigned long int st_atimensec; /* Nscecs of last access. */ + __time_t st_mtime; /* Time of last modification. */ + unsigned long int st_mtimensec; /* Nsecs of last modification. */ + __time_t st_ctime; /* Time of last status change. */ + unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif __blksize_t st_blksize; unsigned int st_pad3; -- Joseph S. Myers joseph@codesourcery.com