Any Linux programming tips for a Windows programmer (C / C ++)?

Possible duplicate:
transition from Windows to the * nix programming platform

Does anyone know a nice compact resource that will allow me to move from Windows programming to Linux programming?

I managed to run simple applications, check the architecture of the daemon, but for some reason I don’t know where to start to better understand the best practices and general solutions for the architecture as a whole.

I think all threads, mutex, critical section, i / o, (named?) Are probably removed from Windows development. But I can not find a good compact documentation.

Daemons on Linux seem simpler than on Windows, but I have already stumbled upon a fork function, which is completely unusual, and there should be other things, as I assume.

Also, what about everything about POSIX? I heard that it should be an agnostic of the platform, but I also read that it is not supported exactly on some distributions.

+6
source share
7 answers

As for the API * nix details, this is a good set of materials:

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

And someone put together a good list of links to many resources here

Although it is useful to study the target platform, I highly recommend using Boost libraries, where possible, as wrappers around platform-specific behaviors (for streams, networks, etc.)

+2
source

The Linux programming interface is a terrific book I'm reading right now:

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

Just look at your outstanding customer portfolio - this is a really great Linux programming book.

+5
source

You can take a look at esr "The Art of Unix Programming," which most of your questions will answer.

He will explain the * nix philosophy, API design, the origins and reasons for POSIX compatibility, and more.

+3
source

Getting Started with Linux Programming and Advanced Linux Programming are two good resources to get started.

+1
source

For streaming in particular, you probably want to read NPTL .

fork most closely resembles Windows CreateProcess , but the semantics are quite different, which you need to understand well before code conversion.

0
source

There are two things you need to learn.

  • Instruments
  • API

for tools see: make and GCC . Build the basics for most unix collections, although there are a number of tools (Auto tools and CMake) that will generate the Makefile for you.

For APIs, the best document is the GLibC Guide . It does an excellent job explaining the basic Unix aiki.

0
source

Take a look at Robbins Unix Systems Programming . This is really more about POSIX, not just on UNIX, and contains quite a lot of material with some very good detailed examples. The POSIX coefficient means that it translates perfectly to Linux, as well as some other UNIX variants, such as BSD and OSX. After reading, you will probably get a very good overview of how the POSIX system works, as well as an excellent overview of the main areas in which you would use APIs, such as streams, sockets, and input / output files.

0
source

Source: https://habr.com/ru/post/890776/


All Articles