To: | |
---|---|
Subject: | Re: [ts-7000] TS-7KV PLD Registers - simple code seg faults - ne suggestions |
From: | "Don W. Carr" <> |
Date: | Wed, 23 Aug 2006 11:10:38 -0500 |
You need to check the mmap function for errors. There is a special value (MAP_FAILED) to check for error. The start must be on a page boundry, and the size must be a multiple of the page size. Use getpagesize(). page_start = (unsigned char *) mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0x72000000); if (MAP_FAILED == page_start) { perror("mmap"); exit(0); } Also check the return value of open(). Less than zero means it failed. On 8/23/06,
mattsaintdev <> wrote:
|
<Prev in Thread] | Current Thread | [Next in Thread> |
---|---|---|
|
Previous by Date: | [ts-7000] Re: rs232 vs rs485, Yan Seiner |
---|---|
Next by Date: | [ts-7000] Re: rs232 vs rs485, Art |
Previous by Thread: | [ts-7000] Re: TS-7KV PLD Registers - simple code seg faults - ne suggestions, Matt Godbolt |
Next by Thread: | [ts-7000] New file uploaded to ts-7000, ts-7000 |
Indexes: | [Date] [Thread] [Top] [All Lists] |
Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU