GPIO Input

Hi All,

I read a previous thread here on using GPIO via mmap. I've written
some quick and dirty code to configure the expansion port pins as
inputs and read data from them and thought it might be of use to
someone. The previous thread mentioned that there may be issues with
the GPIO registers being cached. I found that using the O_SYNC flag
with mmap seems to tell it that the memory is uncacheable. The code is
on my blog at:

I compiled/run this under Handheld Mojo but I think it should be

Comments welcome.