Skip to content

Commit 6074ea8

Browse files
committed
Auto merge of #3218 - JohnTitor:cleanup-extern-c, r=JohnTitor
Clean up some externs
2 parents 86593ce + 9d3b4d6 commit 6074ea8

File tree

3 files changed

+25
-40
lines changed

3 files changed

+25
-40
lines changed

.github/workflows/bors.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ jobs:
314314
run: rustup self update
315315
shell: bash
316316
- name: Execute build.sh
317-
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} WIN_TARGET=${{ matrix.target }} sh ./ci/build.sh
317+
run: LIBC_CI=1 TOOLCHAIN=${{ matrix.toolchain }} sh ./ci/build.sh
318318
shell: bash
319319

320320
check_cfg:

src/unix/bsd/netbsdlike/netbsd/mod.rs

+22-24
Original file line numberDiff line numberDiff line change
@@ -2513,31 +2513,7 @@ extern "C" {
25132513
) -> ::c_int;
25142514

25152515
pub fn reallocarr(ptr: *mut ::c_void, number: ::size_t, size: ::size_t) -> ::c_int;
2516-
}
2517-
2518-
#[link(name = "rt")]
2519-
extern "C" {
2520-
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
2521-
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
2522-
pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
2523-
pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
2524-
pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
2525-
#[link_name = "__aio_suspend50"]
2526-
pub fn aio_suspend(
2527-
aiocb_list: *const *const aiocb,
2528-
nitems: ::c_int,
2529-
timeout: *const ::timespec,
2530-
) -> ::c_int;
2531-
pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
2532-
pub fn lio_listio(
2533-
mode: ::c_int,
2534-
aiocb_list: *const *mut aiocb,
2535-
nitems: ::c_int,
2536-
sevp: *mut sigevent,
2537-
) -> ::c_int;
2538-
}
25392516

2540-
extern "C" {
25412517
pub fn chflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
25422518
pub fn fchflags(fd: ::c_int, flags: ::c_ulong) -> ::c_int;
25432519
pub fn lchflags(path: *const ::c_char, flags: ::c_ulong) -> ::c_int;
@@ -2967,6 +2943,28 @@ extern "C" {
29672943
pub fn getrandom(buf: *mut ::c_void, buflen: ::size_t, flags: ::c_uint) -> ::ssize_t;
29682944
}
29692945

2946+
#[link(name = "rt")]
2947+
extern "C" {
2948+
pub fn aio_read(aiocbp: *mut aiocb) -> ::c_int;
2949+
pub fn aio_write(aiocbp: *mut aiocb) -> ::c_int;
2950+
pub fn aio_fsync(op: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
2951+
pub fn aio_error(aiocbp: *const aiocb) -> ::c_int;
2952+
pub fn aio_return(aiocbp: *mut aiocb) -> ::ssize_t;
2953+
#[link_name = "__aio_suspend50"]
2954+
pub fn aio_suspend(
2955+
aiocb_list: *const *const aiocb,
2956+
nitems: ::c_int,
2957+
timeout: *const ::timespec,
2958+
) -> ::c_int;
2959+
pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;
2960+
pub fn lio_listio(
2961+
mode: ::c_int,
2962+
aiocb_list: *const *mut aiocb,
2963+
nitems: ::c_int,
2964+
sevp: *mut sigevent,
2965+
) -> ::c_int;
2966+
}
2967+
29702968
#[link(name = "util")]
29712969
extern "C" {
29722970
#[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")]

src/unix/linux_like/linux/gnu/mod.rs

+2-15
Original file line numberDiff line numberDiff line change
@@ -1240,9 +1240,6 @@ extern "C" {
12401240
pub fn reallocarray(ptr: *mut ::c_void, nmemb: ::size_t, size: ::size_t) -> *mut ::c_void;
12411241

12421242
pub fn ctermid(s: *mut ::c_char) -> *mut ::c_char;
1243-
}
1244-
1245-
extern "C" {
12461243
pub fn ioctl(fd: ::c_int, request: ::c_ulong, ...) -> ::c_int;
12471244
pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
12481245
pub fn glob64(
@@ -1331,9 +1328,6 @@ extern "C" {
13311328
/// GNU version of `basename(3)`, defined in `string.h`.
13321329
#[link_name = "basename"]
13331330
pub fn gnu_basename(path: *const ::c_char) -> *mut ::c_char;
1334-
}
1335-
1336-
extern "C" {
13371331
pub fn dlmopen(lmid: Lmid_t, filename: *const ::c_char, flag: ::c_int) -> *mut ::c_void;
13381332
pub fn dlinfo(handle: *mut ::c_void, request: ::c_int, info: *mut ::c_void) -> ::c_int;
13391333
pub fn dladdr1(
@@ -1343,15 +1337,10 @@ extern "C" {
13431337
flags: ::c_int,
13441338
) -> ::c_int;
13451339
pub fn malloc_trim(__pad: ::size_t) -> ::c_int;
1346-
}
1347-
1348-
extern "C" {
13491340
pub fn gnu_get_libc_release() -> *const ::c_char;
13501341
pub fn gnu_get_libc_version() -> *const ::c_char;
1351-
}
13521342

1353-
// posix/spawn.h
1354-
extern "C" {
1343+
// posix/spawn.h
13551344
// Added in `glibc` 2.29
13561345
pub fn posix_spawn_file_actions_addchdir_np(
13571346
actions: *mut ::posix_spawn_file_actions_t,
@@ -1372,10 +1361,8 @@ extern "C" {
13721361
actions: *mut ::posix_spawn_file_actions_t,
13731362
tcfd: ::c_int,
13741363
) -> ::c_int;
1375-
}
13761364

1377-
// mntent.h
1378-
extern "C" {
1365+
// mntent.h
13791366
pub fn getmntent_r(
13801367
stream: *mut ::FILE,
13811368
mntbuf: *mut ::mntent,

0 commit comments

Comments
 (0)