Re: Acceptable kernel code?

H. Peter Anvin (hpa@transmeta.com)
6 May 1997 16:42:58 GMT


Followup to: <199705051815.NAA02230@chaos.coredcs.com>
By author: "James R. Leu" <jleu@chaos.coredcs.com>
In newsgroup: linux.dev.kernel

> Is it acceptable to use functions like gethostbyname() inside of the kernel?

ABSOLUTELY NOT.

> Normally a userland function call should stay in userland, right?
> Well what about in a thread like nfsiod? It is kind of in userland
> (it's a process) and kind of in kernel land.

Not so, it is a process in kernel mode. It is 100% kernel code.

> What is the general rule of thumb for this?

Not a rule of thumb, a commandment: DON'T EVEN TRY. This is part of
the reason why autofs is implemented partially in the kernel and
partially in user space, so the user space daemon can take care of
this kind of business whereas the kernel code is there for speed.

-hpa

-- 
Always looking for a few good BOsFH.  **  Linux - the OS of global cooperation
        I am Baha'i -- ask me about it or see http://www.bahai.org/