Skip to content

Commit 3477cb3

Browse files
authored
Remove declarations for libc functions that are now upstream. (#88)
1 parent 7671ee7 commit 3477cb3

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ env_logger = { version = "0.10.0", optional = true, default-features = false }
3333
atomic-dbg = { version = "0.1", default-features = false, optional = true }
3434

3535
# Enable this when disabling origin's implementations.
36-
libc = { version = "0.2.138", default-features = false, optional = true }
36+
libc = { version = "0.2.149", default-features = false, optional = true }
3737
errno = { version = "0.3.3", default-features = false, optional = true }
3838

3939
# Special dependencies used in rustc-dep-of-std mode.

src/thread/libc.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@ extern "C" {
1717
) -> libc::c_int;
1818
fn __tls_get_addr(p: &[usize; 2]) -> *mut c_void;
1919

20-
// TODO: PR for these has been submitted to upstream:
21-
// <https://github.com/rust-lang/libc/pull/3330>
22-
fn pthread_attr_getstacksize(
23-
attr: *const libc::pthread_attr_t,
24-
stacksize: &mut libc::size_t,
25-
) -> libc::c_int;
26-
fn pthread_attr_setguardsize(
27-
attr: *mut libc::pthread_attr_t,
28-
guardsize: libc::size_t,
29-
) -> libc::c_int;
30-
3120
static __dso_handle: *const c_void;
3221
}
3322

@@ -93,7 +82,7 @@ pub fn create_thread(
9382
0 => (),
9483
err => return Err(io::Errno::from_raw_os_error(err)),
9584
}
96-
match pthread_attr_setguardsize(&mut attr, guard_size) {
85+
match libc::pthread_attr_setguardsize(&mut attr, guard_size) {
9786
0 => (),
9887
err => return Err(io::Errno::from_raw_os_error(err)),
9988
}
@@ -236,7 +225,7 @@ pub fn default_stack_size() -> usize {
236225
assert_eq!(libc::pthread_getattr_np(libc::pthread_self(), &mut attr), 0);
237226

238227
let mut stack_size = 0;
239-
assert_eq!(pthread_attr_getstacksize(&attr, &mut stack_size), 0);
228+
assert_eq!(libc::pthread_attr_getstacksize(&attr, &mut stack_size), 0);
240229

241230
stack_size
242231
}

0 commit comments

Comments
 (0)