]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
In linux emulation layer try to detect attempt to use linux_clone() to
authorsobomax <sobomax@FreeBSD.org>
Thu, 3 Mar 2005 16:57:55 +0000 (16:57 +0000)
committersobomax <sobomax@FreeBSD.org>
Thu, 3 Mar 2005 16:57:55 +0000 (16:57 +0000)
commit148546007037b5afa82d0db9d471ef618d875512
treeba29913230380c4c6bf7753c0c677cca210d631f
parent860c6fe96aececfe576fff79d411679e02e945ad
In linux emulation layer try to detect attempt to use linux_clone() to
create kernel threads and call rfork(2) with RFTHREAD flag set in this case,
which puts parent and child into the same threading group. As a result
all threads that belong to the same program end up in the same threading
group.

This is similar to what linuxthreads port does, though in this case we don't
have a luxury of having access to the source code and there is no definite
way to differentiate linux_clone() called for threading purposes from other
uses, so that we have to resort to heuristics.

Allow SIGTHR to be delivered between all processes in the same threading
group previously it has been blocked for s[ug]id processes.

This also should improve locking of the same file descriptor from different
threads in programs running under linux compat layer.

PR: kern/72922
Reported by: Andriy Gapon <avg@icyb.net.ua>
Idea suggested by: rwatson
sys/i386/linux/linux_machdep.c
sys/kern/kern_prot.c