#include <unistd.h>    /* open() */ 
#include <fcntl.h>     /* O_RDWR */ 
int fd; 
if ((fd = open("/dev/mem", O_RDWR)) < 0) 
{ 
  /* handle error here */ 
} 

Example 2: Calling open() on the memory device /dev/mem.

Back to Article
Copyright © 1999, Dr. Dobb's Journal