Deutsch English Français Italiano |
<uuvigf$340q8$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro <ldo@nz.invalid> Newsgroups: comp.lang.c Subject: Re: Memory mapping: MAP_PRIVATE and msync() Date: Mon, 8 Apr 2024 01:50:07 -0000 (UTC) Organization: A noiseless patient Spider Lines: 20 Message-ID: <uuvigf$340q8$1@dont-email.me> References: <osGzrqwQ8DBTJ8mCFoPEiv6Pn0M@jntp> <qmtiixDX3flrgimP-RUFSW_hf7o@jntp> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 08 Apr 2024 01:50:07 +0200 (CEST) Injection-Info: dont-email.me; posting-host="ba48ee83c2dfe27d1f58abbb170b1e26"; logging-data="3277640"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18O1eM16pjQuyKOM5gHANAD" User-Agent: Pan/0.155 (Kherson; fc5a80b8) Cancel-Lock: sha1:2ekvutD76LscuGqy7V+pL61HlII= Bytes: 1502 On Sun, 07 Apr 24 15:18:47 +0000, pehache wrote: > void* p2 = mmap( NULL > , n > , PROT_READ | PROT_WRITE > , MAP_SHARED | MAP_NORESERVE > , fd > , 0 ); Not easy to remember what the arguments mean. Try this: void * p2 = mmap ( /*addr =*/ NULL, /*length =*/ n, /*prot =*/ PROT_READ | PROT_WRITE, /*flags =*/ MAP_SHARED | MAP_NORESERVE, /*fd =*/ fd, /*offset =*/ 0 );