# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Fri Nov 12 01:02:11 EET 1999 [metaconfig 3.0 PL70]
+# Generated on Sat Nov 13 15:36:41 EET 1999 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
sitelibexp=''
siteprefix=''
siteprefixexp=''
-sizesize=''
sizetype=''
so=''
sharpbang=''
val="$undef"
echo "No, it doesn't."
case "$lseeksize" in
- 8) echo "(This is okay because your off_t is 64 bits wide.)" ;;
+ 8) echo "(This is okay because your off_t is 64 bits wide.)" >&4 ;;
esac
fi
$rm -f try.* try
}'
$rm -f signal signal.c signal.awk signal.lst signal_cmd
-echo " "
-case "$sizetype" in
-*_t) zzz="$sizetype" ;;
-*) zzz="filesize" ;;
-esac
-echo "Checking the size of $zzz..." >&4
-cat > try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
- printf("%d\n", (int)sizeof($sizetype));
- exit(0);
-}
-EOCP
-set try
-if eval $compile_ok; then
- yyy=`./try`
- case "$yyy" in
- '') sizesize=4
- echo "(I can't execute the test program--guessing $sizesize.)" >&4
- ;;
- *) sizesize=$yyy
- echo "Your $zzz size is $sizesize bytes."
- ;;
- esac
-else
- sizesize=4
- echo "(I can't compile the test program--guessing $sizesize.)" >&4
-fi
-
-
: see what type is used for signed size_t
set ssize_t ssizetype int stdio.h sys/types.h
eval $typedef
sitelibexp='$sitelibexp'
siteprefix='$siteprefix'
siteprefixexp='$siteprefixexp'
-sizesize='$sizesize'
sizetype='$sizetype'
sleep='$sleep'
smail='$smail'
indicates to the C program that the inet_aton() function is available
to parse IP address "dotted-quad" strings.
-d_int64t (i_inttypes.U):
+d_int64t (d_int64t.U):
This symbol will be defined if the C compiler supports int64_t.
d_isascii (d_isascii.U):
This variable contains the value of the PTRSIZE symbol, which
indicates to the C program how many bytes there are in a pointer.
-quadcase (quadtype.U):
+quadkind (quadtype.U):
This variable, if defined, encodes the type of a quad:
1 = int, 2 = long, 3 = long long, 4 = int64_t.
# Package name : perl5
# Source directory : .
-# Configuration time: Thu Nov 11 21:42:49 EET 1999
+# Configuration time: Sat Nov 13 15:28:21 EET 1999
# Configured by : jhi
# Target system : osf1 alpha.hut.fi v4.0 878 alpha
ccsymbols='LANGUAGE_C=1 SYSTYPE_BSD=1 _LONGLONG=1 __LANGUAGE_C__=1'
cf_by='jhi'
cf_email='yourname@yourhost.yourplace.com'
-cf_time='Thu Nov 11 21:42:49 EET 1999'
+cf_time='Sat Nov 13 15:28:21 EET 1999'
charsize='1'
chgrp=''
chmod=''
privlibexp='/opt/perl/lib/5.00563'
prototype='define'
ptrsize='8'
-quadcase='2'
+quadkind='2'
quadtype='long'
randbits='48'
randfunc='drand48'
/*
* Package name : perl5
* Source directory : .
- * Configuration time: Thu Nov 11 21:42:49 EET 1999
+ * Configuration time: Sat Nov 13 15:28:21 EET 1999
* Configured by : jhi
* Target system : osf1 alpha.hut.fi v4.0 878 alpha
*/
* This symbol holds the type used for 64-bit integers.
* It can be int, long, long long, int64_t etc...
*/
-/* QUADCASE:
- * This symbol, if defined, encodes the type of a quad:
- * 1 = int, 2 = long, 3 = long long, 4 = int64_t.
- */
/* Uquad_t:
* This symbol holds the type used for unsigned 64-bit integers.
* It can be unsigned int, unsigned long, unsigned long long,
#define HAS_QUAD /**/
#define Quad_t long /**/
#define Uquad_t unsigned long /**/
-#define QUADCASE 2 /**/
+#ifdef HAS_QUAD
+# define QUADKIND 2 /**/
+# define QUAD_IS_INT 1
+# define QUAD_IS_LONG 2
+# define QUAD_IS_LONG_LONG 3
+# define QUAD_IS_INT64_T 4
+#endif
/* HAS_ACCESSX:
* This symbol, if defined, indicates that the accessx routine is
*/
/*#define HAS_HASMNTOPT / **/
+/* 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.
+ */
+/*#define HAS_INT64_T / **/
+
/* HAS_LDBL_DIG:
* This symbol, if defined, indicates that this system's <float.h>
* or <limits.h> defines the symbol LDBL_DIG, which is the number
* 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.
- */
/*#define I_INTTYPES / **/
-/*#define HAS_INT64_T / **/
/* I_MNTENT:
* This symbol, if defined, indicates that <mntent.h> exists and
/* LSEEKSIZE:
* This symbol holds the number of bytes used by the Off_t.
*/
+/* Off_t_size:
+ * This symbol holds the number of bytes used by the Off_t.
+ */
#define Off_t off_t /* <offset> type */
#define LSEEKSIZE 8 /* <offset> size */
+#define Off_t_size 8 /* <offset> size */
/* Mode_t:
* This symbol holds the type used to declare file modes
/* LSEEKSIZE:
* This symbol holds the number of bytes used by the Off_t.
*/
+/* Off_t_size:
+ * This symbol holds the number of bytes used by the Off_t.
+ */
#define Off_t $lseektype /* <offset> type */
#define LSEEKSIZE $lseeksize /* <offset> size */
+#define Off_t_size $lseeksize /* <offset> size */
/* Mode_t:
* This symbol holds the type used to declare file modes
*/
#define Pid_t $pidtype /* PID type */
-/* Size_t_size:
- * This symbol holds the size of a Size_t in bytes.
- */
-#define Size_t_size $sizesize /* */
-
/* Size_t:
* This symbol holds the type used to declare length parameters
* for string functions. It is usually size_t, but may be
# endif
#endif
-/* I couldn't find any -Ddefine or -flags in IRIX 6.5 that would
- * have done the necessary symbol renaming using cpp. --jhi */
-#ifdef __sgi
-#define USE_FOPEN64
-#define USE_FSEEK64
-#define USE_FTELL64
-#define USE_FSETPOS64
-#define USE_FGETPOS64
-#define USE_TMPFILE64
-#define USE_FREOPEN64
-#endif
-
#ifdef USE_64_BIT_RAWIO
# ifdef HAS_OFF64_T
# undef Off_t
djSP; dMARK; dORIGMARK; dTARGET;
GV *gv;
IO *io;
- int offset;
+ STRLEN offset;
SV *bufsv;
char *buffer;
- int length;
+ STRLEN length;
STRLEN blen;
MAGIC *mg;
RETURN;
}
+#if LSEEKSIZE > IVSIZE
+ PUSHn( do_tell(gv) );
+#else
PUSHi( do_tell(gv) );
+#endif
RETURN;
}
djSP;
GV *gv;
int whence = POPi;
+#if LSEEKSIZE > IVSIZE
+ Off_t offset = (Off_t)SvNVx(POPs);
+#else
Off_t offset = (Off_t)SvIVx(POPs);
+#endif
MAGIC *mg;
gv = PL_last_in_gv = (GV*)POPs;
PUSHs(boolSV(do_seek(gv, offset, whence)));
else {
Off_t n = do_sysseek(gv, offset, whence);
- PUSHs((n < 0) ? &PL_sv_undef
- : sv_2mortal(n ? newSViv((IV)n)
- : newSVpvn(zero_but_true, ZBTLEN)));
+ if (n < 0)
+ PUSHs(&PL_sv_undef);
+ else {
+ SV* sv = n ?
+#if LSEEKSIZE > IVSIZE
+ newSVnv((NV)n)
+#else
+ newSViv((IV)n)
+#endif
+ : newSVpvn(zero_but_true, ZBTLEN);
+ PUSHs(sv_2mortal(sv));
+ }
}
RETURN;
}
#else
PUSHs(sv_2mortal(newSVpvn("", 0)));
#endif
-#if Size_t_size > IVSIZE
+#if Off_t_size > IVSIZE
PUSHs(sv_2mortal(newSVnv(PL_statcache.st_size)));
#else
PUSHs(sv_2mortal(newSViv(PL_statcache.st_size)));
djSP; dTARGET;
if (result < 0)
RETPUSHUNDEF;
-#if Size_t_size > IVSISE
+#if Off_t_size > IVSIZE
PUSHn(PL_statcache.st_size);
#else
PUSHi(PL_statcache.st_size);
EOM
}
+print "# checking whether we have sparse files...\n";
+
# Known have-nots.
if ($^O eq 'win32' || $^O eq 'vms') {
- print "1..0\n# no sparse files\n";
+ print "1..0\n# no sparse files (because this is $^O) \n";
bye();
}
# Known haves that have problems running this test
# (for example because they do not support sparse files, like UNICOS)
if ($^O eq 'unicos') {
- print "1..0\n# large files known to work but unable to test them here\n";
+ print "1..0\n# large files known to work but unable to test them here ($^O)\n";
bye();
}
-# Then try to deduce whether we have sparse files.
+# Then try heuristically to deduce whether we have sparse files.
# We'll start off by creating a one megabyte file which has
# only three "true" bytes. If we have sparseness, we should
bye();
}
+print "# we seem to have sparse files...\n";
+
# By now we better be sure that we do have sparse files:
# if we are not, the following will hog 5 gigabytes of disk. Ooops.
$ENV{LC_ALL} = "C";
sysopen(BIG, "big", O_WRONLY|O_CREAT|O_TRUNC) or
- do { warn "sysopen failed: $!\n"; bye };
-sysseek(BIG, 5_000_000_000, SEEK_SET);
+ do { warn "sysopen 'big' failed: $!\n"; bye };
+my $sysseek = sysseek(BIG, 5_000_000_000, SEEK_SET);
+unless (defined $sysseek && $sysseek == 5_000_000_000) {
+ print "1..0\n# seeking past 2GB failed: $! (sysseek returned ",
+ defined $sysseek ? $sysseek : 'undef', ")\n";
+ explain();
+ bye();
+}
# The syswrite will fail if there are are filesize limitations (process or fs).
-my $syswrite = syswrite(BIG, "big") == 3;
-my $close = close BIG if $syswrite;
+my $syswrite = syswrite(BIG, "big");
+print "# syswrite failed: $! (syswrite returned ",
+ defined $syswrite ? $syswrite : 'undef', ")\n"
+ unless defined $syswrite && $syswrite == 3;
+my $close = close BIG;
+print "# close failed: $!\n" unless $close;
unless($syswrite && $close) {
- unless ($syswrite) {
- print "# syswrite failed: $!\n"
- } else {
- print "# close failed: $!\n"
- }
if ($! =~/too large/i) {
print "1..0\n# writing past 2GB failed: process limits?\n";
} elsif ($! =~ /quota/i) {
EOM
}
+print "# checking whether we have sparse files...\n";
+
# Known have-nots.
if ($^O eq 'win32' || $^O eq 'vms') {
- print "1..0\n# no sparse files\n";
+ print "1..0\n# no sparse files (because this is $^O) \n";
bye();
}
# Known haves that have problems running this test
# (for example because they do not support sparse files, like UNICOS)
if ($^O eq 'unicos') {
- print "1..0\n# large files known to work but unable to test them here\n";
+ print "1..0\n# large files known to work but unable to test them here ($^O)\n";
bye();
}
-# Then try to deduce whether we have sparse files.
+# Then try to heuristically deduce whether we have sparse files.
# Let's not depend on Fcntl or any other extension.
bye();
}
+print "# we seem to have sparse files...\n";
+
# By now we better be sure that we do have sparse files:
# if we are not, the following will hog 5 gigabytes of disk. Ooops.
open(BIG, ">big") or do { warn "open failed: $!\n"; bye };
binmode BIG;
-seek(BIG, 5_000_000_000, $SEEK_SET);
+unless (seek(BIG, 5_000_000_000, $SEEK_SET)) {
+ print "1..0\n# seeking past 2GB failed: $!\n";
+ explain();
+ bye();
+}
# Either the print or (more likely, thanks to buffering) the close will
# fail if there are are filesize limitations (process or fs).
my $print = print BIG "big";
-my $close = close BIG if $print;
+print "# print failed: $!\n" unless $print;
+my $close = close BIG;
+print "# close failed: $!\n" unless $close;
unless ($print && $close) {
- unless ($print) {
- print "# print failed: $!\n"
- } else {
- print "# close failed: $!\n"
- }
if ($! =~/too large/i) {
print "1..0\n# writing past 2GB failed: process limits?\n";
} elsif ($! =~ /quota/i) {