DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
SVR5

kthread_spawn(D3)


kthread_spawn -- spawn a new kernel thread

Synopsis

   #include <sys/types.h>
   #include <sys/ddi.h>
   

int kthread_spawn(void (*func) (void *), void *arg, const char *name, kthread_id_t *idp);

Description

kthread_spawn( ) spawns a new kernel thread. This thread is outside the context of the current process. The specified function, func, will be called with the given arg in the context of the new thread.

Arguments


func
function to invoke in the new thread.

arg
argument to pass to func.

name
name for the new thread, which may appear in process listings.

idp
pointer to the kthread_id_t structure that will be populated by kthread_spawn( ) with the thread ID of the newly created kernel thread. The resulting kthread_id_t structure may then be passed to the kthread_wait(D3) function. idp may be NULL if the caller is not going to use kthread_wait( ) to wait for the thread to exit.

Return values

The kthread_spawn( ) function returns 0 for success, or the appropriate non-zero error number from errnos(D5).

Usage

Context and synchronization

User or blockable context.

Hardware applicability

All

Version applicability

ddi: 8, 8mp

References

kthread_exit(D3), kthread_wait(D3)

``Kernel threads'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005