Skip to content

Upgrading libc 0.1 to 0.2

Breaking0.1.12 → 0.2.191Breaking47Platform2Deprecated23New809Changed108Fixed244Other248

BreakingUpgrade verdict

46 breaking changes and 2 platform requirement changes.

  • Removes many items from iOS, tvOS, watchOS, and visionOS that are only available on MacOS.
  • Removes the unsupported exec* and fork calls from tvOS and watchOS.
  • Removes unsound af_alg_iv trait implementations on Android and Linux that allowed out-of-bounds reads via safe functions.
  • Removes most items that have been deprecated since before 0.2.100.
Top 5 of 71 that need code or config changes

Requires Rust 1.65 from 0.2.184 (none stated before).

Adds rustc-std-workspace-core ^1.0.1.

Installs 1 package in all (was 0).

Breaking46
Removes many items from iOS, tvOS, watchOS, and visionOS that are only available on MacOS.
Removes the unsupported exec* and fork calls from tvOS and watchOS.
exec*fork
Removes unsound af_alg_iv trait implementations on Android and Linux that allowed out-of-bounds reads via safe functions.
af_alg_iv
Removes most items that have been deprecated since before 0.2.100.
Removes INHERIT_ZERO on Dragonfly because it does not exist upstream.
INHERIT_ZERO
Removes GNU-gated REG_* definitions on Musl riscv64.
REG_*
Removes the non-existent REG_NARGS on Musl riscv64.
REG_NARGS
Dragonfly: Removes FreeBSD-only Elf32_Lword, ip_mreq_source, and IP_ constants.
Elf32_Lwordip_mreq_sourceIP_
Dragonfly: Removes private VM type bindings.
Linux: Removes KERN_REALROOTDEV and VM_LAPTOP_MODE.
KERN_REALROOTDEVVM_LAPTOP_MODE
VxWorks: Removes non-user-facing (kernel) API.
Remove RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64.
RUST_LIBC_UNSTABLE_LINUX_TIME_BITS64
WASI: Remove nonexistent clocks.
MIPS Musl: Remove rogue definition of SIGSTKFLT.
SIGSTKFLT
NetBSD: Remove BPF constants.
NetBSD: Remove *_MAXID constants and AT_SUN_LDPGSIZE.
*_MAXIDAT_SUN_LDPGSIZE
NetBSD: Remove IFF_NOTRAILERS.
IFF_NOTRAILERS
NetBSD: Remove vm_size_t.
vm_size_t
FreeBSD: Remove JAIL_{GET,SET}_MASK, _MC_FLAG_MASK.
JAIL_{GET,SET}_MASK_MC_FLAG_MASK
AIX: Remove duplicate constant definitions FIND and ENTER.
FINDENTER
s390x musl: Remove O_FSYNC.
O_FSYNC
s390x musl: Remove RTLD_DEEPBIND.
RTLD_DEEPBIND
Musl: Remove O_FSYNC on RISC-V-32 (use O_SYNC instead).
O_FSYNCO_SYNC
Musl: Remove RTLD_DEEPBIND on RISC-V-32.
RTLD_DEEPBIND
NuttX: Remove pthread_set_name_np.
pthread_set_name_np
Remove one unused import after the edition 2021 bump.
Apple: remove rmx_state.
rmx_state
openbsd: syscall has been removed in upcoming OpenBSD 7.5.
Remove asmjs-unknown-emscripten target.
Drops support for the armv7-apple-ios target.
armv7-apple-ios
Removes the AIX specific definition of sigval.
sigval
Removes the obsolete private a.out define on illumos.
Drops support for the Rumprun target.
Removes the deprecated winapi part on win32.
winapi
Changes the type of BPF_ALIGNMENT to size_t on AIX to match upstream and other platforms.
BPF_ALIGNMENT
Disables mach.h API on Apple mobile OSs.
mach.h
Replaces the RUST_LIBC_UNSTABLE_* environment variables with --cfg configuration options.
RUST_LIBC_UNSTABLE_*libc_unstable_musl_v1_2_3libc_unstable_gnu_time_bits
Corrects NetBSD _lwp_park ts parameter from *const timespec to *mut timespec.
_lwp_parktimespec
Changes overflowing Linux GNU PTRACE_*ET_SYSCALL_USER_DISPATCH_CONFIG constants from u8 to c_uint.
PTRACE_*ET_SYSCALL_USER_DISPATCH_CONFIGu8c_uint
NetBSD: Make statvfs.f_spare non-public.
statvfs.f_spare
NetBSD: Replace REG_ENOSYS with REG_ILLSEQ.
Fixes the MAP_HASSEMAPHORE name on Hurd, renaming the exposed constant.
MAP_HASSEMAPHORE
Fixes mismatched types of SA_* constants on ulibc Mips.
SA_*
Changes f_* constants to uint from ulong on linux/musl/s390x.
Changes MSG* constant types for musl and emscripten, following up on #2963.
MSG_OOBMSG_PEEKMSG_DONTROUTEMSG_EORMSG_WAITALLMSG_NOSIGNALMSG_TRUNCMSG_CTRUNC
Moves termios2 struct and ioctl constants to linux::arch::* modules.
termios2linux::arch
Platform2
Adds support for Emscripten versions v4.0.12 through v6.0.11.
MSRV: document the MSRV of the stable channel to be 1.63.
Deprecated23
Adds back NOTE_PCTRLMASK on FreeBSD with a deprecation warning.
NOTE_PCTRLMASK
Deprecates AIX _kernel_simple_lock.
_kernel_simple_lock
Deprecates integer *_MIN/*_MAX constants in favor of associated constants like c_int::MAX.
*_MIN*_MAXc_int::MAX
Deprecates Fuchsia types that do not exist upstream.
Deprecates Hurd fallocate64, which does not exist on the platform.
fallocate64
Deprecates redundant Hurd glob64 types and routines.
glob64
Deprecates L4Re LFS bindings.
Deprecates OpenBSD syscall, mincore, and KERN_NSELCOLL, all removed upstream.
syscallmincoreKERN_NSELCOLL
Deprecates the POSIX-obsoleted tmpnam and tempnam on Unix.
tmpnamtempnam
Deprecates CLONE_INTO_CGROUP and CLONE_CLEAR_SIGHAND because they overflow their types and will change to a larger size later.
CLONE_INTO_CGROUPCLONE_CLEAR_SIGHAND
Deprecates Dragonfly compatibility aliases CPUCTL_RSMSR and UTX_DB_LASTLOG.
CPUCTL_RSMSRUTX_DB_LASTLOG
Apple: Deprecate TIOCREMOTE.
TIOCREMOTE
Apple: Correct the deprecated attribute for iconv (a97a0b53).
deprecatediconv
FreeBSD: Deprecate TIOCMGDTRWAIT and TIOCMSDTRWAIT.
TIOCMGDTRWAITTIOCMSDTRWAIT
Linux: MAP_32BIT is only defined on x86 on non-x86 architectures.
MAP_32BIT
FreeBSD: Deprecate TCP_PCAP_OUT and TCP_PCAP_IN.
TCP_PCAP_OUTTCP_PCAP_IN
Linux: Deprecate obsolete packet filter interfaces.
Linux: deprecate kernel modules syscalls.
FreeBSD: Deprecate the CAP_UNUSED* and CAP_ALL* constants.
Deprecates iconv_open on Apple targets.
iconv_open
Deprecates mach_task_self on Apple targets.
mach_task_self
Updates mach deprecation notices for things that were removed in main.
mach
Deprecates XU_NGROUPS on DragonFly.
XU_NGROUPS