Skip to content
Snippets Groups Projects
Commit bf85aa6d authored by bors's avatar bors
Browse files

Auto merge of #1340 - ibabushkin:mmap_flags, r=gnzlbg

Added MAP_FIXED_NOREPLACE and MAP_SHARED_VALIDATE consts.

This addresses #1339 and #1315. I believe the location of the constants is correct as-is, as both flags are linux-specific additions. Let me know if I missed anything.
parents 0b52da1c 63e3932d
No related branches found
No related tags found
No related merge requests found
......@@ -3,14 +3,14 @@ FROM ubuntu:19.04
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
gcc-aarch64-linux-gnu qemu-user
RUN curl --retry 5 https://www.musl-libc.org/releases/musl-1.1.19.tar.gz | \
RUN curl --retry 5 https://www.musl-libc.org/releases/musl-1.1.22.tar.gz | \
tar xzf - && \
cd musl-1.1.19 && \
cd musl-1.1.22 && \
CC=aarch64-linux-gnu-gcc \
./configure --prefix=/musl-aarch64 --enable-wrapper=yes && \
make install -j4 && \
cd .. && \
rm -rf musl-1.1.19
rm -rf musl-1.1.22
# Install linux kernel headers sanitized for use with musl
RUN curl --retry 5 -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-6.tar.gz | \
tar xzf - && \
......
......@@ -4,8 +4,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates \
gcc-arm-linux-gnueabihf qemu-user
RUN curl --retry 5 https://www.musl-libc.org/releases/musl-1.1.19.tar.gz | tar xzf -
WORKDIR /musl-1.1.19
RUN curl --retry 5 https://www.musl-libc.org/releases/musl-1.1.22.tar.gz | tar xzf -
WORKDIR /musl-1.1.22
RUN CC=arm-linux-gnueabihf-gcc \
CFLAGS="-march=armv6 -marm -mfpu=vfp" \
./configure --prefix=/musl-arm --enable-wrapper=yes
......
......@@ -12,13 +12,13 @@ RUN apt-get install -y --no-install-recommends \
# since otherwise the script will fail to find a compiler.
# * We manually unset CROSS_COMPILE when running make; otherwise the makefile
# will call the non-existent binary 'i686-ar'.
RUN curl --retry 5 https://www.musl-libc.org/releases/musl-1.1.19.tar.gz | \
RUN curl --retry 5 https://www.musl-libc.org/releases/musl-1.1.22.tar.gz | \
tar xzf - && \
cd musl-1.1.19 && \
cd musl-1.1.22 && \
CC=gcc CFLAGS=-m32 ./configure --prefix=/musl-i686 --disable-shared --target=i686 && \
make CROSS_COMPILE= install -j4 && \
cd .. && \
rm -rf musl-1.1.19
rm -rf musl-1.1.22
# Install linux kernel headers sanitized for use with musl
RUN curl --retry 5 -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-6.tar.gz | \
tar xzf - && \
......
......@@ -3,13 +3,13 @@ FROM ubuntu:19.04
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc make libc6-dev git curl ca-certificates
RUN curl --retry 5 https://www.musl-libc.org/releases/musl-1.1.19.tar.gz | \
RUN curl --retry 5 https://www.musl-libc.org/releases/musl-1.1.22.tar.gz | \
tar xzf - && \
cd musl-1.1.19 && \
cd musl-1.1.22 && \
./configure --prefix=/musl-x86_64 && \
make install -j4 && \
cd .. && \
rm -rf musl-1.1.19
rm -rf musl-1.1.22
# Install linux kernel headers sanitized for use with musl
RUN curl --retry 5 -L https://github.com/sabotage-linux/kernel-headers/archive/v3.12.6-6.tar.gz | \
tar xzf - && \
......
......@@ -334,6 +334,8 @@ 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_SHARED_VALIDATE: ::c_int = 0x3;
pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
pub const SOCK_STREAM: ::c_int = 2;
pub const SOCK_DGRAM: ::c_int = 1;
......
......@@ -373,6 +373,8 @@ pub const MAP_EXECUTABLE: ::c_int = 0x01000;
pub const MAP_POPULATE: ::c_int = 0x08000;
pub const MAP_NONBLOCK: ::c_int = 0x010000;
pub const MAP_STACK: ::c_int = 0x020000;
pub const MAP_SHARED_VALIDATE: ::c_int = 0x3;
pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
pub const ENOTSUP: ::c_int = EOPNOTSUPP;
pub const EUCLEAN: ::c_int = 117;
......
......@@ -517,6 +517,8 @@ 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_SHARED_VALIDATE: ::c_int = 0x3;
pub const MAP_FIXED_NOREPLACE: ::c_int = 0x100000;
pub const EDEADLOCK: ::c_int = 35;
pub const ENAMETOOLONG: ::c_int = 36;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment