make an LWP context
void _lwp_makecontext(ucontext_t *ucp, void (*start_routine)(void *arg),
void *arg, void *private, caddr_t stackbase, size_t stacksize);
pointer to the context (to be filled)
pointer to function to be called on creation of the LWP
pointer to argument to start_routine
pointer to initial value for private data pointer
pointer to stack area
size of stack area
_lwp_makecontext fills in a context for a lightweight process (LWP).
The storage for the context is allocated by the user.
This interface is provided to fill in a ucontext to pass
allowing library implementors full flexibility in setting up
the abstractions they implement,
while ensuring that they start with a coherent minimal set of
information to execute an LWP.
If the LWP, when created, returns from its start_routine
this is treated as an implicit _lwp_exit.
The ucontext_t object is returned with the appropriate system
information based on the parameters from _lwp_makecontext.
_lwp_makecontext fills in the uninitialized context pointed to
start_routine is the function to be called on creation of the LWP;
it establishes the program counter for the context.
arg is the argument to start_routine.
private is the initial value for the private data pointer (this is
likely to be the address of the user level LWP descriptor in many implementations).
stackbase is the pointer to a user-allocated stack area.
stacksize is the size of the user-allocated stack area.
The values set in ucp are intended to be passed to _lwp_create.
If any of the following conditions is detected,
thr_create returns the appropriate value:
One or more of ucp, start_routine, arg, or private
point to an illegal address.
(This error may not be detected; a SIGSEGV signal may be posted to the
faulting LWP if an illegal address is used.)
Unlike threads, the start function called for _lwp_create returns void.
This means that there is no return value available through _lwp_wait,
and that less information from an LWP context needs to be retained past
Lightweight processes (LWPs) are internal interfaces and are subject
Their use should be avoided.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005