{
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 {
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