-2

I have been developing for Windows for a long time, mainly WinApi (and .Net).

I'v started learning basic Linux, and I have some questions regarding the differences:

  1. In Windows I have barely used the C Standard library.

    If I needed an API, I would search MSDN and find the appropriate library\function.

    From what it seems like, in Linux the C Standard library is EVERYTHING.

    All the code samples I have seen used the standard library (Instead of using some Linux internal functions, like a Linux "CreateFile").

    Is this really how writing "proper" linux code is done ? Using the C standard library ?

    If I wish to read a file, or allocate memory are fopen\malloc the way to go ?

  2. If the answer to my first question is yes (And I guess it will be)

    The C standard library is POWERLESS compared to the powerful WinApi.

    Lets say I wish to get a list of running process (CreateToolhelp32Snapshot) or create a thread or a process (CreateThread\CreateProcess), How should I do that in Linux ?

  3. Documentation.

    In Windows, all I need can be found in MSDN.

    If I have a "how do I do" question (Like the questions above) where should I go ?

    Where is my main source of documentation.

Thanks a lot, Michael.

Michael
  • 796
  • 11
  • 27
  • Try http://www.amazon.com/Posix-Programmers-Guide-Donald-Lewine/dp/0937175730/ref=sr_1_4?ie=UTF8&qid=1401811507&sr=8-4&keywords=POSIX – R Sahu Jun 03 '14 at 16:05
  • http://stackoverflow.com/q/453993/34397 – SLaks Jun 03 '14 at 16:05
  • 2
    http://programmers.stackexchange.com/questions/65845/moving-from-windows-to-linux – xxbbcc Jun 03 '14 at 16:06
  • Of course you don't just use the standard C library. How would you access Linux-specific functionality? – ooga Jun 03 '14 at 16:06
  • I upvoted this - although this is not a great question per SO rules, I believe this would be useful knowledge in a single place. – xxbbcc Jun 03 '14 at 16:07
  • I imagine there are *tons* of libraries which you can invoke from C. Not all of them will be installed on any given machine by default, of course. – David Jun 03 '14 at 16:07
  • 1
    Here's all you need: http://www.amazon.com/The-Linux-Programming-Interface-Handbook/dp/1593272200 – Crowman Jun 03 '14 at 16:23

1 Answers1

2

Perhaps you've forgotten that the Standard C Library isn't environment-specific, it specifies least-common-denominator functionality among all systems that can run C programs, and C runs on systems that don't even have processes.

If you want an API that provides consistent common GUI/multithread/etc. APIs, pick a likely-looking GUI/multithread/etc. API. You might start with Qt, it's quite comprehensive and produces good-looking, near-native UIs on a host of systems.

It's not generally considered polite to point this out, but most questions that get asked publicly are asked by people who lack the discipline to do even simple research. Once people can do that, they don't need to ask very many, and that's why what you see is so ... trivial. You're past that. For more options, you could start here.

For more general-purpose tools, the top hit on a search for important linux tools might be helpful.

jthill
  • 55,082
  • 5
  • 77
  • 137
  • Thanks for your comment, its really helpful. I agree with your point about simple research. Personally I'v been working in the field for years and I am custom to self teaching my self. The thing is ... Linux is a weak spot for me :) Its confusing and counter intuitive from my Windows world. So I had the urge to ask these questions before researching enough by myself. 10x again. – Michael Jun 03 '14 at 19:45
  • You're welcome, glad I could help. Along with the cross-platform stuff, I've found unix fundamentals extremely helpful, file descriptors and forking and pipelines are radical in every sense. [When you get to the point where the answer to about half the things you want to do is "wrote this stupid little script for it", you've got it :-)](http://www.leancrew.com/all-this/2011/12/more-shell-less-egg/) – jthill Jun 03 '14 at 20:37