summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-03-11 03:36:32 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-03-11 03:36:32 +0000
commitd103ec31e7c314096b02a22c4f9c43a9788a0d37 (patch)
treeedfe2aa4661faf4c23c61cf436695b167c161042
parent825e0ba0c8c2dec9c94bdee2122af88724efd944 (diff)
downloadperl-d103ec31e7c314096b02a22c4f9c43a9788a0d37.tar.gz
Re: [PATCH] for broken /proc/curproc/file on FreeBSD
From: Nicholas Clark <nick@unfortu.net> Date: Sun, 10 Mar 2002 18:17:50 +0000 Message-ID: <20020310181749.GC317@Bagpuss.unfortu.net> Subject: Re: [PATCH] for broken /proc/curproc/file on FreeBSD From: sthoenna@efn.org (Yitzchak Scott-Thoennes) Date: Sun, 10 Mar 2002 13:53:34 -0800 Message-ID: <eX9i8gzkg26G092yn@efn.org> (and reenable the feature in freebsd, and move the freebsd pr url to perl.c) p4raw-id: //depot/perl@15160
-rw-r--r--hints/freebsd.sh3
-rw-r--r--perl.c8
-rw-r--r--pod/perldelta.pod13
3 files changed, 7 insertions, 17 deletions
diff --git a/hints/freebsd.sh b/hints/freebsd.sh
index a553633f33..41fe55f510 100644
--- a/hints/freebsd.sh
+++ b/hints/freebsd.sh
@@ -233,6 +233,3 @@ EOM
esac
EOCBU
-# /proc/.../file is broken on FreeBSD
-# see http://www.freebsd.org/cgi/query-pr.cgi?pr=35703
-d_procselfexe='undef'
diff --git a/perl.c b/perl.c
index 70ace15efc..4138e1b8d1 100644
--- a/perl.c
+++ b/perl.c
@@ -3441,7 +3441,13 @@ S_procself_val(pTHX_ SV *sv, char *arg0)
{
char buf[MAXPATHLEN];
int len = readlink(PROCSELFEXE_PATH, buf, sizeof(buf) - 1);
- if (len > 0) {
+ /* FreeBSD's implementation is acknowledged to be imperfect, sometimes
+ returning the text "unknown" from the readlink rather than the path
+ to the exacutable (or returing an error from the readlink). Any valid
+ path has a '/' in it somewhere, so use that to validate the result.
+ See http://www.freebsd.org/cgi/query-pr.cgi?pr=35703
+ */
+ if (len > 0 && memchr (buf, '/', len)) {
sv_setpvn(sv,buf,len);
}
else {
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 65e7fcffd5..77056e4456 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -2566,19 +2566,6 @@ known but the current suspect is the F<ixemul> library.
Don't panic. Read INSTALL 'make test' section instead.
-=head2 FreeBSD 4.3, 4.4, 4.5 fail lib/File/Spec/t/rel2abs2rel.t
-
-F<lib/File/Spec/t/rel2abs2rel.t> tests that "`` works" by running a a perl 1
-liner in backticks, using "$^X" as the path to perl. It is known to be
-failing on FreeBSD 4.3, 4.4 and 4.5, but only when run as part of make test.
-This seems to be a kernel problem rather than perl - reading the symlink
-F</proc/curproc/file> returns "unknown" rather than the path to perl, and a
-kernel debugger reveals that variable C<numfullpathfail2> in
-F</usr/src/sys/kern/vfs_cache.c> is being incremented whenever
-F</proc/curproc/file> fails to return the perl executable's path.
-[If you find that if fails on other versions of FreeBSD, please use perlbug
-to report them to us. If you are able to fix the bug, even better.]
-
=head2 HP-UX lib/posix Subtest 9 Fails When LP64-Configured
If perl is configured with -Duse64bitall, the successful result of the