Bash-Linux.com : Le SHELL pour les nuls

  Actuellement 50 lignes de commande et 1472 man disponibles
login as: root
root@213.186.33.18's password:
Last login: Mon May 28 21:40:28 2012 from 38.107.179.230
[root@bash-linux ~] # echo "Bienvenue sur Bash-Linux.com"_
 Manuel des commandes UNIX (man) Version anglaise

Indiquez la fonction :

Man Getcontext en anglais

GETCONTEXT(2) Linux Programmer's Manual GETCONTEXT(2)
 
NAME


getcontext, setcontext - get or set the user context
 
SYNOPSIS


#include int getcontext(ucontext_t *ucp); int setcontext(const ucontext_t *ucp);
 
DESCRIPTION


In a System V-like environment, one has the two types mcontext_t and ucontext_t defined in and the four functions getcontext(), setcontext(), makecontext(3) and swapcontext(3) that allow user-level context switching between multiple threads of control within a process. The mcontext_t type is machine-dependent and opaque. The ucontext_t type is a structure that has at least the following fields: typedef struct ucontext { struct ucontext *uc_link; sigset_t uc_sigmask; stack_t uc_stack; mcontext_t uc_mcontext; ... } ucontext_t; with sigset_t and stack_t defined in . Here uc_link points to the context that will be resumed when the current context terminates (in case the current context was created using makecontext(3)), uc_sig- mask is the set of signals blocked in this context (see sigproc- mask(2)), uc_stack is the stack used by this context (see sigalt- stack(2)), and uc_mcontext is the machine-specific representation of the saved context, that includes the calling thread's machine regis- ters. The function getcontext() initializes the structure pointed at by ucp to the currently active context. The function setcontext() restores the user context pointed at by ucp. A successful call does not return. The context should have been obtained by a call of getcontext(), or makecontext(3), or passed as third argument to a signal handler. If the context was obtained by a call of getcontext(), program execu- tion continues as if this call just returned. If the context was obtained by a call of makecontext(3), program execu- tion continues by a call to the function func specified as the second argument of that call to makecontext(3). When the function func returns, we continue with the uc_link member of the structure ucp spec- ified as the first argument of that call to makecontext(3). When this member is NULL, the thread exits. If the context was obtained by a call to a signal handler, then old standard text says that "program execution continues with the program instruction following the instruction interrupted by the signal". How- ever, this sentence was removed in SUSv2, and the present verdict is "the result is unspecified".
 
RETURN VALUE


When successful, getcontext() returns 0 and setcontext() does not return. On error, both return -1 and set errno appropriately.
 
ERRORS


None defined.
 
CONFORMING TO


SUSv2, POSIX.1-2001.
 
NOTES


The earliest incarnation of this mechanism was the setjmp(3)/longjmp(3) mechanism. Since that does not define the handling of the signal con- text, the next stage was the sigsetjmp(3)/siglongjmp(3) pair. The present mechanism gives much more control. On the other hand, there is no easy way to detect whether a return from getcontext() is from the first call, or via a setcontext() call. The user has to invent her own bookkeeping device, and a register variable won't do since registers are restored. When a signal occurs, the current user context is saved and a new con- text is created by the kernel for the signal handler. Do not leave the handler using longjmp(3): it is undefined what would happen with con- texts. Use siglongjmp(3) or setcontext() instead.
 
SEE ALSO


sigaction(2), sigaltstack(2), sigprocmask(2), longjmp(3), makecon- text(3), sigsetjmp(3)
 
COLOPHON


This page is part of release 3.05 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2001-11-15 GETCONTEXT(2)


 Dernières recherches
Man  en anglais Man getcontext en anglaisMan  en français Man getcontext en français
Man  en anglais Man getchar en anglaisMan  en français Man getchar en français
Man  en anglais Man getc_unlocked en anglaisMan  en français Man getc_unlocked en français
Man  en anglais Man get_thread_area en anglaisMan  en français Man get_thread_area en français
Man  en anglais Man get_mempolicy en anglaisMan  en français Man get_mempolicy en français
Man  en anglais Man get_current_dir_name en anglaisMan  en français Man get_current_dir_name en français
Man  en anglais Man get en anglaisMan  en français Man get en français
Man  en anglais Man genrsa en anglaisMan  en français Man genrsa en français
Man  en anglais Man loadkeys en anglaisMan  en français Man loadkeys en français
Man  en anglais Man generic en anglaisMan  en français Man generic en français
Man  en anglais Man gendsa en anglaisMan  en français Man gendsa en français
Man  en anglais Man fwscanf en anglaisMan  en français Man fwscanf en français
Man  en anglais Man fwrite en anglaisMan  en français Man fwrite en français
Man  en anglais Man fwprintf en anglaisMan  en français Man fwprintf en français
Man  en anglais Man groupdel en anglaisMan  en français Man groupdel en français

 Recherche

Dans ce moteur de recherche, vous pouvez taper directement votre besoin, en une phrase normale, humaine.
Exemple : vous cherchez comment remplacer un mot par un autre dans tous les fichiers d'un certain dossier. Vous pouvez écrire "Comment remplacer un mot par un autre dans tous les fichiers d'un dossier". Le moteur vous ramenera les résultats en fonction de leur pertinence.
Vous pouvez bien sûr ne chercher qu'un seul mot-clé, par exemple "find".
 Toutes les lignes de code
Par popularité
Par fonction
Recherche avancée
 Les logiciels SHELL/SSH
Putty
Astuces Bash
Faire du SHELL avec PHP!
 La doc officielle
Les man Linux en français
Les man Linux en anglais
 Proposer vos bash
Partagez vos lignes!
 Les requêtes
Déposer une requête
Voir/répondre à une requête
 Quelques sites interessants
Bons sites pour apprendre
 Rechercher