summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-09-25 07:13:13 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-09-25 07:13:13 +0000
commit5ff3f7a4e03a6b103d9e628865398e498e9a7968 (patch)
tree5884f57bd4a3baf1ad76e8ab3f81f12aa71a31da
parent46124e9ee58ad41479e5b089638f6c263bbddcb7 (diff)
downloadperl-5ff3f7a4e03a6b103d9e628865398e498e9a7968.tar.gz
big Configure update from Jarkko: sync metaconfig units; d_statblks fix
for Linux; hpux CMA-threads hints; ELF support for FreeBSD; beginnings of full-fledged 64-bit support (including support for: fseeko/ftello, Quad_t aka long long, hpux and irix 64-bits hints, new 64-bit constants in Fcntl) From: Jarkko Hietaniemi <jhi@iki.fi> Date: Fri, 11 Sep 1998 23:56:11 +0300 (EET DST) Message-Id: <199809112056.XAA04720@alpha.hut.fi> Subject: [PATCH] 5.005_51: Configure "Massive Attack" -- From: Jarkko Hietaniemi <jhi@cc.hut.fi> Date: 12 Sep 1998 09:44:25 +0300 Message-ID: <oeeaf45bzjq.fsf@alpha.hut.fi> Subject: Re: [PATCH] 5.005_51: Configure "Massive Attack" p4raw-id: //depot/perl@1889
-rwxr-xr-xConfigure1127
-rw-r--r--MANIFEST1
-rw-r--r--Makefile.SH55
-rw-r--r--config_h.SH463
-rw-r--r--doio.c11
-rw-r--r--embedvar.h2
-rw-r--r--ext/Fcntl/Fcntl.pm4
-rw-r--r--ext/Fcntl/Fcntl.xs24
-rw-r--r--handy.h28
-rw-r--r--hints/dec_osf.sh6
-rw-r--r--hints/freebsd.sh20
-rw-r--r--hints/hpux.sh37
-rw-r--r--hints/irix_6.sh22
-rw-r--r--lib/filetest.pm65
-rw-r--r--objXSUB.h3
-rw-r--r--perl.c3
-rw-r--r--perl.h243
-rw-r--r--perl_exp.SH2
-rw-r--r--perlio.c13
-rw-r--r--perlvars.h3
-rw-r--r--pod/perldiag.pod15
-rw-r--r--pod/perlfunc.pod39
-rw-r--r--pp_sys.c227
-rw-r--r--proto.h4
-rw-r--r--win32/GenCAPI.pl1
-rw-r--r--win32/makedef.pl1
26 files changed, 1875 insertions, 544 deletions
diff --git a/Configure b/Configure
index 9a110524e2..c2ca7012dd 100755
--- a/Configure
+++ b/Configure
@@ -20,8 +20,8 @@
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Tue Jul 7 10:10:21 EDT 1998 [metaconfig 3.0 PL70]
-# (with additional metaconfig patches by doughera@lafayette.edu)
+# Generated on Fri Sep 11 21:59:48 EET DST 1998 [metaconfig 3.0 PL70]
+# (with additional metaconfig patches by jhi@iki.fi)
cat >/tmp/c1$$ <<EOF
ARGGGHHHH!!!!!
@@ -56,33 +56,6 @@ case "$0" in
;;
esac
-: the newline for tr
-if test X"$trnl" = X; then
- case "`echo foo|tr '\n' x 2>/dev/null`" in
- foox)
- trnl='\n'
- ;;
- esac
-fi
-if test X"$trnl" = X; then
- case "`echo foo|tr '\012' x 2>/dev/null`" in
- foox)
- trnl='\012'
- ;;
- esac
-fi
-if test -n "$DJGPP"; then
- trnl='\012'
-fi
-if test X"$trnl" = X; then
- cat <<EOM >&2
-
-$me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
-
-EOM
- exit 1
-fi
-
: Proper separator for the PATH environment variable
p_=:
: On OS/2 this directory should exist if this is not floppy only system :-]
@@ -317,6 +290,7 @@ cppminus=''
cpprun=''
cppstdin=''
d_access=''
+d_accessx=''
d_alarm=''
d_attribut=''
d_bcmp=''
@@ -344,9 +318,12 @@ d_dlsymun=''
d_dosuid=''
d_suidsafe=''
d_dup2=''
+d_eaccess=''
+d_endgrent=''
d_endhent=''
d_endnent=''
d_endpent=''
+d_endpwent=''
d_endsent=''
d_fchmod=''
d_fchown=''
@@ -358,10 +335,13 @@ d_fgetpos=''
d_flexfnam=''
d_flock=''
d_fork=''
+d_fseeko=''
d_fsetpos=''
+d_ftello=''
d_ftime=''
d_gettimeod=''
d_Gconvert=''
+d_getgrent=''
d_getgrps=''
d_gethbyaddr=''
d_gethbyname=''
@@ -386,12 +366,12 @@ d_getprior=''
d_getpbyname=''
d_getpbynumber=''
d_getprotoprotos=''
+d_getpwent=''
d_getsent=''
d_getservprotos=''
d_getsbyname=''
d_getsbyport=''
d_gnulibc=''
-i_arpainet=''
d_htonl=''
d_inetaton=''
d_isascii=''
@@ -448,6 +428,7 @@ d_semget=''
d_semop=''
d_setegid=''
d_seteuid=''
+d_setgrent=''
d_setgrps=''
d_sethent=''
d_setlinebuf=''
@@ -459,6 +440,7 @@ d_setpgrp2=''
d_bsdsetpgrp=''
d_setpgrp=''
d_setprior=''
+d_setpwent=''
d_setregid=''
d_setresgid=''
d_setresuid=''
@@ -533,6 +515,13 @@ d_wait4=''
d_waitpid=''
d_wcstombs=''
d_wctomb=''
+d_dbmclose64=''
+d_dbminit64=''
+d_delete64=''
+d_fetch64=''
+d_firstkey64=''
+d_nextkey64=''
+d_store64=''
dlext=''
cccdlflags=''
ccdlflags=''
@@ -541,11 +530,13 @@ ld=''
lddlflags=''
usedl=''
doublesize=''
+ebcdic=''
fpostype=''
gidtype=''
groupstype=''
h_fcntl=''
h_sysfile=''
+i_arpainet=''
db_hashtype=''
db_prefixtype=''
i_db=''
@@ -560,10 +551,9 @@ i_fcntl=''
i_float=''
i_gdbm=''
d_grpasswd=''
-d_setgrent=''
-d_getgrent=''
-d_endgrent=''
i_grp=''
+d_int64t=''
+i_inttypes=''
i_limits=''
i_locale=''
i_malloc=''
@@ -582,15 +572,13 @@ d_pwexpire=''
d_pwgecos=''
d_pwpasswd=''
d_pwquota=''
-d_setpwent=''
-d_getpwent=''
-d_endpwent=''
i_pwd=''
i_sfio=''
i_stddef=''
i_stdlib=''
i_string=''
strings=''
+i_sysaccess=''
i_sysdir=''
i_sysfile=''
d_voidtty=''
@@ -601,6 +589,7 @@ i_syssockio=''
i_sysndir=''
i_sysparam=''
i_sysresrc=''
+i_syssecrt=''
i_sysselct=''
i_sysstat=''
i_systimes=''
@@ -624,6 +613,22 @@ i_vfork=''
intsize=''
longsize=''
shortsize=''
+d_dirent64s=''
+d_flock64s=''
+d_fstat64=''
+d_ftruncate64=''
+d_ino64t=''
+d_lockf64=''
+d_lseek64=''
+d_lstat64=''
+d_off64t=''
+d_open64=''
+d_opendir64=''
+d_readdir64=''
+d_seekdir64=''
+d_stat64=''
+d_telldir64=''
+d_truncate64=''
libc=''
libperl=''
shrpenv=''
@@ -635,6 +640,7 @@ plibpth=''
xlibpth=''
libs=''
lns=''
+lseeksize=''
lseektype=''
make_set_make=''
d_mymalloc=''
@@ -697,6 +703,7 @@ randbits=''
installscript=''
scriptdir=''
scriptdirexp=''
+selectminbits=''
selecttype=''
sh=''
sig_name=''
@@ -718,8 +725,19 @@ ssizetype=''
startperl=''
startsh=''
stdchar=''
+d_fgetpos64=''
+d_fopen64=''
+d_freopen64=''
+d_fseek64=''
+d_fseeko64=''
+d_fsetpos64=''
+d_ftell64=''
+d_ftello64=''
+d_tmpfile64=''
sysman=''
+trnl=''
uidtype=''
+use64bits=''
nm_opt=''
nm_so_opt=''
runnm=''
@@ -733,7 +751,6 @@ mips_type=''
usrinc=''
defvoidused=''
voidflags=''
-ebcdic=''
CONFIG=''
define='define'
@@ -750,6 +767,35 @@ if test -f /etc/unixtovms.exe; then
eunicefix=/etc/unixtovms.exe
fi
+i_whoami=''
+: change the next line if compiling for Xenix/286 on Xenix/386
+xlibpth='/usr/lib/386 /lib/386'
+
+: Possible local library directories to search.
+loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
+loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
+
+: general looking path for locating libraries
+glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
+glibpth="$glibpth /lib /usr/lib $xlibpth"
+glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
+glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
+
+: Private path used by Configure to find libraries. Its value
+: is prepended to libpth. This variable takes care of special
+: machines, like the mips. Usually, it should be empty.
+plibpth=''
+
+: default library list
+libswanted=''
+: Possible local include directories to search.
+: Set locincpth to "" in a hint file to defeat local include searches.
+locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
+locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
+:
+: no include file wanted by default
+inclwanted=''
+
: list of known cpp symbols, sorted alphabetically
al="AMIX BIT_MSF BSD BSD4_3 BSD_NET2 CMU CRAY DGUX DOLPHIN DPX2"
al="$al GO32 GOULD_PN HP700 I386 I80960 I960 Lynx M68000 M68K MACH"
@@ -761,8 +807,8 @@ al="$al PWB R3000 RES RISC6000 RT Sun386i SVR3 SVR4"
al="$al SYSTYPE_BSD SYSTYPE_SVR4 SYSTYPE_SYSV Tek4132 Tek4300"
al="$al UMAXV USGr4 USGr4_2 UTEK UTS UTek UnicomPBB UnicomPBD Utek"
al="$al VMS Xenix286"
-al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI _POWER"
-al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET"
+al="$al _AIX _AIX32 _AIX370 _AIX41 _AM29000 _COFF _CRAY _CX_UX _EPI"
+al="$al _IBMESA _IBMR2 _M88K _M88KBCS_TARGET _POWER"
al="$al _MIPSEB _MIPSEL _M_COFF _M_I86 _M_I86SM _M_SYS3"
al="$al _M_SYS5 _M_SYSIII _M_SYSV _M_UNIX _M_XENIX _NLS _PGC_ _R3000"
al="$al _SYSTYPE_BSD _SYSTYPE_BSD43 _SYSTYPE_SVR4"
@@ -815,35 +861,6 @@ al="$al tower32_800 tower32_850 tss u370 u3b u3b2 u3b20 u3b200"
al="$al u3b20d u3b5 ultrix unix unixpc unos vax venix vms"
al="$al xenix z8000"
-i_whoami=''
-: change the next line if compiling for Xenix/286 on Xenix/386
-xlibpth='/usr/lib/386 /lib/386'
-
-: Possible local library directories to search.
-loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
-loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
-
-: general looking path for locating libraries
-glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
-glibpth="$glibpth /lib /usr/lib $xlibpth"
-glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
-glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
-
-: Private path used by Configure to find libraries. Its value
-: is prepended to libpth. This variable takes care of special
-: machines, like the mips. Usually, it should be empty.
-plibpth=''
-
-: default library list
-libswanted=''
-: Possible local include directories to search.
-: Set locincpth to "" in a hint file to defeat local include searches.
-locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
-locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
-:
-: no include file wanted by default
-inclwanted=''
-
: Trailing extension. Override this in a hint file, if needed.
_exe=''
: Extra object files, if any, needed on this platform.
@@ -904,7 +921,7 @@ case "$sh" in
$me: Fatal Error: I can't find a Bourne Shell anywhere.
Usually it's in /bin/sh. How did you even get this far?
-Please contact me (Andy Dougherty) at doughera@lafayette.edu and
+Please contact me (Jarkko Hietaniemi) at jhi@iki.fi and
we'll try to straighten this all out.
EOM
exit 1
@@ -1373,7 +1390,7 @@ THIS PACKAGE SEEMS TO BE INCOMPLETE.
You have the option of continuing the configuration process, despite the
distinct possibility that your kit is damaged, by typing 'y'es. If you
do, don't blame me if something goes wrong. I advise you to type 'n'o
-and contact the author (doughera@lafayette.edu).
+and contact the author (jhi@iki.fi).
EOM
echo $n "Continue? [n] $c" >&4
@@ -1396,6 +1413,30 @@ else
fi
rm -f missing x??
+echo " "
+: Find the appropriate value for a newline for tr
+if test -n "$DJGPP"; then
+ trnl='\012'
+fi
+if test X"$trnl" = X; then
+ case "`echo foo|tr '\n' x 2>/dev/null`" in
+ foox) trnl='\n' ;;
+ esac
+fi
+if test X"$trnl" = X; then
+ case "`echo foo|tr '\012' x 2>/dev/null`" in
+ foox) trnl='\012' ;;
+ esac
+fi
+if test X"$trnl" = X; then
+ cat <<EOM >&2
+
+$me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
+
+EOM
+ exit 1
+fi
+
: compute the number of columns on the terminal for proper question formatting
case "$COLUMNS" in
'') COLUMNS='80';;
@@ -1574,7 +1615,7 @@ Much effort has been expended to ensure that this shell script will run on any
Unix system. If despite that it blows up on yours, your best bet is to edit
Configure and run it again. If you can't run Configure for some reason,
you'll have to generate a config.sh file by hand. Whatever problems you
-have, let me (doughera@lafayette.edu) know how I blew it.
+have, let me (jhi@iki.fi) know how I blew it.
This installation script affects things in two ways:
@@ -1841,14 +1882,14 @@ ABYZ)
*C9D1*|*c9d1*)
echo "Hey, this might be EBCDIC." >&4
if test "X$up" = X -o "X$low" = X; then
- case "`echo IJ | tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
+ case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
ij) up='[A-IJ-RS-Z]'
low='[a-ij-rs-z]'
;;
esac
fi
if test "X$up" = X -o "X$low" = X; then
- case "`echo IJ | tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
+ case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
ij) up='A-IJ-RS-Z'
low='a-ij-rs-z'
;;
@@ -1941,7 +1982,7 @@ EOM
(cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
dflt=''
: Half the following guesses are probably wrong... If you have better
- : tests or hints, please send them to doughera@lafayette.edu
+ : tests or hints, please send them to jhi@iki.fi
: The metaconfig authors would also appreciate a copy...
$test -f /irix && osname=irix
$test -f /xenix && osname=sco_xenix
@@ -3986,10 +4027,21 @@ rmlist="$rmlist pdp11"
: coherency check
echo " "
echo "Checking your choice of C compiler and flags for coherency..." >&4
+$cat > try.c <<'EOF'
+#include <stdio.h>
+main() { printf("Ok\n"); exit(0); }
+EOF
set X $cc $optimize $ccflags -o try $ldflags try.c $libs
shift
-$cat >try.msg <<EOM
-I've tried to compile and run a simple program with:
+$cat >try.msg <<'EOM'
+I've tried to compile and run the following simple program:
+
+EOM
+$cat try.c
+
+$cat >> try.msg <<EOM
+
+I used the command:
$*
./try
@@ -3997,10 +4049,6 @@ I've tried to compile and run a simple program with:
and I got the following output:
EOM
-$cat > try.c <<'EOF'
-#include <stdio.h>
-main() { printf("Ok\n"); exit(0); }
-EOF
dflt=y
if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
if sh -c './try' >>try.msg 2>&1; then
@@ -4037,7 +4085,7 @@ y)
$cat try.msg >&4
case "$knowitall" in
'')
- echo "(The supplied flags might be incorrect with this C compiler.)"
+ echo "(The supplied flags or libraries might be incorrect.)"
;;
*) dflt=n;;
esac
@@ -4155,9 +4203,8 @@ eval $inhdr
: determine which malloc to compile in
echo " "
case "$usemymalloc" in
-''|y*|true) dflt='y' ;;
-n*|false) dflt='n' ;;
-*) dflt="$usemymalloc" ;;
+''|[yY]*|true|$define) dflt='y' ;;
+*) dflt='n' ;;
esac
rp="Do you wish to attempt to use the malloc that comes with $package?"
. ./myread
@@ -4259,7 +4306,7 @@ understands function prototypes. Unfortunately, your C compiler
$cc $ccflags
doesn't seem to understand them. Sorry about that.
-If GNU cc is avaiable for your system, perhaps you could try that instead.
+If GNU cc is available for your system, perhaps you could try that instead.
Eventually, we hope to support building Perl with pre-ANSI compilers.
If you would like to help in that effort, please contact <perlbug@perl.org>.
@@ -4314,32 +4361,6 @@ shift;
$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
echo " "
-echo "Determining whether or not we are on an EBCDIC system..." >&4
-cat >tebcdic.c <<EOM
-int main()
-{
- if ('M'==0xd4) return 0;
- return 1;
-}
-EOM
-val=$undef
-set tebcdic
-if eval $compile_ok; then
- if ./tebcdic; then
- echo "You have EBCDIC." >&4
- val="$define"
- else
- echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
- fi
-else
- echo "I'm unable to compile the test program." >&4
- echo "I'll asuume ASCII or some ISO Latin." >&4
-fi
-$rm -f tebcdic.c tebcdic
-set ebcdic
-eval $setvar
-
-echo " "
echo "Checking for GNU C Library..." >&4
cat >gnulibc.c <<EOM
#include <stdio.h>
@@ -5153,7 +5174,7 @@ case "$shrpdir" in
*) $cat >&4 <<EOM
WARNING: Use of the shrpdir variable for the installation location of
the shared $libperl is not supported. It was never documented and
-will not work in this version. Let me (doughera@lafayette.edu)
+will not work in this version. Let me (jhi@iki.fi)
know of any problems this may cause.
EOM
@@ -5980,6 +6001,30 @@ fi
cat <<EOM
+Perl can be built to take advantage of 64-bit interfaces, on some systems.
+To do so, Configure must be run with -Dusethreads.
+
+If this doesn't make any sense to you, just accept the default 'n'.
+EOM
+case "$use64bits" in
+$define|true|[yY]*) dflt='y';;
+*) dflt='n';;
+esac
+rp='Try to use 64-bit APIs, if available?'
+. ./myread
+case "$ans" in
+y|Y)
+ val="$define"
+ ;;
+*)
+ val="$undef"
+ ;;
+esac
+set use64bits
+eval $setvar
+
+cat <<EOM
+
Previous version of $package used the standard IO mechanisms as defined
in <stdio.h>. Versions 5.003_02 and later of perl allow alternate IO
mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
@@ -6010,9 +6055,9 @@ eval $setvar
: Check how to convert floats to strings.
if test "X$d_Gconvert" = X; then
- echo " "
- echo "Checking for an efficient way to convert floats to strings."
- $cat >try.c <<'EOP'
+ echo " "
+ echo "Checking for an efficient way to convert floats to strings."
+ $cat >try.c <<'EOP'
#ifdef TRY_gconvert
#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
char *myname = "gconvert";
@@ -6071,35 +6116,35 @@ main()
exit(0);
}
EOP
- case "$d_Gconvert" in
- gconvert*) xxx_list='gconvert gcvt sprintf' ;;
- gcvt*) xxx_list='gcvt gconvert sprintf' ;;
- sprintf*) xxx_list='sprintf gconvert gcvt' ;;
- *) xxx_list='gconvert gcvt sprintf' ;;
- esac
+ case "$d_Gconvert" in
+ gconvert*) xxx_list='gconvert gcvt sprintf' ;;
+ gcvt*) xxx_list='gcvt gconvert sprintf' ;;
+ sprintf*) xxx_list='sprintf gconvert gcvt' ;;
+ *) xxx_list='gconvert gcvt sprintf' ;;
+ esac
- for xxx_convert in $xxx_list; do
- echo "Trying $xxx_convert"
- $rm -f try try$_o
- set try -DTRY_$xxx_convert
- if eval $compile; then
- echo "$xxx_convert" found. >&4
- if ./try; then
- echo "I'll use $xxx_convert to convert floats into a string." >&4
- break;
+ for xxx_convert in $xxx_list; do
+ echo "Trying $xxx_convert"
+ $rm -f try try$_o
+ set try -DTRY_$xxx_convert
+ if eval $compile; then
+ echo "$xxx_convert" found. >&4
+ if ./try; then
+ echo "I'll use $xxx_convert to convert floats into a string." >&4
+ break;
+ else
+ echo "...But $xxx_convert didn't work as I expected."
+ fi
else
- echo "...But $xxx_convert didn't work as I expected."
+ echo "$xxx_convert NOT found." >&4
fi
- else
- echo "$xxx_convert NOT found." >&4
- fi
- done
+ done
- case "$xxx_convert" in
- gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
- gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
- *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
- esac
+ case "$xxx_convert" in
+ gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
+ gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
+ *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
+ esac
fi
: Initialize h_fcntl
@@ -6150,6 +6195,10 @@ EOCP
esac
$rm -f access*
+: see if accessx exists
+set accessx d_accessx
+eval $inlibc
+
: see if alarm exists
set alarm d_alarm
eval $inlibc
@@ -6705,10 +6754,52 @@ $rm -f dbl_dig.?
set d_dbl_dig
eval $setvar
+
+if $test X"$use64bits" = X"$define"; then
+ : see if dbminit64 exists
+ set dbminit64 d_dbminit64
+ eval $inlibc
+
+ : see if dbmclose64 exists
+ set dbmclose64 d_dbmclose64
+ eval $inlibc
+
+ : see if fetch64 exists
+ set fetch64 d_fetch64
+ eval $inlibc
+
+ : see if store64 exists
+ set store64 d_store64
+ eval $inlibc
+
+ : see if delete64 exists
+ set delete64 d_delete64
+ eval $inlibc
+
+ : see if firstkey64 exists
+ set firstkey64 d_firstkey64
+ eval $inlibc
+
+ : see if nextkey64 exists
+ set nextkey64 d_nextkey64
+ eval $inlibc
+else
+ val="$undef"
+ for xxx in d_dbminit64 d_dbmclose64 d_fetch64 d_store64 d_delete64 d_firstkey64 d_nextkey64
+ do
+ set $xxx
+ eval $setvar
+ done
+fi
+
: see if difftime exists
set difftime d_difftime
eval $inlibc
+: see if sys/stat.h is available
+set sys/stat.h i_sysstat
+eval $inhdr
+
: see if this is a dirent system
echo " "
if xinc=`./findhdr dirent.h`; $test "$xinc"; then
@@ -6777,6 +6868,139 @@ set d_dirnamlen
eval $setvar
$rm -f try.c
+hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
+while $test $# -ge 2; do
+ case "$1" in
+ $define) echo "#include <$2>";;
+ esac ;
+ shift 2;
+done > try.c;
+echo "int main () { struct $struct foo; foo.$field = 0; }" >> try.c;
+set try;
+if eval $cc $optimize $ccflags -c try.c; then
+ echo "Your struct $struct has field $field."; >&4
+ val="$define";
+else
+ echo "Your struct $struct does not have field $field."; >&4
+ val="$undef";
+fi;
+set $varname;
+eval $setvar;
+$rm -f try.c try'
+
+
+if $test X"$use64bits" = X"$define"; then
+ : see if fstat64 exists
+ set fstat64 d_fstat64
+ eval $inlibc
+
+ : see if ftruncate64 exists
+ set ftruncate64 d_ftruncate64
+ eval $inlibc
+
+ : see if lockf64 exists
+ set lockf64 d_lockf64
+ eval $inlibc
+
+ : see if lseek64 exists
+ set lseek64 d_lseek64
+ eval $inlibc
+
+ : see if lstat64 exists
+ set lstat64 d_lstat64
+ eval $inlibc
+
+ : see if open64 exists
+ set open64 d_open64
+ eval $inlibc
+
+ : see if opendir64 exists
+ set opendir64 d_opendir64
+ eval $inlibc
+
+ : see if readdir64 exists
+ set readdir64 d_readdir64
+ eval $inlibc
+
+ : see if seekdir64 exists
+ set seekdir64 d_seekdir64
+ eval $inlibc
+
+ : see if stat64 exists
+ set stat64 d_stat64
+ eval $inlibc
+
+ : see if telldir64 exists
+ set telldir64 d_telldir64
+ eval $inlibc
+
+ : see if truncate64 exists
+ set truncate64 d_truncate64
+ eval $inlibc
+
+ : check for off64_t
+ echo " "
+ echo $n "Checking to see if your system supports off64_t...$c" >&4
+ $cat >try.c <<EOCP
+#include <sys/types.h>
+off64_t foo() { off64_t x; x = 7; return x; }'
+EOCP
+ if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+ val="$define"
+ echo " Yup, it does." >&4
+ else
+ val="$undef"
+ echo " Nope, it doesn't." >&4
+ fi
+ $rm -f try.*
+ set d_off64t
+ eval $setvar
+
+ : check for ino64_t
+ echo " "
+ echo $n "Checking to see if your system supports ino64_t...$c" >&4
+ val="$undef"
+ case "$i_sysstat" in
+ "$define" )
+ $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <sys/stat.h>
+ino64_t foo() { ino64_t x; x = 7; return x; }'
+EOCP
+ if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+ val="$define"
+ fi
+ $rm -f try.*
+ ;;
+ esac
+ if $test "X$val" = X"$define"; then
+ echo " Yup, it does." >&4
+ else
+ echo " Nope, it doesn't." >&4
+ fi
+ set d_ino64t
+ eval $setvar
+
+ : check for struct flock64
+ echo " "
+ if $h_fcntl; then
+ set d_flock64s flock64 l_len define fcntl.h
+ eval $hasfield
+ fi
+
+ : check for struct dirent64
+ echo " "
+ set d_dirent64s dirent64 d_off $i_dirent dirent.h
+ eval $hasfield
+else
+ val="$undef"
+ for xxx in d_fstat64 d_ftruncate64 d_lockf64 d_lseek64 d_lstat64 d_open64 d_opendir64 d_readdir64 d_seekdir64 d_stat64 d_telldir64 d_truncate64 d_off64t d_ino64t d_flock64s d_dirent64s
+ do
+ set $xxx
+ eval $setvar
+ done
+fi
+
: see if dlerror exists
xxx_runnm="$runnm"
runnm=false
@@ -6897,6 +7121,14 @@ eval $setvar
set dup2 d_dup2
eval $inlibc
+: see if eaccess exists
+set eaccess d_eaccess
+eval $inlibc
+
+: see if endgrent exists
+set endgrent d_endgrent
+eval $inlibc
+
: see if endhostent exists
set endhostent d_endhent
eval $inlibc
@@ -6909,6 +7141,10 @@ eval $inlibc
set endprotoent d_endpent
eval $inlibc
+: see if endpwent exists
+set endpwent d_endpwent
+eval $inlibc
+
: see if endservent exists
set endservent d_endsent
eval $inlibc
@@ -7156,6 +7392,52 @@ eval $inlibc
set fgetpos d_fgetpos
eval $inlibc
+
+if $test X"$use64bits" = X"$define"; then
+ : see if fgetpos64 exists
+ set fgetpos64 d_fgetpos64
+ eval $inlibc
+
+ : see if fopen64 exists
+ set freopen64 d_fopen64
+ eval $inlibc
+
+ : see if freopen64 exists
+ set freopen64 d_freopen64
+ eval $inlibc
+
+ : see if fseek64 exists
+ set fseek64 d_fseek64
+ eval $inlibc
+
+ : see if fseeko64 exists
+ set fseeko64 d_fseeko64
+ eval $inlibc
+
+ : see if fsetpos64 exists
+ set fsetpos64 d_fsetpos64
+ eval $inlibc
+
+ : see if ftell64 exists
+ set ftell64 d_ftell64
+ eval $inlibc
+
+ : see if ftello64 exists
+ set ftello64 d_ftello64
+ eval $inlibc
+
+ : see if tmpfile64 exists
+ set tmpfile64 d_tmpfile64
+ eval $inlibc
+else
+ val="$undef"
+ for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
+ do
+ set $xxx
+ eval $setvar
+ done
+fi
+
: see if flock exists
set flock d_flock
eval $inlibc
@@ -7172,10 +7454,22 @@ eval $inlibc
set fpathconf d_fpathconf
eval $inlibc
+: see if fseeko exists
+set fseeko d_fseeko
+eval $inlibc
+
: see if fsetpos exists
set fsetpos d_fsetpos
eval $inlibc
+: see if ftello exists
+set ftello d_ftello
+eval $inlibc
+
+: see if getgrent exists
+set getgrent d_getgrent
+eval $inlibc
+
: see if gethostbyaddr exists
set gethostbyaddr d_gethbyaddr
eval $inlibc
@@ -7271,6 +7565,11 @@ echo " "
set d_getprotoprotos getprotoent $i_netdb netdb.h
eval $hasproto
+: see if getpwent exists
+set getpwent d_getpwent
+eval $inlibc
+
+
: see if getservbyname exists
set getservbyname d_getsbyname
eval $inlibc
@@ -7307,11 +7606,36 @@ case "$d_gettimeod$d_ftime" in
;;
esac
+: see if this is an grp system
+set grp.h i_grp
+eval $inhdr
+
+case "$i_grp" in
+$define)
+ xxx=`./findhdr grp.h`
+ $cppstdin $cppflags $cppminus < $xxx >$$.h
+
+ if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
+ val="$define"
+ else
+ val="$undef"
+ fi
+ set d_grpasswd
+ eval $setvar
+
+ $rm -f $$.h
+ ;;
+*)
+ val="$undef";
+ set d_grpasswd; eval $setvar
+ ;;
+esac
+
: see if this is a netinet/in.h or sys/in.h system
set netinet/in.h i_niin sys/in.h i_sysin
eval $inhdr
-: see if this is an arpa/inet.h
+: see if arpa/inet.h has to be included
set arpa/inet.h i_arpainet
eval $inhdr
@@ -7412,6 +7736,32 @@ set d_index; eval $setvar
set inet_aton d_inetaton
eval $inlibc
+: see if inttypes.h is available
+set inttypes.h i_inttypes
+eval $inhdr
+: check for int64_t
+echo " "
+echo $n "Checking to see if your system supports int64_t...$c" >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#$i_inttypes I_INTTYPES
+#ifdef I_INTTYPES
+#include <inttypes.h>
+#endif
+int64_t foo() { int64_t x; x = 7; return x; }'
+EOCP
+if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+ val="$define"
+ echo " Yup, it does." >&4
+else
+ val="$undef"
+ echo " Nope, it doesn't." >&4
+fi
+$rm -f try.*
+set d_int64t
+eval $setvar
+
+
: Look for isascii
echo " "
$cat >isascii.c <<'EOCP'
@@ -7641,7 +7991,7 @@ case "$osname" in
freebsd)
case "`ipcs 2>&1`" in
"SVID messages"*"not configured"*)
- echo "But your FreeBSD kernel does not have the msg*(2) configured." >&4
+ echo "Your $osname does not have the msg*(2) configured." >&4
h_msg=false
val="$undef"
set msgctl d_msgctl
@@ -7765,18 +8115,6 @@ eval $inhdr
case "$i_pwd" in
$define)
- : see if setpwent exists
- set setpwent d_setpwent
- eval $inlibc
-
- : see if getpwent exists
- set getpwent d_getpwent
- eval $inlibc
-
- : see if endpwent exists
- set endpwent d_endpwent
- eval $inlibc
-
xxx=`./findhdr pwd.h`
$cppstdin $cppflags $cppminus < $xxx >$$.h
@@ -7846,11 +8184,8 @@ $define)
$rm -f $$.h
;;
-*) # Assume all is lost as far as the d_*pw* go.
+*)
val="$undef";
- set d_setpwent; eval $setvar
- set d_getpwent; eval $setvar
- set d_endpwent; eval $setvar
set d_pwquota; eval $setvar
set d_pwage; eval $setvar
set d_pwchange; eval $setvar
@@ -8142,7 +8477,7 @@ case "$osname" in
freebsd)
case "`ipcs 2>&1`" in
"SVID messages"*"not configured"*)
- echo "But your FreeBSD kernel does not have the sem*(2) configured." >&4
+ echo "Your $osname does not have the sem*(2) configured." >&4
h_sem=false
val="$undef"
set semctl d_semctl
@@ -8333,6 +8668,10 @@ eval $inlibc
set seteuid d_seteuid
eval $inlibc
+: see if setgrent exists
+set setgrent d_setgrent
+eval $inlibc
+
: see if sethostent exists
set sethostent d_sethent
eval $inlibc
@@ -8365,6 +8704,10 @@ eval $inlibc
set setpriority d_setprior
eval $inlibc
+: see if setpwent exists
+set setpwent d_setpwent
+eval $inlibc
+
: see if setregid exists
set setregid d_setregid
eval $inlibc
@@ -8505,7 +8848,7 @@ case "$osname" in
freebsd)
case "`ipcs 2>&1`" in
"SVID shared memory"*"not configured"*)
- echo "But your FreeBSD kernel does not have the shm*(2) configured." >&4
+ echo "Your $osname does not have the shm*(2) configured." >&4
h_shm=false
val="$undef"
set shmctl d_shmctl
@@ -8658,21 +9001,8 @@ eval $inlibc
: see if stat knows about block sizes
echo " "
-xxx=`./findhdr sys/stat.h`
-if $contains 'st_blocks;' "$xxx" >/dev/null 2>&1 ; then
- if $contains 'st_blksize;' "$xxx" >/dev/null 2>&1 ; then
- echo "Your stat() knows about block sizes." >&4
- val="$define"
- else
- echo "Your stat() doesn't know about block sizes." >&4
- val="$undef"
- fi
-else
- echo "Your stat() doesn't know about block sizes." >&4
- val="$undef"
-fi
-set d_statblks
-eval $setvar
+set d_statblks stat st_blocks $i_sysstat sys/stat.h
+eval $hasfield
: see if _ptr and _cnt from stdio act std
echo " "
@@ -8833,38 +9163,38 @@ $rm -f try.*
echo " "
if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
if set strerror val -f d_strerror; eval $csym; $val; then
- echo 'strerror() found.' >&4
- d_strerror="$define"
- d_strerrm='strerror(e)'
- if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
- echo "(You also have sys_errlist[], so we could roll our own strerror.)"
- d_syserrlst="$define"
- else
- echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
- d_syserrlst="$undef"
- fi
+ echo 'strerror() found.' >&4
+ d_strerror="$define"
+ d_strerrm='strerror(e)'
+ if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
+ echo "(You also have sys_errlist[], so we could roll our own strerror.)"
+ d_syserrlst="$define"
+ else
+ echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
+ d_syserrlst="$undef"
+ fi
elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
- $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
- echo 'strerror() found in string header.' >&4
- d_strerror="$define"
- d_strerrm='strerror(e)'
- if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
- echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
- d_syserrlst="$define"
- else
- echo "(You don't appear to have any sys_errlist[], how can this be?)"
- d_syserrlst="$undef"
- fi
+ $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
+ echo 'strerror() found in string header.' >&4
+ d_strerror="$define"
+ d_strerrm='strerror(e)'
+ if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
+ echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
+ d_syserrlst="$define"
+ else
+ echo "(You don't appear to have any sys_errlist[], how can this be?)"
+ d_syserrlst="$undef"
+ fi
elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
-echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
- d_strerror="$undef"
- d_syserrlst="$define"
- d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
+ echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
+ d_strerror="$undef"
+ d_syserrlst="$define"
+ d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
else
- echo 'strerror() and sys_errlist[] NOT found.' >&4
- d_strerror="$undef"
- d_syserrlst="$undef"
- d_strerrm='"unknown"'
+ echo 'strerror() and sys_errlist[] NOT found.' >&4
+ d_strerror="$undef"
+ d_syserrlst="$undef"
+ d_strerrm='"unknown"'
fi
fi
@@ -9616,6 +9946,33 @@ EOCP
esac
$rm -f try.c try
+echo " "
+echo "Determining whether or not we are on an EBCDIC system..." >&4
+$cat >tebcdic.c <<'EOM'
+int main()
+{
+ if ('M'==0xd4) return 0;
+ return 1;
+}
+EOM
+
+val=$undef
+set tebcdic
+if eval $compile_ok; then
+ if ./tebcdic; then
+ echo "You have EBCDIC." >&4
+ val="$define"
+ else
+ echo "Nope, no EBCDIC. Assuming ASCII or some ISO Latin." >&4
+ fi
+else
+ echo "$me: I'm unable to compile the test program." >&4
+ echo "I'll assume ASCII or some ISO Latin." >&4
+fi
+$rm -f tebcdic.c tebcdic
+set ebcdic
+eval $setvar
+
: see what type file positions are declared as in the library
rp="What is the type for file position used by fsetpos()?"
set fpos_t fpostype long stdio.h sys/types.h
@@ -9695,6 +10052,30 @@ set off_t lseektype long stdio.h sys/types.h
eval $typedef_ask
echo " "
+$echo $n "Checking to see how big your file offsets are...$c" >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+main()
+{
+ printf("%d\n", sizeof($lseektype));
+}
+EOCP
+set try
+if eval $compile_ok; then
+ lseeksize=`./try`
+ $echo " $lseeksize bytes." >&4
+else
+ dflt='4'
+ echo " "
+ echo "(I can't seem to compile the test program. Guessing...)"
+ rp="What is the size of your file offsets (in bytes)?"
+ . ./myread
+ lseeksize="$ans"
+fi
+$rm -f try.c try
+
+echo " "
echo "Checking if your $make program sets \$(MAKE)..." >&4
case "$make_set_make" in
'')
@@ -10054,9 +10435,9 @@ eval $inhdr
: see if we should include time.h, sys/time.h, or both
echo " "
if test "X$timeincl" = X; then
- echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
- $echo $n "I'm now running the test program...$c"
- $cat >try.c <<'EOCP'
+ echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
+ $echo $n "I'm now running the test program...$c"
+ $cat >try.c <<'EOCP'
#include <sys/types.h>
#ifdef I_TIME
#include <time.h>
@@ -10088,51 +10469,51 @@ main()
exit(1);
}
EOCP
- flags=''
- for s_timezone in '-DS_TIMEZONE' ''; do
- sysselect=''
- for s_timeval in '-DS_TIMEVAL' ''; do
- for i_systimek in '' '-DSYSTIMEKERNEL'; do
- for i_time in '' '-DI_TIME'; do
- for i_systime in '-DI_SYSTIME' ''; do
- case "$flags" in
- '') $echo $n ".$c"
- set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
- if eval $compile; then
+ flags=''
+ for s_timezone in '-DS_TIMEZONE' ''; do
+ sysselect=''
+ for s_timeval in '-DS_TIMEVAL' ''; do
+ for i_systimek in '' '-DSYSTIMEKERNEL'; do
+ for i_time in '' '-DI_TIME'; do
+ for i_systime in '-DI_SYSTIME' ''; do
+ case "$flags" in
+ '') $echo $n ".$c"
+ set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
+ if eval $compile; then
set X $i_time $i_systime $i_systimek $sysselect $s_timeval
- shift
- flags="$*"
- echo " "
- $echo $n "Succeeded with $flags$c"
- fi
- ;;
+ shift
+ flags="$*"
+ echo " "
+ $echo $n "Succeeded with $flags$c"
+ fi
+ ;;
+ esac
+ done
+ done
+ done
+ done
+ done
+ timeincl=''
+ echo " "
+ case "$flags" in
+ *SYSTIMEKERNEL*) i_systimek="$define"
+ timeincl=`./findhdr sys/time.h`
+ echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
+ *) i_systimek="$undef";;
esac
- done
- done
- done
- done
- done
- timeincl=''
- echo " "
- case "$flags" in
- *SYSTIMEKERNEL*) i_systimek="$define"
- timeincl=`./findhdr sys/time.h`
- echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
- *) i_systimek="$undef";;
- esac
- case "$flags" in
- *I_TIME*) i_time="$define"
- timeincl=`./findhdr time.h`" $timeincl"
- echo "We'll include <time.h>." >&4;;
- *) i_time="$undef";;
- esac
- case "$flags" in
- *I_SYSTIME*) i_systime="$define"
- timeincl=`./findhdr sys/time.h`" $timeincl"
- echo "We'll include <sys/time.h>." >&4;;
- *) i_systime="$undef";;
- esac
- $rm -f try.c try
+ case "$flags" in
+ *I_TIME*) i_time="$define"
+ timeincl=`./findhdr time.h`" $timeincl"
+ echo "We'll include <time.h>." >&4;;
+ *) i_time="$undef";;
+ esac
+ case "$flags" in
+ *I_SYSTIME*) i_systime="$define"
+ timeincl=`./findhdr sys/time.h`" $timeincl"
+ echo "We'll include <sys/time.h>." >&4;;
+ *) i_systime="$undef";;
+ esac
+ $rm -f try.c try
fi
: check for fd_set items
@@ -10256,6 +10637,89 @@ EOM
;;
esac
+: check for the select 'width'
+case "$selectminbits" in
+'') case "$d_select" in
+ $define)
+ $cat <<EOM
+
+Checking to see how on how many bits at a time your select() operates...
+EOM
+ $cat >try.c <<EOCP
+#include <sys/types.h>
+#$i_time I_TIME
+#$i_systime I_SYS_TIME
+#$i_systimek I_SYS_TIME_KERNEL
+#ifdef I_TIME
+# include <time.h>
+#endif
+#ifdef I_SYS_TIME
+# ifdef I_SYS_TIME_KERNEL
+# define KERNEL
+# endif
+# include <sys/time.h>
+# ifdef I_SYS_TIME_KERNEL
+# undef KERNEL
+# endif
+#endif
+#$i_sysselct I_SYS_SELECT
+#ifdef I_SYS_SELECT
+#include <sys/select.h>
+#endif
+#include <stdio.h>
+#define S sizeof($selecttype)
+#define MINBITS 64
+#define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
+#define NBITS (NBYTES * 8)
+int main() {
+ char s[NBYTES];
+ $selecttype b;
+ struct timeval t;
+ int i;
+ FILE* fp;
+ int fd;
+
+ fclose(stdin);
+ fp = fopen("try.c", "r");
+ if (fp == 0)
+ exit(1);
+ fd = fileno(fp);
+ if (fd < 0)
+ exit(2);
+ b = ($selecttype)s;
+ for (i = 0; i < NBITS; i++)
+ FD_SET(i, b);
+ t.tv_sec = 0;
+ t.tv_usec = 0;
+ select(fd + 1, b, 0, 0, &t);
+ for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
+ printf("%d\n", i + 1);
+ return 0;
+}
+EOCP
+ set try
+ if eval $compile_ok; then
+ selectminbits=`./try`
+ echo "Your select() operates on $selectminbits bits at a time." >&4
+ else
+ rp='What is the minimum number of bits your select() operates on?'
+ case "$byteorder" in
+ 1234|12345678) dflt=32 ;;
+ *) dflt=1 ;;
+ esac
+ . ./myread
+ val=$ans
+ selectminbits="$val"
+ fi
+ $rm -f try.* try
+ ;;
+ *) : no select, so pick a harmless default
+ selectminbits='32'
+ ;;
+ esac
+ ;;
+esac
+
: Trace out the files included by signal.h, then look for SIGxxx names.
: Remove SIGARRAYSIZE used by HPUX.
: Remove SIGTYP void lines used by OS2.
@@ -10550,15 +11014,15 @@ fi
echo " "
if test "X$d_time" = X -o X"$timetype" = X; then
if set time val -f d_time; eval $csym; $val; then
- echo 'time() found.' >&4
- val="$define"
- rp="What is the type returned by time() on this system?"
- set time_t timetype long stdio.h sys/types.h
- eval $typedef_ask
+ echo 'time() found.' >&4
+ val="$define"
+ rp="What is the type returned by time() on this system?"
+ set time_t timetype long stdio.h sys/types.h
+ eval $typedef_ask
else
- echo 'time() not found, hope that will do.' >&4
- val="$undef"
- timetype='int';
+ echo 'time() not found, hope that will do.' >&4
+ val="$undef"
+ timetype='int';
fi
set d_time
eval $setvar
@@ -10671,46 +11135,6 @@ esac
set i_fcntl
eval $setvar
-: see if this is an grp system
-set grp.h i_grp
-eval $inhdr
-
-case "$i_grp" in
-$define)
- : see if setgrent exists
- set setgrent d_setgrent
- eval $inlibc
-
- : see if getgrent exists
- set getgrent d_getgrent
- eval $inlibc
-
- : see if endgrent exists
- set endgrent d_endgrent
- eval $inlibc
-
- xxx=`./findhdr grp.h`
- $cppstdin $cppflags $cppminus < $xxx >$$.h
-
- if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
- val="$define"
- else
- val="$undef"
- fi
- set d_grpasswd
- eval $setvar
-
- $rm -f $$.h
- ;;
-*) # Assume all is lost as far as the d_*gr* go.
- val="$undef";
- set d_setgrent; eval $setvar
- set d_getgrent; eval $setvar
- set d_endgrent; eval $setvar
- set d_grpasswd; eval $setvar
- ;;
-esac
-
: see if locale.h is available
set locale.h i_locale
eval $inhdr
@@ -10836,7 +11260,13 @@ $rm -f try.c
EOS
chmod +x ccsym
$eunicefix ccsym
-./ccsym | $sort | $uniq >ccsym.raw
+./ccsym > ccsym1.raw
+if $test -s ccsym1.raw; then
+ $sort ccsym1.raw | $uniq >ccsym.raw
+else
+ mv ccsym1.raw ccsym.raw
+fi
+
$awk '/\=/ { print $0; next }
{ print $0"=1" }' ccsym.raw >ccsym.list
$awk '{ print $0"=1" }' Cppsym.true >ccsym.true
@@ -11032,6 +11462,10 @@ $rm -f varargs*
set stddef.h i_stddef
eval $inhdr
+: see if sys/access.h is available
+set sysaccess.h i_sysaccess
+eval $inhdr
+
: see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
set sys/filio.h i_sysfilio
eval $inhdr
@@ -11061,8 +11495,8 @@ eval $inhdr
set sys/resource.h i_sysresrc
eval $inhdr
-: see if sys/stat.h is available
-set sys/stat.h i_sysstat
+: see if sys/security.h is available
+set syssecrt.h i_syssecrt
eval $inhdr
: see if this is a sys/un.h system
@@ -11201,6 +11635,7 @@ for xxx in $known_extensions ; do
esac
;;
IPC/SysV|ipc/sysv)
+ : XXX Do we need a useipcsysv variable here
case "${d_msg}${d_sem}${d_shm}" in
*"${define}"*) avail_ext="$avail_ext $xxx" ;;
esac
@@ -11470,6 +11905,7 @@ cryptlib='$cryptlib'
csh='$csh'
d_Gconvert='$d_Gconvert'
d_access='$d_access'
+d_accessx='$d_accessx'
d_alarm='$d_alarm'
d_archlib='$d_archlib'
d_attribut='$d_attribut'
@@ -11491,13 +11927,18 @@ d_crypt='$d_crypt'
d_csh='$d_csh'
d_cuserid='$d_cuserid'
d_dbl_dig='$d_dbl_dig'
+d_dbmclose64='$d_dbmclose64'
+d_dbminit64='$d_dbminit64'
+d_delete64='$d_delete64'
d_difftime='$d_difftime'
+d_dirent64s='$d_dirent64s'
d_dirnamlen='$d_dirnamlen'
d_dlerror='$d_dlerror'
d_dlopen='$d_dlopen'
d_dlsymun='$d_dlsymun'
d_dosuid='$d_dosuid'
d_dup2='$d_dup2'
+d_eaccess='$d_eaccess'
d_endgrent='$d_endgrent'
d_endhent='$d_endhent'
d_endnent='$d_endnent'
@@ -11512,13 +11953,28 @@ d_fcntl='$d_fcntl'
d_fd_macros='$d_fd_macros'
d_fd_set='$d_fd_set'
d_fds_bits='$d_fds_bits'
+d_fetch64='$d_fetch64'
+d_fgetpos64='$d_fgetpos64'
d_fgetpos='$d_fgetpos'
+d_firstkey64='$d_firstkey64'
d_flexfnam='$d_flexfnam'
+d_flock64s='$d_flock64s'
d_flock='$d_flock'
+d_fopen64='$d_fopen64'
d_fork='$d_fork'
d_fpathconf='$d_fpathconf'
+d_freopen64='$d_freopen64'
+d_fseek64='$d_fseek64'
+d_fseeko64='$d_fseeko64'
+d_fseeko='$d_fseeko'
+d_fsetpos64='$d_fsetpos64'
d_fsetpos='$d_fsetpos'
+d_fstat64='$d_fstat64'
+d_ftell64='$d_ftell64'
+d_ftello64='$d_ftello64'
+d_ftello='$d_ftello'
d_ftime='$d_ftime'
+d_ftruncate64='$d_ftruncate64'
d_getgrent='$d_getgrent'
d_getgrps='$d_getgrps'
d_gethbyaddr='$d_gethbyaddr'
@@ -11551,14 +12007,19 @@ d_grpasswd='$d_grpasswd'
d_htonl='$d_htonl'
d_index='$d_index'
d_inetaton='$d_inetaton'
+d_ino64t='$d_ino64t'
+d_int64t='$d_int64t'
d_isascii='$d_isascii'
d_killpg='$d_killpg'
d_lchown='$d_lchown'
d_link='$d_link'
d_locconv='$d_locconv'
+d_lockf64='$d_lockf64'
d_lockf='$d_lockf'
d_longdbl='$d_longdbl'
d_longlong='$d_longlong'
+d_lseek64='$d_lseek64'
+d_lstat64='$d_lstat64'
d_lstat='$d_lstat'
d_mblen='$d_mblen'
d_mbstowcs='$d_mbstowcs'
@@ -11576,10 +12037,14 @@ d_msgget='$d_msgget'
d_msgrcv='$d_msgrcv'
d_msgsnd='$d_msgsnd'
d_mymalloc='$d_mymalloc'
+d_nextkey64='$d_nextkey64'
d_nice='$d_nice'
+d_off64t='$d_off64t'
d_oldpthreads='$d_oldpthreads'
d_oldsock='$d_oldsock'
d_open3='$d_open3'
+d_open64='$d_open64'
+d_opendir64='$d_opendir64'
d_pathconf='$d_pathconf'
d_pause='$d_pause'
d_phostname='$d_phostname'
@@ -11594,8 +12059,9 @@ d_pwclass='$d_pwclass'
d_pwcomment='$d_pwcomment'
d_pwexpire='$d_pwexpire'
d_pwgecos='$d_pwgecos'
-d_pwquota='$d_pwquota'
d_pwpasswd='$d_pwpasswd'
+d_pwquota='$d_pwquota'
+d_readdir64='$d_readdir64'
d_readdir='$d_readdir'
d_readlink='$d_readlink'
d_rename='$d_rename'
@@ -11605,6 +12071,7 @@ d_safebcpy='$d_safebcpy'
d_safemcpy='$d_safemcpy'
d_sanemcmp='$d_sanemcmp'
d_sched_yield='$d_sched_yield'
+d_seekdir64='$d_seekdir64'
d_seekdir='$d_seekdir'
d_select='$d_select'
d_sem='$d_sem'
@@ -11647,11 +12114,13 @@ d_sigaction='$d_sigaction'
d_sigsetjmp='$d_sigsetjmp'
d_socket='$d_socket'
d_sockpair='$d_sockpair'
+d_stat64='$d_stat64'
d_statblks='$d_statblks'
d_stdio_cnt_lval='$d_stdio_cnt_lval'
d_stdio_ptr_lval='$d_stdio_ptr_lval'
d_stdiobase='$d_stdiobase'
d_stdstdio='$d_stdstdio'
+d_store64='$d_store64'
d_strchr='$d_strchr'
d_strcoll='$d_strcoll'
d_strctcpy='$d_strctcpy'
@@ -11670,9 +12139,12 @@ d_syserrlst='$d_syserrlst'
d_system='$d_system'
d_tcgetpgrp='$d_tcgetpgrp'
d_tcsetpgrp='$d_tcsetpgrp'
+d_telldir64='$d_telldir64'
d_telldir='$d_telldir'
d_time='$d_time'
d_times='$d_times'
+d_tmpfile64='$d_tmpfile64'
+d_truncate64='$d_truncate64'
d_truncate='$d_truncate'
d_tzname='$d_tzname'
d_umask='$d_umask'
@@ -11737,6 +12209,7 @@ i_fcntl='$i_fcntl'
i_float='$i_float'
i_gdbm='$i_gdbm'
i_grp='$i_grp'
+i_inttypes='$i_inttypes'
i_limits='$i_limits'
i_locale='$i_locale'
i_malloc='$i_malloc'
@@ -11754,6 +12227,7 @@ i_stdarg='$i_stdarg'
i_stddef='$i_stddef'
i_stdlib='$i_stdlib'
i_string='$i_string'
+i_sysaccess='$i_sysaccess'
i_sysdir='$i_sysdir'
i_sysfile='$i_sysfile'
i_sysfilio='$i_sysfilio'
@@ -11762,6 +12236,7 @@ i_sysioctl='$i_sysioctl'
i_sysndir='$i_sysndir'
i_sysparam='$i_sysparam'
i_sysresrc='$i_sysresrc'
+i_syssecrt='$i_syssecrt'
i_sysselct='$i_sysselct'
i_syssockio='$i_syssockio'
i_sysstat='$i_sysstat'
@@ -11817,6 +12292,7 @@ longsize='$longsize'
lp='$lp'
lpr='$lpr'
ls='$ls'
+lseeksize='$lseeksize'
lseektype='$lseektype'
mail='$mail'
mailx='$mailx'
@@ -11888,6 +12364,7 @@ runnm='$runnm'
scriptdir='$scriptdir'
scriptdirexp='$scriptdirexp'
sed='$sed'
+selectminbits='$selectminbits'
selecttype='$selecttype'
sendmail='$sendmail'
sh='$sh'
@@ -11945,6 +12422,7 @@ troff='$troff'
uidtype='$uidtype'
uname='$uname'
uniq='$uniq'
+use64bits='$use64bits'
usedl='$usedl'
usemymalloc='$usemymalloc'
usenm='$usenm'
@@ -12029,51 +12507,6 @@ esac
: if this fails, just run all the .SH files by hand
. ./config.sh
-case "$ebcdic" in
-$define)
- xxx=''
- echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4
- rm -f y.tab.c y.tab.h
- yacc -d perly.y >/dev/null 2>&1
- if cmp -s y.tab.c perly.c; then
- rm -f y.tab.c
- else
- echo "perly.y -> perly.c" >&4
- mv -f y.tab.c perly.c
- chmod u+w perly.c
- sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
- -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
- xxx="$xxx perly.c"
- fi
- if cmp -s y.tab.h perly.h; then
- rm -f y.tab.h
- else
- echo "perly.y -> perly.h" >&4
- mv -f y.tab.h perly.h
- xxx="$xxx perly.h"
- fi
- echo "x2p/a2p.y" >&4
- cd x2p
- rm -f y.tab.c
- yacc a2p.y >/dev/null 2>&1
- if cmp -s y.tab.c a2p.c
- then
- rm -f y.tab.c
- else
- echo "a2p.y -> a2p.c" >&4
- mv -f y.tab.c a2p.c
- chmod u+w a2p.c
- sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
- -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c
- xxx="$xxx a2p.c"
- fi
- cd ..
- case "$xxx" in
- '') echo "No parser files were regenerated. That's okay." >&4 ;;
- esac
- ;;
-esac
-
echo " "
exec 1>&4
. ./UU/extract
diff --git a/MANIFEST b/MANIFEST
index f0f387d2b3..9b525d9350 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -565,6 +565,7 @@ lib/dumpvar.pl A variable dumper
lib/exceptions.pl catch and throw routines
lib/fastcwd.pl a faster but more dangerous getcwd
lib/fields.pm Set up object field names for pseudo-hash-using classes
+lib/filetest.pm For "use filetest"
lib/find.pl A find emulator--used by find2perl
lib/finddepth.pl A depth-first find emulator--used by find2perl
lib/flush.pl Routines to do single flush
diff --git a/Makefile.SH b/Makefile.SH
index 6c8cfceed5..f925a97ad9 100644
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -650,3 +650,58 @@ case `pwd` in
;;
esac
$rm -f $firstmakefile
+
+# Now do any special processing required before building.
+
+case "$ebcdic" in
+$define)
+ xxx=''
+ echo "This is an EBCDIC system, checking if any parser files need regenerating." >&4
+ rm -f y.tab.c y.tab.h
+ yacc -d perly.y >/dev/null 2>&1
+ if cmp -s y.tab.c perly.c; then
+ rm -f y.tab.c
+ else
+ echo "perly.y -> perly.c" >&2
+ mv -f y.tab.c perly.c
+ chmod u+w perly.c
+ sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
+ -e 's/y\.tab/perly/g' perly.c >perly.tmp && mv perly.tmp perly.c
+ xxx="$xxx perly.c"
+ fi
+ if cmp -s y.tab.h perly.h; then
+ rm -f y.tab.h
+ else
+ echo "perly.y -> perly.h" >&2
+ mv -f y.tab.h perly.h
+ xxx="$xxx perly.h"
+ fi
+ cd x2p
+ rm -f y.tab.c
+ yacc a2p.y >/dev/null 2>&1
+ if cmp -s y.tab.c a2p.c
+ then
+ rm -f y.tab.c
+ else
+ echo "a2p.y -> a2p.c" >&2
+ mv -f y.tab.c a2p.c
+ chmod u+w a2p.c
+ sed -e 's/fprintf *( *stderr *,/PerlIO_printf(Perl_debug_log,/g' \
+ -e 's/y\.tab/a2p/g' a2p.c >a2p.tmp && mv a2p.tmp a2p.c
+ xxx="$xxx a2p.c"
+ fi
+ if cmp -s y.tab.h a2p.h
+ then
+ rm -f y.tab.h
+ else
+ echo "a2p.h -> a2p.h" >&2
+ mv -f y.tab.h a2p.h
+ xxx="$xxx a2p.h"
+ fi
+ cd ..
+ case "$xxx" in
+ '') echo "No parser files were regenerated. That's okay." >&2 ;;
+ esac
+ ;;
+esac
+
diff --git a/config_h.SH b/config_h.SH
index 49f86c7de7..b0b65cac37 100644
--- a/config_h.SH
+++ b/config_h.SH
@@ -306,31 +306,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_getprior HAS_GETPRIORITY /**/
-/* HAS_HTONL:
- * This symbol, if defined, indicates that the htonl() routine (and
- * friends htons() ntohl() ntohs()) are available to do network
- * order byte swapping.
- */
-/* HAS_HTONS:
- * This symbol, if defined, indicates that the htons() routine (and
- * friends htonl() ntohl() ntohs()) are available to do network
- * order byte swapping.
- */
-/* HAS_NTOHL:
- * This symbol, if defined, indicates that the ntohl() routine (and
- * friends htonl() htons() ntohs()) are available to do network
- * order byte swapping.
- */
-/* HAS_NTOHS:
- * This symbol, if defined, indicates that the ntohs() routine (and
- * friends htonl() htons() ntohl()) are available to do network
- * order byte swapping.
- */
-#$d_htonl HAS_HTONL /**/
-#$d_htonl HAS_HTONS /**/
-#$d_htonl HAS_NTOHL /**/
-#$d_htonl HAS_NTOHS /**/
-
/* HAS_INET_ATON:
* This symbol, if defined, indicates to the C program that the
* inet_aton() function is available to parse IP address "dotted-quad"
@@ -434,12 +409,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_mktime HAS_MKTIME /**/
-/* HAS_MSG:
- * This symbol, if defined, indicates that the entire msg*(2) library is
- * supported (IPC mechanism based on message queues).
- */
-#$d_msg HAS_MSG /**/
-
/* HAS_NICE:
* This symbol, if defined, indicates that the nice routine is
* available.
@@ -530,12 +499,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_select HAS_SELECT /**/
-/* HAS_SEM:
- * This symbol, if defined, indicates that the entire sem*(2) library is
- * supported.
- */
-#$d_sem HAS_SEM /**/
-
/* HAS_SETEGID:
* This symbol, if defined, indicates that the setegid routine is available
* to change the effective gid of the current program.
@@ -635,12 +598,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_setsid HAS_SETSID /**/
-/* HAS_SHM:
- * This symbol, if defined, indicates that the entire shm*(2) library is
- * supported.
- */
-#$d_shm HAS_SHM /**/
-
/* Shmat_t:
* This symbol holds the return type of the shmat() system call.
* Usually set to 'void *' or 'char *'.
@@ -655,12 +612,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#define Shmat_t $shmattype /**/
#$d_shmatprototype HAS_SHMAT_PROTOTYPE /**/
-/* USE_STAT_BLOCKS:
- * This symbol is defined if this system has a stat structure declaring
- * st_blksize and st_blocks.
- */
-#$d_statblks USE_STAT_BLOCKS /**/
-
/* HAS_STRCHR:
* This symbol is defined to indicate that the strchr()/strrchr()
* functions are available for string searching. If not, try the
@@ -686,25 +637,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_strctcpy USE_STRUCT_COPY /**/
-/* HAS_STRERROR:
- * This symbol, if defined, indicates that the strerror routine is
- * available to translate error numbers to strings. See the writeup
- * of Strerror() in this file before you try to define your own.
- */
-/* HAS_SYS_ERRLIST:
- * This symbol, if defined, indicates that the sys_errlist array is
- * available to translate error numbers to strings. The extern int
- * sys_nerr gives the size of that table.
- */
-/* Strerror:
- * This preprocessor symbol is defined as a macro if strerror() is
- * not available to translate error numbers to strings but sys_errlist[]
- * array is there.
- */
-#$d_strerror HAS_STRERROR /**/
-#$d_syserrlst HAS_SYS_ERRLIST /**/
-#define Strerror(e) $d_strerrm
-
/* HAS_STRTOD:
* This symbol, if defined, indicates that the strtod routine is
* available to provide better numeric string conversion than atof().
@@ -820,17 +752,11 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_wctomb HAS_WCTOMB /**/
-/* EBCDIC:
- * This symbol, if defined, indicates that this system uses
- * EBCDIC encoding.
- */
-#$ebcdic EBCDIC /**/
-
/* I_ARPA_INET:
- * This symbol, if defined, indicates that <arpa/inet.h> exists and should
- * be included.
+ * This symbol, if defined, indicates to the C program that it should
+ * include <arpa/inet.h> to get inet_addr and friends declarations.
*/
-#$i_arpainet I_ARPA_INET /**/
+#$i_arpainet I_ARPA_INET /**/
/* I_DBM:
* This symbol, if defined, indicates that <dbm.h> exists and should
@@ -881,32 +807,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$i_float I_FLOAT /**/
-/* I_GRP:
- * This symbol, if defined, indicates to the C program that it should
- * include <grp.h>.
- */
-/* GRPASSWD:
- * This symbol, if defined, indicates to the C program that struct group
- * contains gr_passwd.
- */
-/* HAS_SETGRENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for initializing sequential access of the group database.
- */
-/* HAS_GETGRENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for sequential access of the group database.
- */
-/* HAS_ENDGRENT:
- * This symbol, if defined, indicates that the getgrent routine is
- * available for finalizing sequential access of the group database.
- */
-#$i_grp I_GRP /**/
-#$d_grpasswd GRPASSWD /**/
-#$d_setgrent HAS_SETGRENT /**/
-#$d_getgrent HAS_GETGRENT /**/
-#$d_endgrent HAS_ENDGRENT /**/
-
/* I_LIMITS:
* This symbol, if defined, indicates to the C program that it should
* include <limits.h> to get definition of symbols like WORD_BIT or
@@ -1136,6 +1036,30 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#define STDCHAR $stdchar /**/
+/* HAS_ACCESSX:
+ * This symbol, if defined, indicates that the accessx routine is
+ * available to do extended access checks.
+ */
+#$d_accessx HAS_ACCESSX /**/
+
+/* HAS_EACCESS:
+ * This symbol, if defined, indicates that the eaccess routine is
+ * available to do extended access checks.
+ */
+#$d_eaccess HAS_EACCESS /**/
+
+/* I_SYS_ACCESS:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sysaccess.h>.
+ */
+#$i_sysaccess I_SYS_ACCESS /**/
+
+/* I_SYS_SECURITY:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <sys/security.h>.
+ */
+#$i_syssecrt I_SYS_SECURITY /**/
+
/* MEM_ALIGNBYTES:
* This symbol contains the number of bytes required to align a
* double. Usual values are 2, 4 and 8.
@@ -1453,6 +1377,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#define SSize_t $ssizetype /* signed count of bytes */
+/* EBCDIC:
+ * This symbol, if defined, indicates that this system uses
+ * EBCDIC encoding.
+ */
+#$ebcdic EBCDIC /**/
+
/* OSNAME:
* This symbol contains the name of the operating system, as determined
* by Configure. You shouldn't rely on it too much; the specific
@@ -1480,6 +1410,13 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#include "Bletch: How does this C preprocessor catenate tokens?"
#endif
+/* HAS_ACCESS:
+ * This manifest constant lets the C program know that the access()
+ * system call is available to check for accessibility using real UID/GID.
+ * (always present on UNIX.)
+ */
+#$d_access HAS_ACCESS /**/
+
/* CSH:
* This symbol, if defined, contains the full pathname of csh.
*/
@@ -1488,6 +1425,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#define CSH "$full_csh" /**/
#endif
+/* HAS_ENDGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the group database.
+ */
+#$d_endgrent HAS_ENDGRENT /**/
+
/* HAS_ENDHOSTENT:
* This symbol, if defined, indicates that the endhostent() routine is
* available to close whatever was being used for host queries.
@@ -1506,12 +1449,24 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_endpent HAS_ENDPROTOENT /**/
+/* HAS_ENDPWENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for finalizing sequential access of the passwd database.
+ */
+#$d_endpwent HAS_ENDPWENT /**/
+
/* HAS_ENDSERVENT:
* This symbol, if defined, indicates that the endservent() routine is
* available to close whatever was being used for service queries.
*/
#$d_endsent HAS_ENDSERVENT /**/
+/* HAS_GETGRENT:
+ * This symbol, if defined, indicates that the getgrent routine is
+ * available for sequential access of the group database.
+ */
+#$d_getgrent HAS_GETGRENT /**/
+
/* HAS_GETHOSTBYADDR:
* This symbol, if defined, indicates that the gethostbyaddr() routine is
* available to look up hosts by their IP addresses.
@@ -1565,6 +1520,13 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#$d_getpbyname HAS_GETPROTOBYNAME /**/
#$d_getpbynumber HAS_GETPROTOBYNUMBER /**/
+/* HAS_GETPWENT:
+ * This symbol, if defined, indicates that the getpwent routine is
+ * available for sequential access of the passwd database.
+ * If this is not available, the older getpw() function may be available.
+ */
+#$d_getpwent HAS_GETPWENT /**/
+
/* HAS_GETSERVENT:
* This symbol, if defined, indicates that the getservent() routine is
* available to look up network services in some data base or another.
@@ -1582,6 +1544,31 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#$d_getsbyname HAS_GETSERVBYNAME /**/
#$d_getsbyport HAS_GETSERVBYPORT /**/
+/* HAS_HTONL:
+ * This symbol, if defined, indicates that the htonl() routine (and
+ * friends htons() ntohl() ntohs()) are available to do network
+ * order byte swapping.
+ */
+/* HAS_HTONS:
+ * This symbol, if defined, indicates that the htons() routine (and
+ * friends htonl() ntohl() ntohs()) are available to do network
+ * order byte swapping.
+ */
+/* HAS_NTOHL:
+ * This symbol, if defined, indicates that the ntohl() routine (and
+ * friends htonl() htons() ntohs()) are available to do network
+ * order byte swapping.
+ */
+/* HAS_NTOHS:
+ * This symbol, if defined, indicates that the ntohs() routine (and
+ * friends htonl() htons() ntohl()) are available to do network
+ * order byte swapping.
+ */
+#$d_htonl HAS_HTONL /**/
+#$d_htonl HAS_HTONS /**/
+#$d_htonl HAS_NTOHL /**/
+#$d_htonl HAS_NTOHS /**/
+
/* HAS_LONG_DOUBLE:
* This symbol will be defined if the C compiler supports long
* doubles.
@@ -1597,8 +1584,7 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#endif
/* HAS_LONG_LONG:
- * This symbol will be defined if the C compiler supports
- * long long.
+ * This symbol will be defined if the C compiler supports long long.
*/
/* LONGLONGSIZE:
* This symbol contains the size of a long long, so that the
@@ -1610,6 +1596,24 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#define LONGLONGSIZE $longlongsize /**/
#endif
+/* HAS_MSG:
+ * This symbol, if defined, indicates that the entire msg*(2) library is
+ * supported (IPC mechanism based on message queues).
+ */
+#$d_msg HAS_MSG /**/
+
+/* HAS_SEM:
+ * This symbol, if defined, indicates that the entire sem*(2) library is
+ * supported.
+ */
+#$d_sem HAS_SEM /**/
+
+/* HAS_SETGRENT:
+ * This symbol, if defined, indicates that the setgrent routine is
+ * available for initializing sequential access of the group database.
+ */
+#$d_setgrent HAS_SETGRENT /**/
+
/* HAS_SETGROUPS:
* This symbol, if defined, indicates that the setgroups() routine is
* available to set the list of process groups. If unavailable, multiple
@@ -1635,6 +1639,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_setpent HAS_SETPROTOENT /**/
+/* HAS_SETPWENT:
+ * This symbol, if defined, indicates that the setpwent routine is
+ * available for initializing sequential access of the passwd database.
+ */
+#$d_setpwent HAS_SETPWENT /**/
+
/* HAS_SETSERVENT:
* This symbol, if defined, indicates that the setservent() routine is
* available.
@@ -1648,6 +1658,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_setvbuf HAS_SETVBUF /**/
+/* HAS_SHM:
+ * This symbol, if defined, indicates that the entire shm*(2) library is
+ * supported.
+ */
+#$d_shm HAS_SHM /**/
+
/* HAS_SOCKET:
* This symbol, if defined, indicates that the BSD socket interface is
* supported.
@@ -1659,6 +1675,31 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#$d_socket HAS_SOCKET /**/
#$d_sockpair HAS_SOCKETPAIR /**/
+/* USE_STAT_BLOCKS:
+ * This symbol is defined if this system has a stat structure declaring
+ * st_blksize and st_blocks.
+ */
+#$d_statblks USE_STAT_BLOCKS /**/ /* backward compatibility */
+
+/* HAS_STRERROR:
+ * This symbol, if defined, indicates that the strerror routine is
+ * available to translate error numbers to strings. See the writeup
+ * of Strerror() in this file before you try to define your own.
+ */
+/* HAS_SYS_ERRLIST:
+ * This symbol, if defined, indicates that the sys_errlist array is
+ * available to translate error numbers to strings. The extern int
+ * sys_nerr gives the size of that table.
+ */
+/* Strerror:
+ * This preprocessor symbol is defined as a macro if strerror() is
+ * not available to translate error numbers to strings but sys_errlist[]
+ * array is there.
+ */
+#$d_strerror HAS_STRERROR /**/
+#$d_syserrlst HAS_SYS_ERRLIST /**/
+#define Strerror(e) $d_strerrm
+
/* HAS_UNION_SEMUN:
* This symbol, if defined, indicates that the union semun is
* defined by including <sys/sem.h>. If not, the user code
@@ -1702,6 +1743,17 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#define Groups_t $groupstype /* Type for 2nd arg to [sg]etgroups() */
#endif
+/* I_GRP:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <grp.h>.
+ */
+/* GRPASSWD:
+ * This symbol, if defined, indicates to the C program that struct group
+ * in <grp.h> contains gr_passwd.
+ */
+#$i_grp I_GRP /**/
+#$d_grpasswd GRPASSWD /**/
+
/* I_NETDB:
* This symbol, if defined, indicates that <netdb.h> exists and
* should be included.
@@ -1744,18 +1796,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
* This symbol, if defined, indicates to the C program that struct passwd
* contains pw_passwd.
*/
-/* HAS_SETPWENT:
- * This symbol, if defined, indicates that the getpwrent routine is
- * available for initializing sequential access of the passwd database.
- */
-/* HAS_GETPWENT:
- * This symbol, if defined, indicates that the getpwent routine is
- * available for sequential access of the password database.
- */
-/* HAS_ENDPWENT:
- * This symbol, if defined, indicates that the getpwent routine is
- * available for finalizing sequential access of the passwd database.
- */
#$i_pwd I_PWD /**/
#$d_pwquota PWQUOTA /**/
#$d_pwage PWAGE /**/
@@ -1765,9 +1805,6 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#$d_pwcomment PWCOMMENT /**/
#$d_pwgecos PWGECOS /**/
#$d_pwpasswd PWPASSWD /**/
-#$d_setpwent HAS_SETPWENT /**/
-#$d_getpwent HAS_GETPWENT /**/
-#$d_endpwent HAS_ENDPWENT /**/
/* Free_t:
* This variable contains the return type of free(). It is usually
@@ -1864,12 +1901,60 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_dlsymun DLSYM_NEEDS_UNDERSCORE /**/
+/* HAS_FSEEKO:
+ * This symbol, if defined, indicates that the fseeko routine is
+ * available to fseek beyond 32 bits (useful for ILP32 hosts).
+ */
+#$d_fseeko HAS_FSEEKO /**/
+
+/* HAS_FTELLO:
+ * This symbol, if defined, indicates that the ftello routine is
+ * available to ftell from beyond 32 bits (useful for ILP32 hosts).
+ */
+#$d_ftello HAS_FTELLO /**/
+
/* USE_SFIO:
* This symbol, if defined, indicates that sfio should
* be used.
*/
#$d_sfio USE_SFIO /**/
+/* HAS_DBMINIT64:
+ * This symbol, if defined, indicates that the dbminit64 routine is
+ * available to open dbm files larger than 2 gigabytes.
+ */
+/* HAS_DBMCLOSE64:
+ * This symbol, if defined, indicates that the dbmclose64 routine is
+ * available to close dbm files larger than 2 gigabytes.
+ */
+/* HAS_FETCH64:
+ * This symbol, if defined, indicates that the fetch64 routine is
+ * available to fetch from dbm files larger than 2 gigabytes.
+ */
+/* HAS_STORE64:
+ * This symbol, if defined, indicates that the store64 routine is
+ * available to store to dbm files larger than 2 gigabytes.
+ */
+/* HAS_DELETE64:
+ * This symbol, if defined, indicates that the delete64 routine is
+ * available to delete from dbm files larger than 2 gigabytes.
+ */
+/* HAS_FIRSTKEY64:
+ * This symbol, if defined, indicates that the firstkey64 routine is
+ * available to firstkey in dbm files larger than 2 gigabytes.
+ */
+/* HAS_NEXTKEY64:
+ * This symbol, if defined, indicates that the nextkey64 routine is
+ * available to nextkey in dbm files larger than 2 gigabytes.
+ */
+#$d_dbminit64 HAS_DBMINIT64 /**/
+#$d_dbmclose64 HAS_DBMCLOSE64 /**/
+#$d_fetch64 HAS_FETCH64 /**/
+#$d_store64 HAS_STORE64 /**/
+#$d_delete64 HAS_DELETE64 /**/
+#$d_firstkey64 HAS_FIRSTKEY64 /**/
+#$d_nextkey64 HAS_NEXTKEY64 /**/
+
/* USE_DYNAMIC_LOADING:
* This symbol, if defined, indicates that dynamic loading of
* some sort is available.
@@ -1889,6 +1974,82 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#define DB_Hash_t $db_hashtype /**/
#define DB_Prefix_t $db_prefixtype /**/
+/* I_INTTYPES:
+ * This symbol, if defined, indicates to the C program that it should
+ * include <inttypes.h>.
+ */
+/* HAS_INT64_T:
+ * This symbol will defined if the C compiler supports int64_t.
+ * Usually the <inttypes.h> needs to be included, but sometimes
+ * <sys/types.h> is enough.
+ */
+#$i_inttypes I_INTTYPES /**/
+#$d_int64t HAS_INT64_T /**/
+
+/* HAS_FSTAT64:
+ * This symbol, if defined, indicates that the fstat64 routine is
+ * available to stat files (fds) larger than 2 gigabytes.
+ */
+/* HAS_FTRUNCATE64:
+ * This symbol, if defined, indicates that the ftruncate64 routine is
+ * available to tell files larger than 2 gigabytes.
+ */
+/* HAS_LSEEK64:
+ * This symbol, if defined, indicates that the lseek64 routine is
+ * available to seek files larger than 2 gigabytes.
+ */
+/* HAS_LSTAT64:
+ * This symbol, if defined, indicates that the lstat64 routine is
+ * available to stat files (symlinks) larger than 2 gigabytes.
+ */
+/* HAS_OPEN64:
+ * This symbol, if defined, indicates that the open64 routine is
+ * available to open files larger than 2 gigabytes.
+ */
+/* HAS_OPENDIR64:
+ * This symbol, if defined, indicates that the opendir64 routine is
+ * available to opendir files larger than 2 gigabytes.
+ */
+/* HAS_READDIR64:
+ * This symbol, if defined, indicates that the readdir64 routine is
+ * available to readdir files larger than 2 gigabytes.
+ */
+/* HAS_SEEKDIR64:
+ * This symbol, if defined, indicates that the seekdir64 routine is
+ * available to seekdir files larger than 2 gigabytes.
+ */
+/* HAS_STAT64:
+ * This symbol, if defined, indicates that the fstat64 routine is
+ * available to stat files larger than 2 gigabytes.
+ */
+/* HAS_TELLDIR64:
+ * This symbol, if defined, indicates that the telldir64 routine is
+ * available to telldir files larger than 2 gigabytes.
+ */
+/* HAS_TRUNCATE64:
+ * This symbol, if defined, indicates that the truncate64 routine is
+ * available to truncate files larger than 2 gigabytes.
+ */
+/* HAS_OFF64_T:
+ * This symbol will be defined if the C compiler supports off64_t.
+ */
+/* HAS_STRUCT_DIRENT64:
+ * This symbol will be defined if the C compiler supports struct dirent64.
+ */
+#$d_fstat64 HAS_FSTAT64 /**/
+#$d_ftruncate64 HAS_FTRUNCATE64 /**/
+#$d_lseek64 HAS_LSEEK64 /**/
+#$d_lstat64 HAS_LSTAT64 /**/
+#$d_open64 HAS_OPEN64 /**/
+#$d_opendir64 HAS_OPENDIR64 /**/
+#$d_readdir64 HAS_READDIR64 /**/
+#$d_seekdir64 HAS_SEEKDIR64 /**/
+#$d_stat64 HAS_STAT64 /**/
+#$d_telldir64 HAS_TELLDIR64 /**/
+#$d_truncate64 HAS_TRUNCATE64 /**/
+#$d_off64t HAS_OFF64_T /**/
+#$d_dirent64s HAS_STRUCT_DIRENT64 /**/
+
/* PRIVLIB:
* This symbol contains the name of the private library for this package.
* The library is private in the sense that it needn't be in anyone's
@@ -1902,6 +2063,15 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
#define PRIVLIB "$privlib" /**/
#define PRIVLIB_EXP "$privlibexp" /**/
+/* SELECT_MIN_BITS:
+ * This symbol holds the minimum number of bits operated by select.
+ * That is, if you do select(n, ...), how many bits at least will be
+ * cleared in the masks if some activity is detected. Usually this
+ * is either n or 32*ceil(n/32), especially many little-endians do
+ * the latter. This is only useful if you have select(), naturally.
+ */
+#define SELECT_MIN_BITS $selectminbits /**/
+
/* SITEARCH:
* This symbol contains the name of the private library for this package.
* The library is private in the sense that it needn't be in anyone's
@@ -1941,6 +2111,59 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#define STARTPERL "$startperl" /**/
+/* HAS_FGETPOS64:
+ * This symbol, if defined, indicates that the fgetpos64 routine is
+ * available to getpos files larger than 2 gigabytes.
+ */
+/* HAS_FOPEN64:
+ * This symbol, if defined, indicates that the fopen64 routine is
+ * available to open files larger than 2 gigabytes.
+ */
+/* HAS_FREOPEN64:
+ * This symbol, if defined, indicates that the freopen64 routine is
+ * available to reopen files larger than 2 gigabytes.
+ */
+/* HAS_FSEEK64:
+ * This symbol, if defined, indicates that the fseek64 routine is
+ * available to seek files larger than 2 gigabytes.
+ */
+/* HAS_FSEEKO64:
+ * This symbol, if defined, indicates that the fseeko64 routine is
+ * available to seek files larger than 2 gigabytes.
+ */
+/* HAS_FSETPOS64:
+ * This symbol, if defined, indicates that the fsetpos64 routine is
+ * available to setpos files larger than 2 gigabytes.
+ */
+/* HAS_FTELL64:
+ * This symbol, if defined, indicates that the ftell64 routine is
+ * available to tell files larger than 2 gigabytes.
+ */
+/* HAS_FTELLO64:
+ * This symbol, if defined, indicates that the ftello64 routine is
+ * available to tell files larger than 2 gigabytes.
+ */
+/* HAS_TMPFILE64:
+ * This symbol, if defined, indicates that the tmpfile64 routine is
+ * available to tmpfile files larger than 2 gigabytes.
+ */
+#$d_fgetpos64 HAS_FGETPOS64 /**/
+#$d_fopen64 HAS_FOPEN64 /**/
+#$d_freopen64 HAS_FREOPEN64 /**/
+#$d_fseek64 HAS_FSEEK64 /**/
+#$d_fseeko64 HAS_FSEEKO64 /**/
+#$d_fsetpos64 HAS_FSETPOS64 /**/
+#$d_ftell64 HAS_FTELL64 /**/
+#$d_ftello64 HAS_FTELLO64 /**/
+#$d_tmpfile64 HAS_TMPFILE64 /**/
+
+/* USE_64_BITS:
+ * This symbol, if defined, indicates that 64-bit APIs should
+ * be used when available. If not defined, the native default APIs
+ * will be used (be they 32 or 64 bits).
+ */
+#$use64bits USE_64_BITS /**/
+
/* USE_PERLIO:
* This symbol, if defined, indicates that the PerlIO abstraction should
* be used throughout. If not defined, stdio should be
diff --git a/doio.c b/doio.c
index 271218f563..72b334cd17 100644
--- a/doio.c
+++ b/doio.c
@@ -125,9 +125,14 @@ do_open(GV *gv, register char *name, I32 len, int as_raw, int rawmode, int rawpe
}
if (as_raw) {
+#if defined(O_LARGEFILE)
+ rawmode |= O_LARGEFILE;
+#endif
+
#ifndef O_ACCMODE
#define O_ACCMODE 3 /* Assume traditional implementation */
#endif
+
switch (result = rawmode & O_ACCMODE) {
case O_RDONLY:
IoTYPE(io) = '<';
@@ -705,7 +710,7 @@ do_eof(GV *gv)
return TRUE;
}
-long
+Off_t
do_tell(GV *gv)
{
register IO *io;
@@ -724,11 +729,11 @@ do_tell(GV *gv)
warner(WARN_UNOPENED, "tell() on unopened file");
}
SETERRNO(EBADF,RMS$_IFI);
- return -1L;
+ return (Off_t)-1;
}
bool
-do_seek(GV *gv, long int pos, int whence)
+do_seek(GV *gv, Off_t pos, int whence)
{
register IO *io;
register PerlIO *fp;
diff --git a/embedvar.h b/embedvar.h
index a6ab6bc9d7..45a1f8d3d5 100644
--- a/embedvar.h
+++ b/embedvar.h
@@ -655,6 +655,7 @@
#define PL_collxfrm_base (PL_Vars.Gcollxfrm_base)
#define PL_collxfrm_mult (PL_Vars.Gcollxfrm_mult)
#define PL_cop_seqmax (PL_Vars.Gcop_seqmax)
+#define PL_cred_mutex (PL_Vars.Gcred_mutex)
#define PL_cryptseen (PL_Vars.Gcryptseen)
#define PL_cshlen (PL_Vars.Gcshlen)
#define PL_cshname (PL_Vars.Gcshname)
@@ -789,6 +790,7 @@
#define PL_Gcollxfrm_base PL_collxfrm_base
#define PL_Gcollxfrm_mult PL_collxfrm_mult
#define PL_Gcop_seqmax PL_cop_seqmax
+#define PL_Gcred_mutex PL_cred_mutex
#define PL_Gcryptseen PL_cryptseen
#define PL_Gcshlen PL_cshlen
#define PL_Gcshname PL_cshname
diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm
index f1edb8ed79..00f834d223 100644
--- a/ext/Fcntl/Fcntl.pm
+++ b/ext/Fcntl/Fcntl.pm
@@ -58,13 +58,16 @@ $VERSION = "1.03";
F_GETFD
F_GETFL
F_GETLK
+ F_GETLK64
F_GETOWN
F_POSIX
F_RDLCK
F_SETFD
F_SETFL
F_SETLK
+ F_SETLK64
F_SETLKW
+ F_SETLKW64
F_SETOWN
F_SHLCK
F_UNLCK
@@ -78,6 +81,7 @@ $VERSION = "1.03";
O_DSYNC
O_EXCL
O_EXLOCK
+ O_LARGEFILE
O_NDELAY
O_NOCTTY
O_NONBLOCK
diff --git a/ext/Fcntl/Fcntl.xs b/ext/Fcntl/Fcntl.xs
index 5149444b68..a8e0e8ac63 100644
--- a/ext/Fcntl/Fcntl.xs
+++ b/ext/Fcntl/Fcntl.xs
@@ -72,6 +72,12 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
+ if (strEQ(name, "F_GETLK64"))
+#ifdef F_GETLK64
+ return F_GETLK64;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "F_GETOWN"))
#ifdef F_GETOWN
return F_GETOWN;
@@ -102,9 +108,9 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
- if (strEQ(name, "F_SETLK"))
-#ifdef F_SETLK
- return F_SETLK;
+ if (strEQ(name, "F_SETLK64"))
+#ifdef F_SETLK64
+ return F_SETLK64;
#else
goto not_there;
#endif
@@ -114,6 +120,12 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
+ if (strEQ(name, "F_SETLKW64"))
+#ifdef F_SETLKW64
+ return F_SETLKW64;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "F_SETOWN"))
#ifdef F_SETOWN
return F_SETOWN;
@@ -289,6 +301,12 @@ constant(char *name, int arg)
#else
goto not_there;
#endif
+ if (strEQ(name, "O_LARGEFILE"))
+#ifdef O_LARGEFILE
+ return O_LARGEFILE;
+#else
+ goto not_there;
+#endif
if (strEQ(name, "O_NDELAY"))
#ifdef O_NDELAY
return O_NDELAY;
diff --git a/handy.h b/handy.h
index af5f3af350..8e79023589 100644
--- a/handy.h
+++ b/handy.h
@@ -105,6 +105,31 @@
Andy Dougherty April 1998
*/
+#ifdef I_INTTYPES
+
+typedef int8_t I8;
+typedef uint8_t U8;
+/* I8_MAX and I8_MIN constants are not defined, as I8 is an ambiguous type.
+ Please search CHAR_MAX in perl.h for further details. */
+#define U8_MAX UINT8_MAX
+#define U8_MIN UINT8_MIN
+
+typedef int16_t I16;
+typedef uint16_t U16;
+#define I16_MAX INT16_MAX
+#define I16_MIN INT16_MIN
+#define U16_MAX UINT16_MAX
+#define U16_MIN UINT16_MIN
+
+typedef int32_t I32;
+typedef uint32_t U32;
+#define I32_MAX INT32_MAX
+#define I32_MIN INT32_MIN
+#define U32_MAX UINT32_MAX
+#define U32_MIN UINT32_MIN
+
+#else
+
typedef char I8;
typedef unsigned char U8;
/* I8_MAX and I8_MIN constants are not defined, as I8 is an ambiguous type.
@@ -112,6 +137,7 @@ typedef unsigned char U8;
#define U8_MAX PERL_UCHAR_MAX
#define U8_MIN PERL_UCHAR_MIN
+/* Beware. SHORTSIZE > 2 in Cray C90ties. */
typedef short I16;
typedef unsigned short U16;
#define I16_MAX PERL_SHORT_MAX
@@ -135,6 +161,8 @@ typedef unsigned short U16;
# define U32_MIN PERL_ULONG_MIN
#endif
+#endif
+
#define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */
#define TYPE_DIGITS(T) BIT_DIGITS(sizeof(T) * 8)
#define TYPE_CHARS(T) (TYPE_DIGITS(T) + 2) /* sign, NUL */
diff --git a/hints/dec_osf.sh b/hints/dec_osf.sh
index a531ea8c8f..0c6056ebde 100644
--- a/hints/dec_osf.sh
+++ b/hints/dec_osf.sh
@@ -202,6 +202,12 @@ fi
# new.) useshrplib="$define" ;;
#esac
+# The EFF_ONLY_OK from <sys/access.h> is dysfunctional for [RWX]_OK
+# as of Digital UNIX 4.0[A-D]?. If and when this gets fixed, adjust
+# this appropriately.
+
+pp_sys_cflags='ccflags="$ccflags -DNO_EFF_ONLY_OK"'
+
#
# Unset temporary variables no more needed.
#
diff --git a/hints/freebsd.sh b/hints/freebsd.sh
index 0f2a5a5a6d..0dbe32341b 100644
--- a/hints/freebsd.sh
+++ b/hints/freebsd.sh
@@ -23,6 +23,10 @@
# Andy Dougherty <doughera@lafcol.lafayette.edu>
# Date: Tue Mar 10 16:07:00 EST 1998
#
+# Support for FreeBSD/ELF
+# Ollivier Robert <roberto@keltia.freenix.fr>
+# Date: Wed Sep 2 16:22:12 CEST 1998
+#
# The two flags "-fpic -DPIC" are used to indicate a
# will-be-shared object. Configure will guess the -fpic, (and the
# -DPIC is not used by perl proper) but the full define is included to
@@ -95,12 +99,20 @@ esac
case "$osvers" in
0.*|1.0*) ;;
-3.0*) if [ -e /usr/lib/aout ]; then
- libpth="/usr/lib/aout /usr/local/lib /usr/lib"
- glibpth="/usr/lib/aout /usr/local/lib /usr/lib"
+3.0*) objformat=`/usr/bin/objformat`
+ if [ x$objformat = xelf ]; then
+ libpth="/usr/lib /usr/local/lib"
+ glibpth="/usr/lib /usr/local/lib"
+ ldflags="-Wl,-E "
+ lddlflags="-shared "
+ else
+ if [ -e /usr/lib/aout ]; then
+ libpth="/usr/lib/aout /usr/local/lib /usr/lib"
+ glibpth="/usr/lib/aout /usr/local/lib /usr/lib"
+ fi
+ lddlflags='-Bshareable'
fi
cccdlflags='-DPIC -fpic'
- lddlflags='-Bshareable'
;;
*) cccdlflags='-DPIC -fpic'
diff --git a/hints/hpux.sh b/hints/hpux.sh
index d1fbb3a480..912ec12ecd 100644
--- a/hints/hpux.sh
+++ b/hints/hpux.sh
@@ -20,6 +20,7 @@
# Distinguish between MC68020, MC68030, MC68040
# Don't assume every OS != 10 is < 10, (e.g., 11).
# From: Chuck Phillips <cdp@fc.hp.com>
+# HP-UX 10 pthreads hints: Matthew T Harden <mthard@mthard1.monsanto.com>
# This version: August 15, 1997
# Current maintainer: Jeff Okamoto <okamoto@corp.hp.com>
@@ -159,6 +160,22 @@ if [ "$xxOsRevMajor" -eq 10 -a "X$usethreads" = "X$define" ]; then
selecttype='int *'
fi
+# Under 10.X, a threaded perl can be built, but it needs
+# libcma and OLD_PTHREADS_API. Also <pthread.h> needs to
+# be #included before any other includes (in perl.h)
+if [ "$xxOsRevMajor" -eq 10 -a "X$usethreads" = "X$define" ]; then
+ # HP-UX 10.X uses the old pthreads API
+ case "$d_oldpthreads" in
+ '') d_oldpthreads="$define" ;;
+ esac
+ # include libcma before all the others
+ libswanted="cma $libswanted"
+ # tell perl.h to include <pthread.h> before other include files
+ ccflags="$ccflags -DPTHREAD_H_FIRST"
+ # CMA redefines select to cma_select, and cma_select expects int *
+ # instead of fd_set * (just like 9.X)
+ selecttype='int *'
+fi
# Remove bad libraries that will cause problems
# (This doesn't remove libraries that don't actually exist)
@@ -214,3 +231,23 @@ esac
# assembler of the form:
# (warning) Use of GR3 when frame >= 8192 may cause conflict.
# These warnings are harmless and can be safely ignored.
+
+# 64-bitness.
+# jhi@iki.fi, inspired by Jeff Okamoto.
+
+if [ X"$use64bits" = X"$define" ]; then
+ if [ "$xxOsRevMajor" -lt 11 ]; then
+ cat <<EOM >&4
+64-bit compilation is not supported on HP-UX $xxOsRevMajor.
+You need at least HP-UX 11.0.
+EOM
+ exit 1
+ fi
+ if [ ! -d /lib/pa20_64 ]; then
+ cat <<EOM >&4
+You do not seem to have the 64-bit libraries, /lib/pa20_64.
+EOM
+ exit 1
+ fi
+ ccflags="$ccflags +DD64 -D_FILE_OFFSET_BITS=64"
+fi
diff --git a/hints/irix_6.sh b/hints/irix_6.sh
index a91be9807e..16033f99b6 100644
--- a/hints/irix_6.sh
+++ b/hints/irix_6.sh
@@ -25,6 +25,8 @@
# gcc-enabled by Kurt Starsinic <kstar@isinet.com> on 3/24/1998
+# 64-bitty by Jarkko Hietaniemi on 9/1998
+
# Use sh Configure -Dcc='cc -n32' to try compiling with -n32.
# or -Dcc='cc -n32 -mips3' (or -mips4) to force (non)portability
# Don't bother with -n32 unless you have the 7.1 or later compilers.
@@ -209,3 +211,23 @@ EOF
libswanted="$*"
usemymalloc='n'
fi
+
+# 64-bitness.
+# jhi@iki.fi, inspired by Scott Henry.
+
+if [ "X$use64bits" = "X$define" ]; then
+ uname_r=`uname -r`
+ case "$uname_r" in
+ [1-5]*|6.[01])
+ echo >&4 "IRIX $uname_r" does not support 64-bit types."
+ echo >&4 "You should upgrade to at least IRIX 6.2."
+ exit 1
+ ;;
+ esac
+ case "$ccflags" in
+ *-n32*)
+ ccflags="$ccflags -DUSE_LONG_LONG"
+ ;;
+ esac
+ ccflags="$ccflags -DUSE_64_BIT_FILES -DNO_OPEN64"
+fi
diff --git a/lib/filetest.pm b/lib/filetest.pm
new file mode 100644
index 0000000000..cc14e82817
--- /dev/null
+++ b/lib/filetest.pm
@@ -0,0 +1,65 @@
+package filetest;
+
+=head1 NAME
+
+filetest - Perl pragma to control the filetest permission operators
+
+=head1 SYNOPSIS
+
+ $can_perhaps_read = -r "file"; # use the mode bits
+ {
+ use filetest 'access'; # intuit harder
+ $can_really_read = -r "file";
+ }
+ $can_perhaps_read = -r "file"; # use the mode bits again
+
+=head1 DESCRIPTION
+
+This pragma tells the compiler to change the behaviour of the filetest
+permissions operators, the -r -w -x -R -W -X (see L<perlfunc>).
+
+The default behaviour to use the mode bits as returned by the stat()
+family of calls. This, however, may not be the right thing to do if
+for example various ACL (access control lists) schemes are in use.
+For such environments, C<use filetest> may help the permission
+operators to return results more consistent with other tools.
+
+Each "use filetest" or "no filetest" affects statements to the end of
+the enclosing block.
+
+There may be a slight performance decrease in the filetests
+when C<use filetest> is in effect, because in some systems
+the extended functionality needs to be emulated.
+
+B<NOTE>: using the file tests is a lost case from the start: there is
+a window open for race conditions (who is to say that the permissions
+will not change between the test and the real operation?). Therefore
+if you are serious about security, just try the real operation and
+test for its success. Think atomicity.
+
+=head2 subpragma access
+
+Currently only one subpragma, C<access> is implemented. It enables
+(or disables) the use of access() or similar system calls. This
+extended filetest functionality is used only when the argument of the
+operators is a filename, not when it is a filehandle.
+
+=cut
+
+sub import {
+ if ( $_[1] eq 'access' ) {
+ $^H |= 0x00400000;
+ } else {
+ die "filetest: the only implemented subpragma is 'access'.\n";
+ }
+}
+
+sub unimport {
+ if ( $_[1] eq 'access' ) {
+ $^H &= ~0x00400000;
+ } else {
+ die "filetest: the only implemented subpragma is 'access'.\n";
+ }
+}
+
+1;
diff --git a/objXSUB.h b/objXSUB.h
index 116075b93b..c9a14beee2 100644
--- a/objXSUB.h
+++ b/objXSUB.h
@@ -19,6 +19,9 @@
#define PL_colors pPerl->PL_colors
#undef PL_colorset
#define PL_colorset pPerl->PL_colorset
+#undef PL_cred_mutex
+#define PL_cred_mutex pPerl->PL_cred_mutex
+#undef PL_sv_no
#undef PL_curcop
#define PL_curcop pPerl->PL_curcop
#undef PL_curpad
diff --git a/perl.c b/perl.c
index a5bb53649a..7433132973 100644
--- a/perl.c
+++ b/perl.c
@@ -138,6 +138,8 @@ perl_construct(register PerlInterpreter *sv_interp)
MUTEX_INIT(&PL_svref_mutex);
#endif /* EMULATE_ATOMIC_REFCOUNTS */
+ MUTEX_INIT(&PL_cred_mutex);
+
thr = init_main_thread();
#endif /* USE_THREADS */
@@ -556,6 +558,7 @@ perl_destruct(register PerlInterpreter *sv_interp)
MUTEX_DESTROY(&PL_strtab_mutex);
MUTEX_DESTROY(&PL_sv_mutex);
MUTEX_DESTROY(&PL_eval_mutex);
+ MUTEX_DESTROY(&PL_cred_mutex);
COND_DESTROY(&PL_eval_cond);
/* As the penultimate thing, free the non-arena SV for thrsv */
diff --git a/perl.h b/perl.h
index cee57eb24d..e5fa8d9fcb 100644
--- a/perl.h
+++ b/perl.h
@@ -309,6 +309,12 @@ register struct op *op asm(stringify(OP_IN_REGISTER));
# include <pthread.h>
#endif
+/* HP-UX 10.X CMA (Common Multithreaded Architecure) insists that
+ pthread.h must be included before all other header files.
+*/
+#if defined(USE_THREADS) && defined(PTHREAD_H_FIRST)
+# include <pthread.h>
+#endif
#ifndef _TYPES_ /* If types.h defines this it's easy. */
# ifndef major /* Does everyone's types.h define this? */
# include <sys/types.h>
@@ -614,7 +620,11 @@ Free_t Perl_free _((Malloc_t where));
#endif /* USE_THREADS */
#ifndef errno
- extern int errno; /* ANSI allows errno to be an lvalue expr */
+ extern int errno; /* ANSI allows errno to be an lvalue expr.
+ * For example in multithreaded environments
+ * something like this might happen:
+ * extern int *_errno(void);
+ * #define errno (*_errno()) */
#endif
#ifdef HAS_STRERROR
@@ -801,6 +811,10 @@ Free_t Perl_free _((Malloc_t where));
#undef UV
#endif
+#ifdef I_INTTYPES
+#include <inttypes.h>
+#endif
+
/* XXX QUAD stuff is not currently supported on most systems.
Specifically, perl internals don't support long long. Among
the many problems is that some compilers support long long,
@@ -814,42 +828,95 @@ Free_t Perl_free _((Malloc_t where));
--Andy Dougherty August 1996
*/
-#ifdef cray
-# define Quad_t int
-#else
-# ifdef convex
-# define Quad_t long long
-# else
-# if LONGSIZE == 8
-# define Quad_t long
-# endif
+/* Much more 64-bit probing added. Now we should get Quad_t
+ in most systems: int64_t, long long, long, int, will do.
+
+ Beware of LP32 systems (ILP32, ILP32LL64). Such systems have been
+ used to sizeof(long) == sizeof(foo*). This is a bad assumption
+ because then IV/UV have been 32 bits, too. Which, in turn means
+ that even if the system has quads (e.g. long long), IV cannot be a
+ quad. Introducing a 64-bit IV (because of long long existing)
+ would introduce binary incompatibility. Therefore the
+ USE_LONG_LONG guard below when probing for quads and the check for
+ PTRSIZE further down when defining IV/UV.
+
+ Summary: a long long system needs to add -DUSE_LONG_LONG to $ccflags
+ to get quads -- and if its pointers are still 32 bits, this will break
+ binary compatibility. Casting an IV (a long long) to a pointer will
+ truncate half of the IV away.
+
+ --jhi September 1998 */
+
+#if INTSIZE == 4 && LONGSIZE == 4 && PTRSIZE == 4
+# define PERL_ILP32
+# if defined(HAS_LONG_LONG) && LONGLONGSIZE == 8
+# define PERL_ILP32LL64
# endif
#endif
-/* XXX Experimental set-up for long long. Just add -DUSE_LONG_LONG
- to your ccflags. --Andy Dougherty 4/1998
-*/
-#ifdef USE_LONG_LONG
-# if defined(HAS_LONG_LONG) && LONGLONGSIZE == 8
-# define Quad_t long long
-# endif
+#if LONGSIZE == 8 && PTRSIZE == 8
+# define PERL_LP64
+# if INTSIZE == 8
+# define PERL_ILP64
+# endif
+#endif
+
+#ifdef HAS_INT64_T
+# define Quad_t int64_t
+# define PERL_QUAD_IS_INT64_T
+#else
+# if LONGSIZE == 8
+# define Quad_t long
+# define PERL_QUAD_IS_LONG
+# else
+# ifdef USE_LONG_LONG /* See above note about LP32. --jhi */
+# if defined(HAS_LONG_LONG) && LONGLONGSIZE == 8
+# define Quad_t long long
+# define PERL_QUAD_IS_LONG_LONG
+# endif
+# endif
+# ifndef Quad_t
+# if INTSIZE == 8
+# define Quad_t int
+# define PERL_QUAD_IS_INT
+# endif
+# endif
+# endif
#endif
#ifdef Quad_t
# define HAS_QUAD
- typedef Quad_t IV;
- typedef unsigned Quad_t UV;
-# define IV_MAX PERL_QUAD_MAX
-# define IV_MIN PERL_QUAD_MIN
-# define UV_MAX PERL_UQUAD_MAX
-# define UV_MIN PERL_UQUAD_MIN
+#endif
+
+/* See above note on LP32 about the PTRSIZE test. --jhi */
+#if defined(HAS_QUAD) && PTRSIZE > 4
+ typedef Quad_t IV;
+ typedef unsigned Quad_t UV;
+# if defined(PERL_QUAD_IS_INT64_T) && defined(INT64_MAX)
+# define IV_MAX INT64_MAX
+# define IV_MIN INT64_MIN
+# define UV_MAX UINT64_MAX
+# define UV_MIN UINT64_MIN
+# else
+# define IV_MAX PERL_QUAD_MAX
+# define IV_MIN PERL_QUAD_MIN
+# define UV_MAX PERL_UQUAD_MAX
+# define UV_MIN PERL_UQUAD_MIN
+# endif
#else
- typedef long IV;
- typedef unsigned long UV;
-# define IV_MAX PERL_LONG_MAX
-# define IV_MIN PERL_LONG_MIN
-# define UV_MAX PERL_ULONG_MAX
-# define UV_MIN PERL_ULONG_MIN
+ typedef long IV;
+ typedef unsigned long UV;
+# if defined(INT32_MAX) && LONGSIZE == 4
+# define IV_MAX INT32_MAX
+# define IV_MIN INT32_MIN
+# define UV_MAX UINT32_MAX
+# define UV_MIN UINT32_MIN
+# else
+# define IV_MAX PERL_LONG_MAX
+# define IV_MIN PERL_LONG_MIN
+# define UV_MAX PERL_ULONG_MAX
+# define UV_MIN PERL_ULONG_MIN
+# endif
#endif
/* Previously these definitions used hardcoded figures.
@@ -1096,6 +1163,122 @@ typedef union any ANY;
#include "handy.h"
+#ifdef USE_64_BITS
+# ifdef USE_64_BIT_FILES
+# ifndef USE_64_BIT_IO
+# define USE_64_BIT_IO
+# endif
+# ifndef USE_64_BIT_STDIO
+# define USE_64_BIT_STDIO
+# endif
+# ifndef USE_64_BIT_DBM
+# define USE_64_BIT_DBM
+# endif
+# endif
+# ifdef USE_64_BIT_IO
+# ifdef HAS_FSTAT64
+# define fstat fstat64
+# endif
+# ifdef HAS_FTRUNCATE64
+# define ftruncate ftruncate64
+# endif
+# ifdef HAS_LSEEK64
+# define lseek lseek64
+# ifdef HAS_OFF64_T
+# undef Off_t
+# define Off_t off64_t
+# endif
+# endif
+# ifdef HAS_LSTAT64
+# define lstat lstat64
+# endif
+ /* Some systems have open64() in libc but use that only
+ * for true LP64 mode, in mixed mode (ILP32LL64, for example)
+ * they use the vanilla open(). --jhi */
+# if defined(HAS_OPEN64) && !defined(NO_OPEN64)
+# define open open64
+# endif
+# ifdef HAS_OPENDIR64
+# define opendir opendir64
+# endif
+# ifdef HAS_READDIR64
+# define readdir readdir64
+# ifdef HAS_STRUCT_DIRENT64
+# define dirent dirent64
+# endif
+# endif
+# ifdef HAS_SEEKDIR64
+# define seekdir seekdir64
+# endif
+# ifdef HAS_STAT64
+# define stat stat64 /* Affects also struct stat, hopefully okay. */
+# endif
+# ifdef HAS_TELLDIR64
+# define telldir telldir64
+# endif
+# ifdef HAS_TRUNCATE64
+# define truncate truncate64
+# endif
+ /* flock is not #defined here to be flock64 because it seems
+ that a system may have struct flock64 but still use flock()
+ and not flock64(). The actual flocking code in pp_sys.c
+ must be changed. Also lockf and lockf64 must be dealt
+ with in pp_sys.c. --jhi */
+# endif
+# ifdef USE_64_BIT_STDIO
+# ifdef HAS_FGETPOS64
+# define fgetpos fgetpos64
+# endif
+# ifdef HAS_FOPEN64
+# define fopen fopen64
+# endif
+# ifdef HAS_FREOPEN64
+# define freopen freopen64
+# endif
+# ifdef HAS_FSEEK64
+# define fseek fseek64
+# endif
+# ifdef HAS_FSEEKO64
+# define fseeko fseeko64
+# endif
+# ifdef HAS_FSETPOS64
+# define fsetpos fsetpos64
+# endif
+# ifdef HAS_FTELL64
+# define ftell ftell64
+# endif
+# ifdef HAS_FTELLO64
+# define ftello ftello64
+# endif
+# ifdef HAS_TMPFILE64
+# define tmpfile tmpfile64
+# endif
+# endif
+# ifdef USE_64_BIT_DBM
+# ifdef HAS_DBMINIT64
+# define dbminit dbminit64
+# endif
+# ifdef HAS_DBMCLOSE64
+# define dbmclose dbmclose64
+# endif
+# ifdef HAS_FETCH64
+# define fetch fetch64
+# endif
+# ifdef HAS_DELETE64
+# define delete delete64
+# endif
+# ifdef HAS_STORE64
+# define store store64
+# endif
+# ifdef HAS_FIRSTKEY64
+# define firstkey firstkey64
+# endif
+# ifdef HAS_NEXTKEY64
+# define nextkey nextkey64
+# endif
+# endif
+#endif
+
#ifdef PERL_OBJECT
typedef I32 (*filter_t) _((CPerlObj*, int, SV *, int));
#else
@@ -1943,6 +2126,8 @@ typedef enum {
#define HINT_RE_TAINT 0x00100000
#define HINT_RE_EVAL 0x00200000
+#define HINT_FILETEST_ACCESS 0x00400000
+
/* Various states of an input record separator SV (rs, nrs) */
#define RsSNARF(sv) (! SvOK(sv))
#define RsSIMPLE(sv) (SvOK(sv) && SvCUR(sv))
diff --git a/perl_exp.SH b/perl_exp.SH
index a210173a99..1a4c8c5e0f 100644
--- a/perl_exp.SH
+++ b/perl_exp.SH
@@ -64,7 +64,7 @@ sed -n 's/^PERLVAR.*(T\([^[,]*\).*/PL_\1/p' thrdvar.h >> perl.exp
# If we use the PerlIO abstraction layer, add its symbols.
#
-if [ $useperlio = "define" ]
+if [ "X$useperlio" = "Xdefine" ]
then
grep '^[A-Za-z]' perlio.sym >> perl.exp
fi
diff --git a/perlio.c b/perlio.c
index 314881e57e..a1af870132 100644
--- a/perlio.c
+++ b/perlio.c
@@ -416,23 +416,30 @@ va_list ap;
return vfprintf(f,fmt,ap);
}
-
#undef PerlIO_tell
-long
+Off_t
PerlIO_tell(f)
PerlIO *f;
{
+#ifdef HAS_FTELLO
+ return ftello(f);
+#else
return ftell(f);
+#endif
}
#undef PerlIO_seek
int
PerlIO_seek(f,offset,whence)
PerlIO *f;
-off_t offset;
+Off_t offset;
int whence;
{
+#ifdef HAS_FSEEKO
+ return fseeko(f,offset,whence);
+#else
return fseek(f,offset,whence);
+#endif
}
#undef PerlIO_rewind
diff --git a/perlvars.h b/perlvars.h
index 98e78c9002..29c8b7319d 100644
--- a/perlvars.h
+++ b/perlvars.h
@@ -37,6 +37,9 @@ PERLVARI(Gthreadsv_names,char *, THREADSV_NAMES)
PERLVAR(Gcurthr, struct perl_thread *)
/* Currently executing (fake) thread */
#endif
+
+PERLVAR(Gcred_mutex, perl_mutex) /* altered credentials in effect */
+
#endif /* USE_THREADS */
PERLVAR(Gninterps, int) /* number of active interpreters */
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 0e37c4dfff..37bcf1a750 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -1096,6 +1096,16 @@ unlikely to be what you want.
(F) An untrapped exception was raised while executing an END subroutine.
The interpreter is immediately exited.
+=item effective %s access is not implemented
+
+(F) We cannot switch the real and effective uids or gids.
+The C<filetest access> pragma is unavailable in this system.
+
+=item entering effective %s access failed
+
+(F) While under the C<filetest access> pragma, switching the real and
+effective uids or gids failed.
+
=item Error converting file specification %s
(F) An error peculiar to VMS. Because Perl may have to deal with file
@@ -1476,6 +1486,11 @@ L<perlfunc/last>.
that name, not even if you count where you were called from. See
L<perlfunc/last>.
+=item leaving effective %s access failed
+
+(F) While under the C<filetest access> pragma, switching the real and
+effective uids or gids failed.
+
=item listen() on closed fd
(W) You tried to do a listen on a closed socket. Did you forget to check
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index 07cea8c78e..92a9532289 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -129,8 +129,9 @@ C<pack>, C<read>, C<syscall>, C<sysread>, C<syswrite>, C<unpack>, C<vec>
=item Functions for filehandles, files, or directories
C<-I<X>>, C<chdir>, C<chmod>, C<chown>, C<chroot>, C<fcntl>, C<glob>,
-C<ioctl>, C<link>, C<lstat>, C<mkdir>, C<open>, C<opendir>, C<readlink>,
-C<rename>, C<rmdir>, C<stat>, C<symlink>, C<umask>, C<unlink>, C<utime>
+C<ioctl>, C<link>, C<lstat>, C<mkdir>, C<open>, C<opendir>,
+C<readlink>, C<rename>, C<rmdir>, C<stat>, C<symlink>, C<umask>,
+C<unlink>, C<utime>
=item Keywords related to the control flow of your perl program
@@ -262,15 +263,6 @@ X<-S>X<-b>X<-c>X<-t>X<-u>X<-g>X<-k>X<-T>X<-B>X<-M>X<-A>X<-C>
-A Same for access time.
-C Same for inode change time.
-The interpretation of the file permission operators C<-r>, C<-R>, C<-w>,
-C<-W>, C<-x>, and C<-X> is based solely on the mode of the file and the
-uids and gids of the user. There may be other reasons you can't actually
-read, write, or execute the file, such as AFS access control lists. Also note that, for the superuser,
-C<-r>, C<-R>, C<-w>, and C<-W> always return C<1>, and C<-x> and C<-X> return
-C<1> if any execute bit is set in the mode. Scripts run by the superuser may
-thus need to do a C<stat()> to determine the actual mode of the
-file, or temporarily set the uid to something else.
-
Example:
while (<>) {
@@ -279,6 +271,31 @@ Example:
#...
}
+The interpretation of the file permission operators C<-r>, C<-R>,
+C<-w>, C<-W>, C<-x>, and C<-X> is by default based solely on the mode
+of the file and the uids and gids of the user. There may be other
+reasons you can't actually read, write, or execute the file. Such
+reasons may be for example network filesystem access controls, ACLs
+(access control lists), read-only filesystems, and unrecognized
+executable formats.
+
+Also note that, for the superuser on the local filesystems, C<-r>,
+C<-R>, C<-w>, and C<-W> always return 1, and C<-x> and C<-X> return 1
+if any execute bit is set in the mode. Scripts run by the superuser
+may thus need to do a stat() to determine the actual mode of the file,
+or temporarily set the uid to something else.
+
+If you are using ACLs, there is a pragma called C<filetest> that may
+produce more accurate results than the bare stat() mode bits.
+
+When under the C<use filetest 'access'> the above-mentioned filetests
+will test whether the permission can (not) be granted using the
+access() family of system calls. Also note that the -x and -X may
+under this pragma return true even if there are no execute permission
+bits set (nor any extra execute permission ACLs). This strangeness is
+due to the underlying system calls' definitions. Read the
+documentation for the C<filetest> pragma for more information.
+
Note that C<-s/a/b/> does not do a negated substitution. Saying
C<-exp($foo)> still works as expected, however--only single letters
following a minus are interpreted as file tests.
diff --git a/pp_sys.c b/pp_sys.c
index 40628afcdb..56f47692ad 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -56,7 +56,10 @@ extern "C" int syscall(unsigned long,...);
/* XXX Configure test needed.
h_errno might not be a simple 'int', especially for multi-threaded
- applications. HOST_NOT_FOUND is typically defined in <netdb.h>.
+ applications, see "extern int errno in perl.h". Creating such
+ a test requires taking into account the differences between
+ compiling multithreaded and singlethreaded ($ccflags et al).
+ HOST_NOT_FOUND is typically defined in <netdb.h>.
*/
#if defined(HOST_NOT_FOUND) && !defined(h_errno)
extern int h_errno;
@@ -170,6 +173,112 @@ static int dooneliner _((char *cmd, char *filename));
#endif /* no flock() */
+#if defined(I_SYS_ACCESS) && !defined(R_OK)
+# include <sys/access.h>
+#endif
+
+#undef PERL_EFF_ACCESS_R_OK /* EFFective uid/gid ACCESS R_OK */
+#undef PERL_EFF_ACCESS_W_OK
+#undef PERL_EFF_ACCESS_X_OK
+
+/* F_OK unused: if stat() cannot find it... */
+
+#if !defined(PERL_EFF_ACCESS_R_OK) && defined(HAS_ACCESS) && defined(EFF_ONLY_OK) && !defined(NO_EFF_ONLY_OK)
+/* Digital UNIX, UnixWare */
+# define PERL_EFF_ACCESS_R_OK(p) (access((p), R_OK | EFF_ONLY_OK))
+# define PERL_EFF_ACCESS_W_OK(p) (access((p), W_OK | EFF_ONLY_OK))
+# define PERL_EFF_ACCESS_X_OK(p) (access((p), X_OK | EFF_ONLY_OK))
+#endif
+
+#if !defined(PERL_EFF_ACCESS_R_OK) && defined(HAS_EACCESS)
+/* HP SecureWare */
+# if defined(I_SYS_SECURITY)
+# include <sys/security.h>
+# endif
+# define PERL_EFF_ACCESS_R_OK(p) (eaccess((p), R_OK, ACC_SELF))
+# define PERL_EFF_ACCESS_W_OK(p) (eaccess((p), W_OK, ACC_SELF))
+# define PERL_EFF_ACCESS_X_OK(p) (eaccess((p), X_OK, ACC_SELF))
+#endif
+
+#if !defined(PERL_EFF_ACCESS_R_OK) && defined(HAS_ACCESSX) && defined(ACC_SELF)
+/* AIX */
+# define PERL_EFF_ACCESS_R_OK(p) (accessx((p), R_OK, ACC_SELF))
+# define PERL_EFF_ACCESS_W_OK(p) (accessx((p), W_OK, ACC_SELF))
+# define PERL_EFF_ACCESS_X_OK(p) (accessx((p), X_OK, ACC_SELF))
+#endif
+
+#if !defined(PERL_EFF_ACCESS_R_OK) && defined(HAS_ACCESS)
+/* The Hard Way. */
+static int emulate_eaccess (const char* path, int mode) {
+ Uid_t ruid = getuid();
+ Uid_t euid = geteuid();
+ Gid_t rgid = getgid();
+ Gid_t egid = getegid();
+ int res;
+
+ MUTEX_LOCK(&PL_cred_mutex);
+#if !defined(HAS_SETREUID) && !defined(HAS_SETRESUID)
+ croak("effective uid access is not implemented");
+#else
+#ifdef HAS_SETREUID
+ if (setreuid(euid, ruid))
+#else
+#ifdef HAS_SETRESUID
+ if (setresuid(euid, ruid, (Uid_t)-1))
+#endif
+#endif
+ croak("entering effective uid access failed");
+#endif
+
+#if !defined(HAS_SETREGID) && !defined(HAS_SETRESGID)
+ croak("effective gid access is not implemented");
+#else
+#ifdef HAS_SETREGID
+ if (setregid(egid, rgid))
+#else
+#ifdef HAS_SETRESGID
+ if (setresgid(egid, rgid, (Gid_t)-1))
+#endif
+#endif
+ croak("entering effective gid access failed");
+#endif
+
+ res = access(path, mode);
+
+#ifdef HAS_SETREUID
+ if (setreuid(ruid, euid))
+#else
+#ifdef HAS_SETRESUID
+ if (setresuid(ruid, euid, (Uid_t)-1))
+#endif
+#endif
+ croak("leaving effective uid access failed");
+
+#ifdef HAS_SETREGID
+ if (setregid(rgid, egid))
+#else
+#ifdef HAS_SETRESGID
+ if (setresgid(rgid, egid, (Gid_t)-1))
+#endif
+#endif
+ croak("leaving effective gid access failed");
+ MUTEX_UNLOCK(&PL_cred_mutex);
+
+ return res;
+}
+# define PERL_EFF_ACCESS_R_OK(p) (emulate_eaccess((p), R_OK))
+# define PERL_EFF_ACCESS_W_OK(p) (emulate_eaccess((p), W_OK))
+# define PERL_EFF_ACCESS_X_OK(p) (emulate_eaccess((p), X_OK))
+#endif
+
+#if !defined(PERL_EFF_ACCESS_R_OK)
+static int emulate_eaccess (const char* path, int mode) {
+ croak("effective uid access is not implemented");
+ /*NOTREACHED*/
+ return -1;
+}
+#endif
+
#ifndef MAXPATHLEN
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
@@ -181,8 +290,6 @@ static int dooneliner _((char *cmd, char *filename));
#define ZBTLEN 10
static char zero_but_true[ZBTLEN + 1] = "0 but true";
-/* Pushy I/O. */
-
PP(pp_backtick)
{
djSP; dTARGET;
@@ -754,24 +861,24 @@ PP(pp_sselect)
maxlen = j;
}
+/* little endians can use vecs directly */
#if BYTEORDER == 0x1234 || BYTEORDER == 0x12345678
-/* XXX Configure test needed. */
-#if defined(__linux__) || defined(OS2) || defined(NeXT) || defined(__osf__) || defined(sun)
+# if SELECT_MIN_BITS > 1
+ growsize = SELECT_MIN_BITS / 8;
+# else
growsize = sizeof(fd_set);
-#else
- growsize = maxlen; /* little endians can use vecs directly */
-#endif
-#else
-#ifdef NFDBITS
+# endif
+# else
+# ifdef NFDBITS
-#ifndef NBBY
-#define NBBY 8
-#endif
+# ifndef NBBY
+# define NBBY 8
+# endif
masksize = NFDBITS / NBBY;
-#else
+# else
masksize = sizeof(long); /* documented int, everyone seems to use long */
-#endif
+# endif
growsize = maxlen + (masksize - (maxlen % masksize));
Zero(&fd_sets[0], 4, char*);
#endif
@@ -2211,8 +2318,21 @@ PP(pp_stat)
PP(pp_ftrread)
{
- I32 result = my_stat(ARGS);
+ I32 result;
djSP;
+#if defined(HAS_ACCESS) && defined(R_OK)
+ if ((PL_hints & HINT_FILETEST_ACCESS) && SvPOK(TOPs)) {
+ result = access(TOPp, R_OK);
+ if (result == 0)
+ RETPUSHYES;
+ if (result < 0)
+ RETPUSHUNDEF;
+ RETPUSHNO;
+ } else
+ result = my_stat(ARGS);
+#else
+ result = my_stat(ARGS);
+#endif
if (result < 0)
RETPUSHUNDEF;
if (cando(S_IRUSR, 0, &PL_statcache))
@@ -2222,8 +2342,21 @@ PP(pp_ftrread)
PP(pp_ftrwrite)
{
- I32 result = my_stat(ARGS);
+ I32 result;
djSP;
+#if defined(HAS_ACCESS) && defined(W_OK)
+ if ((PL_hints & HINT_FILETEST_ACCESS) && SvPOK(TOPs)) {
+ result = access(TOPp, W_OK);
+ if (result == 0)
+ RETPUSHYES;
+ if (result < 0)
+ RETPUSHUNDEF;
+ RETPUSHNO;
+ } else
+ result = my_stat(ARGS);
+#else
+ result = my_stat(ARGS);
+#endif
if (result < 0)
RETPUSHUNDEF;
if (cando(S_IWUSR, 0, &PL_statcache))
@@ -2233,8 +2366,21 @@ PP(pp_ftrwrite)
PP(pp_ftrexec)
{
- I32 result = my_stat(ARGS);
+ I32 result;
djSP;
+#if defined(HAS_ACCESS) && defined(X_OK)
+ if ((PL_hints & HINT_FILETEST_ACCESS) && SvPOK(TOPs)) {
+ result = access(TOPp, X_OK);
+ if (result == 0)
+ RETPUSHYES;
+ if (result < 0)
+ RETPUSHUNDEF;
+ RETPUSHNO;
+ } else
+ result = my_stat(ARGS);
+#else
+ result = my_stat(ARGS);
+#endif
if (result < 0)
RETPUSHUNDEF;
if (cando(S_IXUSR, 0, &PL_statcache))
@@ -2244,8 +2390,21 @@ PP(pp_ftrexec)
PP(pp_fteread)
{
- I32 result = my_stat(ARGS);
+ I32 result;
djSP;
+#ifdef PERL_EFF_ACCESS_R_OK
+ if ((PL_hints & HINT_FILETEST_ACCESS) && SvPOK(TOPs)) {
+ result = PERL_EFF_ACCESS_R_OK(TOPp);
+ if (result == 0)
+ RETPUSHYES;
+ if (result < 0)
+ RETPUSHUNDEF;
+ RETPUSHNO;
+ } else
+ result = my_stat(ARGS);
+#else
+ result = my_stat(ARGS);
+#endif
if (result < 0)
RETPUSHUNDEF;
if (cando(S_IRUSR, 1, &PL_statcache))
@@ -2255,8 +2414,21 @@ PP(pp_fteread)
PP(pp_ftewrite)
{
- I32 result = my_stat(ARGS);
+ I32 result;
djSP;
+#ifdef PERL_EFF_ACCESS_W_OK
+ if ((PL_hints & HINT_FILETEST_ACCESS) && SvPOK(TOPs)) {
+ result = PERL_EFF_ACCESS_W_OK(TOPp);
+ if (result == 0)
+ RETPUSHYES;
+ if (result < 0)
+ RETPUSHUNDEF;
+ RETPUSHNO;
+ } else
+ result = my_stat(ARGS);
+#else
+ result = my_stat(ARGS);
+#endif
if (result < 0)
RETPUSHUNDEF;
if (cando(S_IWUSR, 1, &PL_statcache))
@@ -2266,8 +2438,21 @@ PP(pp_ftewrite)
PP(pp_fteexec)
{
- I32 result = my_stat(ARGS);
+ I32 result;
djSP;
+#ifdef PERL_EFF_ACCESS_X_OK
+ if ((PL_hints & HINT_FILETEST_ACCESS) && SvPOK(TOPs)) {
+ result = PERL_EFF_ACCESS_X_OK(TOPp);
+ if (result == 0)
+ RETPUSHYES;
+ if (result < 0)
+ RETPUSHUNDEF;
+ RETPUSHNO;
+ } else
+ result = my_stat(ARGS);
+#else
+ result = my_stat(ARGS);
+#endif
if (result < 0)
RETPUSHUNDEF;
if (cando(S_IXUSR, 1, &PL_statcache))
diff --git a/proto.h b/proto.h
index 1c33f7895c..e15b405daa 100644
--- a/proto.h
+++ b/proto.h
@@ -118,14 +118,14 @@ VIRTUAL void do_pipe _((SV* sv, GV* rgv, GV* wgv));
VIRTUAL bool do_print _((SV* sv, PerlIO* fp));
VIRTUAL OP* do_readline _((void));
VIRTUAL I32 do_chomp _((SV* sv));
-VIRTUAL bool do_seek _((GV* gv, long pos, int whence));
+VIRTUAL bool do_seek _((GV* gv, Off_t pos, int whence));
#if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
I32 do_semop _((SV** mark, SV** sp));
I32 do_shmio _((I32 optype, SV** mark, SV** sp));
#endif
VIRTUAL void do_sprintf _((SV* sv, I32 len, SV** sarg));
VIRTUAL long do_sysseek _((GV* gv, long pos, int whence));
-VIRTUAL long do_tell _((GV* gv));
+VIRTUAL Off_t do_tell _((GV* gv));
VIRTUAL I32 do_trans _((SV* sv));
VIRTUAL void do_vecset _((SV* sv));
VIRTUAL void do_vop _((I32 optype, SV* sv, SV* left, SV* right));
diff --git a/win32/GenCAPI.pl b/win32/GenCAPI.pl
index 275ed5a74b..a4e409947e 100644
--- a/win32/GenCAPI.pl
+++ b/win32/GenCAPI.pl
@@ -493,6 +493,7 @@ threads_mutex
malloc_mutex
svref_mutex
sv_mutex
+cred_mutex
nthreads_cond
eval_cond
cryptseen
diff --git a/win32/makedef.pl b/win32/makedef.pl
index 6336c0c5bc..872c838ab0 100644
--- a/win32/makedef.pl
+++ b/win32/makedef.pl
@@ -219,6 +219,7 @@ PL_sv_mutex
PL_strtab_mutex
PL_svref_mutex
PL_malloc_mutex
+PL_cred_mutex
PL_eval_mutex
PL_eval_cond
PL_eval_owner