summaryrefslogtreecommitdiff
path: root/ext/Errno
Commit message (Collapse)AuthorAgeFilesLines
* add gitignore exclusions for files in gitGraham Knop2020-11-231-0/+1
| | | | | | | | There are a number of files excluded using gitignore rules that are included in the repository. This can lead to confusion if something other than git tries to read the ignore files. Add rules to the gitignore files so that these files won't be ignored.
* Errno: Bump versionKarl Williamson2020-09-291-1/+1
| | | | after 6b6e83fce2074294ac11d547c8a75bc106bebab9
* Fix build on Haiku beta, set correct Haiku usrinc and locinc, add ↵Thibault DUPONCHELLE2020-09-291-1/+1
| | | | | | -fno-stack-protector to hints for amigaos.sh and haiku.sh (and disable accordingly -fstack-protector* in Configure)
* Fix Win32 errors from ErrnoNicolas R2020-09-141-1/+8
| | | | | | | | | Fix #18025 This is fixing these two errors under windows: "Never use <avx512bwintrin.h> directly; include <immintrin.h> instead." "Never use <avx512vpopcntdqvlintrin.h> directly; include <immintrin.h> instead."
* Remove Symbian portDagfinn Ilmari Mannsåker2020-07-201-15/+3
| | | | | Also eliminate USE_HEAP_INSTEAD_OF_STACK and SETSOCKOPT_OPTION_VALUE_T, since Symbian was the only user of those.
* Make Errno_pm.PL compatible with /usr/include/<ARCH>/errno.hNiko Tyni2018-11-201-10/+14
| | | | | | | | | | | | | | | | | As seen in <https://bugs.debian.org/798955>, Debian glibc maintainers intend to move system header files from /usr/include to /usr/include/<arch> at some point. This would break Errno_pm.PL, which has logic for asking cpp for the location of errno.h but fails earlier if errno.h is not on a list of known paths. Take the cpp fallback instead of dying. The behaviour should stay identical as long as errno.h is not moved. This will also enable multiarch (non-sysroot) cross builds. Original patch by Helmut Grohne. Bug-Debian: https://bugs.debian.org/875921
* bump $Errno::VERSIONTony Cook2018-01-251-1/+1
|
* Typo: 'at alia' should be 'et alia'George Hartzell2018-01-251-1/+1
|
* Switch most open() calls to three-argument form.John Lightsey2016-12-231-6/+6
| | | | | | | | | | 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
* Errno: mention that using %! autoloads Errno (RT #119359)Lukas Mai2016-11-111-5/+8
| | | | Also use lexical filehandles/3-arg open in example.
* Increase $Errno::VERSION to 1.26Father Chrysostomos2016-08-041-1/+1
|
* Rework mod loading for %- and %!; fix mem leakFather Chrysostomos2016-08-041-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are many built-in variables that perl creates on demand for efficiency’s sake. gv_fetchpvn_flags (which is responsible for sym- bol lookup) will fill in those variables automatically when add- ing a symbol. The special GV_ADDMG flag passed to this function by a few code paths (such as defined *{"..."}) tells gv_fetchpvn_flags to add the symbol, but only if it is one of the ‘magical’ built-in variables that we pre- tend already exist. To accomplish this, when the GV_ADDMG flag is passed, gv_fetchpvn_flags, if the symbol does not already exist, creates a new GV that is not attached to the stash. It then runs it through its magicalization code and checks afterward to see whether the GV changed. If it did, then it gets added to the stash. Otherwise, it is discarded. Three of the variables, %-, %!, and $], are problematic, in that they are implemented by external modules. gv_fetchpvn_flags loads those modules, which tie the variable in question, and then control is returned to gv_fetchpvn_flags. If it has a GV that has not been installed in the symbol table yet, then the module will vivify that GV on its own by a recursive call to gv_fetchpvn_flags (with the GV_ADD flag, which does none of this temporary-dangling-GV stuff), and gv_fetchpvn_flags will have a separate one which, when installed, would clobber the one with the tied variable. We solved that by having the GV installed right before calling the module, for those three variables (in perl 5.16). The implementation changed in commit v5.19.3-437-g930867a, which was supposed to clean up the code and make it easier to follow. Unfortun- ately there was a bug in the implementation. It tries to install the GV for those cases *before* the magicalization code, but the logic is wrong. It checks to see whether we are adding only magical symbols (addmg) and whether the GV has anything in it, but before anything has been added to the GV. So the symbol never gets installed. Instead, it just leaks, and the one that the implementing module vivifies gets used. This leak can be observed with XS::APItest::sv_count: $ ./perl -Ilib -MXS::APItest -e 'for (1..10){ defined *{"!"}; delete $::{"!"}; warn sv_count }' 3833 at -e line 1. 4496 at -e line 1. 4500 at -e line 1. 4504 at -e line 1. 4508 at -e line 1. 4512 at -e line 1. 4516 at -e line 1. 4520 at -e line 1. 4524 at -e line 1. 4528 at -e line 1. Perl 5.18 does not exhibit the leak. So in this commit I am finally implementing something that was dis- cussed about the time that v5.19.3-437-g930867a was introduced. To avoid the whole problem of recursive calls to gv_fetchpvn_flags vying over whose GV counts, I have stopped the implementing modules from tying the variables themselves. Instead, whichever gv_fetchpvn_flags call is trying to create the glob is now responsible for seeing that the variable is tied after the module is loaded. Each module now pro- vides a _tie_it function that gv_fetchpvn_flags can call. One remaining infelicity is that Errno mentions $! in its source, so *! will be vivified when it is loading, only to be clobbered by the GV subsequently installed by gv_fetch_pvn_flags. But at least it will not leak. One test that failed as a result of this (in t/op/magic.t) was try- ing to undo the loading of Errno.pm in order to test it afresh with *{"!"}. But it did not remove *! before the test. The new logic in the code happens to work in such a way that the tiedness of the vari- able determines whether the module needs to be loaded (which is neces- sary, now that the module does not tie the variable). Since the test is by no means normal code, it seems reasonable to change it.
* Export Winsock error constants from Errno.pmSteve Hay2016-03-111-4/+24
|
* Avoid %Config check on Errno load if it was built with ↵Todd Rinaldo2015-08-271-2/+13
| | | | | | | | | PERL_BUILD_EXPAND_CONFIG_VARS Any person who built perl with this environment variable already has locked their install to the given platform. Therefore this check should be unnecessary on those installs. This reduces runtime bloat because Config does not have to be loaded any time someone uses $! or Errno directly.
* Fix Errno.pm generation for gcc-5.0Petr Písař2015-02-171-6/+17
| | | | | | | | | | | | | | | | gcc-5.0 -E interleaves now line numbers with expended macros, so that the generated errno.c will be preprocessed to EBFONT => [[ 59 ]] which is hard to parse in in line-based reader. So use -P option with gcc >= 5.0. Global -P usage would break makedepend, global -ftrack-macro-expansion=0 would break lib/h2ph.t. RT#123784
* Clean up VMS includes in ext/Errno/Errno_pm.PL.Craig A. Berry2014-12-161-9/+3
| | | | | | There are currently (and for many years now) no viable alternatives to the headers that come with the operating system, regardless of compiler.
* Bump $Errno::VERSION for previous commitsSteve Hay2014-09-251-1/+1
|
* Errno parsing: Skip expressions containing function names etcSteve Hay2014-09-251-1/+1
| | | | | | | | | | Expressions containing a function name are no more eval()able than expressions which are just a function name, so skip them too. This also picks up on text in the expression and stops eval()s from whining about "String found where operator expected" on Win32 (with VC10) on expressions like L"\\Enlistment\\" and (sizeof(L"\\Enlistment\\")+(38*sizeof(WCHAR))), encountered when parsing ENLISTMENT_OBJECT_PATH and ENLISTMENT_OBJECT_NAME_LENGTH_IN_BYTES respectively.
* Errno parsing: Don't match hex numbers in parts of function namesSteve Hay2014-09-251-2/+2
| | | | | | This stops __stdcall being seen as a hex number and turned into __stdca. Also include _ in the pattern to match function names so that that gets skipped anyway.
* Tweak Errno parsing some moreSteve Hay2014-09-251-1/+1
| | | | | | | This requires there to be something present in the "0xcafebabe" part of the "((type)0xcafebabe)" (et alia) pattern, otherwise it can end up matching things that it shouldn't. (The "type" part is already required to be non-empty.)
* Improve Errno parsing of Win32 outputSteve Hay2014-09-251-1/+1
| | | | | | | | | This allows us to pluck "0xC038000FL" rather than "(0xC038000FL" out of "(DWORD)(0xC038000FL)", which means we go into the hex case rather than the eval case, and get the desired result (hex '0xC038000F' returns 3224895503, whereas eval '(0xC038000F' returns nothing). Also allows for "((DWORD)(0xC038000FL))" and other existing formats.
* Removed NeXT supportBrian Fraser2014-06-111-6/+2
|
* Fix Windows build with MinGW-w64's gcc-4.8.0Steve Hay2014-05-031-2/+2
| | | | | | | | | | | | | | | | | The use of #defines like this: #define ERROR_IPSEC_IKE_PROCESS_ERR_ID __MSABI_LONG(13834) #define __MSABI_LONG(x) x ## l in new MinGW-w64 header files trips up Errno_pm.PL, causing hundreds of warnings like this: Bareword found where operator expected at (eval 22) line 1, near "13834l" (Missing operator before l?) and hundreds of error values to go missing from Errno.pm. This patch, from perl #121773, fixes that.
* Introduce sysroot variable to ConfigureJess Robinson2014-01-131-2/+4
| | | | | | | | | | | | | This is borrowed from gcc and allows us to indicate the logical root directory for headers and libraries, under which all -I and -L are searched for. This patch adjusts Configure to search under $sysroot (if supplied) for headers and libraries, instead of /. --sysroot is added to ccflags and friends so that make in ExtUtils::MakeMaker, and other extensions, will use it. Currently this is only done if compiling with some variant of gcc or g++.
* This version bump also got lost in the mergeH.Merijn Brand2013-11-081-1/+1
| | | | Guess there will always be ways in git to explore ...
* Search for errno.h in more (semi)default locationsH.Merijn Brand2013-11-081-5/+7
|
* Silence noise from Errno_pm.PL on WindowsSteve Hay2013-09-161-1/+1
| | | | | | | | | | | | | | | A block of warnings like this appears when building Errno with VC++: Number found where operator expected at (eval 633) line 1, near ")0xC0000093" (Missing operator before 0xC0000093?) This is caused by #defines like these in the Windows header files: WinBase.h:#define EXCEPTION_FLT_UNDERFLOW STATUS_FLOAT_UNDERFLOW WinNT.h:#define STATUS_FLOAT_UNDERFLOW ((DWORD )0xC0000093L) and can be silenced by teaching Errno_pm.PL about the otherwise unexpected whitespace immediately after "DWORD" in the cast.
* Fix the #include of winsock2.h in win32/include/sys/errno2.hSteve Hay2013-09-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | For some reason (I didn't figure out why) cpan/Win32/Win32.xs did not compile as of the previous commit, but in any case we cannot just blindly include winsock2.h because (a) it is too late if winsock.h has already been included and (b) early WinCE doesn't have it. The definition of _WINSOCKAPI_ was also wrongly not updated to _WINSOCK2API_ but was mistaken in its comment "Don't drag in everything" anyway: it's actually just an old-fashioned "include guard", not a means to include a minimal API from the file. (The mistaken comment came from the original ext/Errno/Errno_pm.PL before this round of $!-related changes. That file also had a redundant "#include <winsock.h>" left in it which should have been removed along with earlier work that removed the other one, so tidy that up too.) Steal a hopefully more correct incantation from win32/include/sys/socket.h instead. Now that we allow for the possibility of winsock.h being used again, we must take care not to make use of WSAECANCELLED if it is not defined. (That is the only WSAExxx constant which we use that was new in winsock2.h.)
* Fix a problem with mod_perl on Windows using VS2010+.Steve Hay2013-09-161-17/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is caused by the following two commits, which sought to deal with new Exxx values (with values >= 100) in errno.h which Microsoft added in VS2010: http://perl5.git.perl.org/perl.git/commit/b59e75b34cef3fedd214c9b6ee744146cf8b3308 http://perl5.git.perl.org/perl.git/commit/912c63ed00375338703043928cac3c740d00cc9d The former commit was mostly a patch to Errno and POSIX, together with some other cleaning up in win32/win32.h and win32/include/sys/socket.h; the latter commit was a fixup to win32/include/sys/socket.h which restored (more aggressively) the ENOTSOCK->WSAENOTSOCK redefinition and added similar redefinitions for ECONNABORTED, ECONNRESET and EAFNOSUPPORT. It is the latter commit which causes this little program to output ECONNABORTED=10053 rather than ECONNABORTED=106 as it ought to do in VC10 (and higher) builds of perl: #include <windows.h> #include "EXTERN.h" #include "perl.h" #include "XSUB.h" void main(void) { printf("ECONNABORTED=%d\n", ECONNABORTED); } That change is now causing problems with mod_perl, in which the (Perl level) APR::Status::is_ECONNABORTED() and the (C level) APR_STATUS_IS_ECONNABORTED() which it calls are failing to recognize an aborted connection (indicated by error code ECONNABORTED set by Apache httpd.exe). The APR_STATUS_IS_ECONNABORTED() macro is picked up by mod_perl from APR's apr_errno.h: #define APR_STATUS_IS_ECONNABORTED(s) ((s) == APR_ECONNABORTED \ || (s) == APR_OS_START_SYSERR + WSAECONNABORTED) where #ifdef ECONNABORTED #define APR_ECONNABORTED ECONNABORTED #else #define APR_ECONNABORTED (APR_OS_START_CANONERR + 18) #endif When this is compiled into httpd.exe ECONNABORTED is 106 (from errno.h) and APR_STATUS_IS_ECONNABORTED(s) amounts to #define APR_STATUS_IS_ECONNABORTED(s) ((s) == 106 || (s) == 730053) but when compiled into APR/Status.dll ECONNABORTED is 10053 (redefined to WSAECONNABORTED as above) so APR_STATUS_IS_ECONNABORTED(s) then amounts to #define APR_STATUS_IS_ECONNABORTED(s) ((s) == 10053 || (s) == 730053) which doesn't pick up an error code of 106 coming from httpd.exe. This could be worked around in mod_perl by redefining ECONNABORTED and the other three back to their original errno.h values to match what httpd.exe is using, but that might just cause problems in the other direction, with those values no longer matching the values which perl.exe is using. Moreoever, this problem could affect other XS interfaces (not just mod_perl), so it really needs to be fixed in perl. This commit implements the alternative solution mentioned the commit message for the first commit cited above. (As noted in that previous commit message, this solution equally has potential problems, missing out on the advantages of the original solution implemented, namely, better backwards compatibility with other perl code having hard-coded numeric error codes, but this will be unavoidable if we want to get to a sane state.) Note that changing the $! values is an incompatible change, so should probably not be done for 5.18.x. That's unfortunate for mod_perl (and anything else similarly affected), but that will just have to either live with the breakage (which was introduced in 5.14.0) until 5.20.0 or else try the workaround mentioned above for 5.14.x, 5.16.x and 5.18.x. The main change is to use a new function throughout win32/win32sck.c to convert WSAGetLastError() values into errno.h constants before assigning to errno. Every possible WSAExxx value (as documented by MSDN) is mapped to an Exxx value, although it is still possible for other WSAxxx values to get assigned to errno unchanged (but that has always been the case, and any non-existent Exxx values get mapped back to WSAExxx values anyway...). We must then ensure that all of those Exxx values are defined, which is now done (in the new file, win32/include/sys/errno2.h) in a friendlier manner, being careful not to redefine any (specifically the new ones in VC++ 2010 and above) which already exist. The rest are defined as the WSAExxx values, as mentioned above. Finally, we need the Errno module to know about these values, which is done by having it include that same new header file to ensure that it gets the same definitions, rather than having to play its own games. The new header is also used in POSIX, which similarly wants definitions of as many as possible of its hard-coded list of Exxx values.
* Generate Errno and Pod::Functions with deterministic order.Nicholas Clark2013-07-131-2/+2
| | | | | | | | | Previously the order of duplicate names in Errno was determined by hash iteration order, as was the order of the list of types for built-ins in Pod::Functions. With hash randomisation this meant that the generated file could differ between builds, which isn't ideal if the input is the same. (Spotted as a side effect of running a diff on two installation trees.)
* Remove the BeOS port.Nicholas Clark2012-12-141-39/+3
| | | | | | | | | 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.
* Remove the EPOC port.Nicholas Clark2012-11-191-4/+1
| | | | | | | EPOC was a family of operating systems developed by Psion for mobile devices. It was the predecessor of Symbian. The port was last updated in April 2002.
* Remove the VM/ESA port.Nicholas Clark2012-08-311-4/+1
| | | | | VM/ESA was a mainframe OS. IBM ended service on it in June 2003. It was superseded by Z/VM.
* Errno does not escape archnameReini Urban2011-11-021-3/+7
| | | | | | | With a @ or $ or % character in the user-choosen archname, Errno fails. I usually use @ to denote git tags in the archlib. E.g. Possible unintended interpolation of @khwtk in string at ../lib/Errno.pm line 12
* The Borland Chainsaw MassacreSteve Hay2011-09-101-8/+2
| | | | | Remove support for the Borland C++ compiler on Win32, as agreed here: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-09/msg00034.html
* Redefine errno values for Visual Studio 2010Steve Hay2011-03-191-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Perl traditionally stores WinSock error codes (values above 10000) in errno, with corresponding support for $! to stringify them properly. In Visual Studio 2010 (and presumably newer Windows SDKs) Microsoft has started to define additional errno constants in errno.h (values between 100 and 200) with conflicting names (e.g. EWOULDBLOCK). There are 2 ways to deal with this situation: 1) Redefine the errno.h constants back to the winsock values for the Errno and POSIX modules. 2) Translate the winsock error codes to the new errno constants in the socket implementation in win32/win32sck.c. Solution 1) has the advantage that any existing Perl code that has numeric error codes hard-coded in it will continue to work. Solution 2) has the advantage that XS code using external libaries can set errno to the new constants, and they will be handled consistently in the Perl core. It will however need additional support for other compilers and runtime libraries that don't support these new error codes. This commit implements solution 1). Blame attribution: the commit message is from Jan Dubois, the actual patch was created by Steve Hay. Signed-off-by: Jan Dubois <jand@activestate.com>
* Ensure that the C<exists &Errno::EFOO> idiom continues to work as documented.Nicholas Clark2011-03-072-3/+29
| | | | | | | A change post-5.12 (probably 42607a60df6df19b) caused the documented idiom not to work if Errno was loaded after the C<exists> code had been compiled, as the compiler implicitly creates typeglobs in the Errno symbol table when it builds the optree for the C<exists code>.
* In Errno, use typeglob aliasing instead of subref to typeglob assignment.Nicholas Clark2011-02-191-2/+1
| | | | | | | Typeglob aliasing saves just over .5K, because fewer internal structures are created. In the general case the behaviour of the two differs, but as the only package variables of these names are subroutines, and we are within our own namespace, there is no difference here.
* Remove Mac OS classic code from the Errno.pm generation script.Nicholas Clark2011-01-191-19/+7
|
* Bump $Errno::VERSION after change be54382Florian Ragwitz2010-09-031-1/+1
|
* Sanity check on Errno values.Curtis Jewell2010-09-021-2/+3
| | | | | | On a few machines (Win32/gcc using mingw64 headers) Errno.pm will find a value that is not numeric for a proposed error key. This change adds a sanity check to discard such keys.
* Tweak the generated Errno.pm slightly. Shorter and slightly fewer ops.Nicholas Clark2010-06-231-8/+7
| | | | | | | Use our directly at the first assignment, rather than on a line by itself. Add editor readonly blocks, consistent with most other generated files. require Exporter, rather than using it with an empty import list. We don't need it at compile time.
* Reduce Errno memory usage by around 55%.Nicholas Clark2010-05-021-33/+36
| | | | | Use Proxy Constant Subroutines rather than full-fat subroutines, and simplify the implementation of the tied hash methods.
* Remove unused %errno and $AUTOLOAD from the generated Errno.pmNicholas Clark2010-05-021-1/+1
|
* Remove the lexical $len and associated calculation, which is never used.Nicholas Clark2010-05-011-3/+1
|
* Make extensions in ext run their tests from the extension's own directory.Nicholas Clark2009-08-281-11/+0
| | | | | | | | | | | Inspired by, and in parts borrows from, Schwern's branch on github, but takes a slightly different approach in places. Not quite perfect yet - ext/File-Glob still runs from t, at least one FIXME needs fixing, and the changes to dual-life modules' tests need to be filtered back upstream, and possibly modified to suit their respective authors. But it works.
* As Errno is formally no longer dual-lived, give it a proper version number.Nicholas Clark2009-06-251-1/+1
|
* Mark all .t and .pm files as non executableRafael Garcia-Suarez2009-06-061-0/+0
|
* Close the file before renaming it. Problem spotted and fix supplied by corion.Nicholas Clark2009-03-311-0/+2
|
* Don't create an empty Errno.pm if there is an error whilst running Errno_pm.PLNicholas Clark2009-03-311-1/+3
| | | | | Implemented by initially writing to an temporary file name, and renaming as the last act.