Even though this isn't relevant to the group, here are a couple of
examples that may help.
It's a client-server program, well documented.
<code snipped>
funny, your code didn't even compile for me!
[sheldon@wsxyz]$ gcc --version
gcc (GCC) 3.3.1
Copyright (C) 2003 Free Software Foundation, Inc.
Dies ist freie Software; die Kopierbedingungen stehen in den Quellen. Es
gibt KEINE Garantie; auch nicht für VERKAUFBARKEIT oder FÜR SPEZIELLE ZWECKE.
[sheldon@wsxyz]$ gcc -Wall -O2 -std=c99 test.c
test.c:13:36: iostream.h: Datei oder Verzeichnis nicht gefunden
test.c:16:46: siginfo.h: Datei oder Verzeichnis nicht gefunden
In file included from test.c:19:
/usr/include/sys/ipc.h:25:3: Warnung: #warning "Files using this header must be compiled with _SVID_SOURCE or
_XOPEN_SOURCE"
test.c:24: error: parse error before "namespace"
test.c:24: Warnung: type defaults to `int' in declaration of `std'
test.c:24: Warnung: data definition has no type or storage class
test.c: In function `main':
test.c:63: error: `cout' undeclared (first use in this function)
test.c:63: error: (Each undeclared identifier is reported only once
test.c:63: error: for each function it appears in.)
test.c:63: error: `endl' undeclared (first use in this function)
test.c:69: Warnung: implicit declaration of function `exit'
test.c:82: Warnung: passing arg 3 of `pthread_create' from incompatible pointer type
test.c:55: Warnung: unused variable `buf_length'
test.c: In function `opFile':
test.c:133: error: `cout' undeclared (first use in this function)
test.c:133: error: `endl' undeclared (first use in this function)
test.c: In function `cleanUp':
test.c:240: Warnung: implicit declaration of function `psignal'
test.c:245: error: `cout' undeclared (first use in this function)
test.c:245: error: `endl' undeclared (first use in this function)
test.c:271:43: iostream.h: Datei oder Verzeichnis nicht gefunden
test.c: At top level:
test.c:279: error: parse error before "namespace"
test.c:279: Warnung: type defaults to `int' in declaration of `std'
test.c:279: Warnung: data definition has no type or storage class
test.c:286: error: redefinition of `struct mesgbuf'
test.c:289: error: redefinition of `message_buf'
test.c:35: error: `message_buf' previously declared here
test.c:291: error: redefinition of `struct filbuf'
test.c:296: error: redefinition of `file_buf'
test.c:42: error: `file_buf' previously declared here
test.c:298: error: redefinition of `main'
test.c:47: error: `main' previously defined here
test.c: In function `main':
test.c:316: error: `cout' undeclared (first use in this function)
test.c:317: error: `endl' undeclared (first use in this function)
[sheldon@wsxyz]$