home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ukma!bogus.sura.net!howland.reston.ans.net!usc!srhqla!quest!kdq
- From: kdq@quest.UUCP (Kevin D. Quitt)
- Newsgroups: comp.lang.c
- Subject: Re: =======Problem with mmap command on DECStation========
- Message-ID: <1ge3XB4w165w@quest.UUCP>
- Date: Wed, 27 Jan 93 18:08:35 PST
- References: <1993Jan27.065349.27873@usage.csd.unsw.OZ.AU>
- Reply-To: srhqla!quest!kdq
- Organization: Job quest (805) 251-8210, So Cal: (800) 400-8210
- Lines: 17
-
- roy@spectrum.cs.unsw.oz.au (Prabal Kumar Roy) writes:
- ...
- > However, at the statement *intptr = 1; I am getting the following error.
- > pid 10810 (a.out) was killed on kernel access, at pc 0x400284. Bus error (co
- > dumped).
- ...
- > result = (caddr_t) mmap(0, 1000, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
- > intptr = (int *) result;
- > *intptr = 1;
-
- Uh, have you bothered to check 'result' to see if the return from
- mmap is a null pointer? I assume that's what you'd get if the call
- fails. I highly recommend such bulletproofing.
-
-
- _
- Kevin D. Quitt 96.37% of all statistics are made up. srhqla!quest!kdq
-