Alexander van der Grinten

Results 119 comments of Alexander van der Grinten

It's not necessary (or useful) to iterate over /proc/self/tasks since we can simply keep a global list of threads. But the remainder of the procedure sounds right.

If a program does `syscall(SYS_CLONE)`, all hope to implement anything thread-related in a sane way is lost anyway. For example, such threads won't have a working TLS.

The `#ifdef` based on `__MLIBC_LINUX_OPTION` doesn't make sense to me either. Why does this type change based on the enabled options?

What's the issue here? Are there programs that rely on EFAULT to detect if a memory range is readable/writable?

I'm not sure if we should make an effort to return EFAULT instead of raising a segfault. Relying on EFAULT sounds very strange.

Hm? What prevents you from implementing `sys_dup` based on `syscall(SYS_dup3)` on Linux?

That's indeed an issue. I guess we should simply use `fcntl(F_DUPFD_CLOEXEC)` instead.

Well, there is only a single flag that can be set (`O_CLOEXEC`), so one can always either use `F_DUPFD`/`dup` (which unsets the flag) or `F_DUPFD_CLOEXEC`.

Since this breaks ABI, we probably want to implement all the pthread attribute functionality in one iteration, possibly for mlibc 3.0.