summaryrefslogtreecommitdiff
path: root/ext/POSIX
Commit message (Collapse)AuthorAgeFilesLines
* un-TODO a test that passes on recent FreeBSDTony Cook2013-01-271-1/+2
| | | | | It may pass on earlier FreeBSD, but I don't have it available to check.
* EINVAL is expected when f?pathconf() isn't implemented for a pathTony Cook2013-01-271-2/+9
| | | | | | | This can happen when a particular file system doesn't implement a particular variable. RT# 116463
* Fix various minor pod issuesKarl Williamson2013-01-241-1/+1
| | | | | These were all uncovered by the new Pod::Checker, not yet in core. Fixing these will speed up debugging the new Checker.
* Remove the BeOS port.Nicholas Clark2012-12-142-2/+2
| | | | | | | | | BeOS was an operating system for personal computers developed by Be Inc, initially for their BeBox hardware. The OS Haiku was written as an open source replacement/continuation for BeOS, and its perl port is current and actively maintained. The BeOS port has not been updated since 2004.
* Add C define to remove taint support from perlSteffen Mueller2012-11-051-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By defining NO_TAINT_SUPPORT, all the various checks that perl does for tainting become no-ops. It's not an entirely complete change: it doesn't attempt to remove the taint-related interpreter variables, but instead virtually eliminates access to it. Why, you ask? Because it appears to speed up perl's run-time significantly by avoiding various "are we running under taint" checks and the like. This change is not in a state to go into blead yet. The actual way I implemented it might raise some (valid) objections. Basically, I replaced all uses of the global taint variables (but not PL_taint_warn!) with an extra layer of get/set macros (TAINT_get/TAINTING_get). Furthermore, the change is not complete: - PL_taint_warn would likely deserve the same treatment. - Obviously, tests fail. We have tests for -t/-T - Right now, I added a Perl warn() on startup when -t/-T are detected but the perl was not compiled support it. It might be argued that it should be silently ignored! Needs some thinking. - Code quality concerns - needs review. - Configure support required. - Needs thinking: How does this tie in with CPAN XS modules that use PL_taint and friends? It's easy to backport the new macros via PPPort, but that doesn't magically change all code out there. Might be harmless, though, because whenever you're running under NO_TAINT_SUPPORT, any check of PL_taint/etc is going to come up false. Thus, the only CPAN code that SHOULD be adversely affected is code that changes taint state.
* Remove the MPE/iX port.Nicholas Clark2012-09-211-2/+0
| | | | | MPE/iX was a business-oriented minicomputer operating system made by Hewlett-Packard. Support from HP terminated at the end of 2010.
* 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.