-
Notifications
You must be signed in to change notification settings - Fork 559
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
POSIX::tmpnam() broken for threaded 5.00503 #123
Comments
From hirschs@btv.ibm.comHello, Perl 5.00503 has a problem in the POSIX library module when built 1) POSIX.xs looks for the definition of 'L_tmpname' in sys/types.h. 2) On non-threaded systems, tmpnam() can be called with an optional The existing XS stub for tmpnam() looks like it wants to be coded for char * Unfortunately, the explicit assignment in the third line causes xsubpp The patch below takes care of both problems: Inline Patch--- POSIX.xs.orig Thu Mar 4 19:34:14 1999
+++ POSIX.xs Mon Jun 28 13:42:46 1999
@@ -1520,8 +1520,8 @@
goto not_there;
#endif
if (strEQ(name, "L_tmpname"))
-#ifdef L_tmpname
- return L_tmpname;
+#ifdef L_tmpnam
+ return L_tmpnam;
#else
goto not_there;
#endif
@@ -3367,9 +3367,17 @@
char * buffer
size_t nbytes
-char *
-tmpnam(s = 0)
- char * s = 0;
+SV *
+tmpnam()
+ PREINIT:
+ U32 i;
+ int len;
+ CODE:
+ RETVAL = newSVpv("", L_tmpnam);
+ len = strlen(tmpnam(SvPV(RETVAL, i)));
+ SvCUR_set(RETVAL, len);
+ OUTPUT:
+ RETVAL
void
abort()
Since the motivation for passing a parameter to tempnam() under C Here is the test program I used to verify the fix: #!/usr/local/bin/perl5.00503 -w use strict; use POSIX qw(:stdio_h); my $tmpfile = POSIX::tmpnam(); my $len = L_tmpname; Please contact me if any more information is required? Regards, Steven N. Hirsch Development Engineer Perl Info
|
via a new LOBJECT tag. This is for 32bit systems and lengths between 2GB and 4GB (I32-U32), and 64bit (>I32). Use SSize_t array and hash lengths, see [cperl #123]. Even for hashes, which we cannot iterate over. This is a upstream limitation in the HvAUX struct and API. We can store >2G keys though, which is fully supported in subsequent cperl commits for #123, but not perl5 upstream. Add several helper functions for strings and hash entries, removed a lot of duplicate code. Reformat consistently (tabs: 8) Modernize: * get rid of main'dump * get rid of *FILE typeglob, replace with lexical filehandle * fix parallel tests, use unique filenames. * fixed many instances of 2arg open, * keep backcompat default handling for XS functions, handle the flag default there. * remove default $Storable::flags settings in the tests * fix some too short I32 len types in the XS Conflicts: dist/Storable/Storable.pm dist/Storable/Storable.xs dist/Storable/t/attach_errors.t dist/Storable/t/blessed.t dist/Storable/t/destroy.t dist/Storable/t/testlib.pl
via a new LOBJECT tag. This is for 32bit systems and lengths between 2GB and 4GB (I32-U32), and 64bit (>I32). Use SSize_t array and hash lengths, see [cperl #123]. Even for hashes, which we cannot iterate over. This is a upstream limitation in the HvAUX struct and API. We can store >2G keys though, which is fully supported in subsequent cperl commits for #123, but not perl5 upstream. Add several helper functions for strings and hash entries, removed a lot of duplicate code. Reformat consistently (tabs: 8) Modernize: * get rid of main'dump * get rid of *FILE typeglob, replace with lexical filehandle * fix parallel tests, use unique filenames. * fixed many instances of 2arg open, * keep backcompat default handling for XS functions, handle the flag default there. * remove default $Storable::flags settings in the tests * fix some too short I32 len types in the XS
Migrated from rt.perl.org#927 (status was 'resolved')
Searchable as RT927$
The text was updated successfully, but these errors were encountered: