Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up some externs #3218

Merged
merged 2 commits into from Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bors.yml
Expand Up @@ -314,7 +314,7 @@ jobs:
run: rustup self update
shell: bash
- name: Execute build.sh
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} WIN_TARGET=${{ matrix.target }} sh ./ci/build.sh
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
shell: bash

check_cfg:
Expand Down
46 changes: 22 additions & 24 deletions src/unix/bsd/netbsdlike/netbsd/mod.rs
Expand Up @@ -2513,31 +2513,7 @@ extern "C" {
) -> ::c_int;

pub fn reallocarr(ptr: *mut ::c_void, number: ::size_t, size: ::size_t) -> ::c_int;
}

#[link(name = "rt")]
extern "C" {
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
#[link_name = "__aio_suspend50"]
pub fn aio_suspend(
aiocb_list: *const *const aiocb,
nitems: ::c_int,
timeout: *const ::timespec,
) -> ::c_int;
pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn lio_listio(
mode: ::c_int,
aiocb_list: *const *mut aiocb,
nitems: ::c_int,
sevp: *mut sigevent,
) -> ::c_int;
}

extern "C" {
pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int;
pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
Expand Down Expand Up @@ -2967,6 +2943,28 @@ extern "C" {
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
}

#[link(name = "rt")]
extern "C" {
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
#[link_name = "__aio_suspend50"]
pub fn aio_suspend(
aiocb_list: *const *const aiocb,
nitems: ::c_int,
timeout: *const ::timespec,
) -> ::c_int;
pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
pub fn lio_listio(
mode: ::c_int,
aiocb_list: *const *mut aiocb,
nitems: ::c_int,
sevp: *mut sigevent,
) -> ::c_int;
}

#[link(name = "util")]
extern "C" {
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]
Expand Down
17 changes: 2 additions & 15 deletions src/unix/linux_like/linux/gnu/mod.rs
Expand Up @@ -1240,9 +1240,6 @@ extern "C" {
pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;

pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
}

extern "C" {
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
pub fn glob64(
Expand Down Expand Up @@ -1331,9 +1328,6 @@ extern "C" {
/// GNU version of `basename(3)`, defined in `string.h`.
#[link_name = "basename"]
pub fn gnu_basename(path: *const ::c_char) -> *mut ::c_char;
}

extern "C" {
pub fn dlmopen(lmid: Lmid_t, filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
pub fn dlinfo(handle: *mut ::c_void, request: ::c_int, info: *mut ::c_void) -> ::c_int;
pub fn dladdr1(
Expand All @@ -1343,15 +1337,10 @@ extern "C" {
flags: ::c_int,
) -> ::c_int;
pub fn malloc_trim(__pad: ::size_t) -> ::c_int;
}

extern "C" {
pub fn gnu_get_libc_release() -> *const ::c_char;
pub fn gnu_get_libc_version() -> *const ::c_char;
}

// posix/spawn.h
extern "C" {
// posix/spawn.h
// Added in `glibc` 2.29
pub fn posix_spawn_file_actions_addchdir_np(
actions: *mut ::posix_spawn_file_actions_t,
Expand All @@ -1372,10 +1361,8 @@ extern "C" {
actions: *mut ::posix_spawn_file_actions_t,
tcfd: ::c_int,
) -> ::c_int;
}

// mntent.h
extern "C" {
// mntent.h
pub fn getmntent_r(
stream: *mut ::FILE,
mntbuf: *mut ::mntent,
Expand Down