|
|
Log in / Subscribe / Register

The *at calls and Windows NT

The *at calls and Windows NT

Posted Mar 20, 2006 21:40 UTC (Mon) by Myria (guest, #36609)
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.

Melissa


to post comments

The *at calls and Windows NT

Posted Mar 21, 2006 1:23 UTC (Tue) by BrucePerens (guest, #2510) [Link]

Unfortunately, the concept of a kernel-level current directory must be retained in Linux, otherwise things like a chroot jail would be impossible.

The new system call that splits off the pathname space for private mounts is probably a susperset of chroot(), and chroot() could be implemented on top of it. You don't need a current directory pointer for chroot() to work. Just a root.

Bruce


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds