Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ _lwp_makecontext(2) — UnixWare 2.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

_lwp_exit(2)

_lwp_create(2)

getcontext(2)

makecontext(3C)

ucontext(5)






       _lwp_makecontext(2)                              _lwp_makecontext(2)


       NAME
             _lwp_makecontext - make an LWP context

       SYNOPSIS
             #include <types.h>
             #include <sys/lwp.h>
             #include <ucontext.h>
             void _lwp_makecontext(ucontext_t *ucp, void (*start_routine)(void *arg),
                   void *arg, void *private, caddr_t stackbase, size_t stacksize);

          Parameters
             ucp             pointer to the context (to be filled)

             start_routine   pointer to function to be called on creation
                             of the LWP

             arg             pointer to argument to start_routine

             private         pointer to initial value for private data
                             pointer

             stackbase       pointer to stack area

             stacksize       size of stack area

       DESCRIPTION
             _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 to
             _lwp_create, 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.

          ucp Parameter
             _lwp_makecontext fills in the uninitialized context pointed to
             by ucp.





                           Copyright 1994 Novell, Inc.               Page 1













      _lwp_makecontext(2)                              _lwp_makecontext(2)


         start_routine Parameter
            start_routine is the function to be called on creation of the
            LWP; it establishes the program counter for the context.

         arg Parameter
            arg is the argument to start_routine.

         private Parameter
            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 Parameter
            stackbase is the pointer to a user-allocated stack area.

         stacksize Parameter
            stacksize is the size of the user-allocated stack area.

         Return Values
            The values set in ucp are intended to be passed to
            _lwp_create.

         Errors
            If any of the following conditions is detected, thr_create
            returns the appropriate value:

            EFAULT   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.)

      USAGE
            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 _lwp_exit.

      REFERENCES
            _lwp_exit(2), _lwp_create(2), getcontext(2), makecontext(3C),
            ucontext(5)

      NOTICES
            Lightweight processes (LWPs) are internal interfaces and are
            subject to change.  Their use should be avoided.




                          Copyright 1994 Novell, Inc.               Page 2








Typewritten Software • bear@typewritten.org • Edmonds, WA 98026