summaryrefslogtreecommitdiff
path: root/perlio.c
Commit message (Collapse)AuthorAgeFilesLines
* perlio.c: Save '&' instrs by casting to U8Karl Williamson2021-07-301-2/+2
|
* Remove :win32 PerlIO layerLeon Timmermans2021-06-281-6/+0
|
* perlio.c: Don't wrongly conditionally compileKarl Williamson2021-06-271-4/+4
| | | | | The code is using '#ifdef EBCDIC' when it has nothing to do with EBCDIC; but is a proxy for how things work on IBM boxes that use EBCDIC.
* replace all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITYTomasz Konojacki2021-06-091-1/+1
| | | | | | | | | | | | Since the removal of PERL_OBJECT (acfe0abcedaf592fb4b9cb69ce3468308ae99d91) PERL_IMPLICIT_CONTEXT and MULTIPLICITY have been synonymous and they're being used interchangeably. To simplify the code, this commit replaces all instances of PERL_IMPLICIT_CONTEXT with MULTIPLICITY. PERL_IMPLICIT_CONTEXT will stay defined for compatibility with XS modules.
* style: Detabify indentation of the C code maintained by the core.Michael G. Schwern2021-01-171-2067/+2067
| | | | | | | | | | | 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.
* perlio.c: White-space, dead-code onlyKarl Williamson2020-11-011-72/+69
| | | | | This properly indents nested #preprocessor directives, and removes two empty #if's
* Remove code guarded by PERLIO_STD_SPECIALDagfinn Ilmari Mannsåker2020-07-201-8/+0
| | | | | The symbol was only defined on Symbian, and calling macros only defined there.
* Remove use of dVAR in coreDagfinn Ilmari Mannsåker2020-07-201-6/+0
| | | | | It only does anything under PERL_GLOBAL_STRUCT, which is gone. Keep the dNOOP defintion for CPAN back-compat
* Remove Symbian portDagfinn Ilmari Mannsåker2020-07-201-1/+1
| | | | | Also eliminate USE_HEAP_INSTEAD_OF_STACK and SETSOCKOPT_OPTION_VALUE_T, since Symbian was the only user of those.
* perlio.c: make :unix close method call underlaying layers as wellLeon Timmermans2020-01-261-0/+1
|
* Local variable 'imode' hides a parameter of the same nameJames E Keenan2019-12-041-1/+1
| | | | | | | LGTM static code analysis of Perl 5 source code issued this recommendation. Implement fix. https://lgtm.com/projects/g/Perl/perl5/rev/ae73d7ec2329275a2dba4be24415743f884d9dfd
* (perl #134221) support O_APPEND for open ..., undef on VMSTony Cook2019-07-161-4/+6
| | | | | | | | | | VMS doesn't allow you to delete an open file like POSIXish systems do, but you can mark a file to be deleted once it's closed, but only when you open it. Since VMS doesn't (yet) have mkostemp() we can add our own flag to our mkostemp() emulation to pass the necessary magic to open() call to delete the file on close.
* (perl #134221) support append mode temp files on Win32 tooTony Cook2019-07-161-1/+1
|
* (perl #134221) support append mode for open .. undefTony Cook2019-07-161-5/+21
|
* The Windows CE Chainsaw MassacreSteve Hay2019-06-181-6/+0
| | | | | Remove WinCE support as agreed in the thread starting here: https://www.nntp.perl.org/group/perl.perl5.porters/2018/07/msg251683.html
* (perl #133604) fix binmode on Win32 :crlf layersTony Cook2018-10-221-1/+1
| | | | | | | | | | | | | On Win32 the :crlf layer is special - it replaces the use of the normal :perlio buffering layer. So while binmode :raw with :crlf present on non-Win32 removes the CRLF layer, on Win32 it simply switches the :crlf layer's CRLF flag off to prevent translation. Unfortunately the :crlf skipped doing something else expected by :raw - it didn't turn off the layer UTF8 flag. This broke the tests I added in 9704d779004.
* Eliminated 3 '-Wparentheses' warnings detected by g++-8.James E Keenan2018-10-101-1/+1
| | | | For: RT # 133557
* (perl #133510) can't use my_vsnprintf() on quadmath/threaded buildsTony Cook2018-09-121-0/+12
| | | | | | | | | Since anything with quadmath should be recent enough to have vsnprintf() I've fallen back to that. Calls to PerlIO_debug() in core don't include floating point values and I expect it to be unlikely outside of core - if it is needed they'll just have to use double formatting/types.
* Revert "Revert "make PerlIO handle FD_CLOEXEC""Zefram2018-01-181-22/+38
| | | | | | This reverts commit 523d71b314dc75bd212794cc8392eab8267ea744, reinstating commit 2cdf406af42834c46ef407517daab0734f7066fc. Reversion is not the way to address the porting problem that motivated that reversion.
* Revert "make PerlIO handle FD_CLOEXEC"Abigail2018-01-181-38/+22
| | | | | | | | | | | | | | | | | | | | | This reverts commit 2cdf406af42834c46ef407517daab0734f7066fc. The reason for the revert is that with this commit, perl fails to compile on darwin (or at least, one some versions of it): ./miniperl -Ilib make_ext.pl lib/auto/DB_File/DB_File.bundle MAKE="/Applications/Xcode.app/Contents/Developer/usr/bin/make" LIBPERL_A=libperl.a LINKTYPE=dynamic Parsing config.in... Looks Good. dyld: lazy symbol binding failed: Symbol not found: _mkostemp Referenced from: /private/tmp/perl/cpan/DB_File/../../miniperl Expected in: flat namespace dyld: Symbol not found: _mkostemp Referenced from: /private/tmp/perl/cpan/DB_File/../../miniperl Expected in: flat namespace Unsuccessful Makefile.PL(cpan/DB_File): code=5 at make_ext.pl line 518. make: *** [lib/auto/DB_File/DB_File.bundle] Error 2
* make PerlIO handle FD_CLOEXECZefram2017-12-221-22/+38
| | | | | | Move handling of close-on-exec flag for PerlIO handles into PerlIO itself. Where PerlIO opens new file descriptors, have them opened in O_CLOEXEC mode where possible.
* set FD_CLOEXEC on PL_perlio_debug_fdZefram2017-12-221-4/+4
| | | | There's clearly no intent for this to be inherited across exec.
* use Perl_my_mkstemp() where appropriateZefram2017-12-221-12/+4
| | | | | | Since commit e48855bdd2fc57fc51156f5e4b8dee6b544456c8 there has been no need to be conditional about using mkstemp(). Perl_my_mkstemp() is always available, one way or another.
* semicolon-friendly diagnostic controlZefram2017-12-161-2/+2
| | | | | | New macros {GCC,CLANG}_DIAG_{IGNORE,RESTORE}_{DECL,STMT}, which take a following semicolon. It is necessary to use the _DECL or _STMT version as appropriate to the context. Fixes [perl #130726].
* avoid redundant initialisation around Newxz()Zefram2017-11-131-1/+1
| | | | | | Reduce Newxz() to Newx() where all relevant parts of the memory are being explicitly initialised, and don't explicitly zero memory that was already zeroed. [perl #36078]
* perlio.c: simplify cpp conditionalsAaron Crane2017-10-211-16/+10
|
* Rely on C89 vprintf()Aaron Crane2017-10-211-20/+0
|
* get rid of "implicit fallthrough" warnings with gcc 7Lukas Mai2017-10-131-3/+1
|
* Remove #ifdef USE_ITHREADS around MUTEX_* callsDagfinn Ilmari Mannsåker2017-07-031-18/+0
| | | | | These macros are defined as NOOP outside USE_ITHREADS, so there's no point in guarding them with it.
* update size after RenewHugo van der Sanden2017-03-151-3/+4
| | | | | | | | | | | | | | | RT #130841 In general code, change this idiom: PL_foo_max += size; Renew(PL_foo, PL_foo_max, foo_t); to Renew(PL_foo, PL_foo_max + size, foo_t); PL_foo_max += size; so that if Renew dies, PL_foo_max won't be left hanging.
* Add support for VS2015 (VC++ 14.0)Steve Hay2017-02-191-1/+1
| | | | | | | | | | | | | | | Due to the rewritten CRT in this version of Visual C++ it is no longer possible (or at least not at all easy) to make use of the ioinfo struct, which commit b47a847f62 (re-)introduced in order to fix RT#120091/118059. Therefore, we effectively revert commit b47a847f62 for VS2015 onwards on the basis that being able to build with VS2015 onwards is more important than the RT#120091/118059 bug fix. This does unfortunately mean that perls built with <=VS2013 will not be compatible with perls built with >=VS2015, but they may well not have been compatible anyway because of the CRT rewrite, and certainly wouldn't be compatible if perl builds with VS2015 were not supported! See RT#125714 for more discussion about this.
* Use cBOOL() instead of ? TRUE : FALSEDagfinn Ilmari Mannsåker2017-01-251-2/+2
| | | | Except under cpan/ and dist/
* Clean up warnings uncovered by 'clang -Weverything'.Andy Lester2016-12-051-2/+7
| | | | For: RT #130195
* Change white space to avoid C++ deprecation warningKarl Williamson2016-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | C++11 requires space between the end of a string literal and a macro, so that a feature can unambiguously be added to the language. Starting in g++ 6.2, the compiler emits a warning when there isn't a space (presumably so that future versions can support C++11). Unfortunately there are many such instances in the perl core. This commit fixes those, including those in ext/, but individual commits will be used for the other modules, those in dist/ and cpan/. This commit also inserts space at the end of a macro before a string literal, even though that is not deprecated, and removes useless "" literals following a macro (instead of inserting a blank). The result is easier to read, making the macro stand out, and be clearer as to the intention. Code and modules included with the Perl core need to be compilable using C++. This is so that perl can be embedded in C++ programs. (Actually, only the hdr files need to be so compilable, but it would be hard to test that just the hdrs are compilable.) So we need to accommodate changes to the C++ language.
* perlio.c: Fix z/OS problemYaroslav Kuzmin2016-09-081-0/+32
| | | | | | | See thread starting at <6E741FE88A7C4E428528A0AAAB94D735B65C65@DFLE10.ent.ti.com> (The commiter made some white space changes to the patch)
* Coverity CID #15149: Missing varargs init or cleanupJarkko Hietaniemi2016-08-161-1/+2
| | | | The return was returning after va_start but before va_end.
* perlio.c: silence a couple of warningsDavid Mitchell2016-06-141-0/+4
|
* (perl #127380) default PERLIO_DEBUG/-Di to use STDERRTony Cook2016-06-081-4/+4
| | | | | This includes under taint, just as other -D switches write to stderr when taint is on.
* (perl #127380) only trace to $PERLIO_DEBUG if -Di is suppliedTony Cook2016-06-081-44/+58
|
* Fix umask for mkstemp(3) callsNiko Tyni2016-01-291-1/+1
| | | | | | | | | | | | | | | | | | With commit v5.21.0-67-g60f7fc1, perl started setting umask to 0600 before calling mkstemp(3), and then restoring it afterwards. This is wrong as it tells open(2) to strip the owner read and write bits from the given mode before applying it, rather than the intended negation of leaving only those bits in place. On modern systems which call open(2) with mode 0600 in mkstemp(3), this clears all the created temporary file permissions. However, any systems that use mode 0666 in mkstemp(3) (like ancient versions of glibc) now create a file with permissions 0066, leaving world read and write permission regardless of current umask. Using umask 0177 instead fixes this. Bug: https://rt.perl.org/Ticket/Display.html?id=127322
* PATCH: Re: [perl #126847] fdclose(3) patchAndy Dougherty2016-01-041-1/+3
| | | | | | | | This patch uses the fdclose() function from FreeBSD if it is available. It is based on the original patch supplied by Mariusz Zaborski <oshogbo@FreeBSD.org> in the RT ticket. The next patch will add Configure support for HAS_FDCLOSE.
* cleanup the mutex use of PerlIOStdio_closeJarkko Hietaniemi2015-11-231-23/+24
| | | | | | | | | | | | | | | | | | Before: clang -Wthread-safety found the flow quite suspect: one conditional mutex lock, with two conditional unlocks. The code *looked* like the being okay logic-wise now, but rather fragile, so let's make it clearer and more solid by hoisting the locking earlier. This is a fd close, this should not be a performance sensitive spot. And it's in PerlIOStdio, so it should be pretty dead anyway. perlio.c:3283:18: warning: mutex 'PL_perlio_mutex' is not held on every path through here [-Wthread-safety-analysis] result = PerlSIO_fclose(stdio); perlio.c:3299:6: warning: releasing mutex 'PL_perlio_mutex' that was not held [-Wthread-safety-analysis] MUTEX_UNLOCK(&PL_perlio_mutex);
* annotate the mutex use of S_more_refcounted_fdsJarkko Hietaniemi2015-11-231-1/+3
| | | | | perlio.c:2232:2: warning: releasing mutex 'PL_perlio_mutex' that was not held [-Wthread-safety-analysis] MUTEX_UNLOCK(&PL_perlio_mutex);
* rt.perl.org #123977 - clear errno in IRIX PERLIO=stdioJarkko Hietaniemi2015-10-171-0/+6
| | | | | | Under some circumstances IRIX stdio fgetc() and fread() set the errno to ENOENT, which makes no sense according to either IRIX or POSIX docs. Just clear such an errno.
* Evict PERLIO_IS_STDIO from top-level core files.Craig A. Berry2015-07-231-24/+0
| | | | | | | | | | | | | Configuring with perlio has been the only option since dd35fa16610 in 2011, first released in 5.16.0. Yet we have still have had all this dead code for stdio support cluttering up the sources and dulling the machetes of anyone who wants to do further work on perlio or someone (like me) who just stumbles on some code that looks like it needs fixing but isn't worth the time since the compiler will never see it. Leave a vestigial perlsdio.h since its presence is hard-coded in a number of places.
* self cannot be NULL here because PerlIO_push() will deref it.Jarkko Hietaniemi2015-06-261-3/+3
| | | | | | Coverity CID 104779. Follow-up on Coverity CID 28973, and the respective commit 316ebaf2.
* Replace common Emacs file-local variables with dir-localsDagfinn Ilmari Mannsåker2015-03-221-6/+0
| | | | | | | | | | | | | | | | An empty cpan/.dir-locals.el stops Emacs using the core defaults for code imported from CPAN. Committer's work: To keep t/porting/cmp_version.t and t/porting/utils.t happy, $VERSION needed to be incremented in many files, including throughout dist/PathTools. perldelta entry for module updates. Add two Emacs control files to MANIFEST; re-sort MANIFEST. For: RT #124119.
* Corrections to spelling and grammatical errors.Lajos Veres2015-01-281-1/+1
| | | | Extracted from patch submitted by Lajos Veres in RT #123693.
* make more use of NOT_REACHEDLukas Mai2014-11-291-2/+2
| | | | In particular, remove all instances of 'assert(0);'.
* add xs_handshake APIDaniel Dragan2014-11-071-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This API elevates the amount of ABI compatibility protection between XS modules and the interp. It also makes each boot XSUB smaller in machine code by removing function calls and factoring out code into the new Perl_xs_handshake and Perl_xs_epilog functions. sv.c : - revise padlist duping code to reduce code bloat/asserts on DEBUGGING ext/DynaLoader/dlutils.c : - disable version checking so interp startup is faster, ABI mismatches are impossible because DynaLoader is never available as a shared library ext/XS-APItest/XSUB-redefined-macros.xs : - "" means dont check the version, so switch to " " to make the test in xsub_h.t pass, see ML thread "XS_APIVERSION_BOOTCHECK and XS_VERSION is CPP defined but "", mow what?" ext/re/re.xs : - disable API version checking until #123007 is resolved ParseXS/Utilities.pm : 109-standard_XS_defs.t : - remove context from S_croak_xs_usage similar to core commit cb077ed296 . CvGV doesn't need a context until 5.21.4 and commit ae77754ae2 and by then core's croak_xs_uage API has been long available and this backport doesn't need to account for newer perls - fix test where lack of having PERL_IMPLICIT_CONTEXT caused it to fail