This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Unable to open /dev/mem: permission denied
- From: "Jamie Mortimore" <jamie dot mortimore at googlemail dot com>
- To: cygwin at cygwin dot com
- Date: Sat, 14 Apr 2007 16:36:44 +0100
- Subject: Unable to open /dev/mem: permission denied
Hi,
There is probably a straightforward answer to this question. I am
trying to run a c program under cygwin that I have compiled using gcc
in cygwin. The program is trying to open /dev/mem in read/write mode.
However I always get permission denied. The code looks like:
int fd = open("/dev/mem", O_RDWR);
if(fd < 0) {
perror("Unable to open /dev/mem");
exit(2);
}
The output I get from this is:
Unable to open /dev/mem: Permission denied
I have set up a root user (in /etc/passwd) and am running the program
as root but this doesn't solve the problem. Any help much appreciated.
Thanks,
Jamie.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/