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
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
{
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 );
3 matches
Mail list logo