Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

CaptainZap

macrumors regular
Original poster
Jan 17, 2007
170
0
I've been reading about BSD sockets and a lot of other Unix functions that I don't understand. And I am wondering if anyone knows some good online tutorials or books that go more into depth on Unix APIs and a good C book.
 

CaptainZap

macrumors regular
Original poster
Jan 17, 2007
170
0
Alright sweet, thanks. I was actually thinking of PMing you directly and asking :)
Oh, and I'm wondering about how much C knowledge is necessary. I've read Programming in Objective-C and know the syntax well but I don't think my C is very good.
 

lee1210

macrumors 68040
Jan 10, 2005
3,182
3
Dallas, TX
Unix APIs are all C. Unix and C are best friends. Other languages essentially all end up using the C routines for getting at the system. For example, perl is in C, the JVM is in C, etc. Any call to a UNIX API will be the description of the C call. Obviously things that can call directly into C can use the APIs as well.

Essentially you will find out what methods you need, and look at a description in a book, the man page, or something online. You'll need to find out what header file (.h) you need to include to use the function, and what types you have to pass in. Many system functions use pointers to special structs as arguments. Normally these will be defined in a .h file as well.

If it's not your forte it might take some time to adjust to some of the UNIXisms, like "everything is a file". When you open a socket, it's a file descriptor. You just poke at it in slightly different ways.

good luck!

-Lee
 

CaptainZap

macrumors regular
Original poster
Jan 17, 2007
170
0
K thanks Lee, now I just need to find a good C tutorial/book that talks about the language a little more in depth.
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
What Cromulent said. The Stevens' books are the standard reference for C "systems" programming.

Other invaluable resources:

The online GNU C library reference manual:

http://www.gnu.org/software/libc/manual/html_node/index.html

(be sure to check your system man pages to check for divergences)

The comp.lang.c FAQ:
http://c-faq.com/

Another must read is Expert C programming:

http://www.amazon.com/Expert-Progra...bs_sr_1?ie=UTF8&s=books&qid=1206154466&sr=8-1

from which I learned as much as I ever did from Stevens or Kernighan and Richie.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.