Thursday, December 11, 2008

Bibliography

Books
"Advanced Programming in the UNIX(R) Environment", W.Richard Stevens


Man pages

Signals
ForkLink

Exercise #1 Usefull functions

Following are links to man pages of system calls and C-Library functions that might be relevant to the exercise.

System related functions

fork()
pipe()
dup2()
kill()
signal()

sigaction()
sigprogmask()
execve() - system call / exec() C-Library functions.
sigsetops
exit()
getenv()

Strings functions
strchr()
strstr()
strlen()

Memory functions
malloc()/free()
memcpy()

Wednesday, December 10, 2008

Exercise #1 FAQ

Q: What should we do with the 'tee-proc' man page?
A: 'tee-proc' is a new command I have invented for the exercise sake. You are required to implement the new 'tee-proc' command which you have received it's man page as a specification.

Q: What is 'tee-proc' supposed to do?
A: The 'tee-proc' commad basically pipes the stdout of one process into the stdin of another between a list of applications given to is as arguments (argv).

Q: Is -i and --ignore-interrupts the same option?
A: Yes. They are the same option only with a different name, i.e. is should be possible to use either 'tee-proc -i ...' or 'tee-proc --ignore-interrupts'.

Q: How can I find out if a file (program) exists in a directory, in order for me to execute it?
A: Instead of checking whether the file exists you can try to exec() the file. If it doesn't exist, or you don't have execution permissions to the file, the exec() call will fail and you can continue looking...

Q: I have a another question, what should I do?
A: You can try talking to your friends and I'm sure you can come out with a reasonable and logical solution.

Q: My friends and I couldn't come to a reasonable and/or logical solution, what should we do?
A: You can always mail me with a specific question and I'll do my best to help.

Good luck