Unix C Programming
Frequently Asked Questions
- About this FAQ
- 1. Process Control
- 1.1 Creating new processes: fork()
- 1.2 Environment variables
- 1.3 How can I sleep for less than a second?
- 1.4 How can I get a finer-grained version of alarm()?
- 1.5 How can a parent and child process communicate?
- 1.6 How do I get rid of zombie processes?
- 1.7 How do I get my program to act like a daemon?
- 1.8 How can I look at process in the system like ps does?
- 1.9 Given a pid, how can I tell if it's a running program?
- 1.10 What's the return value of system/pclose/waitpid?
- 1.11 How do I find out about a process' memory usage?
- 1.12 Why do processes never decrease in size?
- 1.13 How do I change the name of my program (as seen by `ps')?
- 1.14 How can I find a process' executable file?
- 1.15 Why doesn't my process get SIGHUP when its parent dies?
- 1.16 How can I kill all descendents of a process?
- 2. General File handling (including pipes and sockets)
- 2.1 How to manage multiple connections?
- 2.2 How can I tell when the other end of a connection shuts down?
- 2.3 Best way to read directories?
- 2.4 How can I find out if someone else has a file open?
- 2.5 How do I `lock' a file?
- 2.6 How do I find out if a file has been updated by another process?
- 2.7 How does the `du' utility work?
- 2.8 How do I find the size of a file?
- 2.9 How do I expand `~' in a filename like the shell does?
- 2.10 What can I do with named pipes (FIFOs)?
- 3. Terminal I/O
- 4. System Information
- 5. Miscellaneous programming
- 6. Use of tools
- Examples