TIL another awful thing about Linux procfs behavior; top-level /proc only reports processes (thread-groups) via getdents/readdir, but opening /proc/$tid where $tid is any thread id (not necessarily also a process id) succeeds.
Yes I'm aware. See the other branch of this thread. Also it's CLONE_THREAD; you can use CLONE_VM without CLONE_THREAD, e.g. as vfork.https://twitter.com/RichFelker/status/984465290489749504 …
-
-
Oh that’s right. Early on they only had CLONE_VM and no concept of tid. I think that is why CLONE_THREAD got added, so that proc and procps could differentiate processes from threads. I remember in the 2.4.x days a period where ps showed all threads as processes. Linus relented
-
Showing them in /proc was the least of the problems with this naive and bone-headed approach. Signal semantics, child process relationships, exec behavior, etc. were all wrong and could not be fixed just by emulating pthreads in userspace.
End of conversation
New conversation -
-
-
BSD ps would open /dev/men and because it was built as part of “make world” it had the same struct as the kernel. It was fast. Linux procps was slow because it had to open loads of files. top could be using the most cpu when you ran it. top at the top of top.
-
Yep, I'm aware of the historical "let's make ps suid-root" awfulness of the BSDs. It was actually one of my turn-offs to BSD when first getting acquainted with Linux and FOSS. When was it finally fixed?
-
I don’t know. It dates back to the time when you could trust other nodes on the Internet, and services had no auth, before things like cleattext auth in pop3. You needed a local account for mail and uucp, sendmail and nntp all ran as root. sendmail had no authentication.
End of conversation
New conversation -
-
-
This timeframe: http://lwn.net/2001/1108/a/proc-of-shit.php3 …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Linus would be saying Linux has “tasks” iirc
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.