Skip to content

Commit 158590f

Browse files
github-actions[bot]tgross35
authored andcommitted
chore: release (rust-lang#3862)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Trevor Gross <[email protected]>
1 parent 48668be commit 158590f

File tree

4 files changed

+110
-8
lines changed

4 files changed

+110
-8
lines changed

CHANGELOG.md

+31
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,37 @@
22

33
## [Unreleased]
44

5+
## [0.2.159](https://github.com/rust-lang/libc/compare/0.2.158...0.2.159) - 2024-09-24
6+
7+
### Added
8+
9+
- Android: add more `AT_*` constants in <https://github.com/rust-lang/libc/pull/3779>
10+
- Apple: add missing `NOTE_*` constants in <https://github.com/rust-lang/libc/pull/3883>
11+
- Hermit: add missing error numbers in <https://github.com/rust-lang/libc/pull/3858>
12+
- Hurd: add `__timeval` for 64-bit support in <https://github.com/rust-lang/libc/pull/3786>
13+
- Linux: add `epoll_pwait2` in <https://github.com/rust-lang/libc/pull/3868>
14+
- Linux: add `mq_notify` in <https://github.com/rust-lang/libc/pull/3849>
15+
- Linux: add missing `NFT_CT_*` constants in <https://github.com/rust-lang/libc/pull/3844>
16+
- Linux: add the `fchmodat2` syscall in <https://github.com/rust-lang/libc/pull/3588>
17+
- Linux: add the `mseal` syscall in <https://github.com/rust-lang/libc/pull/3798>
18+
- OpenBSD: add `sendmmsg` and `recvmmsg` in <https://github.com/rust-lang/libc/pull/3831>
19+
- Unix: add `IN6ADDR_ANY_INIT` and `IN6ADDR_LOOPBACK_INIT` in <https://github.com/rust-lang/libc/pull/3693>
20+
- VxWorks: add `S_ISVTX` in <https://github.com/rust-lang/libc/pull/3768>
21+
- VxWorks: add `vxCpuLib` and `taskLib` functions <https://github.com/rust-lang/libc/pull/3861>
22+
- WASIp2: add definitions for `std::net` support in <https://github.com/rust-lang/libc/pull/3892>
23+
24+
### Fixed
25+
26+
- Correctly handle version checks when `clippy-driver` is used <https://github.com/rust-lang/libc/pull/3893>
27+
28+
### Changed
29+
30+
- EspIdf: change signal constants to c_int in <https://github.com/rust-lang/libc/pull/3895>
31+
- HorizonOS: update network definitions in <https://github.com/rust-lang/libc/pull/3863>
32+
- Linux: combine `ioctl` APIs in <https://github.com/rust-lang/libc/pull/3722>
33+
- WASI: enable CI testing in <https://github.com/rust-lang/libc/pull/3869>
34+
- WASIp2: enable CI testing in <https://github.com/rust-lang/libc/pull/3870>
35+
536
## [0.2.158](https://github.com/rust-lang/libc/compare/0.2.157...0.2.158) - 2024-08-19
637

738
### Other

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libc"
3-
version = "0.2.158"
3+
version = "0.2.159"
44
authors = ["The Rust Project Developers"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"

libc-test/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ A test crate for the libc crate.
1414

1515
[dependencies.libc]
1616
path = ".."
17-
version = "0.2.158"
17+
version = "0.2.159"
1818
default-features = false
1919

2020
[build-dependencies]

src/wasi/mod.rs

+77-6
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,37 @@ pub const NOEXPR: ::nl_item = 0x50001;
458458
pub const YESSTR: ::nl_item = 0x50002;
459459
pub const NOSTR: ::nl_item = 0x50003;
460460

461+
pub const SOCK_DGRAM: ::c_int = __WASI_SOCK_TYPE_SOCKET_DGRAM;
462+
pub const SOCK_STREAM: ::c_int = __WASI_SOCK_TYPE_SOCKET_STREAM;
463+
pub const SOCK_RAW: ::c_int = __WASI_SOCK_TYPE_SOCKET_RAW;
464+
pub const SOCK_SEQPACKET: ::c_int = __WASI_SOCK_TYPE_SOCKET_SEQPACKET;
465+
466+
pub const MSG_PEEK: ::c_int = 0x0002;
467+
pub const MSG_NOSIGNAL: ::c_int = 0x4000;
468+
pub const MSG_CMSG_CLOEXEC: ::c_int = 0x40000000;
469+
470+
pub const AF_UNSPEC: ::c_int = 0;
471+
pub const AF_INET: ::c_int = 1;
472+
pub const AF_INET6: ::c_int = 2;
473+
pub const AF_UNIX: ::c_int = 3;
474+
475+
pub const SO_RCVTIMEO: ::c_int = __WASI_SOCK_OPTION_RECV_TIMEOUT;
476+
pub const SO_SNDTIMEO: ::c_int = __WASI_SOCK_OPTION_SEND_TIMEOUT;
477+
478+
pub const PTHREAD_STACK_MIN: ::size_t = 2048;
479+
480+
pub fn WIFSIGNALED(status: ::c_int) -> bool {
481+
((status & 0x7f) + 1) as i8 >= 2
482+
}
483+
484+
pub fn WCOREDUMP(status: ::c_int) -> bool {
485+
(status & 0x80) != 0
486+
}
487+
488+
pub fn WIFCONTINUED(status: ::c_int) -> bool {
489+
status == 0xffff
490+
}
491+
461492
f! {
462493
pub fn FD_ISSET(fd: ::c_int, set: *const fd_set) -> bool {
463494
let set = &*set;
@@ -494,6 +525,49 @@ f! {
494525
link(name = "c", cfg(not(target_feature = "crt-static")))
495526
)]
496527
extern "C" {
528+
pub fn bind(socket: ::c_int, addr: *const ::sockaddr, addrlen: ::socklen_t) -> ::c_int;
529+
pub fn connect(socket: ::c_int, addr: *const sockaddr, addrlen: socklen_t) -> ::c_int;
530+
pub fn getsockname(socket: ::c_int, addr: *mut sockaddr, addrlen: *mut socklen_t) -> ::c_int;
531+
pub fn getpeername(socket: ::c_int, addr: *mut sockaddr, addrlen: *mut socklen_t) -> ::c_int;
532+
pub fn recvfrom(
533+
socket: ::c_int,
534+
buffer: *mut ::c_void,
535+
length: ::size_t,
536+
flags: ::c_int,
537+
addr: *mut ::sockaddr,
538+
addrlen: *mut ::socklen_t,
539+
) -> ::ssize_t;
540+
pub fn sendto(
541+
socket: ::c_int,
542+
buffer: *const ::c_void,
543+
length: ::size_t,
544+
flags: ::c_int,
545+
addr: *const sockaddr,
546+
addrlen: socklen_t,
547+
) -> ::ssize_t;
548+
pub fn recvmsg(socket: ::c_int, msg: *mut ::msghdr, flags: ::c_int) -> ::ssize_t;
549+
pub fn sendmsg(socket: ::c_int, msg: *const ::msghdr, flags: ::c_int) -> ::ssize_t;
550+
pub fn dup(fd: ::c_int) -> ::c_int;
551+
pub fn dup2(src: ::c_int, dst: ::c_int) -> ::c_int;
552+
pub fn execvp(c: *const ::c_char, argv: *const *const ::c_char) -> ::c_int;
553+
554+
// Thread functions
555+
pub fn pthread_create(
556+
native: *mut ::pthread_t,
557+
attr: *const ::pthread_attr_t,
558+
f: extern "C" fn(*mut ::c_void) -> *mut ::c_void,
559+
value: *mut ::c_void,
560+
) -> ::c_int;
561+
pub fn pthread_attr_init(attr: *mut ::pthread_attr_t) -> ::c_int;
562+
pub fn pthread_attr_destroy(attr: *mut ::pthread_attr_t) -> ::c_int;
563+
pub fn pthread_attr_setstacksize(attr: *mut ::pthread_attr_t, stack_size: ::size_t) -> ::c_int;
564+
pub fn pthread_join(native: ::pthread_t, value: *mut *mut ::c_void) -> ::c_int;
565+
pub fn pthread_detach(thread: ::pthread_t) -> ::c_int;
566+
567+
// Signal handling
568+
pub fn sigemptyset(set: *mut sigset_t) -> ::c_int;
569+
pub fn sigaddset(set: *mut sigset_t, signum: ::c_int) -> ::c_int;
570+
497571
pub fn _Exit(code: c_int) -> !;
498572
pub fn _exit(code: c_int) -> !;
499573
pub fn abort() -> !;
@@ -880,9 +954,6 @@ extern "C" {
880954
pub fn __errno_location() -> *mut ::c_int;
881955
}
882956

883-
cfg_if! {
884-
if #[cfg(target_env = "p2")] {
885-
mod p2;
886-
pub use self::p2::*;
887-
}
888-
}
957+
mod p2;
958+
pub use self::p2::*;
959+

0 commit comments

Comments
 (0)