Subject: problems with mmap???
To: None <dsndata!sun-lamp.cs.berkeley.edu!current-users>
From: Randy Terbush <sierra!randy>
List: current-users
Date: 01/13/1994 06:14:00
Does mmap in NetBSD-current work as expected? I get the following
error message from this piece of code from XFree86 when calling mmap.
checkDevMem: warning: failed to mmap /dev/mem (Invalid argument)
linear fb access unavailable
if ((fd = open("/dev/mem", O_RDWR)) < 0)
{
if (warn)
{
ErrorF("checkDevMem: warning: failed to open /dev/mem (%s)\n",
strerror(errno));
ErrorF("\tlinear fb access unavailable\n");
}
useDevMem = FALSE;
return;
}
/* Try to map a page at the VGA address */
base = (pointer)mmap((caddr_t)0, 4096, PROT_READ|PROT_WRITE,
MAP_FILE, fd, (off_t)0xA0000);
close(fd);
if (base == (pointer)-1)
{
if (warn)
{
ErrorF("checkDevMem: warning: failed to mmap /dev/mem (%s)\n",
strerror(errno));
ErrorF("\tlinear fb access unavailable\n");
}
useDevMem = FALSE;
return;
}
munmap((caddr_t)base, 4096);
useDevMem = TRUE;
return;
------------------------------------------------------------------------------