summaryrefslogtreecommitdiff
path: root/ext/POSIX
Commit message (Collapse)AuthorAgeFilesLines
* Remove the UTS port.Nicholas Clark2012-08-171-9/+0
| | | | | | UTS was a mainframe version of System V created by Amdahl, subsequently sold to UTS Global. The port has not been touched since before 5.8.0, and UTS Global is now defunct.
* rt #72232 - ignore wday/yday in mini_mktime as indirectly documentedTony Cook2012-07-051-1/+16
|
* POSIX: Sometimes `printf` beats interpolationAristotle Pagaltzis2012-06-191-1/+1
|
* Tidier example code for POSIX::localeconv()Daniel Perrett2012-06-191-21/+26
|
* Version bump for POSIX.pm.Craig A. Berry2012-06-031-1/+1
|
* extern "C" for POSIX.xs.Craig A. Berry2012-06-031-0/+2
| | | | | | We are repeating standard prototypes but we haven't been making them compatible with the standard versions when compiling under C++. Now we do.
* Don't test that errno is still 0 after POSIX::f?pathconfPaul Johnson2012-05-141-19/+19
| | | | | | | | | | | | | | | | | I think the best we can do with respect to the f?pathconf tests is to make sure that the perl call doesn't die, and that the system call doesn't fail. And it's arguable we should only be testing the former. But since we've been testing more that this anyway, it's probably safe to test both. With respect to the sysconf call, I think we shouldn't test more than that perl doesn't die. Any further testing would require different tests based the argument being passed in. Before doing that, it's probably worth considering the purpose of the tests. I don't think we really want to test that POSIX has been implemented correctly, only that our layer over it is correctly implemented. This fixes RT #112866.
* Remove gete?[ug]id cachingÆvar Arnfjörð Bjarmason2012-02-181-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we cache the UID/GID and effective UID/GID similarly to how we used to cache getpid() before v5.14.0-251-g0e21945. Remove this magical behavior in favor of always calling getpid(), getgid() etc. This resolves RT #96208. A minimal testcase for this is the following by Leon Timmermans attached to RT #96208: eval { require 'syscall.ph'; 1 } or eval { require 'sys/syscall.ph'; 1 } or die $@; if (syscall(&SYS_setuid, $ARGV[0] + 0 || 1000) >= 0 or die "$!") { printf "\$< = %d, getuid = %d\n", $<, syscall(&SYS_getuid); } I.e. if we call the sete?[ug]id() functions unbeknownst to perl the $<, $>, $( and $) variables won't be updated. This results in the same sort of issues we had with $$ before v5.14.0-251-g0e21945, and getppid() before my v5.15.7-407-gd7c042c patch. I'm completely eliminating the PL_egid, PL_euid, PL_gid and PL_uid variables as part of this patch, this will break some CPAN modules, but it'll be really easy before the v5.16.0 final to reinstate them. I'd like to remove them to see what breaks, and how easy it is to fix it. These variables are not part of the public API, and the modules using them could either use the Perl_gete?[ug]id() functions or are working around the bug I'm fixing with this commit. The new PL_delaymagic_(egid|euid|gid|uid) variables I'm adding are *only* intended to be used internally in the interpreter to facilitate the delaymagic in Perl_pp_sassign. There's probably some way not to export these to programs that embed perl, but I haven't found out how to do that.
* POSIX: bump version to 1.30Ævar Arnfjörð Bjarmason2012-02-151-1/+1
| | | | | | I've reverted the strptime() code, which involved bumping the version number, bump the version number again to 1.30 so the version number won't go backwards.
* Revert "Merge branch 'avar/POSIX-strptime' into blead"Ævar Arnfjörð Bjarmason2012-02-155-303/+8
| | | | | | | | | | This reverts commit 0e582130ad8fc3afc6514f60b7a513c550379b7d, reversing changes made to a748fe11f70695552294fe4e31343b2dacb59db2. Conflicts: ext/POSIX/POSIX.xs ext/POSIX/lib/POSIX.pm
* Revert "Merge branch 'avar/POSIX-strptime' into blead"Ævar Arnfjörð Bjarmason2012-02-151-1/+1
| | | | | This reverts commit 0e582130ad8fc3afc6514f60b7a513c550379b7d, reversing changes made to 423a1dfc8c367cb58e7dcef73a81b4ec7a8b8810.
* Revert "Use the strptime() probe in POSIX.xs & tests"Ævar Arnfjörð Bjarmason2012-02-152-68/+58
| | | | This reverts commit 05a9a07a5bad262994c7980ced7fffdd93aa2867.
* mixing declarations and assignments not allowed in C89H.Merijn Brand2012-02-141-3/+4
|
* Use the strptime() probe in POSIX.xs & testsÆvar Arnfjörð Bjarmason2012-02-122-58/+68
| | | | | | | | | | | | | | | | My merge of strptime() in v5.15.7-367-g0e58213 would break systems that didn't have strptime in the C library, use the probe H.Merijn Brand kindly provided in v5.15.7-370-g8852e31 to deal with that. Now we'll just croak on systems without strptime(3) if the POSIX::strptime() function is called, in the same way we croak for other unimplemented functions in there: $ ./perl -Ilib -MPOSIX=strptime -e 'strptime(qw/foo bar/)' POSIX::strptime not implemented on this architecture at -e line 1. This patch is best viewed with the -w option to show or git log, I've re-indented some code in time.t for the new SKIP block I've added.
* Cast around signedness warnings in POSIX's new strptime.Craig A. Berry2012-02-121-3/+3
|
* Merge branch 'avar/POSIX-strptime' into bleadÆvar Arnfjörð Bjarmason2012-02-115-8/+302
|\ | | | | | | | | | | | | | | | | | | Merge my rebased version of Paul "LeoNerd" Evans's branch to blead after I'd cherry-picked the unrelated a748fe1 commit out of it. This may or may not be the perfect implementation of strptime, but it seems to work well enough for me, the bugs that have been raised against it have been addressed, and it's going to work a hell of a lot better than not having any strptime support at all.
| * More obvious variable names and neater code in strptime()Paul "LeoNerd" Evans2012-02-111-13/+19
| |
| * str_offset ought to be a STRLEN, not an intPaul "LeoNerd" Evans2012-02-111-1/+1
| |
| * If strptime() is called with UTf-8 string but legacy format, then downgrade ↵Paul "LeoNerd" Evans2012-02-112-9/+38
| | | | | | | | the string to match; taking care to handle pos() counts both sides
| * If strptime() is called with legacy string but UTF-8 format, then upgrade ↵Paul "LeoNerd" Evans2012-02-112-2/+47
| | | | | | | | the string to match; taking care to handle pos() counts both sides
| * Small refactor of string offset code in POSIX::strptime() to hopefully ↵Paul "LeoNerd" Evans2012-02-111-8/+8
| | | | | | | | better handle mixed UTF-8/non between str and fmt
| * When strptime() receives a reference, ensure it's a mutable scalarPaul "LeoNerd" Evans2012-02-112-2/+26
| |
| * Yield -1 as undef from POSIX::strptime(); ensure that mktime() isn't biased ↵Paul "LeoNerd" Evans2012-02-112-10/+23
| | | | | | | | by sec/min/hour = -1
| * Actually implement @EXPORT_OK of strptime correctly; delete'ing an undef ↵Paul "LeoNerd" Evans2012-02-112-3/+6
| | | | | | | | element yields false so ... and push ... would never have worked
| * Solaris needs _STRPTIME_DONTZERO in order not to zero out all the untouched ↵Paul "LeoNerd" Evans2012-02-111-0/+3
| | | | | | | | fields in strptime(3)
| * Fix ext/POSIX/t/time.t test 17's name to be a) unique, and b) factually accuratePaul "LeoNerd" Evans2012-02-111-1/+1
| |
| * Remember to init_tm() the struct tm before strptime()ing it; a workaround ↵Paul "LeoNerd" Evans2012-02-111-0/+1
| | | | | | | | for some architectures that have extra fields
| * Detect failure of mktime(), return errorPaul "LeoNerd" Evans2012-02-111-2/+4
| |
| * Don't use 1906 to test strptime/mktime because it yields a negative time_t valuePaul "LeoNerd" Evans2012-02-111-2/+3
| |
| * Bump version number in POSIX.pmPaul "LeoNerd" Evans2012-02-111-1/+1
| |
| * Added some docs about new POSIX::strptime()Paul "LeoNerd" Evans2012-02-111-0/+59
| |
| * mktime() before returning result from strptime(), to ensure wday/yday/isdst ↵Paul "LeoNerd" Evans2012-02-112-7/+13
| | | | | | | | fields are correct
| * Accept strptime \$str, "format" to use/set pos() magic at parsing positionPaul "LeoNerd" Evans2012-02-112-3/+45
| |
| * Initial hack at strptime(); just literal strings for nowPaul "LeoNerd" Evans2012-02-113-5/+65
|/
* Ammend comment referring to init_tm() to point to its correct locationPaul "LeoNerd" Evans2012-02-111-1/+1
|
* avoid truncating time values when long is smaller than time_tTony Cook2012-01-181-2/+2
| | | | | | | | | long is only 32-bits on x64 Win32, but time_t is 64-bits. This was warning: POSIX.xs(1777) : warning C4244: 'initializing' : conversion from 'time_t' to 'const long', possible loss of data The check against (time_t)-1 is the approved check from ANSI C 89 and 99.
* include a package POSIX::SigSetRicardo Signes2011-12-301-0/+8
| | | | | this is mostly for the benefit of the PAUSE indexer, as described in the code comment
* Provide the correct POSIX return value for POSIX::dup2() on Win32.Nicholas Clark2011-12-302-3/+11
| | | | | | | | | | Microsoft, in their wisdom, chose to ignore the POSIX spec when implementing their dup2(), and have theirs return 0 on success, instead of the file descriptor. It seems that no other vendor is this, um, "special", so code the exception directly, as we don't run Configure on Win32, so there's little point probing for this. This resolves RT #98912.
* Convert POSIX::sleep to an XS wrapper for PerlProc_sleep().Nicholas Clark2011-12-302-2/+9
| | | | | | | | Previously it was a Perl wrapper for CORE::sleep, converting CORE::sleep's return value of elapsed time slept into the POSIX return value of seconds remaining. However, that approach could sometimes return a negative result if CORE::sleep had slept for more than a second longer than the requested time.
* Increase $POSIX::VERSION to 1.28Father Chrysostomos2011-12-291-1/+1
|
* Signal handlers must run before sigsuspend returnsLeon Timmermans2011-12-291-0/+4
| | | | | | | | | | The whole point of sigsuspend and pause is to wait until a signal has arrived, and then return *after* it has been triggered. Currently delayed/"safe" signals prevent that from happening, which might cause race conditions. This patch prevents that (as far as possible) by running the signal handlers ASAP.
* avoid double defining the POSIX::TCSANOW constant subTony Cook2011-11-282-3/+7
| | | | | | | | | On Win32 which has no native TCSANOW definition this would produce: Constant subroutine TCSANOW redefined at ../lib/POSIX.pm line -1. because the macro wasn't defined when building the unknown symbols table but was defined when building the defined symbols table.
* Fix hang in ext/POSIX/t/sysconf.t on GNU/HurdPino Toscano2011-11-041-1/+1
| | | | | | | | | | | | | | | | | | | while compiling perl 5.14.2 on GNU/Hurd, I ran into what it seems a undefined POSIX behaviour in ext/POSIX/t/sysconf.t. my $fd = POSIX::open($fifo, O_RDWR) or skip("could not open $fifo ($!)", 3 * @path_consts_fifo); according to the POSIX open()[1] about O_RDWR, The result is undefined if this flag is applied to a FIFO. .... which is actually our case. Apparently Linux and *FreeBSD (and maybe also OSes) accept this behaviour, but on GNU/Hurd this causes the open() call to block undefinitely. Given there's nothing done with the FIFO if not querying {,f}pathconf() values, the proposed solution I attached is to change the opening mode to "O_RDONLY | O_NONBLOCK". [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html
* Correct punctuation in some POSIX error messagesFather Chrysostomos2011-09-172-39/+39
| | | | | | | | | | | Commit fa22ee54 changed some of the POSIX error messages to be more consistent, but in doing so made many of them grammatically incorrect. It is almost always incorrect in English to join two independent clauses with a comma. I don’t think it’s particularly important that error messages be gram- matical; I just don’t want them getting worse over time. Hence, I have not touched those that were already ungrammatical.
* POSIX::access() doesn't do ENOTDIR on VMS.Craig A. Berry2011-09-171-1/+1
| | | | Even though the underlying error is RMS$_DNF. Go figure.
* Change POSIX::Termios::setattr() to default to TCASNOW, not 0.Nicholas Clark2011-09-131-1/+8
| | | | | | | | 0 isn't valid on all operating systems. TCASNOW has the value 0 on most operating systems, but on Solaris (at least) TCASNOW, TCSADRAIN and TCSAFLUSH have the same values as the equivalent ioctls, TCSETS, TCSETSW and TCSETSF. Solaris faults 0, setting errno to EINVAL. This isn't useful as a default behaviour.
* Remove unneeded fallback definitions of dNOOP, dVAR etc from POSIX.xsNicholas Clark2011-09-131-20/+0
| | | | | | As POSIX.xs is not dual life, we can always rely on these macros being defined for us in perl.h. (And these days, dual life XS code should let Devel::PPPort take care of this sort of thing.)
* Merge the implementations of POSIX::{asctime,mktime} using ALIAS.Nicholas Clark2011-09-131-34/+18
| | | | | | This shares identical code marshaling 6 to 9 input arguments into a struct tm. However, as the return types differ we have to explicitly code pushing the return value onto perl's stack.
* Merge the implementations of POSIX::{access,mkfifo} using ALIAS.Nicholas Clark2011-09-131-7/+8
|
* Merge the implementations of POSIX::{close,dup,tcdrain} using ALIAS.Nicholas Clark2011-09-131-8/+8
| | | | On this platform, this reduces the shared object size by about .5K.