File: ptrace.2

package info (click to toggle)
manpages-es 0.4a-2
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 3,592 kB
  • ctags: 3
  • sloc: sh: 59; makefile: 42
file content (123 lines) | stat: -rw-r--r-- 3,661 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 1993 Michael Haardt
.\" (u31b3hs@pool.informatik.rwth-aachen.de),
.\" Fri Apr  2 11:32:09 MET DST 1993
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
.\" USA.
.\"
.\" Modified Fri Jul 23 23:47:18 1993 by Rik Faith <faith@cs.unc.edu>
.\" Modified Fri Jan 31 16:46:30 1997 by Eric S. Raymond <esr@thyrsus.com>
.\" Translated into Spanish Wed Feb 18 16:11:59 CET 1998 by Gerardo
.\" Aburruzaga Garca <gerardo.aburruzaga@uca.es>
.\"
.TH PTRACE 2 "18 Febrero 1998" "Linux 0.99.11" "Manual del Programador Linux"
.SH NOMBRE
ptrace \- traza de un proceso
.SH SINOPSIS
.B #include <sys/ptrace.h>
.sp
.BI "int ptrace(int " peticion ", int " pid ", int " direc ", int " datos );
.SH DESCRIPCIN
.B Ptrace
porporciona un medio por el que un proceso padre puede controlar la
ejecucin de un proceso hijo, y examinar y cambiar su imagen de
memoria. Su uso primordial es en la implementacin de depuracin con
punto de ruptura. Un proceso del que se lleva la traza se ejecuta
hasta que ocurre una seal. Entonces se para y al padre se le
notificar con 
.BR wait (2).
Cuando el proceso est en su estado parado, su memoria puede ser leda
y escrita. El padre puede hacer tambin que el hijo contine la
ejecucin, opcionalmente sin tener en cuenta la seal que provoc la parada.
.LP
El valor del argumento \fIpeticion\fP determina la precisa accin de
la llamada al sistema:
.TP
PTRACE_TRACEME
El padre de este proceso le va a seguir la traza. El padre debera
estar esperando a llevar la traza del hijo.
.TP
PTRACE_PEEKTEXT, PTRACE_PEEKDATA
Lee palabra en la localizacin
.IR direc .
.TP
PTRACE_PEEKUSR
Lee palabra en la localizacin
.I direc
en el rea
.BR USER .
.TP
PTRACE_POKETEXT, PTRACE_POKEDATA
Escribe palabra en la localizacin
.IR direc .
.TP
PTRACE_POKEUSR
Escribe palabra en la localizacin
.I direc
en el rea
.BR USER .
.TP
PTRACE_SYSCALL, PTRACE_CONT
Rearranca tras la seal.
.TP
PTRACE_KILL
Enva al hijo una seal
.B SIGKILL
para hacerlo terminar.
.TP
PTRACE_SINGLESTEP
Establece la seal de trampa para ir paso a paso.
.TP
PTRACE_ATTACH
Se ata al proceso especificado en
.IR pid .
.TP
PTRACE_DETACH
Desata un proceso que estaba atado previamente.
.SH OBSERVACIONES
.BR init ,
el proceso con PID 1, no puede utilizar esta funcin.
.SH "VALOR DEVUELTO"
En caso de xito, se devuelve cero. En caso de error, se devuelve \-1
y se pone en
.I errno
un valor apropiado.
.SH ERRORES
.TP 0.8i
.B EPERM
El proceso especificado (i.e.,
.BR init ),
no puede ser trazado, o ya lo est siendo.
.TP
.B ESRCH
El proceso especificado no existe.
.TP
.B EIO
.I Peticion
no es vlida.
.SH "CONFORME CON"
SVr4, SVID EXT, AT&T, X/OPEN, BSD 4.3
.SH "VASE TAMBIN"
.BR gdb (1),
.BR exec (3),
.BR signal (2),
.BR wait (2)