+// ... otherwise fall back to the original /dev/mem which requires root level access
+
+ else
+ {
+
+// This check is here because people are too stupid to check for themselves or read
+// error messages.
+
+ if (geteuid () != 0)
+ (void)wiringPiFailure (WPI_FATAL, "wiringPiSetup: Must be root. (Did you forget sudo?)\n") ;
+
+ if ((fd = open ("/dev/mem", O_RDWR | O_SYNC | O_CLOEXEC) ) < 0)
+ return wiringPiFailure (WPI_ALMOST, "wiringPiSetup: Unable to open /dev/mem: %s\n", strerror (errno)) ;
+ }
+
+// Set the offsets into the memory interface.
+
+ GPIO_PADS = RASPBERRY_PI_PERI_BASE + 0x00100000 ;
+ GPIO_CLOCK_BASE = RASPBERRY_PI_PERI_BASE + 0x00101000 ;
+ GPIO_BASE = RASPBERRY_PI_PERI_BASE + 0x00200000 ;
+ GPIO_TIMER = RASPBERRY_PI_PERI_BASE + 0x0000B000 ;
+ GPIO_PWM = RASPBERRY_PI_PERI_BASE + 0x0020C000 ;
+
+// Map the individual hardware components
+
+// GPIO: