Non-blocking access to the file system

view story

http://stackoverflow.com – When writing a non-blocking program (handling multiple sockets) which at a certain point needs to open files using open(2), stat(2) files or open directories using opendir(2), how can I ensure that the system calls do not block? To me it seems that there's no other alternative than using threads or fork(2). (HowTos)