Skip to content

Commit

Permalink
Auto merge of #1574 - Amanieu:deprecate-vfork, r=gnzlbg
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Nov 18, 2019
2 parents b96c0dd + 1f7352c commit a13ad69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/unix/linux_like/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,10 @@ extern "C" {
pub fn acct(filename: *const ::c_char) -> ::c_int;
pub fn brk(addr: *mut ::c_void) -> ::c_int;
pub fn sbrk(increment: ::intptr_t) -> *mut ::c_void;
#[deprecated(
since = "0.2.66",
note = "causes memory corruption, see rust-lang/libc#1596"
)]
pub fn vfork() -> ::pid_t;
pub fn setresgid(rgid: ::gid_t, egid: ::gid_t, sgid: ::gid_t) -> ::c_int;
pub fn setresuid(ruid: ::uid_t, euid: ::uid_t, suid: ::uid_t) -> ::c_int;
Expand Down

0 comments on commit a13ad69

Please sign in to comment.