Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cwd::fastgetcwd broken (or mis-named?) on Unix #2095

Closed
p5pRT opened this issue Jun 15, 2000 · 3 comments
Closed

Cwd::fastgetcwd broken (or mis-named?) on Unix #2095

p5pRT opened this issue Jun 15, 2000 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 15, 2000

Migrated from rt.perl.org#3385 (status was 'resolved')

Searchable as RT3385$

@p5pRT
Copy link
Author

p5pRT commented Jun 15, 2000

From @jimav

This is a bug report for perl from avera@​hal.com,
generated with the help of perlbug 1.26 running under perl 5.00502.


Cwd.pm contains references to both fastgetcwd and fastcwd, but
fastgetcwd is broken or missing on Unix and the documentation
is quite ambiguous about why both exist and when to use one or the
other.

The example code in the pod text shows only fastgetcwd​:

  $dir = fastgetcwd;

But the description text only describes fastcwd() in
"The fastcwd() function looks the same as getcwd(), but ..."

although it does mention fastgetcwd later when describine cwd()​:
"The cwd() function looks the same as getcwd and fastgetcwd..."

Finally, there is no implementation for fastgetcwd on Unix platforms,
althoug the symbol is exported (so only a run-time error occurs)​:
 
  perl -MCwd -we 'print fastgetcwd(),"\n"'
  Undefined subroutine &Cwd​::fastgetcwd called at -e line 1.

Why are both names defined? Should one of them go away, and the
other be supported on all platforms?

-Jim



Site configuration information for perl 5.00502​:

Configured by avera at Mon Jan 18 16​:36​:45 PST 1999.

Summary of my perl5 (5.0 patchlevel 5 subversion 2) configuration​:
  Platform​:
  osname=solaris, osvers=2.5.1, archname=sun4-solaris
  uname='sunos membrane 5.5.1 generic_103640-21 sun4u sparc sunw,ultra-5_10 '
  hint=recommended, useposix=true, d_sigaction=define
  usethreads=undef useperlio=undef d_sfio=undef
  Compiler​:
  cc='/sim/caetools_ssd1/VCS/cctools/sun4-solaris/cc', optimize='-g -O', gccversion=2.7.2.1
  cppflags='-DDEBUGGING'
  ccflags ='-DDEBUGGING'
  stdchar='unsigned char', d_stdstdio=define, usevfork=false
  intsize=4, longsize=4, ptrsize=4, doublesize=8
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  alignbytes=8, usemymalloc=y, prototype=define
  Linker and Libraries​:
  ld='/sim/caetools_ssd1/VCS/cctools/sun4-solaris/cc', ldflags =' -L/usr/local/lib'
  libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib
  libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
  libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
  cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'

Locally applied patches​:
 


@​INC for perl 5.00502​:
  /sim/vcsperl/perl/5.005_02/lib/5.00502/sun4-solaris
  /sim/vcsperl/perl/5.005_02/lib/5.00502
  /sim/vcsperl/perl/5.005_02/lib/site_perl/5.005/sun4-solaris
  /sim/vcsperl/perl/5.005_02/lib/site_perl/5.005
  .


Environment for perl 5.00502​:
  HOME=/u/avera
  LANG=en_US
  LC_COLLATE=en_US
  LC_CTYPE=en_US
  LC_MESSAGES=C
  LC_MONETARY=en_US
  LC_NUMERIC=en_US
  LC_TIME=en_US
  LD_LIBRARY_PATH=/usr/is/lib​:/usr/lib​:/usr/openwin/lib​:/usr/ucblib
  LOGDIR (unset)
  PATH=/sim/vcsperl/perl/new/bin​:/u/avera/bin​:/u/avera/bin/misc​:/usr/is/bin​:/usr/ccs/bin​:/usr/is/gnu/bin​:/usr/bin​:/usr/sbin​:/sbin​:/opt/SUNWspro-5.1/bin​:/usr/ucb​:.​:/sim/avera/cvshome/bin​:/u/avera/bin/hal​:/sim/tools/current/bin​:/usr/dt/bin​:/usr/openwin/bin/.​:/usr/openwin/bin​:/sim/lb/current/bin​:/tools/all/qa/current/bin​:/tools/all/bin​:/u/avera/bin/ssdhosts​:/u/avera/bin/ws​:/distrib/SunOS__5.6__sun4m/frame-5.5.6/bin
  PERL_BADLANG (unset)
  SHELL=/usr/is/gnu/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Dec 12, 2000

From @rspier

Here's a simple patch to make fastgetcwd always work.

(The problem was that fastgetcwd is defined using a glob alias on a
$^O dependent basis - and there was no default assignment or perl
subroutine.)

Inline Patch
--- Cwd.pm      Tue Dec 12 21:05:33 2000
+++ Cwd.pm.orig Tue Dec 12 20:55:01 2000
@@ -70,7 +70,7 @@
 
 use Carp;
 
-our $VERSION = '2.04';
+our $VERSION = '2.03';
 
 use base qw/ Exporter /;
 our @EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
@@ -99,9 +99,6 @@
     }
 }
 
-# set a reasonable (and very safe) default for fastgetcwd, in case it
-# isn't redefined later (20001212 rspier)
-*fastgetcwd = \&cwd;
 
 # By Brandon S. Allbery
 #

@p5pRT
Copy link
Author

p5pRT commented Dec 13, 2000

From @jhi

On Tue, Dec 12, 2000 at 09​:12​:39PM -0500, Robert Spier wrote​:

Here's a simple patch to make fastgetcwd always work.

(The problem was that fastgetcwd is defined using a glob alias on a
$^O dependent basis - and there was no default assignment or perl
subroutine.)

--- Cwd.pm Tue Dec 12 21​:05​:33 2000
+++ Cwd.pm.orig Tue Dec 12 20​:55​:01 2000
@​@​ -70,7 +70,7 @​@​

use Carp;

-our $VERSION = '2.04';
+our $VERSION = '2.03';

I assume this patch is accidentally reversed...?
 

use base qw/ Exporter /;
our @​EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
@​@​ -99,9 +99,6 @​@​
}
}

-# set a reasonable (and very safe) default for fastgetcwd, in case it
-# isn't redefined later (20001212 rspier)
-*fastgetcwd = \&cwd;

# By Brandon S. Allbery
#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant