Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Feb 2002 21:49:55 -0500
From:      "Jason Mawdsley" <jason@macadamian.com>
To:        <freebsd-hackers@FreeBSD.ORG>
Subject:   mmap and PROT_WRITE
Message-ID:  <05e201c1b5cb$73a00520$2a64a8c0@macadamian.com>

next in thread | raw e-mail | index | archive | help
 {
        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 );

        if ( p )
        {
            *((int*)(p)) = 5;
        }
    }
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.

TIA

Jason Mawdsley ~ jason@macadamian.com
Software Designer ~ m_ a c a d a m i a n    t e c h n o l o g i e s

"Software experts for the world's leading technology companies."
http://www.macadamian.com

Because software development cycles should not end in tragedy.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?05e201c1b5cb$73a00520$2a64a8c0>