various: timespec/timeval.tv_sec is time_t, not long, according to POSIX This matters on 32 bit systems configured with 64 bit time_t (so they survive beyond 2038). Casting them to long is causing loss of bits and badly mismatched time data. Signed-off-by: Alexander Kanavin <alex@linutronix.de>
make RC-stack-aware: stat and filetest ops Update the pp functions which do stat and filetest operations to handle a reference-counted stack environment in the presence of PERL_RC_STACK. But in the presence of PERL_XXX_TMP_NORC, don't actually manipulate reference counts yet. This will be turned off in a few commits' time.
do_msgsnd, do_msgrcv: use STRLEN/SSize_t as appropriate The size parameters for msgsnd() and msgrcv() are size_t, and the return value of msgrcv() is ssize_t, adjust perl to match. Unfortunately Linux appears to limit the size of the message queue to well under 2GB, so I wasn't able to write a failing test for this.
Correct typos as per GH 20435 In GH 20435 many typos in our C code were corrected. However, this pull request was not applied to blead and developed merge conflicts. I extracted diffs for the individual modified files and applied them with 'git apply', excepting four files where patch conflicts were reported. Those files were: handy.h locale.c regcomp.c toke.c We can handle these in a subsequent commit. Also, had to run these two programs to keep 'make test_porting' happy: $ ./perl -Ilib regen/uconfig_h.pl $ ./perl -Ilib regen/regcomp.pl regnodes.h
doio.c: Rename formal parameters for clarity This was named 'not_implicit' instead of 'explicit' because the latter is a C++ keyword. But a negative name increases the cognitive load of understanding, and in this case resulted in some double negatives, which is worse. 'is_explicit' isn't a keyword and is a clearer name for this concept.
Fix GH Issue #19472: read warnings from open($fh,">",\(my $x)) We produce all kinds of warnings if someone opens a scalar reference that is undef. Prior to this we handled write operations ok, at least in blead, but read operations would produce a plethora of warnings. To me this analogous to treating an undef var as hash and trying to read from it, we autovivify the undef var to be a hash. So in this case we should just "autovivify" the referenced scalar to be an empty string. Eg. before this patch: ./perl -Ilib -wle'open my $fh,"+>", \(my $v); my @x=<$fh>; print 0+@x' Use of uninitialized value $fh in <HANDLE> at -e line 1. Use of uninitialized value $fh in <HANDLE> at -e line 1. Use of uninitialized value $fh in <HANDLE> at -e line 1. Use of uninitialized value $fh in <HANDLE> at -e line 1. Use of uninitialized value $fh in <HANDLE> at -e line 1. Use of uninitialized value $fh in <HANDLE> at -e line 1. Use of uninitialized value $fh in <HANDLE> at -e line 1. 0 After it: ./perl -Ilib -wle'open my $fh,"+>", \(my $v); my @x=<$fh>; print 0+@x' 0
Provide asciiopen and asciiopen3 for z/OS ASCII I/O - Provide an _asciiopen_ and _asciiopen3_ pair of functions for opening files on z/OS. These services do a standard open and then, if the open is successful, update the CCSID of the file descriptor to 819 (ASCII) iff the oflag has ``O_CREAT`` set (e.g. a file is being created). We could consider printing out a warning if a file is untagged - right now this will _work correctly_ if the file in encoded as ASCII (CCSID 819) but will fail if the file is EBCDIC. - Provide a wrapper _Perl_mkstemp_cloexec_ which not only creates a temporary file using mkstemp but will also tag the file as CCSID 819. The tagging is only performed if ``__CHARSET_LIB == 1``, i.e. the code is compiled with -qascii. - Define _PerlIO_open_ and _PerlLIO_open3_ as _asciiopen_ and _asciiopen3_ respectively, when the code is built for ASCII ``#if (__CHARSET_LIB == 1)`` on z/OS ``#if defined(OEMVS)``.