What are you trying to do? Typically one uses select for one (or a combination) of the following:
- You have more than one handle to read from/write to, and you want to do something with a handle when it comes available.
- You want to read from/write to a handle if it's available, and do something else if it's not.
- You want to time out waiting for a handle to become available.
Your program doesn't do either. It waits at most 0.2 seconds for a single handle to become availble, and then you read from it, without checking whether it actually has data on it, or whether the select timed out. You also don't check whether sysread encountered an error, or eof.
Since I can't guess the intend of your program, I won't offer an alternative.