It's UWAweek 30 (2nd semester, week 1)

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying selected article
Showing 1 of 1168 articles.
Currently 3 other people reading this forum.


 UWA week 40 (2nd semester, week 10) ↓
SVG not supported

Login to reply

👍?
helpful
4:05am Fri 6th Oct, Christopher M.

Hi Ethan, I've tried mixing up the order of the header files, but I can't replicate your problem. My system: gcc version 12.3.0 (Ubuntu 12.3.0-1ubuntu1~23.04) In the file /usr/include/x86_64-linux-gnu/bits/struct_stat.h around line 75, you should have the following declaration of st_time:
# ifdef __USE_XOPEN2K8
    /* 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.  */
    __syscall_ulong_t st_atimensec;     /* Nscecs of last access.  */
    __time_t st_mtime;                  /* Time of last modification.  */
    __syscall_ulong_t st_mtimensec;     /* Nsecs of last modification.  */
    __time_t st_ctime;                  /* Time of last status change.  */
    __syscall_ulong_t st_ctimensec;     /* Nsecs of last status change.  */
# endif
If your system matches, I cannot see how the declaration of st_mtim remains.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  7:24AM Jul 25 2024
Privacy policy