Re: mmap RW then mprotect RWX

Martin Husemann <[email protected]>
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
On Mon, Jan 13, 2025 at 04:46:15PM +0000, Emmanuel Dreyfus wrote:
> main(void)
> {
>         void *p;
> 
>         p = mmap(NULL, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON, -1, 0);
>         if (p == NULL)
>                 err(1, "mmap RWX failed");

You mean if (p == MAP_FAILED) here?

Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.