6

Possible Duplicate:
shifting from windows to *nix programming platform

Does anyone know a good, compact resource that would allow me to migrate from Windows programming to Linux programming?

I managed to get simple apps running, checked daemon architecture, but somehow I don't know where to begin to get a better understanding of the best practices and common solutions for architecture in general.

I guess all threading, mutex, critical section, i/o, (named?)pipe stuff is probably way off from Windows development. But I can't find a good, compact documentation.

The daemons in Linux seem to be way simpler than in Windows, but I already stumbled upon fork function that is completely unusual, and there should be other things like that I guess.

Also, what's about all that POSIX compliance thing? I heard it's supposed to be platform agnostic, but I also read that it's not exactly supported under some distributions.

Community
  • 1
  • 1
Coder
  • 3,695
  • 7
  • 27
  • 42
  • 2
    The question does not seem to be duplicate. – taskinoor Jun 17 '11 at 16:32
  • 1
    @taskinoor: It's pretty damn close. – Lightness Races in Orbit Jun 17 '11 at 16:36
  • I would like to better understand synchronization concepts, process management, file I/O, and gotchas that are connected with say, opening a symlink for writing. Pretty much stuff you can do via vim/gcc/c to develop business logic type components. That link is more about Distros/Editors/console commands. But I'll check it out. – Coder Jun 17 '11 at 16:36
  • @taskinoor - I figured this q would not get totally dup-ed off, but there is useful info there, and now it's forever linked to this one. I have added some more info below on specific areas not covered on that 'dup'. – Steve Townsend Jun 17 '11 at 16:39

7 Answers7

5

The Linux Programming Interface is amazing book I am reading now:

http://www.amazon.com/Linux-Programming-Interface-System-Handbook/dp/1593272200

Just look at its outstanding customers range - it is really excellent Linux programming book.

Alex F
  • 42,307
  • 41
  • 144
  • 212
3

You might take a look at esr's The Art of Unix Programming, which will answer most of your questions.

It will explain the *nix philosophy, the design of the APIs, the origins and reasons for POSIX compatibility, and everything else.

greyfade
  • 24,948
  • 7
  • 64
  • 80
2

As far as details on the *nix API goes, this is a good set of material:

http://www.hiraeth.com/alan/tutorials/courses/unixprog.html

And somebody has pulled together a nice list of links to many resources here

While it's good to learn the target platform, I strongly recommend using Boost libraries wherever possible as wrappers around the platform-dependent behaviors (for threading, networking, etc.)

holtavolt
  • 4,378
  • 1
  • 26
  • 40
1

Beginning Linux Programming and Advanced Linux Programming are two good resources to start with.

taskinoor
  • 45,586
  • 12
  • 116
  • 142
0

For threading in particular, you are probably going to want to read up on NPTL.

fork is most closely analogous to Windows CreateProcess but the semantics are different enough that you need to understand both well before mapping code over.

Steve Townsend
  • 53,498
  • 9
  • 91
  • 140
0

There are two things that you need to learn.

  1. Tools
  2. APIs

for tools look at: make and GCC. Make forms the basis most unix builds although there are a number of tools (Auto tools and CMake) that will generate the Makefile for you.

For APIs the best doc is the GLibC Manual. It does a great job of explaining the basic unix apis.

doron
  • 27,972
  • 12
  • 65
  • 103
0

Take a look at Unix Systems Programming by Robbins. It's really more about POSIX rather than just UNIX, and covers quite a bit of material with some very nice in-depth examples as well. The POSIX factor means that it translates quite nicely to Linux as well as some other UNIX variants such as BSD and OSX. After reading it, you'll definitely get a very good overview of how a POSIX system works, as well as an excellent survey of the major areas you'd use the API in such as threading, sockets, and file I/O.

Jason
  • 31,834
  • 7
  • 59
  • 78