int
main (void)
{
  struct stat statinfo[NFILES];
  struct timespec modtimes[NFILES];
  struct timespec birthtimes[NFILES];

#ifdef SIGHUP
  signal (SIGHUP, cleanup);
#endif
#ifdef SIGINT
  signal (SIGINT, cleanup);
#endif
#ifdef SIGQUIT
  signal (SIGQUIT, cleanup);
#endif
#ifdef SIGTERM
  signal (SIGTERM, cleanup);
#endif

  cleanup (0);
  prepare_test (statinfo, modtimes);
  test_mtime (statinfo, modtimes);
  test_ctime (statinfo);
  test_birthtime (statinfo, modtimes, birthtimes);

  cleanup (0);
  return 0;
}
Exemple #2
0
int
main ()
{
    struct stat statinfo[NFILES];
    struct timespec modtimes[NFILES];
    struct timespec birthtimes[NFILES];

#ifdef SIGHUP
    signal (SIGHUP, cleanup);
#endif
#ifdef SIGINT
    signal (SIGINT, cleanup);
#endif
#ifdef SIGQUIT
    signal (SIGQUIT, cleanup);
#endif
#ifdef SIGTERM
    signal (SIGTERM, cleanup);
#endif

    cleanup (0);
    prepare_test (statinfo, modtimes);
    test_mtime (statinfo, modtimes);
    /* Skip the ctime tests on native Windows platforms, because there st_ctime
       is either the same as st_mtime (plus or minus an offset) or set to the
       file _creation_ time, and is not influenced by rename or chmod.  */
#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
    test_ctime (statinfo);
#endif
    test_birthtime (statinfo, modtimes, birthtimes);

    cleanup (0);
    return 0;
}