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 . _______________________________________________ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"