Download e-book for kindle: The Linux programmer's guide by Goldt S.

By Goldt S.

Show description

Read Online or Download The Linux programmer's guide PDF

Similar unix books

Cameron Newham, Carl Albing, JP Vossen's bash Cookbook: Solutions and Examples for bash Users PDF

The main to gaining knowledge of any Unix method, in particular Linux and Mac OS X, is an intensive wisdom of shell scripting. Scripting is how to harness and customise the ability of any Unix process, and it's a vital ability for any Unix clients, together with process directors OS X builders.

Download e-book for kindle: Teach Yourself Perl 5 in 21 Days by David Till

Sams educate your self Perl five in 21 Days is the suitable ebook for newbie and intermediate point clients who are looking to achieve a great realizing of this programming language. utilizing step by step tutorials, you are going to research every little thing you want to learn about this renowned programming language. detect how you can control textual content, generate reviews, and practice approach projects.

New PDF release: Solaris 9 System Administration Training Guide (Exam

Writer invoice Calkins is the top voice of this undefined, and he is once more introduced the ideal research better half for UNIX method execs getting ready for the Solaris nine method Administrator assessments (310-014 and 310-015). Readers getting ready for this examination locate our education consultant sequence to be the best self-study device available in the market.

Additional resources for The Linux programmer's guide

Example text

EINTR is returned if a signal is caught while the process is in the middle of blocking, and waiting for a message to arrive. Let’s examine a quick wrapper function for retrieving a message from our queue: int read_message( int qid, long type, struct mymsgbuf *qbuf ) { int result, length; /* The length is essentially the size of the structure minus sizeof(mtype length = sizeof(struct mymsgbuf) - sizeof(long); if((result = msgrcv( qid, qbuf, length, type, { return(-1); } 0)) == -1) return(result); } After successfully retrieving a message from the queue, the message entry within the queue is destroyed.

The integer values are stored in an array of unsigned short integers pointed to by the array member of the union. GETNCNT Returns the number of processes currently waiting for resources. GETPID Returns the PID of the process which performed the last semop call. GETVAL Returns the value of a single semaphore within the set. GETZCNT Returns the number of processes currently waiting for 100% resource utilization. SETALL Sets all semaphore values with a set to the matching values contained in the array member of the union.

In another scenario, an application could mark error messages as having a message type of 1, request messages could be type 2, etc. The possibilities are endless. On another note, do not be misled by the almost too-descriptive name assigned to the message data element (mtext). This field is not restricted to holding only arrays of characters, but any data, in any form. The field itself is actually completely arbitrary, since this structure gets redefined by the application programmer. Consider this redefinition: struct my_msgbuf { long mtype; long request_id; struct client info; }; /* Message type */ /* Request identifier */ /* Client information structure */ Here we see the message type, as before, but the remainder of the structure has been replaced by two other elements, one of which is another structure!

Download PDF sample

The Linux programmer's guide by Goldt S.


by Ronald
4.2

Rated 4.04 of 5 – based on 34 votes