3 ms·
Windows does it nicely: everything is a securable (with ACL) object. Process, thread, file, socket, console, service... is an object, in a namespace. The only e
by zvrba 8y ago
Windows does it nicely: everything is a securable (with ACL) object. Process, thread, file, socket, console, service... is an object, in a namespace. The only exception I've encountered so far is network management stuff, like routing tables. WinObj is a nice tool to inspect how Windows handles this (https://docs.microsoft.com/en-us/sysinternals/downloads/winobj https://docs.microsoft.com/en-us/sysinternals/downloads/wino...)
> In Windows, you have 15 different versions of "read()" with sockets and
files and pipes all having strange special cases and special system calls.
That's not correct. ReadFile can be used for all kinds of objects, including sockets: https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-readfile https://docs.microsoft.com/en-us/windows/desktop/api/fileapi... Yes, it behaves differently depending on the type of the object, but so does read(2) (E.g., you'll never get SIGCHLD when reading from a file, for example.)
- forapurpose 8y agoRemember that Linus wrote that in 2007. Let's say he was talking about XP; might things have changed since then?
- zvrba 8y agoThe concepts of objects and ACLs are in the NT kernel itself. So things have worked like this on all windows versions built on the NT kernel: from WinNT 3.1, to Win2k, ... to this day. Windows TCPIP stack has improved since then, but I'd be _very_ surprised if ReadFile didn't work on sockets on XP (or anything NT-based, actually). In any case, he's very rash to call out Windows when Linux has its share of special-purpose syscalls that do the "same" thing (e.g.: send, sendv, sendmsg, sendfile, sendmmsg, …) with myriads of options to alter their behavior.