From patchwork Mon Apr 27 09:39:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1277481 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 499fr32kdsz9sP7 for ; Mon, 27 Apr 2020 19:39:31 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E89EF3A18415; Mon, 27 Apr 2020 09:39:04 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 1E29B3892027 for ; Mon, 27 Apr 2020 09:39:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1E29B3892027 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1jT0E8-0005UK-WA for libc-alpha@sourceware.org; Mon, 27 Apr 2020 09:39:00 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1jT0E8-0000KR-Sb for libc-alpha@sourceware.org; Mon, 27 Apr 2020 11:39:00 +0200 From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] manual: Document the fexecve function Date: Mon, 27 Apr 2020 11:39:00 +0200 Message-ID: <871ro9z2rv.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 X-Spam-Status: No, score=-21.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" ----- manual/process.texi | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/manual/process.texi b/manual/process.texi index 5728bde2cb..b20ad26cbf 100644 --- a/manual/process.texi +++ b/manual/process.texi @@ -405,6 +405,19 @@ be an array of strings in the same format as for the @code{environ} variable; see @ref{Environment Access}. @end deftypefun +@deftypefun int fexecve (int @var{fd}, char *const @var{argv}@t{[]}, char *const @var{env}@t{[]}) +@standards{POSIX.1, unistd.h} +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{}} +This is similar to @code{execve}, but instead identifying the progam +executable by its pathname, the file descriptor @var{fd} is used. The +descriptor must have been opened with the @code{O_RDONLY} flag or (on +Linux) the @code{O_PATH} flag. + +On Linux, @code{fexecve} can fail with an error of @code{ENOSYS} if +@file{/proc} has not been mounted and the kernel lacks support for the +underlying @code{execveat} system call. +@end deftypefun + @deftypefun int execle (const char *@var{filename}, const char *@var{arg0}, @dots{}, char *const @var{env}@t{[]}) @standards{POSIX.1, unistd.h} @safety{@prelim{}@mtsafe{}@asunsafe{@ascuheap{}}@acunsafe{@acsmem{}}}