Category Archives: C Programming

C programming topics

Unix C Sockets

protocol family constants for socket function Family Description AF_INET IPv4 protocols AF_INET6 IPv6 protocols AF_LOCAL Unix domain protocols AF_ROUTE Routing sockets AF_KEY Key socket type of socket for socket function Type Description SOCK_STREAM stream socket SOCK_DGRAM datagram socket SOCK_RAW raw … Continue reading

Posted in C Programming, Network Programming | Leave a comment

Summary of getaddrinfo

getaddrinfo( ) actions and results based on hostname(s) and address families Easy and readable chart thats from the networking book “Unix Network Programming” by: W. Richard Stevens. Hostname specified by caller Address Family specified by caller Hostname string contains Result … Continue reading

Posted in C Programming, Network Programming | Leave a comment

Function for populating dynamic array with ints

Posted in C Programming | Leave a comment

Main arguments in C

The beginning of a program. int main(int argc,char*argv[]) here we have a standard C main routine with two arguments. argc and char*argv[] argc is the number of arguments supplid to the program via command line or other sources. char*argv[] an … Continue reading

Posted in C Programming | Leave a comment

Random C Stuff / Notes for errors in Unix

Random Error Notes error numbers are a unique within system strerror ← system function to get error by number strerror(errno) If you do a system call the error is set. But will be re-set after another system call. This is … Continue reading

Posted in C Programming | Leave a comment

C fork() process

progName.c This is and example of the basic usage of the fork() call in a unix C environment. wrapper.c Here is a link to the source files, just needs proper includes project files.

Posted in C Programming | Leave a comment