Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ swapcontext(3C) — DG/UX R4.11

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exit(2)

getcontext(2)

sigaction(2)

sigprocmask(2)

reentrant(3)

ucontext(5)



swapcontext(3C)                   SDK R4.11                  swapcontext(3C)


NAME
       swapcontext - manipulate user contexts

SYNOPSIS
       #include <ucontext.h>

       int swapcontext (ucontextt *oucp, ucontextt *ucp);

DESCRIPTION
       This function is useful for implementing user-level context switching
       between multiple threads of control within a process.

       swapcontext saves the current context in the context structure
       pointed to by oucp and sets the context to the context structure
       pointed to by ucp.

       This function will fail if either of the following is true:

       ENOMEM         ucp does not have enough stack left to complete the
                      operation.

       EFAULT         ucp or oucp points to an invalid address.


   Considerations for Threads Programming
                    +------------+-----------------------------+
                    |            |                      async- |
                    |function    | reentrant   cancel   cancel |
                    |            |             point     safe  |
                    +------------+-----------------------------+
                    |swapcontext |     Y         N        N    |
                    +------------+-----------------------------+

SEE ALSO
       exit(2), getcontext(2), sigaction(2), sigprocmask(2), reentrant(3),
       ucontext(5).

DIAGNOSTICS
       On successful completion, swapcontext returns a value of zero.
       Otherwise, a value of -1 is returned and errno is set to indicate the
       error.

NOTES
       The size of the ucontextt structure may change in future releases.
       To remain binary compatible, users must always use getcontext to
       create new instances of them.


Licensed material--property of copyright holder(s)

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