3 ms·
In those projects the libc is part of the tree. In Linux it is not the case. This is logically consistent for the project at hand. You can advocate a different
by asveikau 8y ago
In those projects the libc is part of the tree. In Linux it is not the case. This is logically consistent for the project at hand. You can advocate a different way and I can agree but it wouldn't be Linux. (I am no stranger to BSD either. Been using *BSDs in some form for 19 years.)
By the way Windows CRT ships new versions with Visual Studio out of devdiv... So Windows doesn't even work that way if you draw the boundary at libc. This is part of my comment, I don't understand which part of it is MS doing it right? Ntdll abstracting sysenter? Kernel and advapi abstracting ntdll? I don't think the latter example is one of great technical execution, it just sort of happened to promote compatibility with 9x and they're stuck with it.
- int_19h 8y agoBy "libc" I mean the userspace layer here broadly - on Windows that would be kernel32 etc. What VC++ calls CRT is built on that in turn. Although as of Win10, the actual CRT is also an API-stable OS-level component now, not a VC++-specific thing: https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introducing-the-universal-crt/ https://blogs.msdn.microsoft.com/vcblog/2015/03/03/introduci... The right thing here is the general notion of abstracting away core kernel APIs in userspace. It lets you refactor the whole thing significantly without breaking everything. And userspace calls are easier to maintain long-term for legacy support reasons, as well (at some point you can make it into a DLL that doesn't even have to be distributed with the OS, and just ship that with apps that need it).
- asveikau 8y agoDid you miss the part where I pointed out the reason to abstract ntdll is dead? There is no more 9x. There is no more CE. It would already be serious work to move away from NT. eg. Why should all the filesystem APIs be path-based and introduce an extra CreateFile with who-knows-what sharing flags behind the scenes, when NT was built to work with handles and path lookup is slower than on Unix? Abstractions are good but they need some basis in reality. The situation in Windows is in many cases layers atop layers without an actual need.
- int_19h 8y agoThe difference between ntdll and kernel32 is very different from the original discussion about syscalls. The reason why kernel32 is still there because there's tons of software written for that API. The reason why it's good to abstract away syscalls is because it allows you to break those syscalls without userspace noticing.