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 124 125 126 127 128 129 130
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 1992 Drew Eckhardt (drew@cs.colorado.edu), March 28, 1992
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one
.\"
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date. The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein. The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Modified by Michael Haardt (u31b3hs@pool.informatik.rwth-aachen.de)
.\" Modified Wed Jul 21 22:47:01 1993 by Rik Faith (faith@cs.unc.edu)
.\" Modified 21 Aug 1994 by Michael Chastain (mec@shell.portal.com):
.\" Fixed typoes.
.\" Translated by Norbert Weuster (weuster@etecs0.uni-duisburg.de)
.\" Modified 23 April 1996 by Martin Schulze (joey@infodrom.north.de)
.\" Modified Mon Jun 10 01:47:55:48 1996 by Martin Schulze (joey@linux.de)
.\"
.TH EXECVE 2 "21. August 1994" "Linux 1.1.46" "Linux Programmer's Manual"
.SH BEZEICHNUNG
execve \- zum Ausführen von Programmen
.SH SYNTAX
.B #include <unistd.h>
.sp
.BI "int execve (const char *" dateiname ", const char *"
.IB argv "[], const char *" envp []);
.SH BESCHREIBUNG
.B execve()
führt das Programm aus, auf das
.I dateiname
zeigt.
.I dateiname
muss entweder ein binäres ausführbares Programm oder
ein Shell-Skript, welches mit einer Linie in der Form
"\fB#! \fIInterpreter \fR[arg]" beginnt, sein.
.B execve()
kehrt beim Erfolg nicht zurück und der Text, Daten, bss, und
Stapel des aufrufenden Prozesses wird durch das geladene Programm
überschrieben. Das aufgerufene Programm erbt die PID des aufrufenden Prozesses,
sowie jeden offenen Dateideskriptor, der zur Ausführung nicht geschlossen
wurde. Signale bezüglich des elterlichen Prozesses werden gelöscht.
Falls das aktuelle Programm ptraced wird, wird nach erfolgreichem
.B execve()
ein
.B SIGTRAP
gesendet.
.SH "RÜCKGABEWERT"
Bei Erfolg kehrt
.B execve()
nicht zurück, bei Fehlern wird \-1 zurückgegeben und
.I errno
wird dem entsprechend gesetzt.
.SH FEHLER
.TP
.B EACCES
Die Datei ist keine gültige Datei.
.TP
.B EACCES
Die Erlaubnis zum ausführen der Datei wurde verweigert.
.TP
.B EPERM
Das Dateisystem ist als
.IR noexec
gemountet.
.TP
.B EPERM
Das Dateisystem ist als
.I nosuid
gemountet und die Datei hat das SUID oder SGID bit gesetzt.
.TP
.B E2BIG
Die Argumentenliste ist zu lang.
.TP
.B ENOEXEC
Die magische Zahl in der Datei ist falsch.
.TP
.B EFAULT
.I dateiname
zeigt auf einen außerhalb liegenden Adressraum.
.TP
.B ENAMETOOLONG
.I dateiname
ist zu lang.
.TP
.B ENOENT
Das File exestiert nicht.
.TP
.B ENOMEM
Unzulänglicher Kernelspeicher war verfügbar.
.TP
.B ENOTDIR
Eine Komponente des vorangestellten Pfades ist kein Direktory.
.TP
.B EACCES
die Suchrechte auf eine Komponente des vorangestellten Pfades wurden verweigert.
.TP
.B ELOOP
.I dateiname
enthält eine zirkulare Referenz (z.B, durch einen symbolischen Link)
.SH "KONFORM ZU"
SVID, AT&T, POSIX, X/OPEN, BSD 4.3
.SH HINWEISE
SUID und SGID Prozesse können nicht als SUID oder SGID
.BR ptrace() 'd
werden.
Eine maximale Länge von 127 Zeichen ist für die erste Zeile eines #!
ausführbaren Shell-Skripts erlaubt. Dies kann umgangen werden, indem man
die maximale Größe des Puffers (buf) ändert, in diesem Fall ist man an die
Puffergröße von 1024 Bytes gebunden, was keine triviale Lösung darstellt.
.SH "SIEHE AUCH"
.BR execl (3),
.BR fork (2).
|