sosend() and mbuf

Maslan maslanbsd at gmail.com
Tue Aug 4 09:27:08 UTC 2009


man kthread says:
The kthread_create() function is used to create a kernel thread.  The new
     thread shares its address space with process 0, the swapper process, and
     runs in kernel mode only.

However, when i checked the pid & tid of the new created thread it was
not the same as the parent nor as the proc0 & thread0

simple printf() gives:
swap procid=0, threadid=0
procid=1680, threadid=100089
procid=1681, threadid=100090   <--- created by kthread_create()





2009/8/3 Max Laier <max at love2party.net>:
> On Tuesday 04 August 2009 00:03:40 Dag-Erling Smørgrav wrote:
>> Dag-Erling Smørgrav <des at des.no> writes:
>> > One thing that springs to mind is that kern_open() will dereference
>> > td->td_proc, and AFAIK kthread_create() does not associate the thread
>> > with a process.
>>
>> This is wrong, and contradicts what I wrote further down.  Just ignore
>> it.
>
> IIRC, kernel threads don't have root.
>
> --
> /"\  Best regards,                      | mlaier at freebsd.org
> \ /  Max Laier                          | ICQ #67774661
>  X   http://pf4freebsd.love2party.net/  | mlaier at EFnet
> / \  ASCII Ribbon Campaign              | Against HTML Mail and News
>
>


More information about the freebsd-hackers mailing list