Tag Info

Hot answers tagged

16

W. Richard Stevens: Advanced Programming in the UNIX Environment


11

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 ...


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 ...


8

$ man 2 read ... READ(2) Linux Programmer's Manual READ(2) NAME read - read from a file descriptor SYNOPSIS #include <unistd.h> ...


8

Linux Systems Programming you can refer this also link


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

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. ...


5

For GNOME, you can check out devhelp or help.gnome.org. But as everyone has already stated, there is no single SDK for "Linux". You need to have some idea of what you want before we can recommend specific developer resources.


5

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.


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

He's saying it's bound by a 64-bit type, which has a maximum value of (2 ^ 64) - 1 unsigned, or (2 ^ 63) - 1 signed (1 bit holds the sign, +/-). The type is not FILE; it's what the implementation uses to track the offset into the file, namely off_t, which is a typedef for a signed 64-bit type.1 (2 ^ 63) - 1 = 9223372036854775807. If a terabyte is 1000 ^ ...


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 ...


4

Typically command history is saved to a hidden file in the user's home directory. Other than that, you can log to stderr or syslog.


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, ...


3

I'd recommend Bruce Molay's "Understanding Unix/Linux Programming" (http://wps.prenhall.com/esm_molay_UNIXProg_1/). I had him as an instructor at Harvard, and he was fantastic.


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

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

Ambition or a overly severe urge for purity can lead you to do in-line assembly. For example, on x86_64 systems, you can do an open(2) system call like this: #include <sys/syscall.h> int linux_open(const char *pathname, unsigned long flags, unsigned long mode) { long ret; asm volatile ("syscall" : "=a" (ret) : "a" (__NR_open), ...


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.


2

The only overlaps I'm aware of are synonyms in areas that historically have differed between AT&T and BSD-derived Unixes. For example, AT&T Unix's EAGAIN means the same thing as BSD's EWOULDBLOCK, so they have the same value on systems that define both.


2

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 ...


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 ...



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