Skip to content

Commit a13ad69

Browse files
committed
Auto merge of #1574 - Amanieu:deprecate-vfork, r=gnzlbg
Deprecate vfork The compiler may generate incorrect code for `vfork` and `setjmp` because they are missing the `#[returns_twice]` attribute which is currently unstable ([tracking issue](rust-lang/rust#58314)). Since `vfork` is impossible to use safely, I propose deprecating it until `#[returns_twice]` is stable.
2 parents b96c0dd + 1f7352c commit a13ad69

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/unix/linux_like/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,10 @@ extern "C" {
14581458
pub fn acct(filename: *const ::c_char) -> ::c_int;
14591459
pub fn brk(addr: *mut ::c_void) -> ::c_int;
14601460
pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
1461+
#[deprecated(
1462+
since = "0.2.66",
1463+
note = "causes memory corruption, see rust-lang/libc#1596"
1464+
)]
14611465
pub fn vfork() -> ::pid_t;
14621466
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
14631467
pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;

0 commit comments

Comments
 (0)