summaryrefslogtreecommitdiff
path: root/os2
Commit message (Collapse)AuthorAgeFilesLines
* replace "define\t" with "define " in most "normal" core files.Yves Orton2023-04-291-42/+42
| | | | | | | | | | | | | | | | | | | The main exceptions being dist/, ext/, and Configure related files, which will be updated in a subsequent commit. Files in the cpan/ directory are also omitted as they are not owned by the core. '#define' has seven characters, so following it with a \t makes it look like '#define ' when it is not, which then frustrates attempts to find where a given define is. If you *know* then you do a git grep -P 'define\s+WHATEVER' but if don't or you forget, you can get very confused trying to find where a given define is located. This fixes all such cases so they actually are 'define WHATEVER' instead. If this patch is getting in your way with blame analysis then view it with the -w option to blame.
* os2: Use many reader lock instead of exclusiveKarl Williamson2022-09-291-3/+3
| | | | | This is just reading the environment, not changing it, so many readers can be accessing it at the same time.
* porting/diag.t - improved parsing a bitYves Orton2022-09-081-2/+1
| | | | | | | | | | | | | | | | | | | | | The "multiline" logic of diag.t was getting confused by define statements that would define a symbol to call an error function but not end in ";", this would then slurp potentially many lines errorenously, potentially absorbing more than one message. The multi-line logic also would undef $listed_as and lose the diag_listed_as data in some circumstances. Fixing those issues revealed some interesting cases. To fix one of them I defined a new noop macro in perl.h to help: PERL_DIAG_WARN_SYNTAX(), which helps the diag.t parser identify messages without needing to be actually part of a specific message line. These macros are noops, they just return their argument, but they help hint to diag.t what is going on. Maybe in the future this can be reworked to be more generic, there are other similar cases that are not covered. Interestingly fixing this bug meant that at least one message that used to be erroneously picked up was no longer identified or tested. This was replaced with a PERL_DIAG_DIE_SYNTAX() wrapper.
* Revert "Revert "set PERL_EXIT_DESTRUCT_END in all embeddings""Yves Orton2022-09-031-0/+1
| | | | This reverts commit 64a9c780950becebc7326a31d067801ec9b187a2.
* OS2-REXX: Use F<> for file pathKarl Williamson2022-05-271-2/+2
|
* Remove PERL_BOOL_AS_CHAR uses; always define HAS_BOOLKarl Williamson2022-02-061-8/+0
| | | | | | | | | | Now that C99 is required, bool is always defined, so HAS_BOOL should also always be defined. PERL_BOOL_AS_CHAR was used to workaround problems when no bool type existed, so it is obsolete, and in fact perl won't compile if PERL_BOOL_AS_CHAR is #defined. So remove it completely from being looked at.
* Don't call av_fetch() with TRUE to create an SV that is immediately freed.Nicholas Clark2021-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In Perl_my_pclose() the code as been calling av_fetch() with TRUE (lvalue; create the SV if not found) since the Perl 4 -> Perl 5 migration. The code *had* been assuming that the returned result was always a valid SvIV until commit 25d9202327791097 in Jan 2001: Safe fix for Simon's pclose() doing SvIVX of undef -> core bug. which fixes the bug reported in https://www.nntp.perl.org/group/perl.perl5.porters/2001/01/msg28651.html That commit changed the code to default the IV result (the pid) to -1 if the av_fetch() failed to return SVt_IV. However, that commit failed to notice that the value -1 was *already* "in use" *only 4 lines later* as a flag for OS/2 to indicate "Opened by popen." Hence switch the OS/2 sentinel value to -2. The that states that OS/2 has a my_pclose implementation in os2.c is wrong. It was erroneously added by commit 5f05dabc4054964a in Dec 1996: [inseparable changes from patch from perl5.003_11 to perl5.003_12] It appears to be a copy-paste error from the previous comment added about my_popen. I tested this fix with the 2001-era code of commit 25d9202327791097 - it (also) solves the bug reported back then.
* Rename G_ARRAY to G_LIST; provide back-compat when not(PERL_CORE)Paul "LeoNerd" Evans2021-06-021-1/+1
|
* style: Detabify indentation of the C code maintained by the core.Michael G. Schwern2021-01-174-2816/+2816
| | | | | | | | | | | This just detabifies to get rid of the mixed tab/space indentation. Applying consistent indentation and dealing with other tabs are another issue. Done with `expand -i`. * vutil.* left alone, it's part of version. * Left regen managed files alone for now.
* Fix typosSamanta Navarro2020-10-031-1/+1
| | | | | | | | | For: https://github.com/Perl/perl5/pull/18201 Committer: Samanta Navarro is now a Perl author. To keep 'make test_porting' happy: Increment $VERSION in several files. Regenerate uconfig.h via './perl -Ilib regen/uconfig_h.pl'.
* os2.c: Convert to use av_count()Karl Williamson2020-08-191-4/+3
|
* use PERL_REVISION in os2/Makefile.SHs☢ ℕicolas ℝ2020-08-041-1/+1
|
* os2.c: Use PerlEnv_getenvKarl Williamson2020-07-311-27/+37
| | | | which has added protections beyond plain getenv()
* Remove the final remnants of 5005threads supportDagfinn Ilmari Mannsåker2020-07-201-3/+3
| | | | Only THREAD_RET_TYPE is still used.
* handy.h: Create nBIT_MASK(n) macroKarl Williamson2020-07-171-1/+1
| | | | | This encapsulates a common paradigm, making sure that it is done correctly for the platform's size.
* Fix a bunch of repeated-word typosDagfinn Ilmari Mannsåker2020-05-222-2/+2
| | | | | Mostly in comments and docs, but some in diagnostic messages and one case of 'or die die'.
* Add memCHRs() macro and use itKarl Williamson2019-12-182-2/+2
| | | | | | | This replaces strchr("list", c) calls throughout the core. They don't work properly when 'c' is a NUL, returning the position of the terminating NUL in "list" instead of failure. This could lead to segfaults or even security issues.
* Use sv_catpvs where appropriate vs sv_catpvKarl Williamson2018-08-061-1/+1
| | | | | This moves calculations definitely to compile time; some optimizing compilers may already do this, but some may not.
* Revert "set PERL_EXIT_DESTRUCT_END in all embeddings"David Mitchell2018-05-111-1/+0
| | | | | | | | | | | | | | | This reverts commit 8e920bd341e241f50a74dbf8aa343319f204e200. Also skip the tests in t/op/blocks.t RT #132863 8e920bd341 sets the PERL_EXIT_DESTRUCT_END flag on non-UNIXy platforms, like is already done on UNIXy platforms. This makes things like BEGIN { exit(1) } call END blocks on those platforms (like they already do on UNIX). But it caused problems with win32 pseudo-forks, so revert for 5.28 and re-address the issues sometime later.
* set PERL_EXIT_DESTRUCT_END in all embeddingsZefram2017-12-221-0/+1
| | | | | | The new tests in commit 503bc07b4b9e34ed04a725b2bc8faec1ae0f3be2 showed up platform differences in whether END blocks get run. Set PERL_EXIT_DESTRUCT_END in all embeddings to make this consistent.
* fix up faulty perl embeddingsZefram2017-12-211-8/+4
| | | | | | | | | | | | Some platform-specific embeddings of perl were misusing the return values from perl_parse() and perl_run(), in some cases causing failure due to exit(0) combined with the recent changes in commit 0301e899536a22752f40481d8a1d141b7a7dda82. Commit d4a50999a5525c2681d59cae5fcd94f94ff897fd partially fixed a Windows embedding. More fully fix that, along with NetWare and OS/2. Even in embeddings with correct logic, stop using a variable named "exitstatus" to hold the result of perl_parse() or perl_run(), to avoid misleading people who copy the code.
* make exec keep its argument list more reliablyZefram2017-12-141-48/+61
| | | | | | | | | | Bits of exec code were putting the constructed commands into globals PL_Argv and PL_Cmd, which could then be clobbered by reentrancy. These are only global in order to manage their freeing, but that's better managed by using the scope stack. So replace them with automatic variables, with ENTER/SAVEFREEPV/LEAVE to free the memory. Also copy the strings acquired from SVs, to avoid magic clobbering the buffers of SVs already read. Fixes [perl #129888].
* Avoid newGVgen in blead-upstream modulesFather Chrysostomos2017-12-101-1/+2
| | | | | | | | | | | | | | | | | | ExtUtils::ParseXS::Typemaps: Just in documentation, but it’s good to change it, in case peo- ple copy it. Time::HiRes: It doesn’t even use these typemap entries, but I changed it in case they get used in the future. (The changes are not identical to the default typemap, because Time::HiRes is 5.6-compatible, at least nominally.) os2/os2.c: No, this is not a module, but I changed it, too. Some other instances of newGVgen are already handled properly, or are just in tests, so I left them alone.
* Rename strEQs to strBEGINs; remove strNEsKarl Williamson2017-11-061-4/+4
| | | | | | | | | | The original names are confusing. See thread beginning with http://nntp.perl.org/group/perl.perl5.porters/244335 The two macros are mapped into just that one, complementing the result for the few cases where strNEs was used.
* Remove #ifdef USE_ITHREADS around MUTEX_* callsDagfinn Ilmari Mannsåker2017-07-031-2/+0
| | | | | These macros are defined as NOOP outside USE_ITHREADS, so there's no point in guarding them with it.
* (perl #126228) partly revert 8cc95fdb and fix a3c8358cTony Cook2017-01-191-1/+1
| | | | | | | | | | | | | | | | | | | a3c8358c changed: -#define dXSUB_SYS int dummy +#define dXSUB_SYS which made dXSUB_SYS into not-a-declaration, this apparently broke something, since 8cc95fdb then went through all the definitions of dXSUB_SYS, made each of them into not-a-declaration and then ensured ExtUtilis::Miniperl emitted dXSUB_SYS in a place where it didn't matter whether it was a declaration or a statement. When these changes were made perl.h didn't have dNOOP, but now we do, so we can make dXSUB_SYS a declaration again, as its name implies. Based on a patch originally created by Daniel Dragan (bulk88).
* Switch most open() calls to three-argument form.John Lightsey2016-12-231-3/+3
| | | | | | | | | | Switch from two-argument form. Filehandle cloning is still done with the two argument form for backward compatibility. Committer: Get all porting tests to pass. Increment some $VERSIONs. Run: ./perl -Ilib regen/mk_invlists.pl; ./perl -Ilib regen/regcharclass.pl For: RT #130122
* os2: switch to using string constant friendly macrosYves Orton2016-10-192-10/+10
|
* Change sv_setpvn(…, "…", …) to sv_setpvs(…, "…")Dagfinn Ilmari Mannsåker2016-09-213-3/+3
| | | | | The dual-life dists affected use Devel::PPPort, so can safely use sv_setpvs() even though it wasn't added until Perl v5.10.0.
* Makefile.SH: rationalise object list variablesDavid Mitchell2016-03-181-5/+5
| | | | | | | | | | | | | | | | There are a number of variables in the generated Makefile, such as 'obj' and 'minindt_obj', that enumerate various subsets of the object files that need to be compiled and linked. Rename and reorganise these vars slightly, to make the next commit simpler. In particular it now splits the object files in into 3 sets: common (av.o etc), those used just by miniperl (opmini.o etc) and those used just by perl (op.o etc). Should be no functional changes. The changes to os2/Makefile.SHs have been done blind. Does anyone still use OS2?
* s/ar rcu/ar rc/ during linkingDavid Mitchell2016-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | The are a few places in Makefile.SH which do (approximately): rm $libfile ar rcu $libfile *.o The 'u' in 'rcu' seems redundant since the old lib file is always deleted just before being recreated; and more to the point, it generates warnings on recent Linux builds: /bin/ar: `u' modifier ignored since `D' is the default (see `U') This is because the 'u' modifier updates the archive, i.e. only replaces the objects which are newer in an existing archive. On my Linux system, ar by default operates in 'deterministic' mode, which means that it doesn't add timestamps etc (so that repeated builds will give identical binaries). In this mode 'u' can't work, hence the warning. So this commit just removes the 'u' flag.
* [perl #121351] Remove non-doio.c uses of PL_statbufDagfinn Ilmari Mannsåker2016-01-251-2/+3
| | | | | These are the last remaining uses outside the interwoven mess in S_openn_cleanup, openn_setup, and their callers in doio.c.
* Start fixing some pod pedantic errorsKarl Williamson2015-09-034-72/+82
| | | | This fixes a bunch of them, but there are many more
* bump $VERSION for PerlIO-encoding, PerlIO-mmap, PerlIO-scalar, OS2-ProcessTony Cook2014-06-121-1/+1
|
* Change newSVpvn("…", …) to newSVpvs("…")Dagfinn Ilmari Mannsåker2014-06-122-6/+6
| | | | | The dual-life dists affected use Devel::PPPort, so can safely use newSVpvs() even though it wasn't added until Perl v5.8.9.
* Change core uses of Perl_do_openn() to Perl_do_open6() or Perl_do_open_raw().Nicholas Clark2014-03-191-1/+1
| | | | | | Calls to Perl_do_openn() all have at least 2 unused arguments which clutter the code and hinder easy understanding. Perl_do_open6() and Perl_do_open_raw() each only do one job, so don't have the dead arguments.
* Change av_len calls to av_tindex for clarityKarl Williamson2014-02-201-1/+1
| | | | | | av_tindex is a more clearly named synonym for av_len, available starting in v5.18. This changes the core uses to it, including modules in /ext, which are not dual-lifed.
* Removed the ifdefs for INCOMPLETE_TAINTSBrian Fraser2013-09-211-4/+0
| | | | | This was added in 5.5/5.6 as a backwards-compatibility measure when taint was extended to happen in more places.
* typo fix for os2 moduleDavid Steinbrunner2013-05-241-2/+2
| | | | Bump $VERSION for os2/OS2/OS2-Process/Process.pm.
* Fix various minor pod issuesKarl Williamson2013-01-243-6/+6
| | | | | These were all uncovered by the new Pod::Checker, not yet in core. Fixing these will speed up debugging the new Checker.
* Remove "register" declarationsKarl Williamson2012-11-241-2/+2
| | | | | | | This finishes the removal of register declarations started by eb578fdb5569b91c28466a4d1939e381ff6ceaf4. It neglected the ones in function parameter declarations, and didn't include things in dist, ext, and lib, which this does include
* Add C define to remove taint support from perlSteffen Mueller2012-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Undo VERSION bump for undone codeSteve Hay2012-08-201-1/+1
| | | | | | Commit 78ed4cf4d6 undid the accidental effect of eb578fdb55 on OS2::REXX but forgot to revert the accompanying VERSION bump, which is not otherwise required since nothing else has changed.
* fix accidentally modified commentJesse Luehrs2012-08-201-1/+1
|
* Omnibus removal of register declarationsKarl Williamson2012-08-183-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This removes most register declarations in C code (and accompanying documentation) in the Perl core. Retained are those in the ext directory, Configure, and those that are associated with assembly language. See: http://stackoverflow.com/questions/314994/whats-a-good-example-of-register-variable-usage-in-c which says, in part: There is no good example of register usage when using modern compilers (read: last 10+ years) because it almost never does any good and can do some bad. When you use register, you are telling the compiler "I know how to optimize my code better than you do" which is almost never the case. One of three things can happen when you use register: The compiler ignores it, this is most likely. In this case the only harm is that you cannot take the address of the variable in the code. The compiler honors your request and as a result the code runs slower. The compiler honors your request and the code runs faster, this is the least likely scenario. Even if one compiler produces better code when you use register, there is no reason to believe another will do the same. If you have some critical code that the compiler is not optimizing well enough your best bet is probably to use assembler for that part anyway but of course do the appropriate profiling to verify the generated code is really a problem first.
* Remove dead code related to the Atari ST port of perl 4.0 patchlevel 19Nicholas Clark2012-07-281-6/+0
| | | | | The subdirectory containing the port specific files was purged when 5.000 was released, but changes made to other files were not removed.
* OS2-Process/Process.pm: Fix broken pod linksKarl Williamson2011-07-031-4/+5
|
* Bump OS2::Process version since the docs changed triggering a test failJesse Vincent2011-02-011-1/+1
|
* Remove whitespace for pod fix.Michael Stevens2011-02-011-1/+1
|
* Version bumps for OS2 non-dual-life modules identified byJesse Vincent2011-01-201-1/+1
| | | | ./perl -Ilib Porting/cmpVERSION.pl -xd . v5.13.8