bugThe GNU Hurd - Bugs: bug #18216, glibc: `struct stat' et al.

 
 

bug #18216: glibc: `struct stat' et al.

Submitter:  Thomas Schwinge <tschwinge>
Submitted:  Mon 06 Nov 2006 04:30:30 PM UTC
   
 
Category:  glibc Severity:  5 - Blocker
Priority:  9 - Immediate Item Group:  Standard Compliance
Status:  Fixed Privacy:  Public
Assigned to:  roland Originator Name: 
Open/Closed:  Closed Reproducibility:  Every Time
Size (loc):  None Planned Release:  None
Effort:  0.00
Wiki-like text discussion box: 


* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 05 Dec 2006 04:01:48 PM UTC, comment #2: 

It's appears to be just a matter of copy and paste that new timestamp stuff, since there is no other use of that st_atim or st_atime inside the sysdeps stuff.

Leonardo Lopes Pereira <llp>
Mon 06 Nov 2006 04:42:08 PM UTC, comment #1: 

Thomas Schwinge, le Mon 06 Nov 2006 16:30:31 +0000, a écrit :

> ../sysdeps/posix/getaddrinfo.c: In function 'gaiconf_init':
> ../sysdeps/posix/getaddrinfo.c:1798: error: 'struct stat64' has no member
> named 'st_mtim'


This is generic code, so I guess all stat64 structures need fixed the
linuxish way, hence Hurd's too.

Samuel Thibault <sthibaul>
Group administrator
Mon 06 Nov 2006 04:30:30 PM UTC, original submission:  

Building trunk versions of glibc fails (apart from other issues) like this:

#v+
i586-pc-gnu-gcc ../sysdeps/posix/getaddrinfo.c [...]
../sysdeps/posix/getaddrinfo.c: In function 'gaiconf_init':
../sysdeps/posix/getaddrinfo.c:1798: error: 'struct stat64' has no member named 'st_mtim'
../sysdeps/posix/getaddrinfo.c: In function 'gaiconf_reload':
../sysdeps/posix/getaddrinfo.c:1819: error: 'struct stat64' has no member named 'st_mtim'
../sysdeps/posix/getaddrinfo.c: In function 'getaddrinfo':
../sysdeps/posix/getaddrinfo.c:2007: error: used struct type value where scalar is required
#v-

I extracted the following relevant (at least for this issue) differences for `struct stat' and `struct stat64':

Hurd:

#v+
    __time_t st_atime;         /* Access time, seconds */
    unsigned long int st_atime_usec; /* and microseconds.  */
    __time_t st_mtime;         /* Modification time, seconds */
    unsigned long int st_mtime_usec; /* and microseconds.  */
    __time_t st_ctime;         /* Status change time, seconds */
    unsigned long int st_ctime_usec; /* and microseconds.  */
#v-

Linux:

#v+
#ifdef __USE_MISC
    /* Nanosecond resolution timestamps are stored in a format
       equivalent to 'struct timespec'.  This is the type used
       whenever possible but the Unix namespace rules do not allow the
       identifier 'timespec' to appear in the <sys/stat.h> header.
       Therefore we have to handle the use of this header in strictly
       standard-compliant sources special.  */
    struct timespec st_atim;           /* Time of last access.  */
    struct timespec st_mtim;           /* Time of last modification.  */
    struct timespec st_ctim;           /* Time of last status change.  */
# define st_atime st_atim.tv_sec       /* Backward compatibility.  */
# define st_mtime st_mtim.tv_sec
# define st_ctime st_ctim.tv_sec
#else
    __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
[...]
#define _STATBUF_ST_RDEV
/* Nanosecond resolution time values are supported.  */
#define _STATBUF_ST_NSEC
#v-

Thomas Schwinge <tschwinge>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by tschwinge (Updated the item)
  • -email is unavailable- added by llp (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-05-11 tschwinge StatusIn Progress Fixed
        Assigned totschwinge roland
        Open/ClosedOpen Closed
    2008-11-23 tschwinge StatusFixed In Progress
        Open/ClosedClosed Open
        Wiki-like text discussion boxIf I remember correctly, I fixed this some time ago already.
    2008-07-08 tschwinge StatusNone Fixed
        Assigned toNone tschwinge
        Open/ClosedOpen Closed
        Wiki-like text discussion box If I remember correctly, I fixed this some time ago already.

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code