Does a *nix API Exist?

I honestly have no idea why I didn't come here sooner. I've checked online for a few weeks and haven't found anything like MSDN for the Linux community, despite the fact that Linux is also written in C. Every forum out there tells you to use Boost, or QT or some other third party lib but no one actually answers the question that gets asked.

So, regardless of actuall usefulness I'm wondering does any Linux distro have a C\C++ API? Or are people stuck begging the Red Hat group for answers?
No, distros are composed of a large number of different libraries that take care of individual tasks. So is Windows, but the difference is that it is streamlined and all combined into the WinAPI.
Linux mostly conforms to the POSIX standard and for things that aren't covered by POSIX, there are other libraries available.
Each distro ships a (slightly) different set of libraries by default, so there is no uniform API. But of course, there are some libraries that can be expected to be available on all major distros.
For GUI stuff, there is Qt/GTK+/etc., for general graphics rendering there is cairo, for audio/video playback there is gstreamer (Gnome) or Phonon (KDE) and so on.
Last edited on
closed account (z05DSL3A)
This book may be of interest:
The Linux Programming Interface: A Linux and UNIX System Programming Handbook
by Michael Kerrisk
http://www.amazon.co.uk/Linux-Programming-Interface-System-Handbook/dp/1593272200/ref=sr_1_1?ie=UTF8&qid=1305321681&sr=8-1
Last edited on
Thank you guys, like I said I have no idea why I didn't just ask here sooner. This will help me over a roadblock that's been bugging me for a while now.
Last edited on
All UNIXes have a fairly common, standardized API - the POSIX API. There are some differences e.g. between Linux and BSD or Solaris, but generally calls to POSIX functions are fairly uniform. You can find "man pages" (manual pages) for everything in the POSIX API and they are fairly detailed. You can find them online or by using the "man" command on most UNIX systems: man fork.
Wait a minute I thought "fork" was a bash command. Is there no difference or did they name many of the same functions the same?
Lots of UNIX commands are wrappers for a like-named POSIX function. You can give a section number if you want to make sure you get a POSIX function instead of a system command and vice versa: http://www.december.com/unix/ref/mansec.html

e.g.
1
2
$ man 2 fork # fork() function
$ man 1 fork # fork command 


Edit: I don't have a system command "fork". If you want to create a child process in a Bash script, you use parentheses:
echo "Parent process"; ( echo "Child process" )
Last edited on
I was mistaken, thanks for clearing that up. Wow, my respect for those people who cross specilize has just jumped up a notch. This is harder then I thought it would be!
Topic archived. No new replies allowed.