summaryrefslogtreecommitdiff
path: root/reentr.c
Commit message (Collapse)AuthorAgeFilesLines
* fix incorrect vi filetype declarations in generated filesLukas Mai2023-03-241-1/+1
| | | | | Vim's filetype declarations are case sensitive. The correct types for Perl, C, and Pod are perl, c, and pod, respectively.
* generated files - update mode lines to specify file typeElvin Aslanov2023-02-191-2/+2
| | | | | | | | | | This updates the mode-line for most of our generated files so that they include file type information so they will be properly syntax highlighted on github. This does not make any other functional changes to the files. [Note: Commit message rewritten by Yves]
* style: Detabify regen files.Michael G. Schwern2021-01-171-187/+187
| | | | | | | | | | | They generate C files. Bump feature.pm and warnings.pm versions to satisfy cmpVERSION.pl. I can't get it to easily ignore whitespace, `git diff --name-only` does not respect the -w flag. regen_perly.pl is left alone. That would require rebuilding perly.* which is beyond a simple indentation change.
* reentr.c: Prevent infinite loopingKarl Williamson2020-07-301-1/+1
| | | | | This is an easy, though paranoid hedge to prevent something that should never happen from causing an infinite loop if it were to happen.
* reentr.c: Buffer sizes for asctime_r,ctime_r are smallKarl Williamson2020-07-301-2/+2
| | | | | The needed sizes of these are stated in the man pages, and are much smaller than were being allocated.
* reentr.[ch]: Add gmtime_r, localtime_rKarl Williamson2020-03-181-0/+18
| | | | | This now replaces occurrences of the non re-entrant versions of these two functions with the reentrant ones.
* Regne reentr.c.Karl Williamson2020-03-181-0/+1
| | | | | Commit 727613455d53416b197154b7b3cad20fe26372bb failed to regenerate reentr.c after changes.
* reentr.c: revise handling of several wrapped fcnsKarl Williamson2020-03-181-60/+49
| | | | | | | | | | | | | | | | | | Prior to this commit, the code in this function had generic variables, like p0, and malloc'd them using void *, and then cast to what it thought were the proper types. This was failing on solaris g++, because of the stricter casting rules in C++. This commit actually simplifies the code, by getting rid of the generic stuff, and for each group of related functions, declares the appropriate names for the variables, and mallocs them using the correct type as expressed in the __DATA__ section of regen/reentr.pl. The casting is eliminated, except for one case for gethostbyaddr(). Tony Cook pointed out that the 2001 POSIX standard used a type name for this that may be shorter than Size_t. This could be a potential issue, but not on the platforms tested as of now. And this fixes #17482, so works where the previous didn't.
* reentr.c: Handle getspnam()Karl Williamson2020-03-181-3/+38
| | | | | | | | | | | | | This has never worked to increase the buffer size if necessary. Apparently the default has always been big enough. But this commit fixes it to retry if too small. I don't think there is a way to write tests for this. getspnam is called only as a small part of pp_gpwent, and is not part of the API, and is called only when run as root. I did test it on my box, with gdb, starting with a buffer size of 1, and single stepping and observing that it works as I expected.
* reentr.c: Use keywords, not opsKarl Williamson2020-03-181-46/+55
| | | | | | | | | | | | | | | | | The parameter to this function is a string containing the name of the wrapped function. Prior to this commit, it was assumed, without checking, that PL_op->op_type corresponded to this name. This assumption can't be always correct because at least one of the wrapped functions doesn't have an op, getspnam. That means it never would have worked for that function to increase its buffer size. When I was examining this some years ago (and didn't follow up until now), ISTR that there were other cases where the correspondence was wrong, but I couldn't reproduce that now. There is no easy conversion from string to OP code, but there is from string to keyword number. This commit changes to use that conversion function, and switches based on the keyword number. A later commit fixes getspnam.
* reentr.[ch]: White-space onlyKarl Williamson2020-03-151-201/+290
| | | | | | | | I changed the preprocessor directive indentation to make it easier to grasp the nesting levels, and added blank lines for readability. Some of the changes are for future commits that will remove some nesting.
* regen/reentr.pl: Add some commentsKarl Williamson2020-03-151-0/+21
|
* regen/reentr.pl: Use Configure'd typesKarl Williamson2020-01-141-2/+2
| | | | | | Configure goes to the trouble of finding the parameter types that the gethostbyFOO functions use, but reentr.pl was ignoring this, causing compilation failures on at least Solaris.
* regen/reentr.pl: simplify cpp conditionalsAaron Crane2017-10-211-21/+9
|
* reentr: update size after RenewHugo van der Sanden2017-03-151-18/+19
| | | | | | | | RT #130841 Setting it before Renew can cause problems if the Renew fails. Required 'make regen'.
* Make the LoTR quote of reentr.c formatted more like the others.Jarkko Hietaniemi2015-06-241-1/+7
| | | | | (Note: the p.260 is my best estimate since I don't have the same edition as tchrist)
* Unused contexts found under PERL_GLOBAL_STRUCT.Jarkko Hietaniemi2014-06-241-0/+3
|
* reentr.c: Handle systems without getpwentBrian Fraser2014-01-261-0/+2
| | | | Namely, Android.
* [perl #115928] we don't use drand48_r or random_r any longerTony Cook2013-09-131-18/+0
| | | | | Removing this should mean that metaconfig will remove the units from the built Configure
* remove various redundant dTHXesDaniel Dragan2012-11-081-1/+1
| | | | | Remove either unused dTHXes, or remove dTHXes where a nocontext func can be used instead. Smaller/faster machine code is the result.
* Move all the generated file header printing into read_only_top()Nicholas Clark2011-01-231-2/+3
| | | | | | | | | Previously all the scripts in regen/ had code to generate header comments (buffer-read-only, "do not edit this file", and optionally regeneration script, regeneration data, copyright years and filename). This change results in some minor reformatting of header blocks, and standardises the copyright line as "Larry Wall and others".
* reentr.pl -> regen/reentr.plFather Chrysostomos2010-10-131-1/+1
|
* Update from y2038Michael G. Schwern2009-01-031-12/+0
| | | | | | Work around a system that doesn't have gm/localtime_r(). This replaces Perl's own gm/localtime() wrapper which couldn't be called outside a PP anyway because it needs my_perl.
* assert() that every NN argument is not NULL. Otherwise we have theNicholas Clark2008-02-121-0/+5
| | | | | | | | | | | | ability to create landmines that will explode under someone in the future when they upgrade their compiler to one with better optimisation. We've already done this at least twice. (Yes, some of the assertions are after code that would already have SEGVd because it already deferences a pointer, but they are put in to make it easier to automate checking that each and every case is covered.) Add a tool, checkARGS_ASSERT.pl, to check that every case is covered. p4raw-id: //depot/perl@33291
* Re: [Fwd: Smoke [5.9.5] 31775 FAIL(m) OSF1 V5.1 (EV6/4 cpu)]Jarkko Hietaniemi2007-09-041-0/+2
| | | | | | | | Message-ID: <46DC3C7B.9000602@iki.fi> Message-ID: <46DC3C7B.9000602@iki.fi> Add { } to keep all variable declarations at the start of blocks. p4raw-id: //depot/perl@31789
* misc blead stuffJarkko Hietaniemi2007-08-301-5/+3
| | | | | Message-ID: <46D617B5.3000002@iki.fi> p4raw-id: //depot/perl@31765
* Regenerate all filesRafael Garcia-Suarez2007-01-101-1/+1
| | | p4raw-id: //depot/perl@29747
* Regen for #28896H.Merijn Brand2006-09-281-3/+3
| | | p4raw-id: //depot/perl@28897
* Re: Change 28877: [PATCH] deal with some gcc warningsJarkko Hietaniemi2006-09-251-3/+3
| | | | | | | | Message-ID: <45175CA4.3020900@iki.fi> remove casts that were causing failure on FreeBSD -Duse64bitint, and some other cleanups. p4raw-id: //depot/perl@28886
* deal with some gcc warningsJarkko Hietaniemi2006-09-211-3/+3
| | | | | Message-ID: <45122C6F.9080904@iki.fi> p4raw-id: //depot/perl@28877
* Clear up a few more warnings from blead.Steve Peters2006-07-131-0/+2
| | | p4raw-id: //depot/perl@28565
* Introduce a new function, pv_escape(), to display contents of PVsYves Orton2006-07-061-1/+1
| | | | | | | | that might contain non printable chars. Subject: Re: [PATCH]: fix: [perl #39583] Pattern Match fails for specific length string Message-ID: <9b18b3110607051140n10c211a1jf17d3b7914d6f68b@mail.gmail.com> p4raw-id: //depot/perl@28490
* fix signed/unsigned nit in reentr.cCraig A. Berry2006-07-041-1/+1
| | | p4raw-id: //depot/perl@28480
* It's the Barbie bus patchAndy Lester2006-01-101-1/+1
| | | | | Message-ID: <20060110054243.GA26165@petdance.com> p4raw-id: //depot/perl@26764
* Re: janitorial work ? [patch]Jim Cromie2005-07-081-14/+14
| | | | | | | | Message-ID: <42CC3CE9.5050606@divsol.com> (reverted all dual-lived modules since they must work with older perls too so must wait for a new Devel::PPPort) p4raw-id: //depot/perl@25101
* perl 5.9.x (@ 24471): Symbian updateJarkko Hietaniemi2005-05-171-1/+1
| | | | | | | | Message-ID: <B356D8F434D20B40A8CEDAEC305A1F2453D793@esebe105.NOE.Nokia.com> completed by: Message-ID: <B356D8F434D20B40A8CEDAEC305A1F2453D7A0@esebe105.NOE.Nokia.com> p4raw-id: //depot/perl@24492
* Include vim/emacs modelines in generated files to open themRafael Garcia-Suarez2005-05-111-2/+4
| | | | | | in read-only mode. Make vi modelines compatible with non-vim vi versions. p4raw-id: //depot/perl@24445
* Regenerate reentr.[ch]Rafael Garcia-Suarez2005-05-101-1/+1
| | | p4raw-id: //depot/perl@24442
* cast to/from (void *) in the re-entrant code. Now watch the smoke rise.Nicholas Clark2005-04-061-7/+7
| | | p4raw-id: //depot/perl@24176
* Add comment to top of reentr.c and fix typos in other filesDave Mitchell2004-08-011-1/+7
| | | p4raw-id: //depot/perl@23180
* reentr.pl is not defining _srandom_structJan Dubois2003-11-051-0/+6
| | | | | Message-Id: <45igqvsus3hr8bno3si087j5qnrqvn79bf@4ax.com> p4raw-id: //depot/perl@21660
* Detecting errors of reentrant APIs: getgrgid_r and the likeJarkko Hietaniemi2003-04-281-1/+1
| | | | | | | | | | when returning an int can either return the error in the return value or in the errno. We need a new per-interp variable to store the return value instead of clobbering the errno with it. The new variable, PL_reentrant_retint, is only used within the reentrancy framework, and immediately after it's set, so there should not be similar visibility issues as for the errno. Spotted by Edward Moy. p4raw-id: //depot/perl@19357
* Fix up Larry's copyright statements to my best knowledge.Jarkko Hietaniemi2003-04-161-1/+1
| | | | | | | (Lots of Perl 5 source code archaeology was involved.) Larry didn't make strangled noises when I showed him the patch, either :-) p4raw-id: //depot/perl@19242
* Integrate:Jarkko Hietaniemi2003-04-011-4/+5
| | | | | | | | | | [ 19119] Address "5.8.1@19053: crypt_r() takes 128K per thread". p4raw-link: @19119 on //depot/maint-5.8/perl: 5338c2bbd71426ba96ace22615fafeda3d05e36d p4raw-link: @19053 on //depot/maint-5.8/perl: dab75801826d3b09804fff099d3631e91578dcd1 p4raw-id: //depot/perl@19122 p4raw-integrated: from //depot/maint-5.8/perl@19121 'copy in' reentr.c reentr.h reentr.pl (@19106..) 'merge in' pp.c (@19045..)
* Integrate:Ilya Zakharevich2003-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ 19106] Subject: [PATCH 5.8.1 @19053] OS/2-related patches Message-ID: <20030331204337.GA3634@math.berkeley.edu> and regen Configure. p4raw-link: @19106 on //depot/maint-5.8/perl: 8257dec7ed17c0d4d721411d2a781ceadf724da5 p4raw-id: //depot/perl@19120 p4raw-edited: from //depot/maint-5.8/perl@19118 'edit in' embedvar.h (@18804..) p4raw-integrated: from //depot/maint-5.8/perl@19118 'copy in' os2/Makefile.SHs os2/OS2/ExtAttr/Changes os2/OS2/ExtAttr/ExtAttr.pm os2/OS2/PrfDB/Changes os2/OS2/PrfDB/PrfDB.pm os2/OS2/REXX/DLL/DLL.pm os2/OS2/REXX/REXX.pm os2/dl_os2.c os2/os2thread.h (@17645..) ext/threads/threads.xs (@18619..) perlio.c (@18948..) Makefile.SH (@19061..) 'ignore' embed.pl (@18872..) embed.h (@19011..) embed.fnc (@19030..) 'merge in' os2/os2ish.h (@17645..) os2/os2.c (@18347..) perlapi.h (@18804..) perlvars.h (@18808..) makedef.pl (@18896..) intrpvar.h (@18920..) sv.c (@18961..) p4raw-edited: from //depot/maint-5.8/perl@19106 'edit in' Configure (@19040..) p4raw-integrated: from //depot/maint-5.8/perl@19106 'copy in' reentr.h (@18850..) reentr.c reentr.pl (@18922..)
* Uid_t and Gid_t can easily be shorts and one cannotJarkko Hietaniemi2003-03-111-0/+8
| | | | | pull shorts off the va_args, int is the shortest (ahem). p4raw-id: //depot/perl@18919
* Update all copyrights to 2003, from JarkkoHugo van der Sanden2003-03-021-1/+1
| | | p4raw-id: //depot/perl@18801
* Integrate changes #18422 and #18423 from maint-5.8.Rafael Garcia-Suarez2003-01-161-11/+12
| | | | | | | | | | | | | | | 18422 : Third Degree found a read of uninit memory (after setting grent_size with sysconf(), pwent_size was read). Also make the ERANGE/INVARG more consistent. 18423 : spent_size was still off. (As far as I can tell _SC_GETPW_R_SIZE_MAX is supposed to be used also for spents, not just pwents.) p4raw-link: @18422 on //depot/maint-5.8/perl: c45c44aa17d6498a967957363477eb572b803726 p4raw-id: //depot/perl@18498 p4raw-integrated: from //depot/maint-5.8/perl@18497 'copy in' reentr.h (@17645..) reentr.c reentr.pl (@18422..)
* No warn, just ERANGE (Was: Re: [PATCH] reentrant buffers)Jarkko Hietaniemi2002-10-111-23/+5
| | | | | Message-ID: <20021004131157.GD278184@lyta.hut.fi> p4raw-id: //depot/perl@17999
* reentrant buffersJarkko Hietaniemi2002-10-021-8/+53
| | | | | Message-ID: <20020926220856.GA339120@lyta.hut.fi> p4raw-id: //depot/perl@17967