# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Tue Aug 1 20:27:06 EET DST 2000 [metaconfig 3.0 PL70]
+# Generated on Wed Aug 2 03:07:08 EET DST 2000 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
i_iconv=''
i_ieeefp=''
i_inttypes=''
+i_libutil=''
i_limits=''
i_locale=''
i_machcthr=''
set ieeefp.h i_ieeefp
eval $inhdr
+: see if this is a libutil.h system
+set libutil.h i_libutil
+eval $inhdr
+
: see if locale.h is available
set locale.h i_locale
eval $inhdr
i_iconv='$i_iconv'
i_ieeefp='$i_ieeefp'
i_inttypes='$i_inttypes'
+i_libutil='$i_libutil'
i_limits='$i_limits'
i_locale='$i_locale'
i_machcthr='$i_machcthr'
#define PERL_XS_APIVERSION "$xs_apiversion"
#define PERL_PM_APIVERSION "$pm_apiversion"
+/* I_LIBUTIL:
+ * This symbol, if defined, indicates that <libutil.h> exists and
+ * should be included.
+ */
+#$i_libutil I_LIBUTIL /**/
+
#endif
!GROK!THIS!
break;
#ifndef MACOS_TRADITIONAL
case '0':
+#ifdef HAS_SETPROCTITLE
+ /* The BSDs don't show the argv[] in ps(1) output, they
+ * show a string from the process struct and provide
+ * the setproctitle() routine to manipulate that. */
+ {
+ s = SvPV(sv, len);
+# if __FreeBSD_version >= 400000
+ /* The - removes the "perl: " prefix,
+ * but not the "(perl) suffix from the ps(1)
+ * output, because that's what ps(1) shows if the
+ * argv[] is modified. */
+ setproctitle("-%s", s, len + 1);
+# else /* old FreeBSDs, NetBSD, OpenBSD */
+ /* This doesn't really work if you assume that
+ * $0 = 'foobar'; will wipe out 'perl' from the $0
+ * because in ps(1) output the result will be like
+ * sprintf("perl: %s (perl)", s)
+ * I guess this is a security feature:
+ * one (a user process) cannot get rid of the original name.
+ * --jhi */
+ setproctitle("%s", s);
+# endif
+ }
+#endif
if (!PL_origalen) {
s = PL_origargv[0];
s += strlen(s);
for (i = 1; i < PL_origargc; i++)
PL_origargv[i] = Nullch;
}
-#ifdef HAS_SETPROCTITLE
- setproctitle("%s", SvPV_nolen(sv));
-#endif
break;
#endif
#ifdef USE_THREADS
program state than it is for hiding the program you're running.
(Mnemonic: same as B<sh> and B<ksh>.)
+Note for BSD users: setting C<$0> does not completely remove "perl"
+from the ps(1) output. For example, setting C<$0> to C<"foobar"> will
+result in C<"perl: foobar (perl)">. This is an operating system
+feature.
+
=item $[
The index of the first element in an array, and of the first character