
Raymond Toy pushed to branch master at cmucl / cmucl Commits: 13f23f79 by Raymond Toy at 2025-10-13T18:45:22-07:00 Fix #444: Use 64-bit time_t value for stat and friends - - - - - 52ce44f1 by Raymond Toy at 2025-10-13T18:45:22-07:00 Merge branch 'issue-444-b-stat-with-64-bit-time' into 'master' Fix #444: Use 64-bit time_t value for stat and friends Closes #444 See merge request cmucl/cmucl!326 - - - - - 4 changed files: - src/general-info/release-22a.md - src/lisp/os-common.c - tests/os.lisp - + tests/resources/64-bit-timestamp.txt Changes: ===================================== src/general-info/release-22a.md ===================================== @@ -24,8 +24,9 @@ public domain. * Updated CLX from upstream to version from 2024-09-11. * ANSI compliance fixes: * Bug fixes: - * #387: Update CLX from upstream to version from 2024-09-11. * Gitlab tickets: + * #387: Update CLX from upstream to version from 2024-09-11. + * #444: `unix-stat` and friends return wrong timestamp * Other changes: * Improvements to the PCL implementation of CLOS: * Changes to building procedure: ===================================== src/lisp/os-common.c ===================================== @@ -5,6 +5,11 @@ */ +#ifdef __linux__ +/* Want 64-bit time_t values for stat and friends */ +#define _TIME_BITS 64 +#endif + #include <assert.h> #include <errno.h> #include <langinfo.h> ===================================== tests/os.lisp ===================================== @@ -34,3 +34,19 @@ (system:get-user-homedir-namestring "zotuserunknown") (assert-eql home-pathname nil) (assert-eql status 0))) + +#+linux +(define-test stat.64-bit-timestamp + (:tag :issues) + (let ((test-file #.(merge-pathnames "resources/64-bit-timestamp.txt" + cl:*load-pathname*))) + (assert-true (probe-file test-file)) + (multiple-value-bind (ok st-dev st-ino st-mode st-nlink st-uid st-gid st-rdev st-size + st-atime st-mtime + st-ctime st-blksize st-blocks) + (unix:unix-stat (namestring test-file)) + (declare (ignore st-dev st-ino st-mode st-nlink st-uid st-gid st-rdev + st-ctime st-blksize st-blocks)) + (assert-true ok) + (assert-equal st-atime 2153718000) + (assert-equal st-mtime 2153718000)))) ===================================== tests/resources/64-bit-timestamp.txt ===================================== View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/e5b25a238f73321c0961cb5... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/e5b25a238f73321c0961cb5... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)