Tag Info

Hot answers tagged

9

There are in fact three gradations in system calls. Some system calls return immediately. “Immediately” means that the only thing they need is a little processor time. There's no hard limit to how long they can take (except in real-time systems), but these calls return as soon as they've been scheduled for long enough. These calls are usually called ...


9

The Linux Programming Interface by Michael Kerrisk Note that the author is the current maintainer of the Linux man pages. And that it's not out yet so I can't actually say how good it is, but I've read the blog posts about it and it sounds like a good book. (and he is the maintainer of the man pages, and those are mostly well written and he ought to know ...


7

There is no such system call, or set of system calls. It's all done by convention. Back in the old days, when a "terminal" was a large clunky piece of equiment linked to a computer via a cable, "smart terminals" would do things like move the cursor, or draw a line, or fill in a polygon with colors. The smart terminal usually did this via "escape sequenes". ...


6

C is fine for system programming. As a starting point you could take a look at the books from this questions. As system programming is a broad field, perhaps they give you a hint where you could start. The ultimate project would definitely be the linux kernel, but it's hard as your first project. A smoother entrance to the field would be, to rewrite some ...


5

There are various tools to do this (of which, other than daemontools and perp, I don't have much experience with): daemontools is more or less the "classic" implementation that spurned most of the other modern implementations supervisord minit s6 runit The one we have come to like at my workplace is perp, which was the best featured for our ...


5

A unified SDK implies a single source for all the core libraries. That just isn't the way open source operating systems work. Bits and pieces come from all over, and they're all separately documented. EDIT: If paper's not a problem for you, the closest thing to what you're asking for is Advanced Programming in the Unix Environment 2/e by Stevens and Rago. ...


4

Here you can find a database of the best books to learn Linux: http://www.tldp.org/guides.html I'm currently reading Introduction to Linux - A Hands on Guide by Machtelt Garrels And I like it, the way it's written make it easy to understand.


4

Checkout tput. It is a wrapper around ANSI Escape sequences that are supported (the amount of support differs a lot) by almost all terminal emulators. tput will only output the sequence if it is supported by the terminal, therefore you don't have to worry about the support. Or at least you don't have to worry about strange characters being printed in the ...


3

There are two aspects: the ways system calls signal that an error occurred, and the way what error occurred is reported. Most system calls signal that an error occurred by returning -1, but this is not completely universal (for example, some system calls are always successful, e.g. getpid). If you know an error occurred, the error code is always in errno¹. ...


3

In your system admin type work, does some task you do either puzzle you (How does that work?) or irritate you (Shouldn't that work better/faster?)? Find several of those tasks, identify the very basic feature that you don't understand, or that irritates or puzzles you. Try to implement the puzzling, irritating or slow feature in C. You will get a more ...


3

I second the Stevens recommendation. The only real alternative is Advanced UNIX Programming by M.J. Rochkind: http://basepath.com/aup/ ORA's POSIX Programmer's Guide (http://oreilly.com/catalog/9780937175736) may be useful, but I haven't read it myself.


3

MSDN only documents Microsoft technologies, and not other libraries or frameworks to use on Windows; it doesn't include documentation from other vendors. Now, linux distros use software from much more organisations & companies, so the documentation also tends to be more distributed and less uniform. (And sometimes documentation isn't done very well, ...


2

Consider: two processes can have the same file open for reading & writing at the same time, so some kind of communication is possible between the two. When process A writes to the file, it first populates a buffer inside its own process-specific memory with some data, then calls write which copies that buffer into another buffer owned by the kernel (in ...


2

Of course it can. Depending on your specific needs, you should consider several things: will you need any kind of support or will you be able and allowed (in the long run) to take care of the technical things yourself? For anything production grade an "enterprise" distribution with support seems to be a better option. what architecture do you need to run ...


2

Just some pointers on how to (possibly) talk with the power daemon. Have a look into the Chromium OS sources (no idea on how much this differs from Chrome OS), there you'll find the power_managers sources which might be helpful: README explains what one can find there, among others: powerd (powerd.cc) Upper power manager. Adjusts device status ...


2

Free Openclassroom Full courses. Short Videos. Free for everyone, stanford.edu coursera Education company that partners with the top universities and organizations in the world to offer courses online for anyone to take, for free. MIT Open Courseware Massachusetts Institute of Technology Courses. Codecademy Learn to code interactively, for free. ...


2

You might want to start with something a lot simpler to get started in this sort of thing, as it sounds as if you are new to it. Perhaps the old talk / talkd command line program and daemon would be more approachable? Some valuable resources include APUE, or Advanced Programming in the UNIX Environment (Stevens), UNP, or UNIX Network Programming (Also by ...


2

In addition to what Chris Down wrote, I would also recommend monit. It can notably check if a port if open (eg 80) and restart the appropriate service (eg httpd) if this port is closed. See this example for sshd : check process sshd with pidfile /var/run/sshd.pid start program "/etc/init.d/sshd start" stop program "/etc/init.d/sshd stop" if failed port 22 ...


2

I know this is not the exact answer to your question but the curses library is the stuff you need to do some tui dev. If you're a programmer, looking at its source (available in all open-source unix distributions) will show you how it's done.


1

Puppet allows you to define which services should be running on your system. Puppet is IT automation software that helps system administrators manage infrastructure throughout its lifecycle, from provisioning and configuration to patch management and compliance. Using Puppet, you can easily automate repetitive tasks, quickly deploy critical applications, ...


1

Harvard Extension School, offers an online (and real classroom if you live in the greater Boston area) class on Unix & Linux systems programming. CSCI E-28 Unix/Linux Systems Programming by Prof. Bruce Molay. I highly recommend it, but it is not free. Another option is a set of videos and books by Marshall Kirk McCusick (of BSD fame) about the ...


1

Before going there, go read the specifications of the telnet protocol (RFC 854, see also the Wikipedia entry for the full list of RFCs involved). Telnet is a very complex protocol, as it was designed to connect between machines of a wild variety of operating systems, down to different character coding. Moreover, it is recommended to never use it, as it is ...


1

If you search in the header files on your system, you'll find in what header file the function is declared on your system. It may be difficult as sometimes the function is declared via a complex macro. And it'll only tell you what header file declares the function on your system; this may even be a header file that you can't include directly because it needs ...


1

A slow system call is something like a TCP socket read() - if you don't have O_ASYNC (or whatever) set, it can wait for ever. A fast system call is something like gettimeofday() or getpid(), both of which return information to the process that the kernel has immediately available. Disk reads fall in the category of slow system calls. If a process does a ...



Only top voted, non community-wiki answers of a minimum length are eligible