From owner-svn-src-head@freebsd.org Sat Jul 28 23:55:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B59651061D9F; Sat, 28 Jul 2018 23:55:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E4AE86378; Sat, 28 Jul 2018 23:55:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32B6F5FC6; Sat, 28 Jul 2018 23:55:19 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6SNtI0w039785; Sat, 28 Jul 2018 23:55:18 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6SNtIZB039784; Sat, 28 Jul 2018 23:55:18 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201807282355.w6SNtIZB039784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 28 Jul 2018 23:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336852 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 336852 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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: Sat, 28 Jul 2018 23:55:19 -0000 Author: cem Date: Sat Jul 28 23:55:18 2018 New Revision: 336852 URL: https://svnweb.freebsd.org/changeset/base/336852 Log: exec.3: Add BUGS section and document non-FreeBSD portability Requested by: kib (in part) Modified: head/lib/libc/gen/exec.3 Modified: head/lib/libc/gen/exec.3 ============================================================================== --- head/lib/libc/gen/exec.3 Sat Jul 28 23:47:22 2018 (r336851) +++ head/lib/libc/gen/exec.3 Sat Jul 28 23:55:18 2018 (r336852) @@ -314,3 +314,55 @@ The .Fn execvP function first appeared in .Fx 5.2 . +.Sh BUGS +The type of the +.Fa argv +and +.Fa envp +parameters to +.Fn execle , +.Fn exect , +.Fn execv , +.Fn execvp , +and +.Fn execvP +is a historical accident and no sane implementation should modify the provided +strings. +The bogus parameter types trigger false positives from +.Li const +correctness analyzers. +On +.Fx , +the +.Fn __DECONST +macro may be used to work around this limitation. +.Pp +Due to a fluke of the C standard, on platforms other than +.Fx +the definition of +.Dv NULL +may be the untyped number zero, rather than a +.Ad (void *)0 +expression. +To distinguish the concepts, they are referred to as a +.Dq null pointer constant +and a +.Dq null pointer , +respectively. +On exotic computer architectures that +.Fx +does not support, the null pointer constant and null pointer may have a +different representation. +In general, where this document and others reference a +.Dv NULL +value, they actually imply a null pointer. +E.g., for portability to non-FreeBSD operating systems on exotic computer +architectures, one may use +.Li (char *)NULL +in place of +.Dv NULL +when invoking +.Fn execl , +.Fn execle , +and +.Fn execlp .