The *at calls and Windows NT
Posted Mar 20, 2006 21:40 UTC (Mon) by Myria
Parent article: Some new system calls
A lot of people don't realize this, but Windows NT (and its descendants 2000, XP, 2003, Vista) actually does not have a "current directory" at all at the kernel level. When you open a file, you specify the directory to which the filename is relative. This is exactly like the openat, etc. proposed Linux syscalls above.
The current directory concept in Win32 is simulated by the user-mode library kernel32.dll. kernel32.dll retains an open handle to 27 open directory handles, one per drive letter (plus 1 for things like UNC paths). When you open a file relative to the current directory, kernel32.dll and ntdll.dll translate your filename into a path relative to the open handles that simulate the current directory before calling the NT kernel.
I think these syscalls are a good idea. Unfortunately, the concept of a kernel-level current directory must be retained in Linux, otherwise things like a chroot jail would be impossible.
to post comments)