Skip to content

Commit ae51998

Browse files
committed
male libc.rs at least build on FreeBSD
1 parent 98d2049 commit ae51998

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

tests/pass/libc.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fn test_posix_fadvise() {
4242
assert_eq!(result, 0);
4343
}
4444

45-
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
45+
#[cfg(any(target_os = "linux"))]
4646
fn test_sync_file_range() {
4747
use std::fs::{remove_file, File};
4848
use std::io::Write;
@@ -208,7 +208,7 @@ fn test_rwlock_libc_static_initializer() {
208208
/// Test whether the `prctl` shim correctly sets the thread name.
209209
///
210210
/// Note: `prctl` exists only on Linux.
211-
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
211+
#[cfg(any(target_os = "linux"))]
212212
fn test_prctl_thread_name() {
213213
use libc::c_long;
214214
use std::ffi::CString;
@@ -259,9 +259,9 @@ fn test_prctl_thread_name() {
259259

260260
/// Tests whether each thread has its own `__errno_location`.
261261
fn test_thread_local_errno() {
262-
#[cfg(not(target_os = "macos"))]
262+
#[cfg(target_os = "linux")]
263263
use libc::__errno_location;
264-
#[cfg(target_os = "macos")]
264+
#[cfg(any(target_os = "macos", target_os = "freebsd"))]
265265
use libc::__error as __errno_location;
266266

267267
unsafe {
@@ -278,7 +278,7 @@ fn test_thread_local_errno() {
278278
}
279279

280280
/// Tests whether clock support exists at all
281-
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
281+
#[cfg(any(target_os = "linux"))]
282282
fn test_clocks() {
283283
let mut tp = std::mem::MaybeUninit::<libc::timespec>::uninit();
284284
let is_error = unsafe { libc::clock_gettime(libc::CLOCK_REALTIME, tp.as_mut_ptr()) };
@@ -317,22 +317,22 @@ fn main() {
317317

318318
test_posix_gettimeofday();
319319

320-
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
320+
#[cfg(any(target_os = "linux"))]
321321
test_sync_file_range();
322322

323323
test_mutex_libc_init_recursive();
324324
test_mutex_libc_init_normal();
325325
test_mutex_libc_init_errorcheck();
326326
test_rwlock_libc_static_initializer();
327327

328-
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
328+
#[cfg(any(target_os = "linux"))]
329329
test_mutex_libc_static_initializer_recursive();
330330

331-
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
331+
#[cfg(any(target_os = "linux"))]
332332
test_prctl_thread_name();
333333

334334
test_thread_local_errno();
335335

336-
#[cfg(any(target_os = "linux", target_os = "freebsd"))]
336+
#[cfg(any(target_os = "linux"))]
337337
test_clocks();
338338
}

0 commit comments

Comments
 (0)