sosend() and mbuf
John Baldwin
jhb at freebsd.org
Thu Aug 6 12:38:24 UTC 2009
On Tuesday 04 August 2009 12:57:25 pm Dag-Erling Smørgrav wrote:
> Ed Schouten <ed at 80386.nl> writes:
> > Maslan <maslanbsd at gmail.com> writes:
> > > 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
> > I am not sure, but sharing another process's address space doesn't have
> > to imply it shares the same pid, right?
>
> The man page explicitly states that if no process is specified, the new
> thread is assigned to proc0, which has a valid filedesc table, valid
> creds etc., so this shouldn't be a problem. However, he's getting a
> different PID, which shouldn't happen. Either the man page is wrong, or
> things were different in 7.
proc0 does not have a fully valid file descriptor table. It has a structure,
but fd_[cjr]dir are not initialized to point at anything. File descriptors
are a property of userland processes, not of kernel processes. However,
fd_[cjr]dir need to be valid to perform any namei() lookup even if one is
simply going to do a vn_open() on the resulting vnode (which is more
approprate for kernel code to do, if it is to open a file at all).
--
John Baldwin
More information about the freebsd-hackers
mailing list