Skip to content

Commit 3c53418

Browse files
author
Ali Clark
committed
time_t is long on freebsd and dragonfly (and nsec should be long)
This becomes less relevant for dragonfly a i686 support is dropped since release 40, but using long allows some compatibility for older versions.
1 parent c99409f commit 3c53418

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

src/libstd/os/dragonfly/raw.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
definitions")]
1919
#![allow(deprecated)]
2020

21+
use os::raw::c_long;
22+
2123
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
2224
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
2325
#[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u64;
@@ -49,17 +51,17 @@ pub struct stat {
4951
#[stable(feature = "raw_ext", since = "1.1.0")]
5052
pub st_rdev: u32,
5153
#[stable(feature = "raw_ext", since = "1.1.0")]
52-
pub st_atime: i64,
54+
pub st_atime: c_long,
5355
#[stable(feature = "raw_ext", since = "1.1.0")]
54-
pub st_atime_nsec: i64,
56+
pub st_atime_nsec: c_long,
5557
#[stable(feature = "raw_ext", since = "1.1.0")]
56-
pub st_mtime: i64,
58+
pub st_mtime: c_long,
5759
#[stable(feature = "raw_ext", since = "1.1.0")]
58-
pub st_mtime_nsec: i64,
60+
pub st_mtime_nsec: c_long,
5961
#[stable(feature = "raw_ext", since = "1.1.0")]
60-
pub st_ctime: i64,
62+
pub st_ctime: c_long,
6163
#[stable(feature = "raw_ext", since = "1.1.0")]
62-
pub st_ctime_nsec: i64,
64+
pub st_ctime_nsec: c_long,
6365
#[stable(feature = "raw_ext", since = "1.1.0")]
6466
pub st_size: i64,
6567
#[stable(feature = "raw_ext", since = "1.1.0")]
@@ -73,7 +75,7 @@ pub struct stat {
7375
#[stable(feature = "raw_ext", since = "1.1.0")]
7476
pub st_lspare: i32,
7577
#[stable(feature = "raw_ext", since = "1.1.0")]
76-
pub st_birthtime: i64,
78+
pub st_birthtime: c_long,
7779
#[stable(feature = "raw_ext", since = "1.1.0")]
78-
pub st_birthtime_nsec: i64,
80+
pub st_birthtime_nsec: c_long,
7981
}

src/libstd/os/freebsd/raw.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
definitions")]
1919
#![allow(deprecated)]
2020

21+
use os::raw::c_long;
22+
2123
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = u64;
2224
#[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u64;
2325
#[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = u64;
@@ -49,17 +51,17 @@ pub struct stat {
4951
#[stable(feature = "raw_ext", since = "1.1.0")]
5052
pub st_rdev: u32,
5153
#[stable(feature = "raw_ext", since = "1.1.0")]
52-
pub st_atime: i64,
54+
pub st_atime: c_long,
5355
#[stable(feature = "raw_ext", since = "1.1.0")]
54-
pub st_atime_nsec: i64,
56+
pub st_atime_nsec: c_long,
5557
#[stable(feature = "raw_ext", since = "1.1.0")]
56-
pub st_mtime: i64,
58+
pub st_mtime: c_long,
5759
#[stable(feature = "raw_ext", since = "1.1.0")]
58-
pub st_mtime_nsec: i64,
60+
pub st_mtime_nsec: c_long,
5961
#[stable(feature = "raw_ext", since = "1.1.0")]
60-
pub st_ctime: i64,
62+
pub st_ctime: c_long,
6163
#[stable(feature = "raw_ext", since = "1.1.0")]
62-
pub st_ctime_nsec: i64,
64+
pub st_ctime_nsec: c_long,
6365
#[stable(feature = "raw_ext", since = "1.1.0")]
6466
pub st_size: i64,
6567
#[stable(feature = "raw_ext", since = "1.1.0")]
@@ -73,7 +75,7 @@ pub struct stat {
7375
#[stable(feature = "raw_ext", since = "1.1.0")]
7476
pub st_lspare: i32,
7577
#[stable(feature = "raw_ext", since = "1.1.0")]
76-
pub st_birthtime: i64,
78+
pub st_birthtime: c_long,
7779
#[stable(feature = "raw_ext", since = "1.1.0")]
78-
pub st_birthtime_nsec: i64,
80+
pub st_birthtime_nsec: c_long,
7981
}

0 commit comments

Comments
 (0)