usage: ./genserv port_num program_name args where: "port_num" is a valid TCP port number. "program_name" is a program to be run when a client connects. "args" is an optional list of arguments to the program to be executed. eg: ./genserv 12345 /usr/bin/uptime will listen on port 12345 and print the uptime string then exit. eg: ./genserv 12345 /usr/bin/uptime -V will listen on port 12345 and print the uptime version then exit.
[frink@thepurplebuffalo ~/code/cxx/genserv]$telnet 127.0.0.1 12321 Trying 127.0.0.1... Connected to 127.0.0.1. Escape character is '^]'. total 32 drwx------ 2 frink users 4096 May 17 18:00 CVS -rw-r--r-- 1 frink users 94 May 17 21:46 Makefile -rwx------ 1 frink users 16693 May 17 21:46 genserv -rw-r--r-- 1 frink users 3887 May 17 21:46 genserv.c -rw------- 1 frink users 0 May 17 21:47 typescript Connection closed by foreign host. [frink@thepurplebuffalo ~/code/cxx/genserv]$
ioctl(0, SNDCTL_TMR_TIMEBASE, 0xbffff598) = -1 EINVAL (Invalid argument) _exit(0)