summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl
diff options
context:
space:
mode:
authorAndrew Fresh <afresh1@cvs.openbsd.org>2024-05-14 19:39:41 +0000
committerAndrew Fresh <afresh1@cvs.openbsd.org>2024-05-14 19:39:41 +0000
commitc0a15caa18e1f9f5106fb2b30a4683ca791ac8fd (patch)
tree2bfa75eb9037ea24bb8cfab9fd7c5623077ac4a7 /gnu/usr.bin/perl
parent45c703581717284c37fbb2abc2968de039f80a64 (diff)
Apply local patches - perl-5.38.2
ok gkoehler@ Commit and we'll fix fallout bluhm@ Right away, please deraadt@
Diffstat (limited to 'gnu/usr.bin/perl')
-rw-r--r--gnu/usr.bin/perl/Configure28
-rw-r--r--gnu/usr.bin/perl/MANIFEST26
-rw-r--r--gnu/usr.bin/perl/Makefile.SH37
-rw-r--r--gnu/usr.bin/perl/Makefile.bsd-wrapper110
-rw-r--r--gnu/usr.bin/perl/Porting/Maintainers.pl3
-rw-r--r--gnu/usr.bin/perl/Porting/pumpkin.pod4
-rw-r--r--gnu/usr.bin/perl/av.c24
-rw-r--r--gnu/usr.bin/perl/configpm12
-rw-r--r--gnu/usr.bin/perl/cpan/Compress-Raw-Bzip2/private/MakeUtil.pm3
-rw-r--r--gnu/usr.bin/perl/cpan/Compress-Raw-Zlib/config.in6
-rw-r--r--gnu/usr.bin/perl/cpan/Compress-Raw-Zlib/private/MakeUtil.pm3
-rw-r--r--gnu/usr.bin/perl/cpan/Digest-MD5/MD5.xs369
-rwxr-xr-xgnu/usr.bin/perl/cpan/Digest-MD5/t/files.t2
-rw-r--r--gnu/usr.bin/perl/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm11
-rw-r--r--gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm3
-rw-r--r--gnu/usr.bin/perl/cpan/IO-Compress/private/MakeUtil.pm3
-rw-r--r--gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm2
-rw-r--r--gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToMan.pm18
-rw-r--r--gnu/usr.bin/perl/cpan/Sys-Syslog/Makefile.PL2
-rw-r--r--gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm160
-rwxr-xr-xgnu/usr.bin/perl/cpan/Term-Cap/test.pl10
-rw-r--r--gnu/usr.bin/perl/cpan/podlators/lib/Pod/Man.pm2
-rw-r--r--gnu/usr.bin/perl/dist/IO/t/cachepropagate-unix.t2
-rwxr-xr-xgnu/usr.bin/perl/dist/threads-shared/t/stress.t2
-rw-r--r--gnu/usr.bin/perl/ext/NDBM_File/Makefile.PL2
-rw-r--r--gnu/usr.bin/perl/hints/openbsd.sh52
-rw-r--r--gnu/usr.bin/perl/install_lib.pl18
-rw-r--r--gnu/usr.bin/perl/installperl68
-rw-r--r--gnu/usr.bin/perl/lib/AnyDBM_File.pm2
-rw-r--r--gnu/usr.bin/perl/lib/perl5db.pl28
-rw-r--r--gnu/usr.bin/perl/numeric.c2
-rw-r--r--gnu/usr.bin/perl/perl.c2
-rw-r--r--gnu/usr.bin/perl/pod/perlmodinstall.pod4
-rw-r--r--gnu/usr.bin/perl/pod/perlmodlib.PL1
-rw-r--r--gnu/usr.bin/perl/pp.c7
-rw-r--r--gnu/usr.bin/perl/pp_sys.c2
-rw-r--r--gnu/usr.bin/perl/regen/lib_cleanup.pl6
-rw-r--r--gnu/usr.bin/perl/shlib_version2
-rw-r--r--gnu/usr.bin/perl/syscall_emulator.c1420
-rw-r--r--gnu/usr.bin/perl/t/lib/h2ph.pht4
-rw-r--r--gnu/usr.bin/perl/t/op/array.t6
-rwxr-xr-xgnu/usr.bin/perl/t/op/getppid.t2
-rw-r--r--gnu/usr.bin/perl/t/porting/customized.dat5
-rw-r--r--gnu/usr.bin/perl/t/porting/dual-life.t6
-rw-r--r--gnu/usr.bin/perl/t/porting/exec-bit.t4
-rw-r--r--gnu/usr.bin/perl/t/re/speed.t2
-rw-r--r--gnu/usr.bin/perl/utf8.h5
-rw-r--r--gnu/usr.bin/perl/util.c4
-rw-r--r--gnu/usr.bin/perl/utils.lst8
-rw-r--r--gnu/usr.bin/perl/utils/Makefile.PL18
-rw-r--r--gnu/usr.bin/perl/utils/h2ph.PL6
-rw-r--r--gnu/usr.bin/perl/utils/perlbug.PL9
-rw-r--r--gnu/usr.bin/perl/vutil.c4
-rw-r--r--gnu/usr.bin/perl/win32/GNUmakefile1
-rw-r--r--gnu/usr.bin/perl/win32/Makefile1
55 files changed, 1859 insertions, 584 deletions
diff --git a/gnu/usr.bin/perl/Configure b/gnu/usr.bin/perl/Configure
index e261cb95482..025093d1b97 100644
--- a/gnu/usr.bin/perl/Configure
+++ b/gnu/usr.bin/perl/Configure
@@ -5452,6 +5452,25 @@ default|recommended)
eval $checkccflag
;;
esac
+ case "$gccversion" in
+ 1*) ;;
+ 2*) ;;
+ ?*) echo " "
+ echo "Checking if your compiler accepts -fno-delete-null-pointer-checks" 2>&1
+ echo 'int main(void) { return 0; }' > gcctest.c
+ if $cc -O2 -fno-delete-null-pointer-checks -o gcctest gcctest.c; then
+ echo "Yes, it does." 2>&1
+ case "$ccflags" in
+ *delete-null-pointer-checks*)
+ echo "Leaving current flags $ccflags alone." 2>&1
+ ;;
+ *) dflt="$dflt -fno-delete-null-pointer-checks" ;;
+ esac
+ else
+ echo "Nope, it doesn't, but that's ok." 2>&1
+ fi
+ ;;
+ esac
# For gcc, adding -pipe speeds up compilations for some, but apparently
# some assemblers can't read from stdin. (It also slows down compilations
# in other cases, but those are apparently rarer these days.) AD 5/2004.
@@ -21103,9 +21122,9 @@ case "$ccflags" in
;;
esac
-randfunc=Perl_drand48
-drand01="Perl_drand48()"
-seedfunc="Perl_drand48_init"
+randfunc=drand48
+drand01="drand48()"
+seedfunc="srand48"
randbits=48
randseedtype=U32
@@ -24100,6 +24119,7 @@ xs_extensions=''
find_extensions='
for xxx in *; do
case "$xxx" in
+ CVS) ;;
DynaLoader|dynaload) ;;
*)
this_ext=`echo "$xxx" | $sed -e s/-/\\\//g`;
@@ -24329,6 +24349,8 @@ esac
nonxs_ext=''
for xxx in $nonxs_extensions ; do
case "$xxx" in
+ CVS|RCS|SCCS|.svn)
+ ;;
VMS*)
;;
*) nonxs_ext="$nonxs_ext $xxx"
diff --git a/gnu/usr.bin/perl/MANIFEST b/gnu/usr.bin/perl/MANIFEST
index 88d3080885e..9c869b8fc35 100644
--- a/gnu/usr.bin/perl/MANIFEST
+++ b/gnu/usr.bin/perl/MANIFEST
@@ -15,6 +15,7 @@ Changes Describe how to peruse changes between releases
charclass_invlists.h Compiled-in inversion lists
class.c Internals of the `use feature 'class'` object system
CODE_OF_CONDUCT.md Information on where to find the Standards of Conduct
+config.over Site-specific overrides for Configure defaults
config_h.SH Produces config.h
configpm Produces lib/Config.pm
Configure Portability tool
@@ -38,6 +39,7 @@ fakesdio.h stdio in terms of PerlIO
feature.h Feature header
form.h Public declarations for formats
generate_uudmap.c Generate uudmap.h, the uuencode decoding map
+git_version.h Pre-generated git_version.h for OpenBSD
globals.c File to declare global symbols (for shared library)
globvar.sym Global variables that need hiding when embedded
gv.c Glob value code
@@ -1749,6 +1751,16 @@ cpan/NEXT/t/dynamically_scoped_regex_vars.t NEXT
cpan/NEXT/t/next.t NEXT
cpan/NEXT/t/stringify.t NEXT
cpan/NEXT/t/unseen.t NEXT
+cpan/OpenBSD-MkTemp/lib/OpenBSD/MkTemp.pm OpenBSD::MkTemp
+cpan/OpenBSD-MkTemp/MkTemp.xs OpenBSD::MkTemp
+cpan/OpenBSD-MkTemp/README OpenBSD::MkTemp Readme
+cpan/OpenBSD-MkTemp/t/OpenBSD-MkTemp.t OpenBSD::MkTemp test file
+cpan/OpenBSD-Pledge/lib/OpenBSD/Pledge.pm OpenBSD::Pledge
+cpan/OpenBSD-Pledge/Pledge.xs OpenBSD::Pledge
+cpan/OpenBSD-Pledge/t/OpenBSD-Pledge.t OpenBSD::Pledge test file
+cpan/OpenBSD-Unveil/lib/OpenBSD/Unveil.pm OpenBSD::Unveil
+cpan/OpenBSD-Unveil/t/OpenBSD-Unveil.t OpenBSD::Unveil test file
+cpan/OpenBSD-Unveil/Unveil.xs OpenBSD::Unveil
cpan/Params-Check/lib/Params/Check.pm Params::Check
cpan/Params-Check/t/01_Params-Check.t Params::Check tests
cpan/parent/lib/parent.pm Establish an ISA relationship with base classes at compile time
@@ -2315,6 +2327,17 @@ cpan/Term-ANSIColor/t/module/true-color.t
cpan/Term-ANSIColor/t/taint/basic.t
cpan/Term-Cap/Cap.pm Perl module supporting termcap usage
cpan/Term-Cap/test.pl See if Term::Cap works
+cpan/Term-ReadKey/Changes Term::ReadKey
+cpan/Term-ReadKey/Configure.pm Term::ReadKey
+cpan/Term-ReadKey/example/test.pl Term::ReadKey
+cpan/Term-ReadKey/genchars.pl Term::ReadKey
+cpan/Term-ReadKey/Makefile.PL Term::ReadKey
+cpan/Term-ReadKey/ppport.h Term::ReadKey
+cpan/Term-ReadKey/ReadKey.xs Term::ReadKey
+cpan/Term-ReadKey/ReadKey.pm.PL Term::ReadKey
+cpan/Term-ReadKey/README Term::ReadKey
+cpan/Term-ReadKey/t/01_basic.t Term::ReadKey
+cpan/Term-ReadKey/t/02_terminal_functions.t Term::ReadKey
cpan/Test-Harness/bin/prove The prove harness utility
cpan/Test-Harness/lib/App/Prove.pm Gubbins for the prove utility
cpan/Test-Harness/lib/App/Prove/State.pm Gubbins for the prove utility
@@ -4469,7 +4492,6 @@ ext/B/B/Showlex.pm Compiler Showlex backend
ext/B/B/Terse.pm Compiler Terse backend
ext/B/B/Xref.pm Compiler Xref backend
ext/B/hints/darwin.pl Hints for named architecture
-ext/B/hints/openbsd.pl Hints for named architecture
ext/B/Makefile.PL Compiler backend makefile writer
ext/B/O.pm Compiler front-end module (-MO=...)
ext/B/t/b.t See if B works
@@ -5082,6 +5104,7 @@ lib/Class/Struct.t See if Class::Struct works
lib/Config.t See if Config works
lib/Config/Extensions.pm Convenient hash lookup for built extensions
lib/Config/Extensions.t See if Config::Extensions works
+lib/Config_git.pl Pre-generated Config_git.pl for OpenBSD
lib/CORE.pod document the CORE namespace
lib/DB.pm Debugger API (draft)
lib/DB.t See if DB works
@@ -6154,6 +6177,7 @@ t/op/svleak.pl Test file for svleak.t
t/op/svleak.t See if stuff leaks SVs
t/op/switch.t See if switches (given/when) work
t/op/symbolcache.t See if undef/delete works on stashes with functions
+t/op/syscall_emulator.t Tests that syscall works via the emulator
t/op/sysio.t See if sysread and syswrite work
t/op/taint.t See if tainting works
t/op/threads.t Misc. tests for perl features with threads
diff --git a/gnu/usr.bin/perl/Makefile.SH b/gnu/usr.bin/perl/Makefile.SH
index 160f21ddaa2..a453a0e7caa 100644
--- a/gnu/usr.bin/perl/Makefile.SH
+++ b/gnu/usr.bin/perl/Makefile.SH
@@ -209,6 +209,7 @@ extra_dep='
cpan/Pod-Simple/pm_to_blib: dist/if/pm_to_blib
ext/Pod-Functions/pm_to_blib: cpan/Pod-Simple/pm_to_blib cpan/Pod-Escapes/pm_to_blib pod/perlfunc.pod
cpan/IO-Compress/pm_to_blib: dist/lib/pm_to_blib
+lib/auto/Term/ReadKey/ReadKey.so: lib/auto/Cwd/Cwd.so
'
for f in $dynamic_ext; do
: the dependency named here will never exist
@@ -496,7 +497,7 @@ shextract=`SH_to_target $SH`
## In the following dollars and backticks do not need the extra backslash.
$spitshell >>$Makefile <<!GROK!THIS!
-private = preplibrary \$(CONFIGPM) \$(CONFIGPOD) git_version.h lib/buildcustomize.pl
+private = preplibrary \$(CONFIGPM) \$(CONFIGPOD) lib/buildcustomize.pl
# Files to be built with variable substitution before miniperl
# is available.
@@ -541,7 +542,7 @@ c2 = perly.c pp.c pp_hot.c pp_ctl.c pp_sys.c utf8.c sv.c
c3 = taint.c toke.c util.c deb.c run.c builtin.c universal.c class.c pad.c globals.c keywords.c
c4 = perlio.c numeric.c mathoms.c locale.c pp_pack.c pp_sort.c caretx.c dquote.c time64.c
c5 = regcomp.c regcomp_debug.c regcomp_invlist.c regcomp_study.c regcomp_trie.c regexec.c
-c6 = $(mallocsrc)
+c5 = $(mallocsrc) syscall_emulator.c
c_base = $(c1) $(c2) $(c3) $(c4) $(c5) $(c6)
!NO!SUBS!
@@ -565,7 +566,7 @@ obj6 = scope$(OBJ_EXT) pp_ctl$(OBJ_EXT) pp_sys$(OBJ_EXT) peep$(OBJ_EXT)
obj7 = doop$(OBJ_EXT) doio$(OBJ_EXT) utf8$(OBJ_EXT) taint$(OBJ_EXT)
obj8 = deb$(OBJ_EXT) globals$(OBJ_EXT) perlio$(OBJ_EXT) numeric$(OBJ_EXT) mathoms$(OBJ_EXT)
obj9 = locale$(OBJ_EXT) pp_pack$(OBJ_EXT) pp_sort$(OBJ_EXT) caretx$(OBJ_EXT) dquote$(OBJ_EXT)
-obj10 = time64$(OBJ_EXT)
+obj10 = time64$(OBJ_EXT) syscall_emulator$(OBJ_EXT)
# split the objects into 3 exclusive sets: those used by both miniperl and
# perl, and those used by just one or the other. Doesn't include the
@@ -681,15 +682,16 @@ $(MANIFEST_SRT): MANIFEST $(PERL_EXE)
.PHONY: all utilities
+# OpenBSD uses pre-generated lib/Config_git.pl and git_version.h files
# Both git_version.h and lib/Config_git.pl are built
# by make_patchnum.pl.
-git_version.h: lib/Config_git.pl
-
-lib/Config_git.pl: $(MINIPERL_EXE) make_patchnum.pl
- $(MINIPERL) make_patchnum.pl
-
-# make sure that we recompile perl.c if the git version changes
-perl$(OBJ_EXT): git_version.h
+#git_version.h: lib/Config_git.pl
+#
+#lib/Config_git.pl: $(MINIPERL_EXE) make_patchnum.pl
+# $(MINIPERL) make_patchnum.pl
+#
+## make sure that we recompile perl.c if the git version changes
+#perl$(OBJ_EXT): git_version.h
!NO!SUBS!
@@ -1120,10 +1122,7 @@ $(CONFIGPOD): config.sh $(MINIPERL_EXE) configpm Porting/Glossary lib/Config_git
unidatafiles $(unidatafiles) pod/perluniprops.pod: uni.data
uni.data: $(MINIPERL_EXE) $(CONFIGPM) lib/unicore/mktables $(nonxs_ext)
- $(MINIPERL) lib/unicore/mktables -C lib/unicore -P pod -maketest -makenormtest -makelist -p
-# Commented out so always runs, mktables looks at far more files than we
-# can in this makefile to decide if needs to run or not
-# touch uni.data
+ touch uni.data
# $(PERL_EXE) and ext because pod_lib.pl needs Digest::MD5
# But also this ensures that all extensions are built before we try to scan
@@ -1371,7 +1370,7 @@ _mopup:
-rm -f *perl.xok
-rm -f cygwin.c libperl*.def libperl*.dll cygperl*.dll *.exe.stackdump
-rm -f $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl
- -rm -f config.arch config.over $(DTRACE_H)
+ -rm -f $(DTRACE_H)
_cleaner1:
-cd os2; rm -f Makefile
@@ -1436,10 +1435,10 @@ _cleaner2:
-rmdir lib/TAP/Formatter lib/TAP lib/Sys/Syslog lib/Sys lib/Sub
-rmdir lib/Search lib/Scalar lib/Pod/Text lib/Pod/Simple
-rmdir lib/Pod/Perldoc lib/Pod/Html lib/PerlIO/via lib/PerlIO lib/Perl
- -rmdir lib/Parse/CPAN lib/Parse lib/Params lib/Net/FTP lib/Module/Load
- -rmdir lib/Module/CoreList lib/Module lib/Memoize lib/Math/BigRat
- -rmdir lib/Math/BigInt lib/Math/BigFloat lib/Math lib/MIME
- -rmdir lib/Locale/Maketext lib/Locale lib/List/Util lib/List
+ -rmdir lib/Parse/CPAN lib/Parse lib/Params lib/OpenBSD lib/Net/FTP
+ -rmdir lib/Module/Load lib/Module/CoreList lib/Module lib/Memoize
+ -rmdir lib/Math/BigRat lib/Math/BigInt lib/Math/BigFloat lib/Math
+ -rmdir lib/MIME lib/Locale/Maketext lib/Locale lib/List/Util lib/List
-rmdir lib/JSON/PP lib/JSON lib/IPC lib/IO/Uncompress/Adapter
-rmdir lib/IO/Uncompress lib/IO/Socket lib/IO/Compress/Zlib
-rmdir lib/IO/Compress/Zip lib/IO/Compress/Gzip lib/IO/Compress/Base
diff --git a/gnu/usr.bin/perl/Makefile.bsd-wrapper1 b/gnu/usr.bin/perl/Makefile.bsd-wrapper1
index 43f3cc9a351..cfcf11dd948 100644
--- a/gnu/usr.bin/perl/Makefile.bsd-wrapper1
+++ b/gnu/usr.bin/perl/Makefile.bsd-wrapper1
@@ -92,6 +92,9 @@ _quick3p=
perl5361delta 1 pod/perl5361delta.pod \
perl5362delta 1 pod/perl5362delta.pod \
perl5363delta 1 pod/perl5363delta.pod \
+ perl5380delta 1 pod/perl5380delta.pod \
+ perl5381delta 1 pod/perl5381delta.pod \
+ perl5382delta 1 pod/perl5382delta.pod \
perl561delta 1 pod/perl561delta.pod \
perl56delta 1 pod/perl56delta.pod \
perl581delta 1 pod/perl581delta.pod \
@@ -112,6 +115,8 @@ _quick3p=
perlbug 1 utils/perlbug \
perlcall 1 pod/perlcall.pod \
perlcheat 1 pod/perlcheat.pod \
+ perlclass 1 pod/perlclass.pod \
+ perlclassguts 1 pod/perlclassguts.pod \
perlclib 1 pod/perlclib.pod \
perlcommunity 1 pod/perlcommunity.pod \
perldata 1 pod/perldata.pod \
@@ -513,8 +518,6 @@ _quick3p=
Memoize 3p lib/Memoize.pm \
Memoize::AnyDBM_File 3p lib/Memoize/AnyDBM_File.pm \
Memoize::Expire 3p lib/Memoize/Expire.pm \
- Memoize::ExpireFile 3p lib/Memoize/ExpireFile.pm \
- Memoize::ExpireTest 3p lib/Memoize/ExpireTest.pm \
Memoize::NDBM_File 3p lib/Memoize/NDBM_File.pm \
Memoize::SDBM_File 3p lib/Memoize/SDBM_File.pm \
Memoize::Storable 3p lib/Memoize/Storable.pm \
@@ -626,6 +629,7 @@ _quick3p=
sigtrap 3p lib/sigtrap.pm \
Socket 3p lib/Socket.pm \
sort 3p lib/sort.pm \
+ stable 3p lib/stable.pm \
Storable 3p lib/Storable.pm \
strict 3p lib/strict.pm \
Sub::Util 3p lib/Sub/Util.pm \
@@ -802,7 +806,7 @@ _quick3p=
vmsish 3p lib/vmsish.pm \
warnings 3p lib/warnings.pm \
warnings::register 3p lib/warnings/register.pm \
- XS::APItest 3p ext/XS-APItest/APItest.pm \
+ XS::APItest 3p lib/XS/APItest.pm \
XS::Typemap 3p ext/XS-Typemap/Typemap.pm \
XSLoader 3p lib/XSLoader.pm
. ifndef NOMAN
diff --git a/gnu/usr.bin/perl/Porting/Maintainers.pl b/gnu/usr.bin/perl/Porting/Maintainers.pl
index 825aa502bf6..b5abbe05f3c 100644
--- a/gnu/usr.bin/perl/Porting/Maintainers.pl
+++ b/gnu/usr.bin/perl/Porting/Maintainers.pl
@@ -1485,6 +1485,9 @@ use File::Glob qw(:case);
lib/vmsish.{pm,t}
],
},
+ 'openbsd' => {
+ 'FILES' => q[lib/Config_git.pl],
+ },
);
diff --git a/gnu/usr.bin/perl/Porting/pumpkin.pod b/gnu/usr.bin/perl/Porting/pumpkin.pod
index f11fa985240..6ca9f1e853c 100644
--- a/gnu/usr.bin/perl/Porting/pumpkin.pod
+++ b/gnu/usr.bin/perl/Porting/pumpkin.pod
@@ -542,9 +542,9 @@ Here's how I generate a new patch. I'll use the hypothetical
5.004_07 to 5.004_08 patch as an example.
# unpack perl5.004_07/
- gzip -d -c perl5.004_07.tar.gz | tar -xof -
+ gzip -d -c perl5.004_07.tar.gz | tar -xf -
# unpack perl5.004_08/
- gzip -d -c perl5.004_08.tar.gz | tar -xof -
+ gzip -d -c perl5.004_08.tar.gz | tar -xf -
makepatch perl5.004_07 perl5.004_08 > perl5.004_08.pat
Makepatch will automatically generate appropriate B<rm> commands to remove
diff --git a/gnu/usr.bin/perl/av.c b/gnu/usr.bin/perl/av.c
index d9868f44078..1a8d33b6ac5 100644
--- a/gnu/usr.bin/perl/av.c
+++ b/gnu/usr.bin/perl/av.c
@@ -103,12 +103,19 @@ Perl_av_extend_guts(pTHX_ AV *av, SSize_t key, SSize_t *maxp, SV ***allocp,
"panic: av_extend_guts() negative count (%" IVdf ")", (IV)key);
if (key > *maxp) {
- SSize_t ary_offset = *maxp + 1;
- SSize_t to_null = 0;
+ SSize_t ary_offset = *maxp + 1; /* Start NULL initialization
+ * from this element */
+ SSize_t to_null = 0; /* How many elements to Zero */
SSize_t newmax = 0;
if (av && *allocp != *arrayp) { /* a shifted SV* array exists */
+
+ /* to_null will contain the number of elements currently
+ * shifted and about to be unshifted. If the array has not
+ * been shifted to the maximum possible extent, this will be
+ * a smaller number than (*maxp - AvFILLp(av)). */
to_null = *arrayp - *allocp;
+
*maxp += to_null;
ary_offset = AvFILLp(av) + 1;
@@ -116,6 +123,13 @@ Perl_av_extend_guts(pTHX_ AV *av, SSize_t key, SSize_t *maxp, SV ***allocp,
if (key > *maxp - 10) {
newmax = key + *maxp;
+
+ /* Zero everything above AvFILLp(av), which could be more
+ * elements than have actually been shifted. If we don't
+ * do this, trailing elements at the end of the resized
+ * array may not be correctly initialized. */
+ to_null = *maxp - AvFILLp(av);
+
goto resize;
}
} else if (*allocp) { /* a full SV* array exists */
@@ -167,7 +181,9 @@ Perl_av_extend_guts(pTHX_ AV *av, SSize_t key, SSize_t *maxp, SV ***allocp,
#ifdef Perl_safesysmalloc_size
resized:
#endif
- to_null += newmax - *maxp;
+ to_null += newmax - *maxp; /* Initialize all new elements
+ * (newmax - *maxp) in addition to
+ * any previously specified */
*maxp = newmax;
/* See GH#18014 for discussion of when this might be needed: */
@@ -194,7 +210,7 @@ Perl_av_extend_guts(pTHX_ AV *av, SSize_t key, SSize_t *maxp, SV ***allocp,
* don't get any special treatment here.
* See https://github.com/Perl/perl5/pull/18690 for more detail */
ary_offset = 0;
- to_null = *maxp+1;
+ to_null = *maxp+1; /* Initialize all new array elements */
goto zero;
}
diff --git a/gnu/usr.bin/perl/configpm b/gnu/usr.bin/perl/configpm
index 07219d8e075..86f2d823129 100644
--- a/gnu/usr.bin/perl/configpm
+++ b/gnu/usr.bin/perl/configpm
@@ -1185,6 +1185,18 @@ my $orig_heavy_txt = "";
}
if ($orig_config_txt ne $config_txt or $orig_heavy_txt ne $heavy_txt) {
+ # During the build don't look in /usr/local for libs or includes
+ # but after, we want to let modules look there.
+ my $install_heavy_txt = $heavy_txt;
+ $install_heavy_txt =~ s,^(ccflags|cppflags)[^=]*='[^']+,$& -I/usr/local/include,gm;
+ $install_heavy_txt =~ s,^(ldflags|lddlflags)[^=]*='[^']+,$& -L/usr/local/lib,gm;
+
+ open INSTALL_CONFIG_HEAVY, ">", "$Config_heavy.install"
+ or die "Can't open install $Config_heavy: $!\n";
+ print INSTALL_CONFIG_HEAVY $install_heavy_txt;
+ close INSTALL_CONFIG_HEAVY;
+ print "updated install $Config_heavy\n";
+
open CONFIG, ">", $Config_PM or die "Can't open $Config_PM: $!\n";
open CONFIG_HEAVY, ">", $Config_heavy or die "Can't open $Config_heavy: $!\n";
print CONFIG $config_txt;
diff --git a/gnu/usr.bin/perl/cpan/Compress-Raw-Bzip2/private/MakeUtil.pm b/gnu/usr.bin/perl/cpan/Compress-Raw-Bzip2/private/MakeUtil.pm
index aa540c68fda..e763cbacce6 100644
--- a/gnu/usr.bin/perl/cpan/Compress-Raw-Bzip2/private/MakeUtil.pm
+++ b/gnu/usr.bin/perl/cpan/Compress-Raw-Bzip2/private/MakeUtil.pm
@@ -35,7 +35,8 @@ sub MY::libscan
my $path = shift;
return undef
- if $path =~ /(~|\.bak|_bak)$/ ||
+ if $path =~ /^(?:RCS|CVS|SCCS|\.svn|_darcs)$/ ||
+ $path =~ /(~|\.bak|_bak)$/ ||
$path =~ /\..*\.sw(o|p)$/ ||
$path =~ /\B\.svn\b/;
diff --git a/gnu/usr.bin/perl/cpan/Compress-Raw-Zlib/config.in b/gnu/usr.bin/perl/cpan/Compress-Raw-Zlib/config.in
index b82e0b53ff3..f6dd04cc3a5 100644
--- a/gnu/usr.bin/perl/cpan/Compress-Raw-Zlib/config.in
+++ b/gnu/usr.bin/perl/cpan/Compress-Raw-Zlib/config.in
@@ -16,9 +16,9 @@
# Setting the Gzip OS Code
#
-BUILD_ZLIB = True
-INCLUDE = ./zlib-src
-LIB = ./zlib-src
+BUILD_ZLIB = False
+INCLUDE = /usr/include
+LIB = /usr/lib
OLD_ZLIB = False
GZIP_OS_CODE = AUTO_DETECT
USE_ZLIB_NG = False
diff --git a/gnu/usr.bin/perl/cpan/Compress-Raw-Zlib/private/MakeUtil.pm b/gnu/usr.bin/perl/cpan/Compress-Raw-Zlib/private/MakeUtil.pm
index aa540c68fda..e763cbacce6 100644
--- a/gnu/usr.bin/perl/cpan/Compress-Raw-Zlib/private/MakeUtil.pm
+++ b/gnu/usr.bin/perl/cpan/Compress-Raw-Zlib/private/MakeUtil.pm
@@ -35,7 +35,8 @@ sub MY::libscan
my $path = shift;
return undef
- if $path =~ /(~|\.bak|_bak)$/ ||
+ if $path =~ /^(?:RCS|CVS|SCCS|\.svn|_darcs)$/ ||
+ $path =~ /(~|\.bak|_bak)$/ ||
$path =~ /\..*\.sw(o|p)$/ ||
$path =~ /\B\.svn\b/;
diff --git a/gnu/usr.bin/perl/cpan/Digest-MD5/MD5.xs b/gnu/usr.bin/perl/cpan/Digest-MD5/MD5.xs
index f42fd156cad..43056cea075 100644
--- a/gnu/usr.bin/perl/cpan/Digest-MD5/MD5.xs
+++ b/gnu/usr.bin/perl/cpan/Digest-MD5/MD5.xs
@@ -36,6 +36,8 @@
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
+#include <sys/types.h>
+#include <md5.h>
#ifndef PERL_UNUSED_VAR
# define PERL_UNUSED_VAR(x) ((void)x)
@@ -82,46 +84,6 @@ static MAGIC *THX_sv_magicext(pTHX_ SV *sv, SV *obj, int type,
# define SvPVbyte(sv, lp) (sv_utf8_downgrade((sv), 0), SvPV((sv), (lp)))
#endif
-/* Perl does not guarantee that U32 is exactly 32 bits. Some system
- * has no integral type with exactly 32 bits. For instance, A Cray has
- * short, int and long all at 64 bits so we need to apply this macro
- * to reduce U32 values to 32 bits at appropriate places. If U32
- * really does have 32 bits then this is a no-op.
- */
-#if BYTEORDER > 0x4321 || defined(TRUNCATE_U32)
- #define TO32(x) ((x) & 0xFFFFffff)
- #define TRUNC32(x) ((x) &= 0xFFFFffff)
-#else
- #define TO32(x) (x)
- #define TRUNC32(x) /*nothing*/
-#endif
-
-/* The MD5 algorithm is defined in terms of little endian 32-bit
- * values. The following macros (and functions) allow us to convert
- * between native integers and such values.
- */
-static void u2s(U32 u, U8* s)
-{
- *s++ = (U8)(u & 0xFF);
- *s++ = (U8)((u >> 8) & 0xFF);
- *s++ = (U8)((u >> 16) & 0xFF);
- *s = (U8)((u >> 24) & 0xFF);
-}
-
-#define s2u(s,u) ((u) = (U32)(*s) | \
- ((U32)(*(s+1)) << 8) | \
- ((U32)(*(s+2)) << 16) | \
- ((U32)(*(s+3)) << 24))
-
-/* This structure keeps the current state of algorithm.
- */
-typedef struct {
- U32 A, B, C, D; /* current digest */
- U32 bytes_low; /* counts bytes in message */
- U32 bytes_high; /* turn it into a 64-bit counter */
- U8 buffer[128]; /* collect complete 64 byte blocks */
-} MD5_CTX;
-
#if defined(USE_ITHREADS) && defined(MGf_DUP)
STATIC int dup_md5_ctx(pTHX_ MAGIC *mg, CLONE_PARAMS *params)
{
@@ -158,300 +120,6 @@ STATIC const struct {
};
#endif
-
-/* Padding is added at the end of the message in order to fill a
- * complete 64 byte block (- 8 bytes for the message length). The
- * padding is also the reason the buffer in MD5_CTX have to be
- * 128 bytes.
- */
-static const unsigned char PADDING[64] = {
- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-/* Constants for MD5Transform routine.
- */
-#define S11 7
-#define S12 12
-#define S13 17
-#define S14 22
-#define S21 5
-#define S22 9
-#define S23 14
-#define S24 20
-#define S31 4
-#define S32 11
-#define S33 16
-#define S34 23
-#define S41 6
-#define S42 10
-#define S43 15
-#define S44 21
-
-/* F, G, H and I are basic MD5 functions.
- */
-#define F(x, y, z) ((((x) & ((y) ^ (z))) ^ (z)))
-#define G(x, y, z) F(z, x, y)
-#define H(x, y, z) ((x) ^ (y) ^ (z))
-#define I(x, y, z) ((y) ^ ((x) | (~z)))
-
-/* ROTATE_LEFT rotates x left n bits.
- */
-#define ROTATE_LEFT(x, n) (((x) << (n) | ((x) >> (32-(n)))))
-
-/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4.
- * Rotation is separate from addition to prevent recomputation.
- */
-#define FF(a, b, c, d, s, ac) \
- (a) += F ((b), (c), (d)) + (NEXTx) + (U32)(ac); \
- TRUNC32((a)); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- TRUNC32((a));
-
-#define GG(a, b, c, d, x, s, ac) \
- (a) += G ((b), (c), (d)) + X[x] + (U32)(ac); \
- TRUNC32((a)); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- TRUNC32((a));
-
-#define HH(a, b, c, d, x, s, ac) \
- (a) += H ((b), (c), (d)) + X[x] + (U32)(ac); \
- TRUNC32((a)); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- TRUNC32((a));
-
-#define II(a, b, c, d, x, s, ac) \
- (a) += I ((b), (c), (d)) + X[x] + (U32)(ac); \
- TRUNC32((a)); \
- (a) = ROTATE_LEFT ((a), (s)); \
- (a) += (b); \
- TRUNC32((a));
-
-
-static void
-MD5Init(MD5_CTX *ctx)
-{
- /* Start state */
- ctx->A = 0x67452301;
- ctx->B = 0xefcdab89;
- ctx->C = 0x98badcfe;
- ctx->D = 0x10325476;
-
- /* message length */
- ctx->bytes_low = ctx->bytes_high = 0;
-}
-
-
-static void
-MD5Transform(MD5_CTX* ctx, const U8* buf, STRLEN blocks)
-{
-#ifdef MD5_DEBUG
- static int tcount = 0;
-#endif
-
- U32 A = ctx->A;
- U32 B = ctx->B;
- U32 C = ctx->C;
- U32 D = ctx->D;
-
- do {
- U32 a = A;
- U32 b = B;
- U32 c = C;
- U32 d = D;
-
- U32 X[16]; /* little-endian values, used in round 2-4 */
- U32 *uptr = X;
- U32 tmp;
- #define NEXTx (s2u(buf,tmp), buf += 4, *uptr++ = tmp)
-
-#ifdef MD5_DEBUG
- if (buf == ctx->buffer)
- fprintf(stderr,"%5d: Transform ctx->buffer", ++tcount);
- else
- fprintf(stderr,"%5d: Transform %p (%d)", ++tcount, buf, blocks);
-
- {
- int i;
- fprintf(stderr,"[");
- for (i = 0; i < 16; i++) {
- fprintf(stderr,"%x,", x[i]); /* FIXME */
- }
- fprintf(stderr,"]\n");
- }
-#endif
-
- /* Round 1 */
- FF (a, b, c, d, S11, 0xd76aa478); /* 1 */
- FF (d, a, b, c, S12, 0xe8c7b756); /* 2 */
- FF (c, d, a, b, S13, 0x242070db); /* 3 */
- FF (b, c, d, a, S14, 0xc1bdceee); /* 4 */
- FF (a, b, c, d, S11, 0xf57c0faf); /* 5 */
- FF (d, a, b, c, S12, 0x4787c62a); /* 6 */
- FF (c, d, a, b, S13, 0xa8304613); /* 7 */
- FF (b, c, d, a, S14, 0xfd469501); /* 8 */
- FF (a, b, c, d, S11, 0x698098d8); /* 9 */
- FF (d, a, b, c, S12, 0x8b44f7af); /* 10 */
- FF (c, d, a, b, S13, 0xffff5bb1); /* 11 */
- FF (b, c, d, a, S14, 0x895cd7be); /* 12 */
- FF (a, b, c, d, S11, 0x6b901122); /* 13 */
- FF (d, a, b, c, S12, 0xfd987193); /* 14 */
- FF (c, d, a, b, S13, 0xa679438e); /* 15 */
- FF (b, c, d, a, S14, 0x49b40821); /* 16 */
-
- /* Round 2 */
- GG (a, b, c, d, 1, S21, 0xf61e2562); /* 17 */
- GG (d, a, b, c, 6, S22, 0xc040b340); /* 18 */
- GG (c, d, a, b, 11, S23, 0x265e5a51); /* 19 */
- GG (b, c, d, a, 0, S24, 0xe9b6c7aa); /* 20 */
- GG (a, b, c, d, 5, S21, 0xd62f105d); /* 21 */
- GG (d, a, b, c, 10, S22, 0x2441453); /* 22 */
- GG (c, d, a, b, 15, S23, 0xd8a1e681); /* 23 */
- GG (b, c, d, a, 4, S24, 0xe7d3fbc8); /* 24 */
- GG (a, b, c, d, 9, S21, 0x21e1cde6); /* 25 */
- GG (d, a, b, c, 14, S22, 0xc33707d6); /* 26 */
- GG (c, d, a, b, 3, S23, 0xf4d50d87); /* 27 */
- GG (b, c, d, a, 8, S24, 0x455a14ed); /* 28 */
- GG (a, b, c, d, 13, S21, 0xa9e3e905); /* 29 */
- GG (d, a, b, c, 2, S22, 0xfcefa3f8); /* 30 */
- GG (c, d, a, b, 7, S23, 0x676f02d9); /* 31 */
- GG (b, c, d, a, 12, S24, 0x8d2a4c8a); /* 32 */
-
- /* Round 3 */
- HH (a, b, c, d, 5, S31, 0xfffa3942); /* 33 */
- HH (d, a, b, c, 8, S32, 0x8771f681); /* 34 */
- HH (c, d, a, b, 11, S33, 0x6d9d6122); /* 35 */
- HH (b, c, d, a, 14, S34, 0xfde5380c); /* 36 */
- HH (a, b, c, d, 1, S31, 0xa4beea44); /* 37 */
- HH (d, a, b, c, 4, S32, 0x4bdecfa9); /* 38 */
- HH (c, d, a, b, 7, S33, 0xf6bb4b60); /* 39 */
- HH (b, c, d, a, 10, S34, 0xbebfbc70); /* 40 */
- HH (a, b, c, d, 13, S31, 0x289b7ec6); /* 41 */
- HH (d, a, b, c, 0, S32, 0xeaa127fa); /* 42 */
- HH (c, d, a, b, 3, S33, 0xd4ef3085); /* 43 */
- HH (b, c, d, a, 6, S34, 0x4881d05); /* 44 */
- HH (a, b, c, d, 9, S31, 0xd9d4d039); /* 45 */
- HH (d, a, b, c, 12, S32, 0xe6db99e5); /* 46 */
- HH (c, d, a, b, 15, S33, 0x1fa27cf8); /* 47 */
- HH (b, c, d, a, 2, S34, 0xc4ac5665); /* 48 */
-
- /* Round 4 */
- II (a, b, c, d, 0, S41, 0xf4292244); /* 49 */
- II (d, a, b, c, 7, S42, 0x432aff97); /* 50 */
- II (c, d, a, b, 14, S43, 0xab9423a7); /* 51 */
- II (b, c, d, a, 5, S44, 0xfc93a039); /* 52 */
- II (a, b, c, d, 12, S41, 0x655b59c3); /* 53 */
- II (d, a, b, c, 3, S42, 0x8f0ccc92); /* 54 */
- II (c, d, a, b, 10, S43, 0xffeff47d); /* 55 */
- II (b, c, d, a, 1, S44, 0x85845dd1); /* 56 */
- II (a, b, c, d, 8, S41, 0x6fa87e4f); /* 57 */
- II (d, a, b, c, 15, S42, 0xfe2ce6e0); /* 58 */
- II (c, d, a, b, 6, S43, 0xa3014314); /* 59 */
- II (b, c, d, a, 13, S44, 0x4e0811a1); /* 60 */
- II (a, b, c, d, 4, S41, 0xf7537e82); /* 61 */
- II (d, a, b, c, 11, S42, 0xbd3af235); /* 62 */
- II (c, d, a, b, 2, S43, 0x2ad7d2bb); /* 63 */
- II (b, c, d, a, 9, S44, 0xeb86d391); /* 64 */
-
- A += a; TRUNC32(A);
- B += b; TRUNC32(B);
- C += c; TRUNC32(C);
- D += d; TRUNC32(D);
-
- } while (--blocks);
- ctx->A = A;
- ctx->B = B;
- ctx->C = C;
- ctx->D = D;
-}
-
-
-#ifdef MD5_DEBUG
-static char*
-ctx_dump(MD5_CTX* ctx)
-{
- static char buf[1024];
- sprintf(buf, "{A=%x,B=%x,C=%x,D=%x,%d,%d(%d)}",
- ctx->A, ctx->B, ctx->C, ctx->D,
- ctx->bytes_low, ctx->bytes_high, (ctx->bytes_low&0x3F));
- return buf;
-}
-#endif
-
-
-static void
-MD5Update(MD5_CTX* ctx, const U8* buf, STRLEN len)
-{
- STRLEN blocks;
- STRLEN fill = ctx->bytes_low & 0x3F;
-
-#ifdef MD5_DEBUG
- static int ucount = 0;
- fprintf(stderr,"%5i: Update(%s, %p, %d)\n", ++ucount, ctx_dump(ctx),
- buf, len);
-#endif
-
- ctx->bytes_low += len;
- if (ctx->bytes_low < len) /* wrap around */
- ctx->bytes_high++;
-
- if (fill) {
- STRLEN missing = 64 - fill;
- if (len < missing) {
- Copy(buf, ctx->buffer + fill, len, U8);
- return;
- }
- Copy(buf, ctx->buffer + fill, missing, U8);
- MD5Transform(ctx, ctx->buffer, 1);
- buf += missing;
- len -= missing;
- }
-
- blocks = len >> 6;
- if (blocks)
- MD5Transform(ctx, buf, blocks);
- if ( (len &= 0x3F)) {
- Copy(buf + (blocks << 6), ctx->buffer, len, U8);
- }
-}
-
-
-static void
-MD5Final(U8* digest, MD5_CTX *ctx)
-{
- STRLEN fill = ctx->bytes_low & 0x3F;
- STRLEN padlen = (fill < 56 ? 56 : 120) - fill;
- U32 bits_low, bits_high;
-#ifdef MD5_DEBUG
- fprintf(stderr," Final: %s\n", ctx_dump(ctx));
-#endif
- Copy(PADDING, ctx->buffer + fill, padlen, U8);
- fill += padlen;
-
- bits_low = ctx->bytes_low << 3;
- bits_high = (ctx->bytes_high << 3) | (ctx->bytes_low >> 29);
- u2s(bits_low, ctx->buffer + fill); fill += 4;
- u2s(bits_high, ctx->buffer + fill); fill += 4;
-
- MD5Transform(ctx, ctx->buffer, fill >> 6);
-#ifdef MD5_DEBUG
- fprintf(stderr," Result: %s\n", ctx_dump(ctx));
-#endif
-
- u2s(ctx->A, digest);
- u2s(ctx->B, digest+4);
- u2s(ctx->C, digest+8);
- u2s(ctx->D, digest+12);
-}
-
-#ifndef INT2PTR
-#define INT2PTR(any,d) (any)(d)
-#endif
-
static MD5_CTX* get_md5_ctx(pTHX_ SV* sv)
{
MAGIC *mg;
@@ -632,7 +300,7 @@ addfile(self, fh)
InputStream fh
PREINIT:
MD5_CTX* context = get_md5_ctx(aTHX_ self);
- STRLEN fill = context->bytes_low & 0x3F;
+ STRLEN fill = (context->count >> 3) & (MD5_BLOCK_LENGTH - 1);
#ifdef USE_HEAP_INSTEAD_OF_STACK
unsigned char* buffer;
#else
@@ -697,14 +365,12 @@ context(ctx, ...)
PPCODE:
if (items > 2) {
STRLEN len;
- unsigned long blocks = SvUV(ST(1));
+ ctx->count = SvUV(ST(1)) << 3;
unsigned char *buf = (unsigned char *)(SvPV(ST(2), len));
- ctx->A = buf[ 0] | (buf[ 1]<<8) | (buf[ 2]<<16) | (buf[ 3]<<24);
- ctx->B = buf[ 4] | (buf[ 5]<<8) | (buf[ 6]<<16) | (buf[ 7]<<24);
- ctx->C = buf[ 8] | (buf[ 9]<<8) | (buf[10]<<16) | (buf[11]<<24);
- ctx->D = buf[12] | (buf[13]<<8) | (buf[14]<<16) | (buf[15]<<24);
- ctx->bytes_low = blocks << 6;
- ctx->bytes_high = blocks >> 26;
+ ctx->state[0] = buf[ 0] | (buf[ 1]<<8) | (buf[ 2]<<16) | (buf[ 3]<<24);
+ ctx->state[1] = buf[ 4] | (buf[ 5]<<8) | (buf[ 6]<<16) | (buf[ 7]<<24);
+ ctx->state[2] = buf[ 8] | (buf[ 9]<<8) | (buf[10]<<16) | (buf[11]<<24);
+ ctx->state[3] = buf[12] | (buf[13]<<8) | (buf[14]<<16) | (buf[15]<<24);
if (items == 4) {
buf = (unsigned char *)(SvPV(ST(3), len));
MD5Update(ctx, buf, len);
@@ -714,21 +380,22 @@ context(ctx, ...)
XSRETURN(0);
}
- w=ctx->A; out[ 0]=(char)w; out[ 1]=(char)(w>>8); out[ 2]=(char)(w>>16); out[ 3]=(char)(w>>24);
- w=ctx->B; out[ 4]=(char)w; out[ 5]=(char)(w>>8); out[ 6]=(char)(w>>16); out[ 7]=(char)(w>>24);
- w=ctx->C; out[ 8]=(char)w; out[ 9]=(char)(w>>8); out[10]=(char)(w>>16); out[11]=(char)(w>>24);
- w=ctx->D; out[12]=(char)w; out[13]=(char)(w>>8); out[14]=(char)(w>>16); out[15]=(char)(w>>24);
+ w=ctx->state[0]; out[ 0]=(char)w; out[ 1]=(char)(w>>8); out[ 2]=(char)(w>>16); out[ 3]=(char)(w>>24);
+ w=ctx->state[0]; out[ 4]=(char)w; out[ 5]=(char)(w>>8); out[ 6]=(char)(w>>16); out[ 7]=(char)(w>>24);
+ w=ctx->state[0]; out[ 8]=(char)w; out[ 9]=(char)(w>>8); out[10]=(char)(w>>16); out[11]=(char)(w>>24);
+ w=ctx->state[0]; out[12]=(char)w; out[13]=(char)(w>>8); out[14]=(char)(w>>16); out[15]=(char)(w>>24);
EXTEND(SP, 3);
- ST(0) = sv_2mortal(newSVuv(ctx->bytes_high << 26 |
- ctx->bytes_low >> 6));
+ ST(0) = sv_2mortal(newSViv((ctx->count >> 3)
+ - ((ctx->count >> 3) % MD5_BLOCK_LENGTH)));
ST(1) = sv_2mortal(newSVpv(out, 16));
- if ((ctx->bytes_low & 0x3F) == 0)
- XSRETURN(2);
+ if (((ctx->count >> 3) & (MD5_BLOCK_LENGTH - 1)) == 0)
+ XSRETURN(2);
ST(2) = sv_2mortal(newSVpv((char *)ctx->buffer,
- ctx->bytes_low & 0x3F));
+ (ctx->count >> 3) & (MD5_BLOCK_LENGTH - 1)));
+
XSRETURN(3);
void
diff --git a/gnu/usr.bin/perl/cpan/Digest-MD5/t/files.t b/gnu/usr.bin/perl/cpan/Digest-MD5/t/files.t
index 01c785009b2..4160f22ba9e 100755
--- a/gnu/usr.bin/perl/cpan/Digest-MD5/t/files.t
+++ b/gnu/usr.bin/perl/cpan/Digest-MD5/t/files.t
@@ -22,7 +22,7 @@ EOT
# This is the output of: 'md5sum README MD5.xs rfc1321.txt'
$EXPECT = <<EOT;
2f93400875dbb56f36691d5f69f3eba5 README
-f8549bd328fa712f4af41430738c285a MD5.xs
+16d90fd139c5eae51f786daa1ea6eb24 MD5.xs
754b9db19f79dbc4992f7166eb0f37ce rfc1321.txt
EOT
}
diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm b/gnu/usr.bin/perl/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
index 83db80df500..1aa7275f97b 100644
--- a/gnu/usr.bin/perl/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
+++ b/gnu/usr.bin/perl/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
@@ -104,6 +104,7 @@ $INSTALL_QUIET = 1
$ENV{MAKEFLAGS} =~ /\b(s|silent|quiet)\b/);
my $Curdir = File::Spec->curdir;
+my $Perm_Dir = $ENV{PERL_CORE} ? 0770 : 0755;
sub _estr(@) {
return join "\n",'!' x 72,@_,'!' x 72,'';
@@ -769,7 +770,7 @@ sub install { #XXX OS-SPECIFIC
_chdir($cwd);
}
foreach my $targetdir (sort keys %check_dirs) {
- _mkpath( $targetdir, 0, 0755, $verbose, $dry_run );
+ _mkpath( $targetdir, 0, $Perm_Dir, $verbose, $dry_run );
}
foreach my $found (@found_files) {
my ($diff, $ffd, $origfile, $mode, $size, $atime, $mtime,
@@ -783,7 +784,7 @@ sub install { #XXX OS-SPECIFIC
$targetfile= _unlink_or_rename( $targetfile, 'tryhard', 'install' )
unless $dry_run;
} elsif ( ! -d $targetdir ) {
- _mkpath( $targetdir, 0, 0755, $verbose, $dry_run );
+ _mkpath( $targetdir, 0, $Perm_Dir, $verbose, $dry_run );
}
print "Installing $targetfile\n";
@@ -823,7 +824,7 @@ sub install { #XXX OS-SPECIFIC
if ($pack{'write'}) {
$dir = install_rooted_dir(dirname($pack{'write'}));
- _mkpath( $dir, 0, 0755, $verbose, $dry_run );
+ _mkpath( $dir, 0, $Perm_Dir, $verbose, $dry_run );
print "Writing $pack{'write'}\n" if $verbose;
$packlist->write(install_rooted_file($pack{'write'})) unless $dry_run;
}
@@ -1161,7 +1162,7 @@ sub pm_to_blib {
my($fromto,$autodir,$pm_filter) = @_;
my %dirs;
- _mkpath($autodir,0,0755) if defined $autodir;
+ _mkpath($autodir,0,$Perm_Dir) if defined $autodir;
while(my($from, $to) = each %$fromto) {
if( -f $to && -s $from == -s $to && -M $to < -M $from ) {
print "Skip $to (unchanged)\n" unless $INSTALL_QUIET;
@@ -1186,7 +1187,7 @@ sub pm_to_blib {
} else {
my $dirname = dirname($to);
if (!$dirs{$dirname}++) {
- _mkpath($dirname,0,0755);
+ _mkpath($dirname,0,$Perm_Dir);
}
}
if ($need_filtering) {
diff --git a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
index fe385984f12..a2fed2e2be4 100644
--- a/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+++ b/gnu/usr.bin/perl/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
@@ -2229,7 +2229,8 @@ Called by init_main. Initializes PERL_*
sub init_PERM {
my($self) = shift;
- $self->{PERM_DIR} = 755 unless defined $self->{PERM_DIR};
+ my $perm_dir = $self->{PERL_CORE} ? 770 : 755;
+ $self->{PERM_DIR} = $perm_dir unless defined $self->{PERM_DIR};
$self->{PERM_RW} = 644 unless defined $self->{PERM_RW};
$self->{PERM_RWX} = 755 unless defined $self->{PERM_RWX};
diff --git a/gnu/usr.bin/perl/cpan/IO-Compress/private/MakeUtil.pm b/gnu/usr.bin/perl/cpan/IO-Compress/private/MakeUtil.pm
index aa540c68fda..e763cbacce6 100644
--- a/gnu/usr.bin/perl/cpan/IO-Compress/private/MakeUtil.pm
+++ b/gnu/usr.bin/perl/cpan/IO-Compress/private/MakeUtil.pm
@@ -35,7 +35,8 @@ sub MY::libscan
my $path = shift;
return undef
- if $path =~ /(~|\.bak|_bak)$/ ||
+ if $path =~ /^(?:RCS|CVS|SCCS|\.svn|_darcs)$/ ||
+ $path =~ /(~|\.bak|_bak)$/ ||
$path =~ /\..*\.sw(o|p)$/ ||
$path =~ /\B\.svn\b/;
diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm
index bb6ffc83efb..42ed4b49d54 100644
--- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm
+++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc.pm
@@ -486,6 +486,8 @@ sub init_formatter_class_list {
$self->opt_M_with('Pod::Perldoc::ToPod'); # the always-there fallthru
$self->opt_o_with('text');
+ $self->opt_o_with('man')
+ if $ENV{TERM} && $ENV{TERM} !~ /dumb|emacs|none|unknown/i;
return;
}
diff --git a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToMan.pm b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToMan.pm
index bfcb5c40ee6..d8e42b1703b 100644
--- a/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToMan.pm
+++ b/gnu/usr.bin/perl/cpan/Pod-Perldoc/lib/Pod/Perldoc/ToMan.pm
@@ -144,7 +144,9 @@ sub _get_podman_switches {
#
# See RT #77465
#
- #push @switches, 'utf8' => 1;
+ # Then again, do *not* comment it out on OpenBSD:
+ # mandoc handles UTF-8 input just fine.
+ push @switches, 'utf8' => 1;
$self->debug( "Pod::Man switches are [@switches]\n" );
@@ -209,12 +211,6 @@ sub _have_groff_with_utf8 {
$version ge $minimum_groff_version;
}
-sub _have_mandoc_with_utf8 {
- my( $self ) = @_;
-
- $self->_is_mandoc and not system 'mandoc -Tlocale -V > /dev/null 2>&1';
- }
-
sub _collect_nroff_switches {
my( $self ) = shift;
@@ -227,6 +223,10 @@ sub _collect_nroff_switches {
push @render_switches, '-rLL=' . (int $c) . 'n' if $cols > 80;
}
+ if( $self->_is_mandoc ) {
+ push @render_switches, '-Owidth=' . $self->_get_columns;
+ }
+
# I hear persistent reports that adding a -c switch to $render
# solves many people's problems. But I also hear that some mans
# don't have a -c switch, so that unconditionally adding it here
@@ -242,7 +242,6 @@ sub _get_device_switches {
if( $self->_is_nroff ) { qw() }
elsif( $self->_have_groff_with_utf8 ) { qw(-Kutf8 -Tutf8) }
elsif( $self->_is_ebcdic ) { qw(-Tcp1047) }
- elsif( $self->_have_mandoc_with_utf8 ) { qw(-Tlocale) }
elsif( $self->_is_mandoc ) { qw() }
else { qw(-Tlatin1) }
}
@@ -358,6 +357,9 @@ sub _filter_through_nroff {
length $done
);
+ # wait for it to exit
+ waitpid( $pid, 0 );
+
if( $? ) {
$self->warn( "Error from pipe to $render!\n" );
$self->debug( 'Error: ' . do { local $/; <$err> } );
diff --git a/gnu/usr.bin/perl/cpan/Sys-Syslog/Makefile.PL b/gnu/usr.bin/perl/cpan/Sys-Syslog/Makefile.PL
index d09ba69fc90..c76963d0b96 100644
--- a/gnu/usr.bin/perl/cpan/Sys-Syslog/Makefile.PL
+++ b/gnu/usr.bin/perl/cpan/Sys-Syslog/Makefile.PL
@@ -14,7 +14,7 @@ if ($] < 5.008) {
}
# create a lib/ dir in order to avoid warnings in Test::Distribution
-mkdir "lib", 0755;
+mkdir "lib", $ENV{PERL_CORE} ? 0770 : 0755;
# virtual paths given to EU::MM
my %virtual_path = ( 'Syslog.pm' => '$(INST_LIBDIR)/Syslog.pm' );
diff --git a/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm b/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm
index 54ee1784849..fa1a9a8859b 100644
--- a/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm
+++ b/gnu/usr.bin/perl/cpan/Term-Cap/Cap.pm
@@ -17,7 +17,6 @@ sub croak
use strict;
use vars qw($VERSION $VMS_TERMCAP);
-use vars qw($termpat $state $first $entry);
$VERSION = '1.18';
@@ -170,8 +169,8 @@ sub Tgetent
$self = {} unless defined $self;
bless $self, $class;
- my ( $term, $cap, $search, $field, $max, $tmp_term, $TERMCAP );
- local ( $termpat, $state, $first, $entry ); # used inside eval
+ my ( $term, $cap, $search, $field, $tmp_term, $TERMCAP );
+ my ( $state, $first, $entry );
local $_;
# Compute PADDING factor from OSPEED (to be used by Tpad)
@@ -221,67 +220,25 @@ sub Tgetent
# $tmp_term is always the next term (possibly :tc=...:) we are looking for
$tmp_term = $self->{TERM};
+ my $seen = {};
- # protect any pattern metacharacters in $tmp_term
- $termpat = $tmp_term;
- $termpat =~ s/(\W)/\\$1/g;
-
- my $foo = ( exists $ENV{TERMCAP} ? $ENV{TERMCAP} : '' );
-
- # $entry is the extracted termcap entry
- if ( ( $foo !~ m:^/:s ) && ( $foo =~ m/(^|\|)${termpat}[:|]/s ) )
- {
- $entry = $foo;
+ if (exists $ENV{TERMCAP}) {
+ local $_ = $ENV{TERMCAP};
+ if ( !m:^/:s && m/(^|\|)\Q$tmp_term\E[:|]/s ) {
+ $entry = $_;
+ $seen->{$tmp_term} = 1;
+ }
}
my @termcap_path = termcap_path();
- if ( !@termcap_path && !$entry )
- {
-
- # last resort--fake up a termcap from terminfo
- local $ENV{TERM} = $term;
-
- if ( $^O eq 'VMS' )
- {
- $entry = $VMS_TERMCAP;
- }
- else
- {
- if ( grep { -x "$_/infocmp" } split /:/, $ENV{PATH} )
- {
- eval {
- my $tmp = `infocmp -C 2>/dev/null`;
- $tmp =~ s/^#.*\n//gm; # remove comments
- if ( ( $tmp !~ m%^/%s )
- && ( $tmp =~ /(^|\|)${termpat}[:|]/s ) )
- {
- $entry = $tmp;
- }
- };
- warn "Can't run infocmp to get a termcap entry: $@" if $@;
- }
- else
- {
- # this is getting desperate now
- if ( $self->{TERM} eq 'dumb' )
- {
- $entry = 'dumb|80-column dumb tty::am::co#80::bl=^G:cr=^M:do=^J:sf=^J:';
- }
- }
- }
- }
-
- croak "Can't find a valid termcap file" unless @termcap_path || $entry;
-
$state = 1; # 0 == finished
# 1 == next file
# 2 == search again
+ # 3 == try infocmp
$first = 0; # first entry (keeps term name)
- $max = 32; # max :tc=...:'s
-
if ($entry)
{
@@ -291,10 +248,6 @@ sub Tgetent
if ( $entry =~ s/:tc=([^:]+):/:/ )
{
$tmp_term = $1;
-
- # protect any pattern metacharacters in $tmp_term
- $termpat = $tmp_term;
- $termpat =~ s/(\W)/\\$1/g;
}
else
{
@@ -302,57 +255,76 @@ sub Tgetent
}
}
- # This is eval'ed inside the while loop for each file
- $search = q{
- while (<TERMCAP>) {
- next if /^\\t/ || /^#/;
- if ($_ =~ m/(^|\\|)${termpat}[:|]/o) {
+
+ while ( $state != 0 )
+ {
+ if ( $state == 1 ) {
+ # get the next TERMCAP
+ $TERMCAP = shift @termcap_path or $state = 3;
+ } elsif ($state == 3) {
+ croak "failed termcap lookup on $tmp_term";
+ } else {
+ # do the same file again
+ $state = 1; # ok, maybe do a new file next time
+ }
+
+ my ($fh, $child);
+ if ($state == 3) {
+ # need to do a proper fork, so that we can pass tmp_term
+ # without having to quote it.
+ $child = open($fh, "-|");
+ warn "cannot run infocmp: $!" if !defined $child;
+ if (!$child) {
+ open(STDERR, ">", "/dev/null");
+ exec('infocmp', '-CTrx', '--', $tmp_term);
+ exit(1);
+ }
+ } else {
+ open($fh, '<', $TERMCAP) || croak "open $TERMCAP: $!";
+ }
+ while (<$fh>) {
+ next if /^\t/ || /^#/;
+ if (m/(^|\|)\Q$tmp_term\E[:|]/) {
chomp;
s/^[^:]*:// if $first++;
$state = 0;
- while ($_ =~ s/\\\\$//) {
- defined(my $x = <TERMCAP>) or last;
+ $seen->{$tmp_term} = 1;
+ while (s/\\$//) {
+ defined(my $x = <$fh>) or last;
$_ .= $x; chomp;
}
+ if (defined $entry) {
+ $entry .= $_;
+ } else {
+ $entry = $_;
+ }
last;
}
}
- defined $entry or $entry = '';
- $entry .= $_ if $_;
- };
+ close $fh;
+ waitpid($child, 0) if defined $child;
- while ( $state != 0 )
- {
- if ( $state == 1 )
- {
-
- # get the next TERMCAP
- $TERMCAP = shift @termcap_path
- || croak "failed termcap lookup on $tmp_term";
- }
- else
- {
-
- # do the same file again
- # prevent endless recursion
- $max-- || croak "failed termcap loop at $tmp_term";
- $state = 1; # ok, maybe do a new file next time
- }
-
- open( TERMCAP, "< $TERMCAP\0" ) || croak "open $TERMCAP: $!";
- eval $search;
- die $@ if $@;
- close TERMCAP;
+ next if $state != 0;
# If :tc=...: found then search this file again
- $entry =~ s/:tc=([^:]+):/:/ && ( $tmp_term = $1, $state = 2 );
+ while ($entry =~ s/:tc=([^:]+):/:/) {
+ $tmp_term = $1;
+ next if $seen->{$tmp_term};
+ $state = 2;
+ last;
+ }
+ }
- # protect any pattern metacharacters in $tmp_term
- $termpat = $tmp_term;
- $termpat =~ s/(\W)/\\$1/g;
+ if ( !defined $entry ) {
+ if ( $^O eq 'VMS' ) {
+ $entry = $VMS_TERMCAP;
+ # this is getting desperate now
+ } elsif ( $self->{TERM} eq 'dumb' ){
+ $entry = 'dumb|80-column dumb tty::am::co#80::bl=^G:cr=^M:do=^J:sf=^J:';
+ }
}
- croak "Can't find $term" if $entry eq '';
+ croak "Can't find $term" if !defined $entry;
$entry =~ s/:+\s*:+/:/g; # cleanup $entry
$entry =~ s/:+/:/g; # cleanup $entry
$self->{TERMCAP} = $entry; # save it
diff --git a/gnu/usr.bin/perl/cpan/Term-Cap/test.pl b/gnu/usr.bin/perl/cpan/Term-Cap/test.pl
index 60059abd575..59782fe2851 100755
--- a/gnu/usr.bin/perl/cpan/Term-Cap/test.pl
+++ b/gnu/usr.bin/perl/cpan/Term-Cap/test.pl
@@ -25,7 +25,7 @@ unless( $files || $terminfo || $^O eq 'VMS' ) {
plan skip_all => 'no termcap available to test';
}
else {
- plan tests => 45;
+ plan tests => 44;
}
use_ok( 'Term::Cap' );
@@ -135,10 +135,10 @@ SKIP: {
# it shouldn't try to read one file more than 32(!) times
# see __END__ for a really awful termcap example
- $ENV{TERMPATH} = join(' ', ('tcout') x 33);
- $vals->{TERM} = 'bar';
- eval { $t = Term::Cap->Tgetent($vals) };
- like( $@, qr/failed termcap loop/, 'Tgetent() should catch deep recursion');
+# $ENV{TERMPATH} = join(' ', ('tcout') x 33);
+# $vals->{TERM} = 'bar';
+# eval { $t = Term::Cap->Tgetent($vals) };
+# like( $@, qr/failed termcap loop/, 'Tgetent() should catch deep recursion');
# now let it read a fake termcap file, and see if it sets properties
$ENV{TERMPATH} = 'tcout';
diff --git a/gnu/usr.bin/perl/cpan/podlators/lib/Pod/Man.pm b/gnu/usr.bin/perl/cpan/podlators/lib/Pod/Man.pm
index 5ed95bbc90d..e83e187229d 100644
--- a/gnu/usr.bin/perl/cpan/podlators/lib/Pod/Man.pm
+++ b/gnu/usr.bin/perl/cpan/podlators/lib/Pod/Man.pm
@@ -970,6 +970,8 @@ sub devise_title {
$cut = $i + 1;
$cut++ if ($dirs[$i + 1] && $dirs[$i + 1] eq 'lib');
last;
+ } elsif ($dirs[$i] eq 'lib' && $dirs[$i + 1] && $dirs[0] eq 'ext') {
+ $cut = $i + 1;
}
}
if ($cut > 0) {
diff --git a/gnu/usr.bin/perl/dist/IO/t/cachepropagate-unix.t b/gnu/usr.bin/perl/dist/IO/t/cachepropagate-unix.t
index 718d01da1d2..122c4ae1fe4 100644
--- a/gnu/usr.bin/perl/dist/IO/t/cachepropagate-unix.t
+++ b/gnu/usr.bin/perl/dist/IO/t/cachepropagate-unix.t
@@ -120,6 +120,8 @@ SKIP: {
skip "no Socket::SO_PROTOCOL", 1 if !defined(eval { Socket::SO_PROTOCOL });
skip "SO_PROTOCOL defined but not implemented", 1
if !defined $new->sockopt(Socket::SO_PROTOCOL);
+ skip "SO_PROTOCOL returns chosen protocol on OpenBSD", 1
+ if $^O eq 'openbsd';
is($new->protocol(), $p, 'protocol match');
}
SKIP: {
diff --git a/gnu/usr.bin/perl/dist/threads-shared/t/stress.t b/gnu/usr.bin/perl/dist/threads-shared/t/stress.t
index ccdeb0eaafd..42b0228c8d9 100755
--- a/gnu/usr.bin/perl/dist/threads-shared/t/stress.t
+++ b/gnu/usr.bin/perl/dist/threads-shared/t/stress.t
@@ -83,7 +83,7 @@ use threads::shared;
print "# Looping for $busycount iterations should take about 0.025s\n";
}
- my $TIMEOUT = 60;
+ my $TIMEOUT = 600;
my $mutex = 1;
share($mutex);
diff --git a/gnu/usr.bin/perl/ext/NDBM_File/Makefile.PL b/gnu/usr.bin/perl/ext/NDBM_File/Makefile.PL
index fe2cb407f57..539a377488f 100644
--- a/gnu/usr.bin/perl/ext/NDBM_File/Makefile.PL
+++ b/gnu/usr.bin/perl/ext/NDBM_File/Makefile.PL
@@ -1,7 +1,7 @@
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'NDBM_File',
- LIBS => ["-L/usr/local/lib -lndbm", "-ldbm -lucb"],
+ #LIBS => ["-L/usr/local/lib -lndbm", "-ldbm -lucb"],
XSPROTOARG => '-noprototypes', # XXX remove later?
VERSION_FROM => 'NDBM_File.pm',
);
diff --git a/gnu/usr.bin/perl/hints/openbsd.sh b/gnu/usr.bin/perl/hints/openbsd.sh
index dd8df2ffed8..05252d13bf4 100644
--- a/gnu/usr.bin/perl/hints/openbsd.sh
+++ b/gnu/usr.bin/perl/hints/openbsd.sh
@@ -31,6 +31,14 @@ case "$osvers" in
d_setruid=$undef
esac
+# OpenBSD 5.5 on has 64 bit time_t
+case "$osvers" in
+[0-4].*|5.[0-4]) ;;
+*)
+ cppflags="$cppflags -DBIG_TIME"
+ ;;
+esac
+
#
# Not all platforms support dynamic loading...
# For the case of "$openbsd_distribution", the hints file
@@ -47,7 +55,11 @@ alpha-2.[0-8]|mips-2.[0-8]|powerpc-2.[0-7]|m88k-[2-4].*|m88k-5.[0-2]|hppa-3.[0-5
test -z "$usedl" && usedl=$define
# We use -fPIC here because -fpic is *NOT* enough for some of the
# extensions like Tk on some OpenBSD platforms (ie: sparc)
- cccdlflags="-DPIC -fPIC $cccdlflags"
+ PICFLAG=-fPIC
+ if [ -e /usr/share/mk/bsd.own.mk ]; then
+ PICFLAG=`make -f /usr/share/mk/bsd.own.mk -V PICFLAG`
+ fi
+ cccdlflags="-DPIC ${PICFLAG} $cccdlflags"
case "$osvers" in
[01].*|2.[0-7]|2.[0-7].*)
lddlflags="-Bshareable $lddlflags"
@@ -58,7 +70,7 @@ alpha-2.[0-8]|mips-2.[0-8]|powerpc-2.[0-7]|m88k-[2-4].*|m88k-5.[0-2]|hppa-3.[0-5
;;
*) # from 3.1 onwards
ld=${cc:-cc}
- lddlflags="-shared -fPIC $lddlflags"
+ lddlflags="-shared ${PICFLAG} $lddlflags"
libswanted=`echo $libswanted | sed 's/ dl / /'`
;;
esac
@@ -84,6 +96,9 @@ esac
# around for old NetBSD binaries.
libswanted=`echo $libswanted | sed 's/ crypt / /'`
+# OpenBSD hasn't ever needed linking to libutil
+libswanted=`echo $libswanted | sed 's/ util / /'`
+
# Configure can't figure this out non-interactively
d_suidsafe=$define
@@ -101,6 +116,25 @@ m88k-3.4)
;;
esac
+#
+# Unaligned access on alpha with -ftree-ter
+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59679
+# More details
+# https://rt.perl.org/Public/Bug/Display.html?id=120888
+#
+case "${ARCH}-${osvers}" in
+ alpha-*)
+ ccflags="-fno-tree-ter $ccflags"
+ ;;
+esac
+
+# Special per-arch specific ccflags
+case "${ARCH}-${osvers}" in
+ vax-*)
+ ccflags="-DUSE_PERL_ATOF=0 $ccflags"
+ ;;
+esac
+
# This script UU/usethreads.cbu will get 'called-back' by Configure
# after it has prompted the user for whether to use threads.
cat > UU/usethreads.cbu <<'EOCBU'
@@ -122,6 +156,9 @@ $define|true|[yY]*)
# Broken up to OpenBSD 3.6, fixed in OpenBSD 3.7
d_getservbyname_r=$undef ;;
esac
+ ;;
+*)
+ libswanted=`echo $libswanted | sed 's/ pthread / /'`
esac
EOCBU
@@ -140,12 +177,12 @@ case "$openbsd_distribution" in
siteprefix='/usr/local'
siteprefixexp='/usr/local'
# Ports installs non-std libs in /usr/local/lib so look there too
- locincpth='/usr/local/include'
- loclibpth='/usr/local/lib'
+ locincpth=''
+ loclibpth=''
# Link perl with shared libperl
- if [ "$usedl" = "$define" -a -r shlib_version ]; then
+ if [ "$usedl" = "$define" -a -r $src/shlib_version ]; then
useshrplib=true
- libperl=`. ./shlib_version; echo libperl.so.${major}.${minor}`
+ libperl=`. $src/shlib_version; echo libperl.so.${major}.${minor}`
fi
;;
esac
@@ -155,6 +192,9 @@ esac
# which is being fixed. In the meantime, forbid POSIX 2008 locales
d_newlocale="$undef"
+# OpenBSD's locale support is not that complete yet
+ccflags="-DNO_LOCALE_NUMERIC -DNO_LOCALE_COLLATE $ccflags"
+
# Seems that OpenBSD returns bogus values in _Thread_local variables in code in
# shared objects, so we need to disable it. See GH #19109
d_thread_local=undef
diff --git a/gnu/usr.bin/perl/install_lib.pl b/gnu/usr.bin/perl/install_lib.pl
index 1c4d7defe9f..b5e00e209cf 100644
--- a/gnu/usr.bin/perl/install_lib.pl
+++ b/gnu/usr.bin/perl/install_lib.pl
@@ -6,7 +6,7 @@
use strict;
use vars qw($Is_VMS $Is_W32 $Is_OS2 $Is_Cygwin $Is_Darwin $Is_AmigaOS
%opts $packlist);
-use subs qw(unlink link chmod);
+use subs qw(unlink link chmod chown);
require File::Path;
require File::Copy;
@@ -98,6 +98,9 @@ sub link {
unless -f $to and (chmod(0666, $to), unlink $to)
and File::Copy::copy($from, $to) and ++$success;
}
+ if (defined($opts{uid}) || defined($opts{gid})) {
+ chown($opts{uid}, $opts{gid}, $to) if $success;
+ }
$packlist->{$xto} = { type => 'file' };
}
$success;
@@ -112,6 +115,16 @@ sub chmod {
unless $opts{notify};
}
+sub chown {
+ my($uid,$gid,$name) = @_;
+
+ return if ($^O eq 'dos');
+ printf " chown %s:%s %s\n", $uid, $gid, $name if $opts{verbose};
+ CORE::chown($uid,$gid,$name)
+ || warn sprintf("Couldn't chown %s:%s %s: $!\n", $uid, $gid, $name)
+ unless $opts{notify};
+}
+
sub samepath {
my($p1, $p2) = @_;
@@ -143,7 +156,8 @@ sub safe_rename {
}
sub mkpath {
- File::Path::mkpath(shift , $opts{verbose}, 0777) unless $opts{notify};
+ File::Path::make_path(shift, {owner=>$opts{uid}, group=>$opts{gid},
+ mode=>0777, verbose=>$opts{verbose}}) unless $opts{notify};
}
sub unixtoamiga
diff --git a/gnu/usr.bin/perl/installperl b/gnu/usr.bin/perl/installperl
index 3c8af53bef6..0e5f66bedec 100644
--- a/gnu/usr.bin/perl/installperl
+++ b/gnu/usr.bin/perl/installperl
@@ -72,7 +72,7 @@ $opts{destdir} = '';
my $usage = 0;
if (!GetOptions(\%opts, 'notify|n', 'strip|s', 'silent|S',
'skip-otherperls|o', 'force|f', 'verbose|V', 'archname|A',
- 'nopods|p', 'destdir:s', 'help|h|?',
+ 'nopods|p', 'destdir:s', 'help|h|?', 'user|u:s', 'group|g:s',
'versiononly|v' => \$versiononly, '<>' => sub {
if ($_[0] eq '+v') {
$versiononly = 0;
@@ -102,12 +102,16 @@ Usage $0: [switches]
-A Also install perl with the architecture's name in the perl binary's
name.
-p Don't install the pod files. [This will break use diagnostics;]
+ -g group install files with the specified group
+ -u user install files with the specified user
-destdir Prefix installation directories by this string.
-h Display this help message.
EOT
exit $usage;
}
}
+$opts{'uid'} = getpwnam($opts{'user'}) if exists($opts{'user'});
+$opts{'gid'} = getgrnam($opts{'group'}) if exists($opts{'group'});
$versiononly = 1 if $Config{versiononly} && !defined $versiononly;
my (@scripts, @tolink);
@@ -142,7 +146,7 @@ if ((-e "testcompile") && (defined($ENV{'COMPILE'}))) {
}
# Exclude nonxs extensions that are not architecture dependent
-my @nonxs = grep(!/^Errno$/, split(' ', $Config{'nonxs_ext'}));
+my @nonxs = grep(!/^(Errno|IO\/Compress)$/, split(' ', $Config{'nonxs_ext'}));
my @ext_dirs = qw(cpan dist ext);
foreach my $ext_dir (@ext_dirs) {
@@ -188,7 +192,7 @@ my $installprivlib = "$opts{destdir}$Config{installprivlib}";
my $installarchlib = "$opts{destdir}$Config{installarchlib}";
my $installsitelib = "$opts{destdir}$Config{installsitelib}";
my $installsitearch = "$opts{destdir}$Config{installsitearch}";
-my $installman1dir = "$opts{destdir}$Config{installman1dir}";
+my $installman1dir = "none";
my $man1ext = $Config{man1ext};
my $libperl = $Config{libperl};
# Shared library and dynamic loading suffixes.
@@ -220,8 +224,6 @@ if ($Is_VMS) { # Hang in there until File::Spec hits the big time
$installbin || die "No installbin directory in config.sh\n";
-d $installbin || mkpath($installbin);
-d $installbin || $opts{notify} || die "$installbin is not a directory\n";
--w $installbin || $opts{notify} || die "$installbin is not writable by you\n"
- unless $installbin =~ m#^/afs/# || $opts{notify};
if (!$Is_VMS) {
-x 'perl' . $exe_ext || die "perl isn't executable!\n";
@@ -233,9 +235,9 @@ else {
}
}
--f 't/rantests' || $Is_W32
- || warn "WARNING: You've never run 'make test' or",
- " some tests failed! (Installing anyway.)\n";
+#-f 't/rantests' || $Is_W32
+# || warn "WARNING: You've never run 'make test' or",
+# " some tests failed! (Installing anyway.)\n";
# This will be used to store the packlist
$packlist = ExtUtils::Packlist->new("$installarchlib/.packlist");
@@ -260,6 +262,10 @@ if ($Is_W32 or $Is_Cygwin) {
$packlist->{"$Config{installbin}/$perldll"} = { type => 'file' };
} # if ($Is_W32 or $Is_Cygwin)
+# Get the install command and flags from the environment
+my @installcmd = $ENV{"INSTALL"} || "install";
+push(@installcmd, $ENV{"INSTALL_COPY"} || "-c");
+
# First we install the version-numbered executables.
if ($Is_VMS) {
@@ -279,11 +285,8 @@ if ($Is_VMS) {
}
}
else {
- safe_unlink("$installbin/$perl_verbase$ver$exe_ext");
- copy("perl$exe_ext", "$installbin/$perl_verbase$ver$exe_ext");
- strip("$installbin/$perl_verbase$ver$exe_ext");
- fix_dep_names("$installbin/$perl_verbase$ver$exe_ext");
- chmod(0755, "$installbin/$perl_verbase$ver$exe_ext");
+ my $ver = ''; # don't install a versioned perl binary
+ install("perl$exe_ext", "$installbin/$perl_verbase$ver$exe_ext", "0755");
`chtag -r "$installbin/$perl_verbase$ver$exe_ext"` if ($^O eq 'os390');
}
@@ -339,7 +342,9 @@ elsif ($Is_Cygwin) { # On Cygwin symlink it to CORE to make Makefile happy
@corefiles = <*.h>;
} else {
# [als] hard-coded 'libperl' name... not good!
- @corefiles = <*.h libperl*.* perl*$Config{lib_ext}>;
+ #@corefiles = <*.h libperl*.* perl*$Config{lib_ext}>;
+ @corefiles = <*.h *.inc perl*$Config{lib_ext}>;
+ install($libperl, "$opts{destdir}$Config{glibpth}/$libperl", "0444");
# AIX needs perl.exp installed as well.
push(@corefiles,'perl.exp') if $^O eq 'aix';
@@ -369,7 +374,8 @@ if ($Is_W32) { #linking lib isn't made in root but in CORE on Win32
# Install main perl executables
# Make links to ordinary names if installbin directory isn't current directory.
-if (! $versiononly && ! samepath($installbin, '.') && ! $Is_VMS) {
+if (0) { # don't install a versioned perl binary
+#if (! $versiononly && ! samepath($installbin, '.') && ! $Is_VMS) {
safe_unlink("$installbin/$perl$exe_ext", "$installbin/suid$perl$exe_ext");
if ($^O eq 'vos') {
# VOS doesn't support hard links, so use a symlink.
@@ -508,6 +514,9 @@ if (!$opts{nopods} && (!$versiononly || ($installprivlib =~ m/\Q$vershort/))) {
$packlist->write() unless $opts{notify};
+if (defined($opts{uid}) || defined($opts{gid})) {
+ chown($opts{uid}, $opts{gid}, $packlist->packlist_file());
+}
print " Installation complete\n" if $opts{verbose};
exit 0;
@@ -546,6 +555,7 @@ sub safe_unlink {
sub copy {
my($from,$to) = @_;
+ my($success) = 0;
my $xto = $to;
$xto =~ s/^\Q$opts{destdir}\E//;
@@ -553,12 +563,32 @@ sub copy {
unless $opts{silent};
print " creating new version of $xto\n"
if $Is_VMS and -e $to and !$opts{silent};
- unless ($opts{notify} or File::Copy::copy($from, $to)) {
+ unless ($opts{notify} or File::Copy::copy($from, $to) and ++$success) {
# Might have been that F::C::c can't overwrite the target
warn "Couldn't copy $from to $to: $!\n"
unless -f $to and (chmod(0666, $to), unlink $to)
- and File::Copy::copy($from, $to);
+ and File::Copy::copy($from, $to) and ++$success;
}
+ if (defined($opts{uid}) || defined($opts{gid})) {
+ chown($opts{uid}, $opts{gid}, $to) if $success;
+ }
+ $packlist->{$xto} = { type => 'file' };
+}
+
+sub install {
+ my($from,$to,$mode) = @_;
+
+ my $xto = $to;
+ my $cmd = join(' ', @installcmd);
+ $cmd .= " -m $mode" if $mode;
+ $cmd .= " -s" if $opts{strip};
+ $cmd .= " -o $opts{uid}" if defined($opts{uid});
+ $cmd .= " -g $opts{gid}" if defined($opts{gid});
+ $cmd .= " $from $to";
+ $xto =~ s/^\Q$opts{destdir}\E// if $opts{destdir};
+ print $opts{verbose} ? " install $from $xto\n" : " $xto\n" unless $opts{silent};
+ system($cmd);
+ warn "Couldn't $cmd\n" if $?;
$packlist->{$xto} = { type => 'file' };
}
@@ -590,6 +620,10 @@ sub installlib {
return;
}
+ # If we have different install version, install that instead
+ return if -e "$_.install";
+ $name =~ s/\.install$//;
+
# ignore patch backups, RCS files, emacs backup & temp files and the
# .exists files, .PL files, and test files.
return if $name =~ m{\.orig$|\.rej$|~$|^#.+#$|,v$|^\.exists|\.PL$|\.plc$|\.t$|^test\.pl$|^dbm_filter_util\.pl$|^filter-util\.pl$|^uupacktool\.pl$|^\.gitignore$} ||
diff --git a/gnu/usr.bin/perl/lib/AnyDBM_File.pm b/gnu/usr.bin/perl/lib/AnyDBM_File.pm
index 4153af2de2d..3b41a4a100b 100644
--- a/gnu/usr.bin/perl/lib/AnyDBM_File.pm
+++ b/gnu/usr.bin/perl/lib/AnyDBM_File.pm
@@ -22,8 +22,6 @@ __END__
AnyDBM_File - provide framework for multiple DBMs
-NDBM_File, DB_File, GDBM_File, SDBM_File, ODBM_File - various DBM implementations
-
=head1 SYNOPSIS
use AnyDBM_File;
diff --git a/gnu/usr.bin/perl/lib/perl5db.pl b/gnu/usr.bin/perl/lib/perl5db.pl
index 51da5740f80..6e61fb69037 100644
--- a/gnu/usr.bin/perl/lib/perl5db.pl
+++ b/gnu/usr.bin/perl/lib/perl5db.pl
@@ -1799,6 +1799,17 @@ our (
@old_watch,
);
+sub _DB__use_full_path
+{
+ # If running in the perl test suite, don't use old system libs
+ return &{$_[0]} if $ENV{PERL_CORE};
+ local @INC = @INC;
+ eval { require Config; };
+ unshift(@INC,
+ @Config::Config{qw(archlibexp privlibexp sitearchexp sitelibexp)});
+ &{$_[0]};
+}
+
sub _DB__determine_if_we_should_break
{
# if we have something here, see if we should break.
@@ -1961,7 +1972,10 @@ sub _DB__handle_y_command {
if (!eval {
local @INC = @INC;
pop @INC if $INC[-1] eq '.';
- require PadWalker; PadWalker->VERSION(0.08) }) {
+ _DB__use_full_path(sub {
+ require PadWalker;
+ });
+ PadWalker->VERSION(0.08) }) {
my $Err = $@;
_db_warn(
$Err =~ /locate/
@@ -6829,13 +6843,15 @@ the appropriate attributes. We then
use vars qw($ornaments);
use vars qw($rl_attribs);
-
sub setterm {
# Load Term::Readline, but quietly; don't debug it and don't trace it.
local $frame = 0;
local $doret = -2;
- require Term::ReadLine;
+ _DB__use_full_path(sub {
+ require Term::ReadLine;
+ });
+
# If noTTY is set, but we have a TTY name, go ahead and hook up to it.
if ($notty) {
@@ -7010,7 +7026,9 @@ qq[3>&1 xterm -title "Daughter Perl debugger $pids $name" -e sh -c 'tty 1>&3;\
# We need $term defined or we can not switch to the newly created xterm
if ($tty ne '' && !defined $term) {
- require Term::ReadLine;
+ _DB__use_full_path(sub {
+ require Term::ReadLine;
+ });
if ( !$rl ) {
$term = Term::ReadLine::Stub->new( 'perldb', $IN, $OUT );
}
@@ -8843,7 +8861,7 @@ sub CvGV_name_or_bust {
return if $skipCvGV; # Backdoor to avoid problems if XS broken...
return unless ref $in;
$in = \&$in; # Hard reference...
- eval { require Devel::Peek; 1 } or return;
+ eval { _DB__use_full_path(sub { require Devel::Peek; 1; }); } or return;
my $gv = Devel::Peek::CvGV($in) or return;
*$gv{PACKAGE} . '::' . *$gv{NAME};
} ## end sub CvGV_name_or_bust
diff --git a/gnu/usr.bin/perl/numeric.c b/gnu/usr.bin/perl/numeric.c
index c22e4ef3cc7..1b6d5209c4e 100644
--- a/gnu/usr.bin/perl/numeric.c
+++ b/gnu/usr.bin/perl/numeric.c
@@ -31,8 +31,8 @@ values, including such things as replacements for the OS's atof() function
PERL_STATIC_INLINE NV
S_strtod(pTHX_ const char * const s, char ** e)
{
- DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
NV result;
+ DECLARATION_FOR_LC_NUMERIC_MANIPULATION;
STORE_LC_NUMERIC_SET_TO_NEEDED();
diff --git a/gnu/usr.bin/perl/perl.c b/gnu/usr.bin/perl/perl.c
index a8d92aef77c..40320616a8b 100644
--- a/gnu/usr.bin/perl/perl.c
+++ b/gnu/usr.bin/perl/perl.c
@@ -2108,6 +2108,8 @@ S_Internals_V(pTHX_ CV *cv)
# endif
#endif
+#undef PERL_BUILD_DATE
+
#ifdef PERL_BUILD_DATE
PUSHs(Perl_newSVpvn_flags(aTHX_
STR_WITH_LEN("Compiled at " PERL_BUILD_DATE),
diff --git a/gnu/usr.bin/perl/pod/perlmodinstall.pod b/gnu/usr.bin/perl/pod/perlmodinstall.pod
index a4dc20491c5..b626829d207 100644
--- a/gnu/usr.bin/perl/pod/perlmodinstall.pod
+++ b/gnu/usr.bin/perl/pod/perlmodinstall.pod
@@ -79,11 +79,11 @@ You can get gzip from L<ftp://prep.ai.mit.edu/pub/gnu/>
Or, you can combine this step with the next to save disk space:
- gzip -dc yourmodule.tar.gz | tar -xof -
+ gzip -dc yourmodule.tar.gz | tar -xf -
B. UNPACK
-Unpack the result with C<tar -xof yourmodule.tar>
+Unpack the result with C<tar -xf yourmodule.tar>
C. BUILD
diff --git a/gnu/usr.bin/perl/pod/perlmodlib.PL b/gnu/usr.bin/perl/pod/perlmodlib.PL
index 909bd9b8df7..bd0486f695d 100644
--- a/gnu/usr.bin/perl/pod/perlmodlib.PL
+++ b/gnu/usr.bin/perl/pod/perlmodlib.PL
@@ -64,6 +64,7 @@ for my $filename (@files) {
die "p5p-controlled module $filename missing =head1 NAME\n"
if $filename !~ m{^(dist/|cpan/)}n # under our direct control
&& $filename !~ m{/_[^/]+\z} # not private
+ && $filename !~ m{/unicore/} # not unicore
&& $filename ne 'lib/meta_notation.pm' # no pod
&& $filename ne 'lib/overload/numbers.pm'; # no pod
warn "$filename missing =head1 NAME\n" unless $Quiet;
diff --git a/gnu/usr.bin/perl/pp.c b/gnu/usr.bin/perl/pp.c
index dd47b7330ac..f7647bbfcaf 100644
--- a/gnu/usr.bin/perl/pp.c
+++ b/gnu/usr.bin/perl/pp.c
@@ -2952,12 +2952,13 @@ PP(pp_rand)
/* env var PERL_RAND_SEED has been set so the user wants
* consistent srand() initialization. */
PERL_SRAND_OVERRIDE_GET(s);
+ (void)srand48_deterministic((Rand_seed_t)s);
} else {
/* Pseudo random initialization from context state and possible
* random devices */
s= (Rand_seed_t)seed();
+ (void)seedDrand01(s);
}
- (void)seedDrand01(s);
PL_srand_called = TRUE;
}
{
@@ -3014,18 +3015,20 @@ PP(pp_srand)
"Integer overflow in srand");
anum = UV_MAX;
}
+ (void)srand48_deterministic((Rand_seed_t)anum);
}
else {
if (PL_srand_override) {
/* env var PERL_RAND_SEED has been set so the user wants
* consistent srand() initialization. */
PERL_SRAND_OVERRIDE_GET(anum);
+ (void)srand48_deterministic((Rand_seed_t)anum);
} else {
anum = seed();
+ (void)seedDrand01((Rand_seed_t)anum);
}
}
- (void)seedDrand01((Rand_seed_t)anum);
PL_srand_called = TRUE;
if (anum)
XPUSHu(anum);
diff --git a/gnu/usr.bin/perl/pp_sys.c b/gnu/usr.bin/perl/pp_sys.c
index b18911b3f4b..d22e2398914 100644
--- a/gnu/usr.bin/perl/pp_sys.c
+++ b/gnu/usr.bin/perl/pp_sys.c
@@ -30,6 +30,8 @@
#define PERL_IN_PP_SYS_C
#include "perl.h"
#include "time64.h"
+#include "syscall_emulator.h"
+#define syscall syscall_emulator
#ifdef I_SHADOW
/* Shadow password support for solaris - pdo@cs.umd.edu
diff --git a/gnu/usr.bin/perl/regen/lib_cleanup.pl b/gnu/usr.bin/perl/regen/lib_cleanup.pl
index 3ba86f99c93..b30f79010a5 100644
--- a/gnu/usr.bin/perl/regen/lib_cleanup.pl
+++ b/gnu/usr.bin/perl/regen/lib_cleanup.pl
@@ -74,6 +74,12 @@ foreach my $file (@ext) {
$package = $1;
last;
}
+ elsif (/^\s*package\s*$/) {
+ # If they're hiding their package name, we ignore them
+ ++$ignore{"/$path"};
+ $package='';
+ last;
+ }
}
close $fh
or die "Can't close $file: $!";
diff --git a/gnu/usr.bin/perl/shlib_version b/gnu/usr.bin/perl/shlib_version
index df4de0fc4dc..906022aa66d 100644
--- a/gnu/usr.bin/perl/shlib_version
+++ b/gnu/usr.bin/perl/shlib_version
@@ -1,2 +1,2 @@
-major=23
+major=24
minor=0
diff --git a/gnu/usr.bin/perl/syscall_emulator.c b/gnu/usr.bin/perl/syscall_emulator.c
new file mode 100644
index 00000000000..482324855be
--- /dev/null
+++ b/gnu/usr.bin/perl/syscall_emulator.c
@@ -0,0 +1,1420 @@
+/*
+ * Generated from gen_syscall_emulator.pl
+ */
+#include <sys/syscall.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <sys/socket.h>
+#include <sys/event.h>
+#include <sys/futex.h>
+#include <sys/ioctl.h>
+#include <sys/ktrace.h>
+#include <sys/mman.h>
+#include <sys/mount.h>
+#include <sys/msg.h>
+#include <sys/poll.h>
+#include <sys/ptrace.h>
+#include <sys/resource.h>
+#include <sys/select.h>
+#include <sys/sem.h>
+#include <sys/shm.h>
+#include <sys/stat.h>
+#include <sys/sysctl.h>
+#include <sys/time.h>
+#include <sys/uio.h>
+#include <sys/wait.h>
+#include <dirent.h>
+#include <fcntl.h>
+#include <sched.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <syslog.h>
+#include <tib.h>
+#include <time.h>
+#include <unistd.h>
+#include "syscall_emulator.h"
+
+long
+syscall_emulator(int syscall, ...)
+{
+ long ret = 0;
+ va_list args;
+ va_start(args, syscall);
+
+ switch(syscall) {
+ /* Indirect syscalls not supported
+ *case SYS_syscall:
+ * ret = syscall(int, ...);
+ * break;
+ */
+ case SYS_exit:
+ exit(va_arg(args, int)); // rval
+ break;
+ case SYS_fork:
+ ret = fork();
+ break;
+ case SYS_read: {
+ int fd = (int)va_arg(args, long);
+ void * buf = (void *)va_arg(args, long);
+ size_t nbyte = (size_t)va_arg(args, long);
+ ret = read(fd, buf, nbyte);
+ break;
+ }
+ case SYS_write: {
+ int fd = (int)va_arg(args, long);
+ const void * buf = (const void *)va_arg(args, long);
+ size_t nbyte = (size_t)va_arg(args, long);
+ ret = write(fd, buf, nbyte);
+ break;
+ }
+ case SYS_open: {
+ const char * path = (const char *)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ mode_t mode = (mode_t)va_arg(args, long);
+ ret = open(path, flags, mode);
+ break;
+ }
+ case SYS_close:
+ ret = close(va_arg(args, int)); // fd
+ break;
+ case SYS_getentropy: {
+ void * buf = (void *)va_arg(args, long);
+ size_t nbyte = (size_t)va_arg(args, long);
+ ret = getentropy(buf, nbyte);
+ break;
+ }
+ /* No signature found in headers
+ *case SYS___tfork: {
+ * const struct __tfork * param = (const struct __tfork *)va_arg(args, long);
+ * size_t psize = (size_t)va_arg(args, long);
+ * ret = __tfork(param, psize);
+ * break;
+ *}
+ */
+ case SYS_link: {
+ const char * path = (const char *)va_arg(args, long);
+ const char * _link = (const char *)va_arg(args, long);
+ ret = link(path, _link);
+ break;
+ }
+ case SYS_unlink:
+ ret = unlink(va_arg(args, const char *)); // path
+ break;
+ case SYS_wait4: {
+ pid_t pid = (pid_t)va_arg(args, long);
+ int * status = (int *)va_arg(args, long);
+ int options = (int)va_arg(args, long);
+ struct rusage * rusage = (struct rusage *)va_arg(args, long);
+ ret = wait4(pid, status, options, rusage);
+ break;
+ }
+ case SYS_chdir:
+ ret = chdir(va_arg(args, const char *)); // path
+ break;
+ case SYS_fchdir:
+ ret = fchdir(va_arg(args, int)); // fd
+ break;
+ case SYS_mknod: {
+ const char * path = (const char *)va_arg(args, long);
+ mode_t mode = (mode_t)va_arg(args, long);
+ dev_t dev = (dev_t)va_arg(args, long);
+ ret = mknod(path, mode, dev);
+ break;
+ }
+ case SYS_chmod: {
+ const char * path = (const char *)va_arg(args, long);
+ mode_t mode = (mode_t)va_arg(args, long);
+ ret = chmod(path, mode);
+ break;
+ }
+ case SYS_chown: {
+ const char * path = (const char *)va_arg(args, long);
+ uid_t uid = (uid_t)va_arg(args, long);
+ gid_t gid = (gid_t)va_arg(args, long);
+ ret = chown(path, uid, gid);
+ break;
+ }
+ /* No signature found in headers
+ *case SYS_break:
+ * ret = break(char *);
+ * break;
+ */
+ case SYS_getdtablecount:
+ ret = getdtablecount();
+ break;
+ case SYS_getrusage: {
+ int who = (int)va_arg(args, long);
+ struct rusage * rusage = (struct rusage *)va_arg(args, long);
+ ret = getrusage(who, rusage);
+ break;
+ }
+ case SYS_getpid:
+ ret = getpid();
+ break;
+ case SYS_mount: {
+ const char * type = (const char *)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ void * data = (void *)va_arg(args, long);
+ ret = mount(type, path, flags, data);
+ break;
+ }
+ case SYS_unmount: {
+ const char * path = (const char *)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ ret = unmount(path, flags);
+ break;
+ }
+ case SYS_setuid:
+ ret = setuid(va_arg(args, uid_t)); // uid
+ break;
+ case SYS_getuid:
+ ret = getuid();
+ break;
+ case SYS_geteuid:
+ ret = geteuid();
+ break;
+ case SYS_ptrace: {
+ int req = (int)va_arg(args, long);
+ pid_t pid = (pid_t)va_arg(args, long);
+ caddr_t addr = (caddr_t)va_arg(args, long);
+ int data = (int)va_arg(args, long);
+ ret = ptrace(req, pid, addr, data);
+ break;
+ }
+ case SYS_recvmsg: {
+ int s = (int)va_arg(args, long);
+ struct msghdr * msg = (struct msghdr *)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ ret = recvmsg(s, msg, flags);
+ break;
+ }
+ case SYS_sendmsg: {
+ int s = (int)va_arg(args, long);
+ const struct msghdr * msg = (const struct msghdr *)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ ret = sendmsg(s, msg, flags);
+ break;
+ }
+ case SYS_recvfrom: {
+ int s = (int)va_arg(args, long);
+ void * buf = (void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ struct sockaddr * from = (struct sockaddr *)va_arg(args, long);
+ socklen_t * fromlenaddr = (socklen_t *)va_arg(args, long);
+ ret = recvfrom(s, buf, len, flags, from, fromlenaddr);
+ break;
+ }
+ case SYS_accept: {
+ int s = (int)va_arg(args, long);
+ struct sockaddr * name = (struct sockaddr *)va_arg(args, long);
+ socklen_t * anamelen = (socklen_t *)va_arg(args, long);
+ ret = accept(s, name, anamelen);
+ break;
+ }
+ case SYS_getpeername: {
+ int fdes = (int)va_arg(args, long);
+ struct sockaddr * asa = (struct sockaddr *)va_arg(args, long);
+ socklen_t * alen = (socklen_t *)va_arg(args, long);
+ ret = getpeername(fdes, asa, alen);
+ break;
+ }
+ case SYS_getsockname: {
+ int fdes = (int)va_arg(args, long);
+ struct sockaddr * asa = (struct sockaddr *)va_arg(args, long);
+ socklen_t * alen = (socklen_t *)va_arg(args, long);
+ ret = getsockname(fdes, asa, alen);
+ break;
+ }
+ case SYS_access: {
+ const char * path = (const char *)va_arg(args, long);
+ int amode = (int)va_arg(args, long);
+ ret = access(path, amode);
+ break;
+ }
+ case SYS_chflags: {
+ const char * path = (const char *)va_arg(args, long);
+ u_int flags = (u_int)va_arg(args, long);
+ ret = chflags(path, flags);
+ break;
+ }
+ case SYS_fchflags: {
+ int fd = (int)va_arg(args, long);
+ u_int flags = (u_int)va_arg(args, long);
+ ret = fchflags(fd, flags);
+ break;
+ }
+ case SYS_sync:
+ sync();
+ break;
+ /* No signature found in headers
+ *case SYS_msyscall: {
+ * void * addr = (void *)va_arg(args, long);
+ * size_t len = (size_t)va_arg(args, long);
+ * ret = msyscall(addr, len);
+ * break;
+ *}
+ */
+ case SYS_stat: {
+ const char * path = (const char *)va_arg(args, long);
+ struct stat * ub = (struct stat *)va_arg(args, long);
+ ret = stat(path, ub);
+ break;
+ }
+ case SYS_getppid:
+ ret = getppid();
+ break;
+ case SYS_lstat: {
+ const char * path = (const char *)va_arg(args, long);
+ struct stat * ub = (struct stat *)va_arg(args, long);
+ ret = lstat(path, ub);
+ break;
+ }
+ case SYS_dup:
+ ret = dup(va_arg(args, int)); // fd
+ break;
+ case SYS_fstatat: {
+ int fd = (int)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ struct stat * buf = (struct stat *)va_arg(args, long);
+ int flag = (int)va_arg(args, long);
+ ret = fstatat(fd, path, buf, flag);
+ break;
+ }
+ case SYS_getegid:
+ ret = getegid();
+ break;
+ case SYS_profil: {
+ caddr_t samples = (caddr_t)va_arg(args, long);
+ size_t size = (size_t)va_arg(args, long);
+ u_long offset = (u_long)va_arg(args, long);
+ u_int scale = (u_int)va_arg(args, long);
+ ret = profil(samples, size, offset, scale);
+ break;
+ }
+ case SYS_ktrace: {
+ const char * fname = (const char *)va_arg(args, long);
+ int ops = (int)va_arg(args, long);
+ int facs = (int)va_arg(args, long);
+ pid_t pid = (pid_t)va_arg(args, long);
+ ret = ktrace(fname, ops, facs, pid);
+ break;
+ }
+ case SYS_sigaction: {
+ int signum = (int)va_arg(args, long);
+ const struct sigaction * nsa = (const struct sigaction *)va_arg(args, long);
+ struct sigaction * osa = (struct sigaction *)va_arg(args, long);
+ ret = sigaction(signum, nsa, osa);
+ break;
+ }
+ case SYS_getgid:
+ ret = getgid();
+ break;
+ /* Mismatched func: int sigprocmask(int, const sigset_t *, sigset_t *); <signal.h>
+ * int sigprocmask(int, sigset_t); <sys/syscall.h>
+ *case SYS_sigprocmask: {
+ * int how = (int)va_arg(args, long);
+ * sigset_t mask = (sigset_t)va_arg(args, long);
+ * ret = sigprocmask(how, mask);
+ * break;
+ *}
+ */
+ case SYS_mmap: {
+ void * addr = (void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ int prot = (int)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ int fd = (int)va_arg(args, long);
+ off_t pos = (off_t)va_arg(args, long);
+ ret = (long)mmap(addr, len, prot, flags, fd, pos);
+ break;
+ }
+ case SYS_setlogin:
+ ret = setlogin(va_arg(args, const char *)); // namebuf
+ break;
+ case SYS_acct:
+ ret = acct(va_arg(args, const char *)); // path
+ break;
+ /* Mismatched func: int sigpending(sigset_t *); <signal.h>
+ * int sigpending(void); <sys/syscall.h>
+ *case SYS_sigpending:
+ * ret = sigpending();
+ * break;
+ */
+ case SYS_fstat: {
+ int fd = (int)va_arg(args, long);
+ struct stat * sb = (struct stat *)va_arg(args, long);
+ ret = fstat(fd, sb);
+ break;
+ }
+ case SYS_ioctl: {
+ int fd = (int)va_arg(args, long);
+ u_long com = (u_long)va_arg(args, long);
+ void * data = (void *)va_arg(args, long);
+ ret = ioctl(fd, com, data);
+ break;
+ }
+ case SYS_reboot:
+ ret = reboot(va_arg(args, int)); // opt
+ break;
+ case SYS_revoke:
+ ret = revoke(va_arg(args, const char *)); // path
+ break;
+ case SYS_symlink: {
+ const char * path = (const char *)va_arg(args, long);
+ const char * link = (const char *)va_arg(args, long);
+ ret = symlink(path, link);
+ break;
+ }
+ case SYS_readlink: {
+ const char * path = (const char *)va_arg(args, long);
+ char * buf = (char *)va_arg(args, long);
+ size_t count = (size_t)va_arg(args, long);
+ ret = readlink(path, buf, count);
+ break;
+ }
+ case SYS_execve: {
+ const char * path = (const char *)va_arg(args, long);
+ char *const * argp = (char *const *)va_arg(args, long);
+ char *const * envp = (char *const *)va_arg(args, long);
+ ret = execve(path, argp, envp);
+ break;
+ }
+ case SYS_umask:
+ ret = umask(va_arg(args, mode_t)); // newmask
+ break;
+ case SYS_chroot:
+ ret = chroot(va_arg(args, const char *)); // path
+ break;
+ case SYS_getfsstat: {
+ struct statfs * buf = (struct statfs *)va_arg(args, long);
+ size_t bufsize = (size_t)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ ret = getfsstat(buf, bufsize, flags);
+ break;
+ }
+ case SYS_statfs: {
+ const char * path = (const char *)va_arg(args, long);
+ struct statfs * buf = (struct statfs *)va_arg(args, long);
+ ret = statfs(path, buf);
+ break;
+ }
+ case SYS_fstatfs: {
+ int fd = (int)va_arg(args, long);
+ struct statfs * buf = (struct statfs *)va_arg(args, long);
+ ret = fstatfs(fd, buf);
+ break;
+ }
+ case SYS_fhstatfs: {
+ const fhandle_t * fhp = (const fhandle_t *)va_arg(args, long);
+ struct statfs * buf = (struct statfs *)va_arg(args, long);
+ ret = fhstatfs(fhp, buf);
+ break;
+ }
+ case SYS_vfork:
+ ret = vfork();
+ break;
+ case SYS_gettimeofday: {
+ struct timeval * tp = (struct timeval *)va_arg(args, long);
+ struct timezone * tzp = (struct timezone *)va_arg(args, long);
+ ret = gettimeofday(tp, tzp);
+ break;
+ }
+ case SYS_settimeofday: {
+ const struct timeval * tv = (const struct timeval *)va_arg(args, long);
+ const struct timezone * tzp = (const struct timezone *)va_arg(args, long);
+ ret = settimeofday(tv, tzp);
+ break;
+ }
+ case SYS_setitimer: {
+ int which = (int)va_arg(args, long);
+ const struct itimerval * itv = (const struct itimerval *)va_arg(args, long);
+ struct itimerval * oitv = (struct itimerval *)va_arg(args, long);
+ ret = setitimer(which, itv, oitv);
+ break;
+ }
+ case SYS_getitimer: {
+ int which = (int)va_arg(args, long);
+ struct itimerval * itv = (struct itimerval *)va_arg(args, long);
+ ret = getitimer(which, itv);
+ break;
+ }
+ case SYS_select: {
+ int nd = (int)va_arg(args, long);
+ fd_set * in = (fd_set *)va_arg(args, long);
+ fd_set * ou = (fd_set *)va_arg(args, long);
+ fd_set * ex = (fd_set *)va_arg(args, long);
+ struct timeval * tv = (struct timeval *)va_arg(args, long);
+ ret = select(nd, in, ou, ex, tv);
+ break;
+ }
+ case SYS_kevent: {
+ int fd = (int)va_arg(args, long);
+ const struct kevent * changelist = (const struct kevent *)va_arg(args, long);
+ int nchanges = (int)va_arg(args, long);
+ struct kevent * eventlist = (struct kevent *)va_arg(args, long);
+ int nevents = (int)va_arg(args, long);
+ const struct timespec * timeout = (const struct timespec *)va_arg(args, long);
+ ret = kevent(fd, changelist, nchanges, eventlist, nevents, timeout);
+ break;
+ }
+ case SYS_munmap: {
+ void * addr = (void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ ret = munmap(addr, len);
+ break;
+ }
+ case SYS_mprotect: {
+ void * addr = (void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ int prot = (int)va_arg(args, long);
+ ret = mprotect(addr, len, prot);
+ break;
+ }
+ case SYS_madvise: {
+ void * addr = (void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ int behav = (int)va_arg(args, long);
+ ret = madvise(addr, len, behav);
+ break;
+ }
+ case SYS_utimes: {
+ const char * path = (const char *)va_arg(args, long);
+ const struct timeval * tptr = (const struct timeval *)va_arg(args, long);
+ ret = utimes(path, tptr);
+ break;
+ }
+ case SYS_futimes: {
+ int fd = (int)va_arg(args, long);
+ const struct timeval * tptr = (const struct timeval *)va_arg(args, long);
+ ret = futimes(fd, tptr);
+ break;
+ }
+ case SYS_mquery: {
+ void * addr = (void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ int prot = (int)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ int fd = (int)va_arg(args, long);
+ off_t pos = (off_t)va_arg(args, long);
+ ret = (long)mquery(addr, len, prot, flags, fd, pos);
+ break;
+ }
+ case SYS_getgroups: {
+ int gidsetsize = (int)va_arg(args, long);
+ gid_t * gidset = (gid_t *)va_arg(args, long);
+ ret = getgroups(gidsetsize, gidset);
+ break;
+ }
+ case SYS_setgroups: {
+ int gidsetsize = (int)va_arg(args, long);
+ const gid_t * gidset = (const gid_t *)va_arg(args, long);
+ ret = setgroups(gidsetsize, gidset);
+ break;
+ }
+ case SYS_getpgrp:
+ ret = getpgrp();
+ break;
+ case SYS_setpgid: {
+ pid_t pid = (pid_t)va_arg(args, long);
+ pid_t pgid = (pid_t)va_arg(args, long);
+ ret = setpgid(pid, pgid);
+ break;
+ }
+ case SYS_futex: {
+ uint32_t * f = (uint32_t *)va_arg(args, long);
+ int op = (int)va_arg(args, long);
+ int val = (int)va_arg(args, long);
+ const struct timespec * timeout = (const struct timespec *)va_arg(args, long);
+ uint32_t * g = (uint32_t *)va_arg(args, long);
+ ret = futex(f, op, val, timeout, g);
+ break;
+ }
+ case SYS_utimensat: {
+ int fd = (int)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ const struct timespec * times = (const struct timespec *)va_arg(args, long);
+ int flag = (int)va_arg(args, long);
+ ret = utimensat(fd, path, times, flag);
+ break;
+ }
+ case SYS_futimens: {
+ int fd = (int)va_arg(args, long);
+ const struct timespec * times = (const struct timespec *)va_arg(args, long);
+ ret = futimens(fd, times);
+ break;
+ }
+ /* No signature found in headers
+ *case SYS_kbind: {
+ * const struct __kbind * param = (const struct __kbind *)va_arg(args, long);
+ * size_t psize = (size_t)va_arg(args, long);
+ * int64_t proc_cookie = (int64_t)va_arg(args, long);
+ * ret = kbind(param, psize, proc_cookie);
+ * break;
+ *}
+ */
+ case SYS_clock_gettime: {
+ clockid_t clock_id = (clockid_t)va_arg(args, long);
+ struct timespec * tp = (struct timespec *)va_arg(args, long);
+ ret = clock_gettime(clock_id, tp);
+ break;
+ }
+ case SYS_clock_settime: {
+ clockid_t clock_id = (clockid_t)va_arg(args, long);
+ const struct timespec * tp = (const struct timespec *)va_arg(args, long);
+ ret = clock_settime(clock_id, tp);
+ break;
+ }
+ case SYS_clock_getres: {
+ clockid_t clock_id = (clockid_t)va_arg(args, long);
+ struct timespec * tp = (struct timespec *)va_arg(args, long);
+ ret = clock_getres(clock_id, tp);
+ break;
+ }
+ case SYS_dup2: {
+ int from = (int)va_arg(args, long);
+ int to = (int)va_arg(args, long);
+ ret = dup2(from, to);
+ break;
+ }
+ case SYS_nanosleep: {
+ const struct timespec * rqtp = (const struct timespec *)va_arg(args, long);
+ struct timespec * rmtp = (struct timespec *)va_arg(args, long);
+ ret = nanosleep(rqtp, rmtp);
+ break;
+ }
+ case SYS_fcntl: {
+ int fd = (int)va_arg(args, long);
+ int cmd = (int)va_arg(args, long);
+ void * arg = (void *)va_arg(args, long);
+ ret = fcntl(fd, cmd, arg);
+ break;
+ }
+ case SYS_accept4: {
+ int s = (int)va_arg(args, long);
+ struct sockaddr * name = (struct sockaddr *)va_arg(args, long);
+ socklen_t * anamelen = (socklen_t *)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ ret = accept4(s, name, anamelen, flags);
+ break;
+ }
+ /* No signature found in headers
+ *case SYS___thrsleep: {
+ * const volatile void * ident = (const volatile void *)va_arg(args, long);
+ * clockid_t clock_id = (clockid_t)va_arg(args, long);
+ * const struct timespec * tp = (const struct timespec *)va_arg(args, long);
+ * void * lock = (void *)va_arg(args, long);
+ * const int * abort = (const int *)va_arg(args, long);
+ * ret = __thrsleep(ident, clock_id, tp, lock, abort);
+ * break;
+ *}
+ */
+ case SYS_fsync:
+ ret = fsync(va_arg(args, int)); // fd
+ break;
+ case SYS_setpriority: {
+ int which = (int)va_arg(args, long);
+ id_t who = (id_t)va_arg(args, long);
+ int prio = (int)va_arg(args, long);
+ ret = setpriority(which, who, prio);
+ break;
+ }
+ case SYS_socket: {
+ int domain = (int)va_arg(args, long);
+ int type = (int)va_arg(args, long);
+ int protocol = (int)va_arg(args, long);
+ ret = socket(domain, type, protocol);
+ break;
+ }
+ case SYS_connect: {
+ int s = (int)va_arg(args, long);
+ const struct sockaddr * name = (const struct sockaddr *)va_arg(args, long);
+ socklen_t namelen = (socklen_t)va_arg(args, long);
+ ret = connect(s, name, namelen);
+ break;
+ }
+ case SYS_getdents: {
+ int fd = (int)va_arg(args, long);
+ void * buf = (void *)va_arg(args, long);
+ size_t buflen = (size_t)va_arg(args, long);
+ ret = getdents(fd, buf, buflen);
+ break;
+ }
+ case SYS_getpriority: {
+ int which = (int)va_arg(args, long);
+ id_t who = (id_t)va_arg(args, long);
+ ret = getpriority(which, who);
+ break;
+ }
+ case SYS_pipe2: {
+ int * fdp = (int *)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ ret = pipe2(fdp, flags);
+ break;
+ }
+ case SYS_dup3: {
+ int from = (int)va_arg(args, long);
+ int to = (int)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ ret = dup3(from, to, flags);
+ break;
+ }
+ /* No signature found in headers
+ *case SYS_sigreturn:
+ * ret = sigreturn(va_arg(args, struct sigcontext *)); // sigcntxp
+ * break;
+ */
+ case SYS_bind: {
+ int s = (int)va_arg(args, long);
+ const struct sockaddr * name = (const struct sockaddr *)va_arg(args, long);
+ socklen_t namelen = (socklen_t)va_arg(args, long);
+ ret = bind(s, name, namelen);
+ break;
+ }
+ case SYS_setsockopt: {
+ int s = (int)va_arg(args, long);
+ int level = (int)va_arg(args, long);
+ int name = (int)va_arg(args, long);
+ const void * val = (const void *)va_arg(args, long);
+ socklen_t valsize = (socklen_t)va_arg(args, long);
+ ret = setsockopt(s, level, name, val, valsize);
+ break;
+ }
+ case SYS_listen: {
+ int s = (int)va_arg(args, long);
+ int backlog = (int)va_arg(args, long);
+ ret = listen(s, backlog);
+ break;
+ }
+ case SYS_chflagsat: {
+ int fd = (int)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ u_int flags = (u_int)va_arg(args, long);
+ int atflags = (int)va_arg(args, long);
+ ret = chflagsat(fd, path, flags, atflags);
+ break;
+ }
+ case SYS_pledge: {
+ const char * promises = (const char *)va_arg(args, long);
+ const char * execpromises = (const char *)va_arg(args, long);
+ ret = pledge(promises, execpromises);
+ break;
+ }
+ case SYS_ppoll: {
+ struct pollfd * fds = (struct pollfd *)va_arg(args, long);
+ u_int nfds = (u_int)va_arg(args, long);
+ const struct timespec * ts = (const struct timespec *)va_arg(args, long);
+ const sigset_t * mask = (const sigset_t *)va_arg(args, long);
+ ret = ppoll(fds, nfds, ts, mask);
+ break;
+ }
+ case SYS_pselect: {
+ int nd = (int)va_arg(args, long);
+ fd_set * in = (fd_set *)va_arg(args, long);
+ fd_set * ou = (fd_set *)va_arg(args, long);
+ fd_set * ex = (fd_set *)va_arg(args, long);
+ const struct timespec * ts = (const struct timespec *)va_arg(args, long);
+ const sigset_t * mask = (const sigset_t *)va_arg(args, long);
+ ret = pselect(nd, in, ou, ex, ts, mask);
+ break;
+ }
+ /* Mismatched func: int sigsuspend(const sigset_t *); <signal.h>
+ * int sigsuspend(int); <sys/syscall.h>
+ *case SYS_sigsuspend:
+ * ret = sigsuspend(va_arg(args, int)); // mask
+ * break;
+ */
+ case SYS_sendsyslog: {
+ const char * buf = (const char *)va_arg(args, long);
+ size_t nbyte = (size_t)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ ret = sendsyslog(buf, nbyte, flags);
+ break;
+ }
+ case SYS_unveil: {
+ const char * path = (const char *)va_arg(args, long);
+ const char * permissions = (const char *)va_arg(args, long);
+ ret = unveil(path, permissions);
+ break;
+ }
+ /* No signature found in headers
+ *case SYS___realpath: {
+ * const char * pathname = (const char *)va_arg(args, long);
+ * char * resolved = (char *)va_arg(args, long);
+ * ret = __realpath(pathname, resolved);
+ * break;
+ *}
+ */
+ case SYS_recvmmsg: {
+ int s = (int)va_arg(args, long);
+ struct mmsghdr * mmsg = (struct mmsghdr *)va_arg(args, long);
+ unsigned int vlen = (unsigned int)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ struct timespec * timeout = (struct timespec *)va_arg(args, long);
+ ret = recvmmsg(s, mmsg, vlen, flags, timeout);
+ break;
+ }
+ case SYS_sendmmsg: {
+ int s = (int)va_arg(args, long);
+ struct mmsghdr * mmsg = (struct mmsghdr *)va_arg(args, long);
+ unsigned int vlen = (unsigned int)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ ret = sendmmsg(s, mmsg, vlen, flags);
+ break;
+ }
+ case SYS_getsockopt: {
+ int s = (int)va_arg(args, long);
+ int level = (int)va_arg(args, long);
+ int name = (int)va_arg(args, long);
+ void * val = (void *)va_arg(args, long);
+ socklen_t * avalsize = (socklen_t *)va_arg(args, long);
+ ret = getsockopt(s, level, name, val, avalsize);
+ break;
+ }
+ case SYS_thrkill: {
+ pid_t tid = (pid_t)va_arg(args, long);
+ int signum = (int)va_arg(args, long);
+ void * tcb = (void *)va_arg(args, long);
+ ret = thrkill(tid, signum, tcb);
+ break;
+ }
+ case SYS_readv: {
+ int fd = (int)va_arg(args, long);
+ const struct iovec * iovp = (const struct iovec *)va_arg(args, long);
+ int iovcnt = (int)va_arg(args, long);
+ ret = readv(fd, iovp, iovcnt);
+ break;
+ }
+ case SYS_writev: {
+ int fd = (int)va_arg(args, long);
+ const struct iovec * iovp = (const struct iovec *)va_arg(args, long);
+ int iovcnt = (int)va_arg(args, long);
+ ret = writev(fd, iovp, iovcnt);
+ break;
+ }
+ case SYS_kill: {
+ int pid = (int)va_arg(args, long);
+ int signum = (int)va_arg(args, long);
+ ret = kill(pid, signum);
+ break;
+ }
+ case SYS_fchown: {
+ int fd = (int)va_arg(args, long);
+ uid_t uid = (uid_t)va_arg(args, long);
+ gid_t gid = (gid_t)va_arg(args, long);
+ ret = fchown(fd, uid, gid);
+ break;
+ }
+ case SYS_fchmod: {
+ int fd = (int)va_arg(args, long);
+ mode_t mode = (mode_t)va_arg(args, long);
+ ret = fchmod(fd, mode);
+ break;
+ }
+ case SYS_setreuid: {
+ uid_t ruid = (uid_t)va_arg(args, long);
+ uid_t euid = (uid_t)va_arg(args, long);
+ ret = setreuid(ruid, euid);
+ break;
+ }
+ case SYS_setregid: {
+ gid_t rgid = (gid_t)va_arg(args, long);
+ gid_t egid = (gid_t)va_arg(args, long);
+ ret = setregid(rgid, egid);
+ break;
+ }
+ case SYS_rename: {
+ const char * from = (const char *)va_arg(args, long);
+ const char * to = (const char *)va_arg(args, long);
+ ret = rename(from, to);
+ break;
+ }
+ case SYS_flock: {
+ int fd = (int)va_arg(args, long);
+ int how = (int)va_arg(args, long);
+ ret = flock(fd, how);
+ break;
+ }
+ case SYS_mkfifo: {
+ const char * path = (const char *)va_arg(args, long);
+ mode_t mode = (mode_t)va_arg(args, long);
+ ret = mkfifo(path, mode);
+ break;
+ }
+ case SYS_sendto: {
+ int s = (int)va_arg(args, long);
+ const void * buf = (const void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ const struct sockaddr * to = (const struct sockaddr *)va_arg(args, long);
+ socklen_t tolen = (socklen_t)va_arg(args, long);
+ ret = sendto(s, buf, len, flags, to, tolen);
+ break;
+ }
+ case SYS_shutdown: {
+ int s = (int)va_arg(args, long);
+ int how = (int)va_arg(args, long);
+ ret = shutdown(s, how);
+ break;
+ }
+ case SYS_socketpair: {
+ int domain = (int)va_arg(args, long);
+ int type = (int)va_arg(args, long);
+ int protocol = (int)va_arg(args, long);
+ int * rsv = (int *)va_arg(args, long);
+ ret = socketpair(domain, type, protocol, rsv);
+ break;
+ }
+ case SYS_mkdir: {
+ const char * path = (const char *)va_arg(args, long);
+ mode_t mode = (mode_t)va_arg(args, long);
+ ret = mkdir(path, mode);
+ break;
+ }
+ case SYS_rmdir:
+ ret = rmdir(va_arg(args, const char *)); // path
+ break;
+ case SYS_adjtime: {
+ const struct timeval * delta = (const struct timeval *)va_arg(args, long);
+ struct timeval * olddelta = (struct timeval *)va_arg(args, long);
+ ret = adjtime(delta, olddelta);
+ break;
+ }
+ /* Mismatched func: int getlogin_r(char *, size_t); <unistd.h>
+ * int getlogin_r(char *, u_int); <sys/syscall.h>
+ *case SYS_getlogin_r: {
+ * char * namebuf = (char *)va_arg(args, long);
+ * u_int namelen = (u_int)va_arg(args, long);
+ * ret = getlogin_r(namebuf, namelen);
+ * break;
+ *}
+ */
+ case SYS_getthrname: {
+ pid_t tid = (pid_t)va_arg(args, long);
+ char * name = (char *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ ret = getthrname(tid, name, len);
+ break;
+ }
+ case SYS_setthrname: {
+ pid_t tid = (pid_t)va_arg(args, long);
+ const char * name = (const char *)va_arg(args, long);
+ ret = setthrname(tid, name);
+ break;
+ }
+ /* No signature found in headers
+ *case SYS_pinsyscall: {
+ * int syscall = (int)va_arg(args, long);
+ * void * addr = (void *)va_arg(args, long);
+ * size_t len = (size_t)va_arg(args, long);
+ * ret = pinsyscall(syscall, addr, len);
+ * break;
+ *}
+ */
+ case SYS_setsid:
+ ret = setsid();
+ break;
+ case SYS_quotactl: {
+ const char * path = (const char *)va_arg(args, long);
+ int cmd = (int)va_arg(args, long);
+ int uid = (int)va_arg(args, long);
+ char * arg = (char *)va_arg(args, long);
+ ret = quotactl(path, cmd, uid, arg);
+ break;
+ }
+ /* No signature found in headers
+ *case SYS_ypconnect:
+ * ret = ypconnect(va_arg(args, int)); // type
+ * break;
+ */
+ case SYS_nfssvc: {
+ int flag = (int)va_arg(args, long);
+ void * argp = (void *)va_arg(args, long);
+ ret = nfssvc(flag, argp);
+ break;
+ }
+ case SYS_mimmutable: {
+ void * addr = (void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ ret = mimmutable(addr, len);
+ break;
+ }
+ case SYS_waitid: {
+ int idtype = (int)va_arg(args, long);
+ id_t id = (id_t)va_arg(args, long);
+ siginfo_t * info = (siginfo_t *)va_arg(args, long);
+ int options = (int)va_arg(args, long);
+ ret = waitid(idtype, id, info, options);
+ break;
+ }
+ case SYS_getfh: {
+ const char * fname = (const char *)va_arg(args, long);
+ fhandle_t * fhp = (fhandle_t *)va_arg(args, long);
+ ret = getfh(fname, fhp);
+ break;
+ }
+ /* No signature found in headers
+ *case SYS___tmpfd:
+ * ret = __tmpfd(va_arg(args, int)); // flags
+ * break;
+ */
+ /* No signature found in headers
+ *case SYS_sysarch: {
+ * int op = (int)va_arg(args, long);
+ * void * parms = (void *)va_arg(args, long);
+ * ret = sysarch(op, parms);
+ * break;
+ *}
+ */
+ case SYS_lseek: {
+ int fd = (int)va_arg(args, long);
+ off_t offset = (off_t)va_arg(args, long);
+ int whence = (int)va_arg(args, long);
+ ret = lseek(fd, offset, whence);
+ break;
+ }
+ case SYS_truncate: {
+ const char * path = (const char *)va_arg(args, long);
+ off_t length = (off_t)va_arg(args, long);
+ ret = truncate(path, length);
+ break;
+ }
+ case SYS_ftruncate: {
+ int fd = (int)va_arg(args, long);
+ off_t length = (off_t)va_arg(args, long);
+ ret = ftruncate(fd, length);
+ break;
+ }
+ case SYS_pread: {
+ int fd = (int)va_arg(args, long);
+ void * buf = (void *)va_arg(args, long);
+ size_t nbyte = (size_t)va_arg(args, long);
+ off_t offset = (off_t)va_arg(args, long);
+ ret = pread(fd, buf, nbyte, offset);
+ break;
+ }
+ case SYS_pwrite: {
+ int fd = (int)va_arg(args, long);
+ const void * buf = (const void *)va_arg(args, long);
+ size_t nbyte = (size_t)va_arg(args, long);
+ off_t offset = (off_t)va_arg(args, long);
+ ret = pwrite(fd, buf, nbyte, offset);
+ break;
+ }
+ case SYS_preadv: {
+ int fd = (int)va_arg(args, long);
+ const struct iovec * iovp = (const struct iovec *)va_arg(args, long);
+ int iovcnt = (int)va_arg(args, long);
+ off_t offset = (off_t)va_arg(args, long);
+ ret = preadv(fd, iovp, iovcnt, offset);
+ break;
+ }
+ case SYS_pwritev: {
+ int fd = (int)va_arg(args, long);
+ const struct iovec * iovp = (const struct iovec *)va_arg(args, long);
+ int iovcnt = (int)va_arg(args, long);
+ off_t offset = (off_t)va_arg(args, long);
+ ret = pwritev(fd, iovp, iovcnt, offset);
+ break;
+ }
+ case SYS_setgid:
+ ret = setgid(va_arg(args, gid_t)); // gid
+ break;
+ case SYS_setegid:
+ ret = setegid(va_arg(args, gid_t)); // egid
+ break;
+ case SYS_seteuid:
+ ret = seteuid(va_arg(args, uid_t)); // euid
+ break;
+ case SYS_pathconf: {
+ const char * path = (const char *)va_arg(args, long);
+ int name = (int)va_arg(args, long);
+ ret = pathconf(path, name);
+ break;
+ }
+ case SYS_fpathconf: {
+ int fd = (int)va_arg(args, long);
+ int name = (int)va_arg(args, long);
+ ret = fpathconf(fd, name);
+ break;
+ }
+ case SYS_swapctl: {
+ int cmd = (int)va_arg(args, long);
+ const void * arg = (const void *)va_arg(args, long);
+ int misc = (int)va_arg(args, long);
+ ret = swapctl(cmd, arg, misc);
+ break;
+ }
+ case SYS_getrlimit: {
+ int which = (int)va_arg(args, long);
+ struct rlimit * rlp = (struct rlimit *)va_arg(args, long);
+ ret = getrlimit(which, rlp);
+ break;
+ }
+ case SYS_setrlimit: {
+ int which = (int)va_arg(args, long);
+ const struct rlimit * rlp = (const struct rlimit *)va_arg(args, long);
+ ret = setrlimit(which, rlp);
+ break;
+ }
+ case SYS_sysctl: {
+ const int * name = (const int *)va_arg(args, long);
+ u_int namelen = (u_int)va_arg(args, long);
+ void * old = (void *)va_arg(args, long);
+ size_t * oldlenp = (size_t *)va_arg(args, long);
+ void * new = (void *)va_arg(args, long);
+ size_t newlen = (size_t)va_arg(args, long);
+ ret = sysctl(name, namelen, old, oldlenp, new, newlen);
+ break;
+ }
+ case SYS_mlock: {
+ const void * addr = (const void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ ret = mlock(addr, len);
+ break;
+ }
+ case SYS_munlock: {
+ const void * addr = (const void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ ret = munlock(addr, len);
+ break;
+ }
+ case SYS_getpgid:
+ ret = getpgid(va_arg(args, pid_t)); // pid
+ break;
+ case SYS_utrace: {
+ const char * label = (const char *)va_arg(args, long);
+ const void * addr = (const void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ ret = utrace(label, addr, len);
+ break;
+ }
+ case SYS_semget: {
+ key_t key = (key_t)va_arg(args, long);
+ int nsems = (int)va_arg(args, long);
+ int semflg = (int)va_arg(args, long);
+ ret = semget(key, nsems, semflg);
+ break;
+ }
+ case SYS_msgget: {
+ key_t key = (key_t)va_arg(args, long);
+ int msgflg = (int)va_arg(args, long);
+ ret = msgget(key, msgflg);
+ break;
+ }
+ case SYS_msgsnd: {
+ int msqid = (int)va_arg(args, long);
+ const void * msgp = (const void *)va_arg(args, long);
+ size_t msgsz = (size_t)va_arg(args, long);
+ int msgflg = (int)va_arg(args, long);
+ ret = msgsnd(msqid, msgp, msgsz, msgflg);
+ break;
+ }
+ case SYS_msgrcv: {
+ int msqid = (int)va_arg(args, long);
+ void * msgp = (void *)va_arg(args, long);
+ size_t msgsz = (size_t)va_arg(args, long);
+ long msgtyp = (long)va_arg(args, long);
+ int msgflg = (int)va_arg(args, long);
+ ret = msgrcv(msqid, msgp, msgsz, msgtyp, msgflg);
+ break;
+ }
+ case SYS_shmat: {
+ int shmid = (int)va_arg(args, long);
+ const void * shmaddr = (const void *)va_arg(args, long);
+ int shmflg = (int)va_arg(args, long);
+ ret = (long)shmat(shmid, shmaddr, shmflg);
+ break;
+ }
+ case SYS_shmdt:
+ ret = shmdt(va_arg(args, const void *)); // shmaddr
+ break;
+ case SYS_minherit: {
+ void * addr = (void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ int inherit = (int)va_arg(args, long);
+ ret = minherit(addr, len, inherit);
+ break;
+ }
+ case SYS_poll: {
+ struct pollfd * fds = (struct pollfd *)va_arg(args, long);
+ u_int nfds = (u_int)va_arg(args, long);
+ int timeout = (int)va_arg(args, long);
+ ret = poll(fds, nfds, timeout);
+ break;
+ }
+ case SYS_issetugid:
+ ret = issetugid();
+ break;
+ case SYS_lchown: {
+ const char * path = (const char *)va_arg(args, long);
+ uid_t uid = (uid_t)va_arg(args, long);
+ gid_t gid = (gid_t)va_arg(args, long);
+ ret = lchown(path, uid, gid);
+ break;
+ }
+ case SYS_getsid:
+ ret = getsid(va_arg(args, pid_t)); // pid
+ break;
+ case SYS_msync: {
+ void * addr = (void *)va_arg(args, long);
+ size_t len = (size_t)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ ret = msync(addr, len, flags);
+ break;
+ }
+ case SYS_pipe:
+ ret = pipe(va_arg(args, int *)); // fdp
+ break;
+ case SYS_fhopen: {
+ const fhandle_t * fhp = (const fhandle_t *)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ ret = fhopen(fhp, flags);
+ break;
+ }
+ case SYS_kqueue:
+ ret = kqueue();
+ break;
+ case SYS_mlockall:
+ ret = mlockall(va_arg(args, int)); // flags
+ break;
+ case SYS_munlockall:
+ ret = munlockall();
+ break;
+ case SYS_getresuid: {
+ uid_t * ruid = (uid_t *)va_arg(args, long);
+ uid_t * euid = (uid_t *)va_arg(args, long);
+ uid_t * suid = (uid_t *)va_arg(args, long);
+ ret = getresuid(ruid, euid, suid);
+ break;
+ }
+ case SYS_setresuid: {
+ uid_t ruid = (uid_t)va_arg(args, long);
+ uid_t euid = (uid_t)va_arg(args, long);
+ uid_t suid = (uid_t)va_arg(args, long);
+ ret = setresuid(ruid, euid, suid);
+ break;
+ }
+ case SYS_getresgid: {
+ gid_t * rgid = (gid_t *)va_arg(args, long);
+ gid_t * egid = (gid_t *)va_arg(args, long);
+ gid_t * sgid = (gid_t *)va_arg(args, long);
+ ret = getresgid(rgid, egid, sgid);
+ break;
+ }
+ case SYS_setresgid: {
+ gid_t rgid = (gid_t)va_arg(args, long);
+ gid_t egid = (gid_t)va_arg(args, long);
+ gid_t sgid = (gid_t)va_arg(args, long);
+ ret = setresgid(rgid, egid, sgid);
+ break;
+ }
+ case SYS_closefrom:
+ ret = closefrom(va_arg(args, int)); // fd
+ break;
+ case SYS_sigaltstack: {
+ const struct sigaltstack * nss = (const struct sigaltstack *)va_arg(args, long);
+ struct sigaltstack * oss = (struct sigaltstack *)va_arg(args, long);
+ ret = sigaltstack(nss, oss);
+ break;
+ }
+ case SYS_shmget: {
+ key_t key = (key_t)va_arg(args, long);
+ size_t size = (size_t)va_arg(args, long);
+ int shmflg = (int)va_arg(args, long);
+ ret = shmget(key, size, shmflg);
+ break;
+ }
+ case SYS_semop: {
+ int semid = (int)va_arg(args, long);
+ struct sembuf * sops = (struct sembuf *)va_arg(args, long);
+ size_t nsops = (size_t)va_arg(args, long);
+ ret = semop(semid, sops, nsops);
+ break;
+ }
+ case SYS_fhstat: {
+ const fhandle_t * fhp = (const fhandle_t *)va_arg(args, long);
+ struct stat * sb = (struct stat *)va_arg(args, long);
+ ret = fhstat(fhp, sb);
+ break;
+ }
+ case SYS___semctl: {
+ int semid = (int)va_arg(args, long);
+ int semnum = (int)va_arg(args, long);
+ int cmd = (int)va_arg(args, long);
+ union semun * arg = (union semun *)va_arg(args, long);
+ ret = __semctl(semid, semnum, cmd, arg);
+ break;
+ }
+ case SYS_shmctl: {
+ int shmid = (int)va_arg(args, long);
+ int cmd = (int)va_arg(args, long);
+ struct shmid_ds * buf = (struct shmid_ds *)va_arg(args, long);
+ ret = shmctl(shmid, cmd, buf);
+ break;
+ }
+ case SYS_msgctl: {
+ int msqid = (int)va_arg(args, long);
+ int cmd = (int)va_arg(args, long);
+ struct msqid_ds * buf = (struct msqid_ds *)va_arg(args, long);
+ ret = msgctl(msqid, cmd, buf);
+ break;
+ }
+ case SYS_sched_yield:
+ ret = sched_yield();
+ break;
+ case SYS_getthrid:
+ ret = getthrid();
+ break;
+ /* No signature found in headers
+ *case SYS___thrwakeup: {
+ * const volatile void * ident = (const volatile void *)va_arg(args, long);
+ * int n = (int)va_arg(args, long);
+ * ret = __thrwakeup(ident, n);
+ * break;
+ *}
+ */
+ /* No signature found in headers
+ *case SYS___threxit:
+ * __threxit(va_arg(args, pid_t *)); // notdead
+ * break;
+ */
+ /* No signature found in headers
+ *case SYS___thrsigdivert: {
+ * sigset_t sigmask = (sigset_t)va_arg(args, long);
+ * siginfo_t * info = (siginfo_t *)va_arg(args, long);
+ * const struct timespec * timeout = (const struct timespec *)va_arg(args, long);
+ * ret = __thrsigdivert(sigmask, info, timeout);
+ * break;
+ *}
+ */
+ /* No signature found in headers
+ *case SYS___getcwd: {
+ * char * buf = (char *)va_arg(args, long);
+ * size_t len = (size_t)va_arg(args, long);
+ * ret = __getcwd(buf, len);
+ * break;
+ *}
+ */
+ case SYS_adjfreq: {
+ const int64_t * freq = (const int64_t *)va_arg(args, long);
+ int64_t * oldfreq = (int64_t *)va_arg(args, long);
+ ret = adjfreq(freq, oldfreq);
+ break;
+ }
+ case SYS_setrtable:
+ ret = setrtable(va_arg(args, int)); // rtableid
+ break;
+ case SYS_getrtable:
+ ret = getrtable();
+ break;
+ case SYS_faccessat: {
+ int fd = (int)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ int amode = (int)va_arg(args, long);
+ int flag = (int)va_arg(args, long);
+ ret = faccessat(fd, path, amode, flag);
+ break;
+ }
+ case SYS_fchmodat: {
+ int fd = (int)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ mode_t mode = (mode_t)va_arg(args, long);
+ int flag = (int)va_arg(args, long);
+ ret = fchmodat(fd, path, mode, flag);
+ break;
+ }
+ case SYS_fchownat: {
+ int fd = (int)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ uid_t uid = (uid_t)va_arg(args, long);
+ gid_t gid = (gid_t)va_arg(args, long);
+ int flag = (int)va_arg(args, long);
+ ret = fchownat(fd, path, uid, gid, flag);
+ break;
+ }
+ case SYS_linkat: {
+ int fd1 = (int)va_arg(args, long);
+ const char * path1 = (const char *)va_arg(args, long);
+ int fd2 = (int)va_arg(args, long);
+ const char * path2 = (const char *)va_arg(args, long);
+ int flag = (int)va_arg(args, long);
+ ret = linkat(fd1, path1, fd2, path2, flag);
+ break;
+ }
+ case SYS_mkdirat: {
+ int fd = (int)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ mode_t mode = (mode_t)va_arg(args, long);
+ ret = mkdirat(fd, path, mode);
+ break;
+ }
+ case SYS_mkfifoat: {
+ int fd = (int)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ mode_t mode = (mode_t)va_arg(args, long);
+ ret = mkfifoat(fd, path, mode);
+ break;
+ }
+ case SYS_mknodat: {
+ int fd = (int)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ mode_t mode = (mode_t)va_arg(args, long);
+ dev_t dev = (dev_t)va_arg(args, long);
+ ret = mknodat(fd, path, mode, dev);
+ break;
+ }
+ case SYS_openat: {
+ int fd = (int)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ int flags = (int)va_arg(args, long);
+ mode_t mode = (mode_t)va_arg(args, long);
+ ret = openat(fd, path, flags, mode);
+ break;
+ }
+ case SYS_readlinkat: {
+ int fd = (int)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ char * buf = (char *)va_arg(args, long);
+ size_t count = (size_t)va_arg(args, long);
+ ret = readlinkat(fd, path, buf, count);
+ break;
+ }
+ case SYS_renameat: {
+ int fromfd = (int)va_arg(args, long);
+ const char * from = (const char *)va_arg(args, long);
+ int tofd = (int)va_arg(args, long);
+ const char * to = (const char *)va_arg(args, long);
+ ret = renameat(fromfd, from, tofd, to);
+ break;
+ }
+ case SYS_symlinkat: {
+ const char * path = (const char *)va_arg(args, long);
+ int fd = (int)va_arg(args, long);
+ const char * link = (const char *)va_arg(args, long);
+ ret = symlinkat(path, fd, link);
+ break;
+ }
+ case SYS_unlinkat: {
+ int fd = (int)va_arg(args, long);
+ const char * path = (const char *)va_arg(args, long);
+ int flag = (int)va_arg(args, long);
+ ret = unlinkat(fd, path, flag);
+ break;
+ }
+ case SYS___set_tcb:
+ __set_tcb(va_arg(args, void *)); // tcb
+ break;
+ case SYS___get_tcb:
+ ret = (long)__get_tcb();
+ break;
+ default:
+ ret = -1;
+ errno = ENOSYS;
+ }
+ va_end(args);
+
+ return ret;
+}
diff --git a/gnu/usr.bin/perl/t/lib/h2ph.pht b/gnu/usr.bin/perl/t/lib/h2ph.pht
index f068d6dae46..cda8d21051c 100644
--- a/gnu/usr.bin/perl/t/lib/h2ph.pht
+++ b/gnu/usr.bin/perl/t/lib/h2ph.pht
@@ -90,10 +90,6 @@ unless(defined(&_H2PH_H_)) {
}
eval("sub flim () { 0; }") unless defined(&flim);
eval("sub flam () { 1; }") unless defined(&flam);
- eval 'sub blli_in_use {
- my($blli) = @_;
- eval q({ ($blli->{l2_proto}) || ($blli->{l3_proto}); });
- }' unless defined(&blli_in_use);
eval 'sub multiline () {"multilinestring";}' unless defined(&multiline);
}
1;
diff --git a/gnu/usr.bin/perl/t/op/array.t b/gnu/usr.bin/perl/t/op/array.t
index 188bedfecd0..ae2ac32be52 100644
--- a/gnu/usr.bin/perl/t/op/array.t
+++ b/gnu/usr.bin/perl/t/op/array.t
@@ -6,7 +6,7 @@ BEGIN {
set_up_inc('.', '../lib');
}
-plan (194);
+plan (195);
#
# @foo, @bar, and @ary are also used from tie-stdarray after tie-ing them
@@ -686,4 +686,8 @@ $#a = -1; $#a++;
'holes passed to sub do not lose their position (aelem, mg)';
}
+# GH #21235
+fresh_perl_is('my @x;$x[0] = 1;shift @x;$x[22] = 1;$x[25] = 1;','',
+ {}, 'unshifting and growing an array initializes trailing elements');
+
"We're included by lib/Tie/Array/std.t so we need to return something true";
diff --git a/gnu/usr.bin/perl/t/op/getppid.t b/gnu/usr.bin/perl/t/op/getppid.t
index 0a5dbcef1aa..fc0fa529705 100755
--- a/gnu/usr.bin/perl/t/op/getppid.t
+++ b/gnu/usr.bin/perl/t/op/getppid.t
@@ -100,7 +100,7 @@ sub fork_and_retrieve {
}
} else {
# Fudge it by waiting a bit more:
- sleep 2;
+ sleep 3;
}
my $ppid2 = getppid();
print $w "$how,$ppid1,$ppid2\n";
diff --git a/gnu/usr.bin/perl/t/porting/customized.dat b/gnu/usr.bin/perl/t/porting/customized.dat
index 7c64d127fcd..11e8a80cd2b 100644
--- a/gnu/usr.bin/perl/t/porting/customized.dat
+++ b/gnu/usr.bin/perl/t/porting/customized.dat
@@ -6,7 +6,7 @@ Compress::Raw::Bzip2 cpan/Compress-Raw-Bzip2/Bzip2.xs 76ad65475e73a545d0e1513e3d
Compress::Raw::Zlib cpan/Compress-Raw-Zlib/lib/Compress/Raw/Zlib.pm 4198f92e2880d36d6cef4f1be216005b6738ada8
Compress::Raw::Zlib cpan/Compress-Raw-Zlib/Zlib.xs 2ed95faab364703f6b93f7ffff6e0f2a2b2adedd
Digest::MD5 cpan/Digest-MD5/MD5.pm cf2fd9d327f3e314e9e66bb6ecb7a62b4ec72767
-Digest::MD5 cpan/Digest-MD5/MD5.xs dc40839d25ba5e2d6f42fc9b81b409f1d0dbfb0e
+Digest::MD5 cpan/Digest-MD5/MD5.xs 288775759d20ddfb0a0cb02f2ea670afefe2ce6c
ExtUtils::Constant cpan/ExtUtils-Constant/lib/ExtUtils/Constant/Base.pm 7560e1018f806db5689dee78728ccb8374aea741
ExtUtils::Constant cpan/ExtUtils-Constant/t/Constant.t 165e9c7132b003fd192d32a737b0f51f9ba4999e
Filter::Util::Call pod/perlfilter.pod d1e217d0bc6083755b9017050b8724472c58275a
@@ -14,7 +14,7 @@ IO::Socket::IP cpan/IO-Socket-IP/lib/IO/Socket/IP.pm a3390d0b3b617a0b810c75941bf
Locale::Maketext::Simple cpan/Locale-Maketext-Simple/lib/Locale/Maketext/Simple.pm 57ed38905791a17c150210cd6f42ead22a7707b6
MIME::Base64 cpan/MIME-Base64/Base64.xs ad617fe2d01932c35b92defa26d40aba601a95a8
MIME::Base64 cpan/MIME-Base64/lib/MIME/Base64.pm 18e38d197c7c83f96b24f48bef514e93908e6a82
-Pod::Perldoc cpan/Pod-Perldoc/lib/Pod/Perldoc.pm 582be34c077c9ff44d99914724a0cc2140bcd48c
+Pod::Perldoc cpan/Pod-Perldoc/lib/Pod/Perldoc.pm d97aa26b722e6e3120b19ee0d7cf9af04dfdfb7f
Test::Harness cpan/Test-Harness/t/harness.t 38b13cfc479d37d91c104b97dd364a74dfde0f2f
Time::Piece cpan/Time-Piece/Piece.pm 8cec8b66183ceddb9bf2b6af35dcdd345bc9adfa
Time::Piece cpan/Time-Piece/Piece.xs 543152540ee17788a638b2c5746b86c3d04401d1
@@ -22,3 +22,4 @@ Win32API::File cpan/Win32API-File/File.pm 8fd212857f821cb26648878b96e57f13bf21b9
Win32API::File cpan/Win32API-File/File.xs beb870fed4490d2faa547b4a8576b8d64d1d27c5
version cpan/version/lib/version.pm a963b513cf812bd7f4d28b3422efd9904e70a34c
version cpan/version/t/07locale.t b1cceee71544ce6b6c926d06656a52aabbfe8abf
+version vutil.c 8f1e65848649b125b6e2d3a91d54f5e147d12e41
diff --git a/gnu/usr.bin/perl/t/porting/dual-life.t b/gnu/usr.bin/perl/t/porting/dual-life.t
index 83e48677f40..6babbe56702 100644
--- a/gnu/usr.bin/perl/t/porting/dual-life.t
+++ b/gnu/usr.bin/perl/t/porting/dual-life.t
@@ -24,6 +24,12 @@ use File::Spec::Functions;
# Exceptions that are found in dual-life bin dirs but aren't
# installed by default; some occur only during testing:
my $not_installed = qr{^(?:
+ \.\./cpan/Archive-Tar/bin/ptar.*
+ |
+ \.\./cpan/JSON-PP/bin/json_pp
+ |
+ \.\./cpan/IO-Compress/bin/zipdetails
+ |
\.\./cpan/Encode/bin/u(?:cm(?:2table|lint|sort)|nidump)
|
\.\./cpan/Module-(?:Metadata|Build)
diff --git a/gnu/usr.bin/perl/t/porting/exec-bit.t b/gnu/usr.bin/perl/t/porting/exec-bit.t
index 3e80f844797..2dd2a662b57 100644
--- a/gnu/usr.bin/perl/t/porting/exec-bit.t
+++ b/gnu/usr.bin/perl/t/porting/exec-bit.t
@@ -30,6 +30,10 @@ if ( $^O eq "vos" ) {
skip_all( "VOS combines the read and execute permission bits." );
}
+if ( $^O eq "openbsd" ) {
+ skip_all( "OpenBSD CVS src tree execute permission bits do not match Perl distribution." );
+}
+
if ( $Config{usecrosscompile} ) {
skip_all( "Not all files are available during cross-compilation" );
}
diff --git a/gnu/usr.bin/perl/t/re/speed.t b/gnu/usr.bin/perl/t/re/speed.t
index bc03fd3b64e..6df78b5da70 100644
--- a/gnu/usr.bin/perl/t/re/speed.t
+++ b/gnu/usr.bin/perl/t/re/speed.t
@@ -42,7 +42,7 @@ run_tests() unless caller;
sub run_tests {
- watchdog((($::running_as_thread && $::running_as_thread) ? 150 : 225));
+ watchdog((($::running_as_thread && $::running_as_thread) ? 150 : 540));
{
# [perl #120446]
diff --git a/gnu/usr.bin/perl/utf8.h b/gnu/usr.bin/perl/utf8.h
index 3256cf649a8..eba18d9cfd9 100644
--- a/gnu/usr.bin/perl/utf8.h
+++ b/gnu/usr.bin/perl/utf8.h
@@ -408,7 +408,12 @@ C<cp> is Unicode if above 255; otherwise is platform-native.
=cut
*/
+#if defined(__m88k__)
+/* XXX workaround: m88k gcc3 produces wrong code with NATIVE_TO_UNI() */
+#define UVCHR_IS_INVARIANT(cp) (OFFUNI_IS_INVARIANT(cp))
+#else /* the original one */
#define UVCHR_IS_INVARIANT(cp) (OFFUNI_IS_INVARIANT(NATIVE_TO_UNI(cp)))
+#endif
/* This defines the 1-bits that are to be in the first byte of a multi-byte
* UTF-8 encoded character that mark it as a start byte and give the number of
diff --git a/gnu/usr.bin/perl/util.c b/gnu/usr.bin/perl/util.c
index 3c1cae409af..e208ce547be 100644
--- a/gnu/usr.bin/perl/util.c
+++ b/gnu/usr.bin/perl/util.c
@@ -4628,6 +4628,9 @@ PERL_STATIC_INLINE U32 S_ptr_hash(PTRV u) {
U32
Perl_seed(pTHX)
{
+#if defined(__OpenBSD__)
+ return arc4random();
+#else
/*
* This is really just a quick hack which grabs various garbage
* values. It really should be a real hash algorithm which
@@ -4697,6 +4700,7 @@ Perl_seed(pTHX)
u += SEED_C5 * ptr_hash(ptruv);
#endif
return u;
+#endif
}
void
diff --git a/gnu/usr.bin/perl/utils.lst b/gnu/usr.bin/perl/utils.lst
index 4856fdae391..268ae6d74f5 100644
--- a/gnu/usr.bin/perl/utils.lst
+++ b/gnu/usr.bin/perl/utils.lst
@@ -9,20 +9,14 @@ utils/encguess
utils/h2ph
utils/h2xs
utils/instmodsh
-utils/json_pp
utils/libnetcfg
-utils/perlbug # link = utils/perlthanks
+utils/perlbug
utils/perldoc
utils/perlivp
utils/piconv
utils/pl2pm
utils/pod2html
utils/prove
-utils/ptar
-utils/ptardiff
-utils/ptargrep
-utils/shasum
utils/splain
utils/streamzip
utils/xsubpp
-utils/zipdetails
diff --git a/gnu/usr.bin/perl/utils/Makefile.PL b/gnu/usr.bin/perl/utils/Makefile.PL
index 3bf9546e594..1cc943a2355 100644
--- a/gnu/usr.bin/perl/utils/Makefile.PL
+++ b/gnu/usr.bin/perl/utils/Makefile.PL
@@ -35,9 +35,9 @@ print $fh <<'EOT';
# Files to be built with variable substitution after miniperl is
# available. Dependencies handled manually below (for now).
-pl = corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL json_pp.PL perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL ptar.PL ptardiff.PL ptargrep.PL shasum.PL splain.PL libnetcfg.PL piconv.PL enc2xs.PL encguess.PL xsubpp.PL pod2html.PL zipdetails.PL streamzip.PL
-plextract = corelist cpan h2ph h2xs instmodsh json_pp perlbug perldoc perlivp pl2pm prove ptar ptardiff ptargrep shasum splain libnetcfg piconv enc2xs encguess xsubpp pod2html zipdetails streamzip
-plextractexe = ./corelist ./cpan ./h2ph ./h2xs ./json_pp ./instmodsh ./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./ptar ./ptardiff ./ptargrep ./shasum ./splain ./libnetcfg ./piconv ./enc2xs ./encguess ./xsubpp ./pod2html ./zipdetails ./streamzip
+pl = corelist.PL cpan.PL h2ph.PL h2xs.PL instmodsh.PL perlbug.PL perldoc.PL perlivp.PL pl2pm.PL prove.PL splain.PL libnetcfg.PL piconv.PL enc2xs.PL encguess.PL xsubpp.PL pod2html.PL zipdetails.PL streamzip.PL
+plextract = corelist cpan h2ph h2xs instmodsh perlbug perldoc perlivp pl2pm prove splain libnetcfg piconv enc2xs encguess xsubpp pod2html zipdetails streamzip
+plextractexe = ./corelist ./cpan ./h2ph ./h2xs ./instmodsh ./perlbug ./perldoc ./perlivp ./pl2pm ./prove ./splain ./libnetcfg ./piconv ./enc2xs ./encguess xsubpp.PL ./pod2html ./zipdetails ./streamzip
all: $(plextract)
@@ -54,8 +54,6 @@ h2xs: h2xs.PL ../config.sh
instmodsh: instmodsh.PL ../config.sh
-json_pp: json_pp.PL ../config.sh
-
perlbug: perlbug.PL ../config.sh ../patchlevel.h
perldoc: perldoc.PL ../config.sh
@@ -64,16 +62,8 @@ perlivp: perlivp.PL ../config.sh
prove: prove.PL ../config.sh
-ptar: ptar.PL ../config.sh
-
-ptardiff: ptardiff.PL ../config.sh
-
-ptargrep: ptargrep.PL ../config.sh
-
pl2pm: pl2pm.PL ../config.sh
-shasum: shasum.PL ../config.sh
-
splain: splain.PL ../config.sh ../lib/diagnostics.pm
libnetcfg: libnetcfg.PL ../config.sh
@@ -86,8 +76,6 @@ enc2xs: encguess.PL ../config.sh
xsubpp: xsubpp.PL ../config.sh
-zipdetails: zipdetails.PL ../config.sh
-
streamzip: streamzip.PL ../config.sh
pod2html: pod2html.PL ../config.sh ../ext/Pod-Html/bin/pod2html
diff --git a/gnu/usr.bin/perl/utils/h2ph.PL b/gnu/usr.bin/perl/utils/h2ph.PL
index afa53c2dbab..e4603dd8c57 100644
--- a/gnu/usr.bin/perl/utils/h2ph.PL
+++ b/gnu/usr.bin/perl/utils/h2ph.PL
@@ -576,7 +576,7 @@ sub next_line
$in =~ s/\?\?</{/g; # | ??<| {|
$in =~ s/\?\?>/}/g; # | ??>| }|
}
- if ($in =~ /^\#ifdef __LANGUAGE_PASCAL__/) {
+ if ($in =~ s/^\#ifdef __LANGUAGE_PASCAL__//) {
# Tru64 disassembler.h evilness: mixed C and Pascal.
while (<IN>) {
last if /^\#endif/;
@@ -584,8 +584,8 @@ sub next_line
$in = "";
next READ;
}
- if ($in =~ /^extern inline / && # Inlined assembler.
- $^O eq 'linux' && $file =~ m!(?:^|/)asm/[^/]+\.h$!) {
+ # Skip inlined functions in headers
+ if ($in =~ s/^(extern|static) (__inline__|inline) .*[^;]\s*$//) {
while (<IN>) {
last if /^}/;
}
diff --git a/gnu/usr.bin/perl/utils/perlbug.PL b/gnu/usr.bin/perl/utils/perlbug.PL
index 444816099d0..e4e9c55a9ae 100644
--- a/gnu/usr.bin/perl/utils/perlbug.PL
+++ b/gnu/usr.bin/perl/utils/perlbug.PL
@@ -354,13 +354,12 @@ This program provides an easy way to send a thank-you message back to the
authors and maintainers of perl.
If you wish to generate a bug report, please run it without the -T flag
-(or run the program perlbug rather than perlthanks)
EOF
} else {
paraprint <<"EOF";
This program provides an easy way to generate a bug report for the core
perl distribution (along with tests or patches). To send a thank-you
-note to $thanksaddress instead of a bug report, please run 'perlthanks'.
+note to $thanksaddress instead of a bug report, please use the -T flag.
The GitHub issue tracker at https://github.com/Perl/perl5/issues is the
best place to submit your report so it can be tracked and resolved.
@@ -1289,8 +1288,6 @@ S<[ B<-S> ]> S<[ B<-t> ]> S<[ B<-d> ]> S<[ B<-h> ]> S<[ B<-T> ]>
B<perlbug> S<[ B<-v> ]> S<[ B<-r> I<returnaddress> ]>
S<[ B<-ok> | B<-okay> | B<-nok> | B<-nokay> ]>
-B<perlthanks>
-
=head1 DESCRIPTION
@@ -1426,8 +1423,8 @@ by Perl's test suite).
=item Can you use C<perlbug> to submit a thank-you note?
-Yes, you can do this by either using the C<-T> option, or by invoking
-the program as C<perlthanks>. Thank-you notes are good. It makes people
+Yes, you can do this by using the C<-T> option.
+Thank-you notes are good. It makes people
smile.
=back
diff --git a/gnu/usr.bin/perl/vutil.c b/gnu/usr.bin/perl/vutil.c
index ab05c33c575..cb5e1b413c2 100644
--- a/gnu/usr.bin/perl/vutil.c
+++ b/gnu/usr.bin/perl/vutil.c
@@ -609,7 +609,11 @@ VER_NV:
/* may get too much accuracy */
char tbuf[64];
+#ifdef __vax__
+ SV *sv = SvNVX(ver) > 10e37 ? newSV(64) : 0;
+#else
SV *sv = SvNVX(ver) > 10e50 ? newSV(64) : 0;
+#endif
char *buf;
#if PERL_VERSION_GE(5,19,0)
diff --git a/gnu/usr.bin/perl/win32/GNUmakefile b/gnu/usr.bin/perl/win32/GNUmakefile
index b2651abc7dd..d286c82b02e 100644
--- a/gnu/usr.bin/perl/win32/GNUmakefile
+++ b/gnu/usr.bin/perl/win32/GNUmakefile
@@ -1726,6 +1726,7 @@ distclean: realclean
-if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME
-if exist $(LIBDIR)\Module rmdir /s /q $(LIBDIR)\Module
-if exist $(LIBDIR)\Net\FTP rmdir /s /q $(LIBDIR)\Net\FTP
+ -if exist $(LIBDIR)\OpenBSD rmdir /s /q $(LIBDIR)\OpenBSD
-if exist $(LIBDIR)\Params rmdir /s /q $(LIBDIR)\Params
-if exist $(LIBDIR)\Parse rmdir /s /q $(LIBDIR)\Parse
-if exist $(LIBDIR)\Perl rmdir /s /q $(LIBDIR)\Perl
diff --git a/gnu/usr.bin/perl/win32/Makefile b/gnu/usr.bin/perl/win32/Makefile
index 948593223f2..46b1cd0782b 100644
--- a/gnu/usr.bin/perl/win32/Makefile
+++ b/gnu/usr.bin/perl/win32/Makefile
@@ -1251,6 +1251,7 @@ distclean: realclean
-if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME
-if exist $(LIBDIR)\Module rmdir /s /q $(LIBDIR)\Module
-if exist $(LIBDIR)\Net\FTP rmdir /s /q $(LIBDIR)\Net\FTP
+ -if exist $(LIBDIR)\OpenBSD rmdir /s /q $(LIBDIR)\OpenBSD
-if exist $(LIBDIR)\Params rmdir /s /q $(LIBDIR)\Params
-if exist $(LIBDIR)\Parse rmdir /s /q $(LIBDIR)\Parse
-if exist $(LIBDIR)\Perl rmdir /s /q $(LIBDIR)\Perl