open(2)ing some files (e.g. devices) may produce various side effects which
are usually not desirable when you e.g. want to list a directory.
Also, with your suggestion, ls -l would require to open each of the files,
fstat it, close it, that's 3 times the amount of syscalls needed now.
What about stale symlinks? They should be lstatable, but open(2) will not
open you a file, nor the difference between lstat/stat disappears. Bad.
If the program needs to make sure a file is not changed underneath, it can
use open/fstat/close.
Cheers,
Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
UltraLinux | http://ultra.linux.cz/ | http://ultra.penguin.cz/
Linux version 2.3.18 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/