You need root privileges to access /dev/mem.
To allow access to the GPIO a new device was created called /dev/gpiomem.
/dev/gpiomem can be accessed by members of the gpio group and grants access to the memory used by the GPIO.
I give example code at http://abyz.co.uk/rpi/pigpio/examples.html#Misc_tiny_gpiohttp://abyz.me.uk/rpi/pigpio/examples.html#Misc_tiny_gpio