99#[ test]
1010fn test_y2038_with_utimensat ( ) {
1111 use rustix:: fs:: {
12- fstat, openat, statat, utimensat, AtFlags , Mode , OFlags , StatExt , Timespec , Timestamps , CWD ,
12+ fstat, openat, statat, utimensat, AtFlags , Mode , OFlags , Timespec , Timestamps , CWD ,
1313 } ;
1414
1515 let tmp = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -46,47 +46,47 @@ fn test_y2038_with_utimensat() {
4646 // Use `statat` to read back the timestamp.
4747 let stat = statat ( & dir, "file" , AtFlags :: empty ( ) ) . unwrap ( ) ;
4848
49- assert_eq ! ( TryInto :: <u64 >:: try_into( stat. mtime ( ) ) . unwrap( ) , m_sec) ;
49+ assert_eq ! ( TryInto :: <u64 >:: try_into( stat. st_mtime ) . unwrap( ) , m_sec) ;
5050
5151 #[ cfg( not( target_os = "netbsd" ) ) ]
5252 assert_eq ! ( stat. st_mtime_nsec as u32 , m_nsec) ;
5353 #[ cfg( target_os = "netbsd" ) ]
5454 assert_eq ! ( stat. st_mtimensec as u32 , m_nsec) ;
5555
56- assert ! ( TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) >= a_sec) ;
56+ assert ! ( TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) >= a_sec) ;
5757
5858 #[ cfg( not( target_os = "netbsd" ) ) ]
5959 assert ! (
60- TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) > a_sec
60+ TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) > a_sec
6161 || stat. st_atime_nsec as u32 >= a_nsec
6262 ) ;
6363 #[ cfg( target_os = "netbsd" ) ]
6464 assert ! (
65- TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) > a_sec
65+ TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) > a_sec
6666 || stat. st_atimensec as u32 >= a_nsec
6767 ) ;
6868
6969 // Now test the same thing, but with `fstat`.
7070 let file = openat ( & dir, "file" , OFlags :: RDONLY , Mode :: empty ( ) ) . unwrap ( ) ;
7171 let stat = fstat ( & file) . unwrap ( ) ;
7272
73- assert_eq ! ( TryInto :: <u64 >:: try_into( stat. mtime ( ) ) . unwrap( ) , m_sec) ;
73+ assert_eq ! ( TryInto :: <u64 >:: try_into( stat. st_mtime ) . unwrap( ) , m_sec) ;
7474
7575 #[ cfg( not( target_os = "netbsd" ) ) ]
7676 assert_eq ! ( stat. st_mtime_nsec as u32 , m_nsec) ;
7777 #[ cfg( target_os = "netbsd" ) ]
7878 assert_eq ! ( stat. st_mtimensec as u32 , m_nsec) ;
7979
80- assert ! ( TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) >= a_sec) ;
80+ assert ! ( TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) >= a_sec) ;
8181
8282 #[ cfg( not( target_os = "netbsd" ) ) ]
8383 assert ! (
84- TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) > a_sec
84+ TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) > a_sec
8585 || stat. st_atime_nsec as u32 >= a_nsec
8686 ) ;
8787 #[ cfg( target_os = "netbsd" ) ]
8888 assert ! (
89- TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) > a_sec
89+ TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) > a_sec
9090 || stat. st_atimensec as u32 >= a_nsec
9191 ) ;
9292}
@@ -102,7 +102,7 @@ fn test_y2038_with_utimensat() {
102102#[ test]
103103fn test_y2038_with_futimens ( ) {
104104 use rustix:: fs:: {
105- fstat, futimens, openat, statat, AtFlags , Mode , OFlags , StatExt , Timespec , Timestamps , CWD ,
105+ fstat, futimens, openat, statat, AtFlags , Mode , OFlags , Timespec , Timestamps , CWD ,
106106 } ;
107107
108108 let tmp = tempfile:: tempdir ( ) . unwrap ( ) ;
@@ -139,47 +139,47 @@ fn test_y2038_with_futimens() {
139139 // Use `statat` to read back the timestamp.
140140 let stat = statat ( & dir, "file" , AtFlags :: empty ( ) ) . unwrap ( ) ;
141141
142- assert_eq ! ( TryInto :: <u64 >:: try_into( stat. mtime ( ) ) . unwrap( ) , m_sec) ;
142+ assert_eq ! ( TryInto :: <u64 >:: try_into( stat. st_mtime ) . unwrap( ) , m_sec) ;
143143
144144 #[ cfg( not( target_os = "netbsd" ) ) ]
145145 assert_eq ! ( stat. st_mtime_nsec as u32 , m_nsec) ;
146146 #[ cfg( target_os = "netbsd" ) ]
147147 assert_eq ! ( stat. st_mtimensec as u32 , m_nsec) ;
148148
149- assert ! ( TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) >= a_sec) ;
149+ assert ! ( TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) >= a_sec) ;
150150
151151 #[ cfg( not( target_os = "netbsd" ) ) ]
152152 assert ! (
153- TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) > a_sec
153+ TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) > a_sec
154154 || stat. st_atime_nsec as u32 >= a_nsec
155155 ) ;
156156 #[ cfg( target_os = "netbsd" ) ]
157157 assert ! (
158- TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) > a_sec
158+ TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) > a_sec
159159 || stat. st_atimensec as u32 >= a_nsec
160160 ) ;
161161
162162 // Now test the same thing, but with `fstat`.
163163 let file = openat ( & dir, "file" , OFlags :: RDONLY , Mode :: empty ( ) ) . unwrap ( ) ;
164164 let stat = fstat ( & file) . unwrap ( ) ;
165165
166- assert_eq ! ( TryInto :: <u64 >:: try_into( stat. mtime ( ) ) . unwrap( ) , m_sec) ;
166+ assert_eq ! ( TryInto :: <u64 >:: try_into( stat. st_mtime ) . unwrap( ) , m_sec) ;
167167
168168 #[ cfg( not( target_os = "netbsd" ) ) ]
169169 assert_eq ! ( stat. st_mtime_nsec as u32 , m_nsec) ;
170170 #[ cfg( target_os = "netbsd" ) ]
171171 assert_eq ! ( stat. st_mtimensec as u32 , m_nsec) ;
172172
173- assert ! ( TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) >= a_sec) ;
173+ assert ! ( TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) >= a_sec) ;
174174
175175 #[ cfg( not( target_os = "netbsd" ) ) ]
176176 assert ! (
177- TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) > a_sec
177+ TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) > a_sec
178178 || stat. st_atime_nsec as u32 >= a_nsec
179179 ) ;
180180 #[ cfg( target_os = "netbsd" ) ]
181181 assert ! (
182- TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) > a_sec
182+ TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) > a_sec
183183 || stat. st_atimensec as u32 >= a_nsec
184184 ) ;
185185}
@@ -193,7 +193,7 @@ fn test_y2038_with_futimens() {
193193#[ cfg( not( all( target_os = "emscripten" , target_pointer_width = "32" ) ) ) ]
194194#[ test]
195195fn test_y2038_with_futimens_and_stat ( ) {
196- use rustix:: fs:: { fstat, futimens, open, stat, Mode , OFlags , StatExt , Timespec , Timestamps } ;
196+ use rustix:: fs:: { fstat, futimens, open, stat, Mode , OFlags , Timespec , Timestamps } ;
197197
198198 let tmp = tempfile:: tempdir ( ) . unwrap ( ) ;
199199
@@ -233,47 +233,47 @@ fn test_y2038_with_futimens_and_stat() {
233233 // Use `statat` to read back the timestamp.
234234 let stat = stat ( tmp. path ( ) . join ( "file" ) ) . unwrap ( ) ;
235235
236- assert_eq ! ( TryInto :: <u64 >:: try_into( stat. mtime ( ) ) . unwrap( ) , m_sec) ;
236+ assert_eq ! ( TryInto :: <u64 >:: try_into( stat. st_mtime ) . unwrap( ) , m_sec) ;
237237
238238 #[ cfg( not( target_os = "netbsd" ) ) ]
239239 assert_eq ! ( stat. st_mtime_nsec as u32 , m_nsec) ;
240240 #[ cfg( target_os = "netbsd" ) ]
241241 assert_eq ! ( stat. st_mtimensec as u32 , m_nsec) ;
242242
243- assert ! ( TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) >= a_sec) ;
243+ assert ! ( TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) >= a_sec) ;
244244
245245 #[ cfg( not( target_os = "netbsd" ) ) ]
246246 assert ! (
247- TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) > a_sec
247+ TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) > a_sec
248248 || stat. st_atime_nsec as u32 >= a_nsec
249249 ) ;
250250 #[ cfg( target_os = "netbsd" ) ]
251251 assert ! (
252- TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) > a_sec
252+ TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) > a_sec
253253 || stat. st_atimensec as u32 >= a_nsec
254254 ) ;
255255
256256 // Now test the same thing, but with `fstat`.
257257 let file = open ( tmp. path ( ) . join ( "file" ) , OFlags :: RDONLY , Mode :: empty ( ) ) . unwrap ( ) ;
258258 let stat = fstat ( & file) . unwrap ( ) ;
259259
260- assert_eq ! ( TryInto :: <u64 >:: try_into( stat. mtime ( ) ) . unwrap( ) , m_sec) ;
260+ assert_eq ! ( TryInto :: <u64 >:: try_into( stat. st_mtime ) . unwrap( ) , m_sec) ;
261261
262262 #[ cfg( not( target_os = "netbsd" ) ) ]
263263 assert_eq ! ( stat. st_mtime_nsec as u32 , m_nsec) ;
264264 #[ cfg( target_os = "netbsd" ) ]
265265 assert_eq ! ( stat. st_mtimensec as u32 , m_nsec) ;
266266
267- assert ! ( TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) >= a_sec) ;
267+ assert ! ( TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) >= a_sec) ;
268268
269269 #[ cfg( not( target_os = "netbsd" ) ) ]
270270 assert ! (
271- TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) > a_sec
271+ TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) > a_sec
272272 || stat. st_atime_nsec as u32 >= a_nsec
273273 ) ;
274274 #[ cfg( target_os = "netbsd" ) ]
275275 assert ! (
276- TryInto :: <u64 >:: try_into( stat. atime ( ) ) . unwrap( ) > a_sec
276+ TryInto :: <u64 >:: try_into( stat. st_atime ) . unwrap( ) > a_sec
277277 || stat. st_atimensec as u32 >= a_nsec
278278 ) ;
279279}
0 commit comments