Re: mmap and PROT_WRITE

2002-02-14 Thread Andrew Gallatin
Jason Mawdsley writes: > Why can't I write to memory in the first case? > > Is there anyway I can implement writable but no readable memory? > > I read some where that there is no true write only memory do to the > limitations of x86. I think you must have read correctly -- your sample c

Re: mmap and PROT_WRITE

2002-02-14 Thread Terry Lambert
Jason Mawdsley wrote: [ ... trying to distinguish between PROT_WRITE and PROT_READ|PROT_WRITE ... ] > Why can't I write to memory in the first case? > > Is there anyway I can implement writable but no readable memory? Yes. Use hardware manufactured by a vendor other than Intel, and which can

mmap and PROT_WRITE

2002-02-14 Thread Jason Mawdsley
{ void * p = mmap( 0, 1024, PROT_WRITE, MAP_ANON, -1, 0 ); if ( p ) { /* * pukes and dies * *((int*)(p)) = 5; */ } } { void * p = mmap( 0, 1024, PROT_WRITE | PROT_READ, MAP_ANON, -1, 0 );