I am writing GPIO functions in C using standard libraries that come with the raspberry pi, and do not require installing other libraries such as wiringpi.

So I have been using stdlib.h and stdio.h, and writing, and reading the files that describe each GPIO pin using the sysfs interface. I'm just wondering if there are any other standard library interfaces for the raspberry pi i should know about.

  • Maybe relevant: raspberrypi.stackexchange.com/q/41014/5538 The linux kernel interface (sysfs) is language agnostic by design; as per that Q&A implementing something language specific is trivial and so you may or may not find various things around -- which of course would require "installing other libraries". However, since there is no C standard which specifies a GPIO interface, pretty much by definition the answer here has to be no, there are only the add-on libraries.
    – goldilocks
    Sep 27, 2016 at 13:53

2 Answers 2


The sysfs system filesystem access to the GPIO is all that is provided as a standard library from Linux.

There are dozens of third party libraries.

See http://elinux.org/RPi_GPIO_Code_Samples for some of the third party libraries.

  • I just found pigpio.h it looks promising.
    – j0h
    Sep 27, 2016 at 13:46
  • 2
    @j0h I think so, but I wrote it so I would say that! pigpio
    – joan
    Sep 27, 2016 at 14:04

AFAIK WiringPi should be included in latest Raspbian. If you have the gpio utility it is there (as gpio is a WiringPi utility).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.