lkml.org 
[lkml]   [2004]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Having problem with mmap system call!!!
From
Date
On Iau, 2004-09-16 at 15:07, Richard B. Johnson wrote:
> if((vp = mmap((caddr_t) HINT, len, PROT, FLAGS, fd, addr)) == SHM_FAIL)
> {
> fprintf(stderr, "Can't access shared memory\n");
> exit(EXIT_FAILURE);

SHM_FAIL is the wrong error check btw.

It is much better to do this in the driver than do nasty user mode hacks
using /dev/mem. When you do it kernel driver side you end up with a
cleaner mmap interface, a sensible permissions model and the hardware
device pages mapped directly and nicely into the app

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:06    [from the cache]
©2003-2011 Jasper Spaans