Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add MAP_UNINITIALIZED flag (Linux-only) for mmap #3274

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/unix/linux_like/android/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,7 @@ pub const MAP_NORESERVE: ::c_int = 0x04000;
pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/emscripten/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,7 @@ pub const RLIMIT_NLIMITS: ::c_int = 15;
pub const RLIM_NLIMITS: ::c_int = RLIMIT_NLIMITS;

pub const MAP_ANONYMOUS: ::c_int = MAP_ANON;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

#[doc(hidden)]
#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")]
Expand Down Expand Up @@ -1533,6 +1534,7 @@ pub const MAP_NORESERVE: ::c_int = 0x04000;
pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b32/arm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const EDEADLOCK: ::c_int = 35;
pub const EUCLEAN: ::c_int = 117;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b32/m68k/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const EDEADLOCK: ::c_int = 35;
pub const EUCLEAN: ::c_int = 117;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b32/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ pub const MAP_LOCKED: ::c_int = 0x8000;
pub const MAP_POPULATE: ::c_int = 0x10000;
pub const MAP_NONBLOCK: ::c_int = 0x20000;
pub const MAP_STACK: ::c_int = 0x40000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b32/powerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const EDEADLOCK: ::c_int = 58;
pub const EUCLEAN: ::c_int = 117;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ pub const MAP_POPULATE: ::c_int = 32768;
pub const MAP_NONBLOCK: ::c_int = 65536;
pub const MAP_STACK: ::c_int = 131072;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;
pub const EDEADLOCK: ::c_int = 35;
pub const EUCLEAN: ::c_int = 117;
pub const ENOTNAM: ::c_int = 118;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b32/sparc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const EDEADLK: ::c_int = 78;
pub const ENAMETOOLONG: ::c_int = 63;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b32/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_GROWSDOWN: ::c_int = 0x0100;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const EDEADLOCK: ::c_int = 35;
pub const EUCLEAN: ::c_int = 117;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const EDEADLOCK: ::c_int = 35;

Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ pub const MAP_POPULATE: ::c_int = 0x8000;
pub const MAP_NONBLOCK: ::c_int = 0x10000;
pub const MAP_STACK: ::c_int = 0x20000;
pub const MAP_HUGETLB: ::c_int = 0x40000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b64/mips64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ pub const MAP_POPULATE: ::c_int = 0x10000;
pub const MAP_NONBLOCK: ::c_int = 0x20000;
pub const MAP_STACK: ::c_int = 0x40000;
pub const MAP_HUGETLB: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const EDEADLK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ pub const MAP_POPULATE: ::c_int = 32768;
pub const MAP_NONBLOCK: ::c_int = 65536;
pub const MAP_STACK: ::c_int = 131072;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;
pub const EDEADLOCK: ::c_int = 35;
pub const EUCLEAN: ::c_int = 117;
pub const ENOTNAM: ::c_int = 118;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b64/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const EDEADLOCK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const EDEADLK: ::c_int = 78;
pub const ENAMETOOLONG: ::c_int = 63;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const EDEADLOCK: ::c_int = 35;
pub const EUCLEAN: ::c_int = 117;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b32/arm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b32/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ pub const MAP_POPULATE: ::c_int = 0x10000;
pub const MAP_NONBLOCK: ::c_int = 0x20000;
pub const MAP_STACK: ::c_int = 0x40000;
pub const MAP_HUGETLB: ::c_int = 0x80000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const EDEADLK: ::c_int = 45;
pub const ENAMETOOLONG: ::c_int = 78;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b32/powerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const PTRACE_SYSEMU: ::c_int = 0x1d;
pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 0x1e;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b32/riscv32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ pub const MAP_POPULATE: ::c_int = 32768;
pub const MAP_NONBLOCK: ::c_int = 65536;
pub const MAP_STACK: ::c_int = 131072;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;
pub const EDEADLOCK: ::c_int = 35;
pub const EUCLEAN: ::c_int = 117;
pub const ENOTNAM: ::c_int = 118;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b32/x86/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const SOCK_STREAM: ::c_int = 1;
pub const SOCK_DGRAM: ::c_int = 2;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/mips64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,7 @@ pub const MAP_POPULATE: ::c_int = 0x10000;
pub const MAP_NONBLOCK: ::c_int = 0x20000;
pub const MAP_STACK: ::c_int = 0x40000;
pub const MAP_HUGETLB: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/powerpc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const PTRACE_SYSEMU: ::c_int = 0x1d;
pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 0x1e;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/riscv64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const PTRACE_SYSEMU: ::c_int = 31;
pub const PTRACE_SYSEMU_SINGLESTEP: ::c_int = 32;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/musl/b64/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_HUGETLB: ::c_int = 0x040000;
pub const MAP_SYNC: ::c_int = 0x080000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const MCL_CURRENT: ::c_int = 0x0001;
pub const MCL_FUTURE: ::c_int = 0x0002;
Expand Down
2 changes: 2 additions & 0 deletions src/unix/linux_like/linux/musl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ pub const MAP_HUGE_1GB: ::c_int = 30 << MAP_HUGE_SHIFT;
pub const MAP_HUGE_2GB: ::c_int = 31 << MAP_HUGE_SHIFT;
pub const MAP_HUGE_16GB: ::c_int = 34 << MAP_HUGE_SHIFT;

pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const MS_RMT_MASK: ::c_ulong = 0x02800051;

pub const SFD_CLOEXEC: ::c_int = 0x080000;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/uclibc/arm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ pub const MAP_NONBLOCK: ::c_int = 0x10000;
pub const MAP_NORESERVE: ::c_int = 0x4000;
pub const MAP_POPULATE: ::c_int = 0x8000;
pub const MAP_STACK: ::c_int = 0x20000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;
pub const NLDLY: ::tcflag_t = 0x100;
pub const NOFLSH: ::tcflag_t = 0x80;
pub const OLCUC: ::tcflag_t = 0x2;
Expand Down
1 change: 1 addition & 0 deletions src/unix/linux_like/linux/uclibc/mips/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ pub const MAP_LOCKED: ::c_int = 0x8000;
pub const MAP_POPULATE: ::c_int = 0x10000;
pub const MAP_NONBLOCK: ::c_int = 0x20000;
pub const MAP_STACK: ::c_int = 0x40000;
pub const MAP_UNINITIALIZED: ::c_int = 0x4000000;

pub const NLDLY: ::tcflag_t = 0o0000400;

Expand Down