linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Drysdale <drysdale@google.com>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	Meredydd Luff <meredydd@senatehouse.org>,
	linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Kees Cook <keescook@chromium.org>, Arnd Bergmann <arnd@arndb.de>,
	x86@kernel.org, linux-arch@vger.kernel.org,
	linux-api@vger.kernel.org, David Drysdale <drysdale@google.com>
Subject: [PATCHv4 RESEND man-pages 3/3] execveat.2: initial man page for execveat(2)
Date: Thu,  5 Jun 2014 14:40:35 +0100	[thread overview]
Message-ID: <1401975635-6162-4-git-send-email-drysdale@google.com> (raw)
In-Reply-To: <1401975635-6162-1-git-send-email-drysdale@google.com>

Signed-off-by: David Drysdale <drysdale@google.com>
---
 man2/execveat.2 | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 132 insertions(+)
 create mode 100644 man2/execveat.2

diff --git a/man2/execveat.2 b/man2/execveat.2
new file mode 100644
index 000000000000..fbbb9f824290
--- /dev/null
+++ b/man2/execveat.2
@@ -0,0 +1,132 @@
+.\" Copyright (c) 2014 Google, Inc.
+.\"
+.\" %%%LICENSE_START(VERBATIM)
+.\" 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.
+.\" %%%LICENSE_END
+.\"
+.TH EXECVEAT 2 2014-04-02 "Linux" "Linux Programmer's Manual"
+.SH NAME
+execveat \- execute program relative to a directory file descriptor
+.SH SYNOPSIS
+.B #include <unistd.h>
+.sp
+.BI "int execve(int " fd ", const char *" pathname ","
+.br
+.BI "           char *const " argv "[],  char *const " envp "[],"
+.br
+.BI "           int " flags);
+.SH DESCRIPTION
+The
+.BR execveat ()
+system call executes the program pointed to by the combination of \fIfd\fP and \fIpathname\fP.
+The
+.BR execveat ()
+system call operates in exactly the same way as
+.BR execve (2),
+except for the differences described in this manual page.
+
+If the pathname given in
+.I pathname
+is relative, then it is interpreted relative to the directory
+referred to by the file descriptor
+.I fd
+(rather than relative to the current working directory of
+the calling process, as is done by
+.BR execve (2)
+for a relative pathname).
+
+If
+.I pathname
+is relative and
+.I fd
+is the special value
+.BR AT_FDCWD ,
+then
+.I pathname
+is interpreted relative to the current working
+directory of the calling process (like
+.BR execve (2)).
+
+If
+.I pathname
+is absolute, then
+.I fd
+is ignored.
+
+If
+.I pathname
+is NULL, then the file descriptor
+.I fd
+specifies the file to be executed.
+
+.I flags
+can either be 0, or include the following flag:
+.TP
+.B AT_SYMLINK_NOFOLLOW
+If the file identified by
+.I fd
+and a non-NULL
+.I pathname
+is a symbolic link, then the call fails with the error
+.BR EINVAL .
+.SH "RETURN VALUE"
+On success,
+.BR execveat ()
+does not return. On error \-1 is returned, and
+.I errno
+is set appropriately.
+.SH ERRORS
+The same errors that occur for
+.BR execve (2)
+can also occur for
+.BR execveat ().
+The following additional errors can occur for
+.BR execveat ():
+.TP
+.B EBADF
+.I fd
+is not a valid file descriptor.
+.TP
+.B EINVAL
+Invalid flag specified in
+.IR flags .
+.TP
+.B ENOTDIR
+.I pathname
+is relative and
+.I fd
+is a file descriptor referring to a file other than a directory.
+.SH VERSIONS
+.BR execveat ()
+was added to Linux in kernel 3.???.
+.SH NOTES
+In addition to the reasons explained in
+.BR openat (2),
+the
+.BR execveat ()
+system call is also needed to allow
+.BR fexecve (3)
+to be implemented on systems that do not have the
+.I /proc
+filesystem mounted.
+.SH SEE ALSO
+.BR execve (2),
+.BR fexecve (3)
--
1.9.1.423.g4596e3a

  parent reply	other threads:[~2014-06-05 13:40 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 13:40 [PATCHv4 RESEND 0/3] syscalls,x86: Add execveat() system call David Drysdale
2014-06-05 13:40 ` David Drysdale
2014-06-05 13:40 ` [PATCHv4 RESEND 1/3] syscalls,x86: implement " David Drysdale
     [not found]   ` <1401975635-6162-2-git-send-email-drysdale-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2014-06-23 18:39     ` Kees Cook
2014-06-23 18:39       ` Kees Cook
2014-06-05 13:40 ` [PATCHv4 RESEND 2/3] syscalls,x86: add selftest for execveat(2) David Drysdale
2014-06-05 13:40   ` David Drysdale
2014-06-05 13:40 ` David Drysdale [this message]
2014-06-05 13:40   ` [PATCHv4 RESEND man-pages 3/3] execveat.2: initial man page " David Drysdale
2014-06-05 17:14 ` [PATCHv4 RESEND 0/3] syscalls,x86: Add execveat() system call Kees Cook
     [not found] ` <1401975635-6162-1-git-send-email-drysdale-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2014-10-17 21:45   ` Andy Lutomirski
2014-10-17 21:45     ` Andy Lutomirski
2014-10-19  0:20     ` Eric W. Biederman
2014-10-19  0:20       ` Eric W. Biederman
2014-10-19 19:11       ` Andy Lutomirski
     [not found]       ` <87zjcszz8y.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2014-10-20 13:48         ` David Drysdale
2014-10-20 13:48           ` David Drysdale
     [not found]           ` <CAHse=S-Xyk7CFn=tAGzo+tuUFt+04aBw+mGQmi=kWAaBJGALBw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-20 22:48             ` Andy Lutomirski
2014-10-20 22:48               ` Andy Lutomirski
     [not found]               ` <CALCETrXBjLZTWVJfcsE4NA-JP9zSSgn=6ND0=cZ9BTy=CoN7pA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-21  4:29                 ` Eric W. Biederman
2014-10-21  4:29                   ` Eric W. Biederman
     [not found]                   ` <87ioje2ggq.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2014-10-22 11:08                     ` David Drysdale
2014-10-22 11:08                       ` David Drysdale
2014-10-22 17:40                       ` Eric W. Biederman
2014-10-27 18:01                         ` David Drysdale
2014-10-27 18:01                           ` David Drysdale
2014-10-19 20:20     ` Al Viro
     [not found]       ` <20141019202034.GH7996-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2014-10-19 20:37         ` Andy Lutomirski
2014-10-19 20:37           ` Andy Lutomirski
     [not found]           ` <CALCETrVZUW2iPtfFJtGnWd2RsYLwjGRGYuujrVqcOsO5oBB8Cg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-19 21:29             ` Al Viro
2014-10-19 21:29               ` Al Viro
     [not found]               ` <20141019212921.GI7996-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2014-10-19 22:16                 ` Andy Lutomirski
2014-10-19 22:16                   ` Andy Lutomirski
2014-10-19 22:42                   ` Al Viro
2014-10-19 23:35                     ` Andy Lutomirski
2014-10-19 23:35                       ` Andy Lutomirski
2014-10-25 21:22                       ` Pavel Machek
2014-10-19 20:53         ` H. Peter Anvin
2014-10-19 20:53           ` H. Peter Anvin
2014-10-22 11:54     ` Christoph Hellwig
2014-10-22 11:54       ` Christoph Hellwig
2014-10-22 11:54       ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401975635-6162-4-git-send-email-drysdale@google.com \
    --to=drysdale@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=hpa@zytor.com \
    --cc=keescook@chromium.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=meredydd@senatehouse.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=viro@zeniv.linux.org.uk \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).