From owner-svn-src-head@FreeBSD.ORG Sun Jul 5 20:20:09 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C10A0106566C; Sun, 5 Jul 2009 20:20:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF0888FC16; Sun, 5 Jul 2009 20:20:09 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n65KK9HV058767; Sun, 5 Jul 2009 20:20:09 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n65KK9Cs058765; Sun, 5 Jul 2009 20:20:09 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <200907052020.n65KK9Cs058765@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 5 Jul 2009 20:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195380 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jul 2009 20:20:10 -0000 Author: pjd Date: Sun Jul 5 20:20:09 2009 New Revision: 195380 URL: http://svn.freebsd.org/changeset/base/195380 Log: - Don't suggest opening file for writing in preparation for fexecve(2). - execve(2)/fexecve(2) won't return ETXTBSY if file is open for reading. Approved by: re (kib) Modified: head/lib/libc/sys/execve.2 Modified: head/lib/libc/sys/execve.2 ============================================================================== --- head/lib/libc/sys/execve.2 Sun Jul 5 18:17:37 2009 (r195379) +++ head/lib/libc/sys/execve.2 Sun Jul 5 20:20:09 2009 (r195380) @@ -220,13 +220,11 @@ Since execute permission is checked by .Fn fexecve , the file descriptor .Fa fd -need not have been -opened with the +need not have been opened with the .Dv O_EXEC flag. -However, if the file to be executed denies read and write -permission for the process preparing to do the exec, the only way to -provide the +However, if the file to be executed denies read permission for the process +preparing to do the exec, the only way to provide the .Fa fd to .Fn fexecve @@ -234,6 +232,7 @@ is to use the .Dv O_EXEC flag when opening .Fa fd . +Note that the file to be executed can not be open for writing. .Sh RETURN VALUES As the .Fn execve @@ -277,7 +276,7 @@ The new process file has the appropriate permission, but has an invalid magic number in its header. .It Bq Er ETXTBSY The new process file is a pure procedure (shared text) -file that is currently open for writing or reading by some process. +file that is currently open for writing by some process. .It Bq Er ENOMEM The new process requires more virtual memory than is allowed by the imposed maximum