Skip to content

Commit 6b07546

Browse files
committed
Auto merge of #2822 - GuillaumeGomez:__error-alias, r=JohnTitor
Add doc aliases on __error() function We recommend using `__errno_location` everywhere except on apple and freebsd targets, which is a bit confusing. I can instead reexport it as `__errno_location` if you prefer?
2 parents 4042ce2 + b5499de commit 6b07546

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5020,6 +5020,8 @@ extern "C" {
50205020
thread_info_out: thread_info_t,
50215021
thread_info_outCnt: *mut mach_msg_type_number_t,
50225022
) -> kern_return_t;
5023+
#[cfg_attr(doc, doc(alias = "__errno_location"))]
5024+
#[cfg_attr(doc, doc(alias = "errno"))]
50235025
pub fn __error() -> *mut ::c_int;
50245026
pub fn backtrace(buf: *mut *mut ::c_void, sz: ::c_int) -> ::c_int;
50255027
pub fn backtrace_symbols(addrs: *const *mut ::c_void, sz: ::c_int) -> *mut *mut ::c_char;

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3835,6 +3835,8 @@ cfg_if! {
38353835
}
38363836

38373837
extern "C" {
3838+
#[cfg_attr(doc, doc(alias = "__errno_location"))]
3839+
#[cfg_attr(doc, doc(alias = "errno"))]
38383840
pub fn __error() -> *mut ::c_int;
38393841

38403842
pub fn aio_cancel(fd: ::c_int, aiocbp: *mut aiocb) -> ::c_int;

0 commit comments

Comments
 (0)