# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Fri Aug 13 18:08:55 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Sat Aug 14 00:51:07 EET DST 1999 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
d_wcstombs=''
d_wctomb=''
d_writev=''
-d_dbmclose64=''
-d_dbminit64=''
-d_delete64=''
-d_fetch64=''
-d_firstkey64=''
-d_nextkey64=''
-d_store64=''
dlext=''
cccdlflags=''
ccdlflags=''
intsize=''
longsize=''
shortsize=''
-d_dirent64_s=''
-d_flock64_s=''
-d_fstat64=''
-d_ftruncate64=''
-d_ino64_t=''
+d_fpos64_t=''
d_llseek=''
-d_lockf64=''
-d_lseek64=''
-d_lstat64=''
d_off64_t=''
-d_offset_t=''
-d_open64=''
-d_opendir64=''
-d_readdir64=''
-d_seekdir64=''
-d_stat64=''
-d_telldir64=''
-d_truncate64=''
libc=''
ldlibpthname=''
libperl=''
rp='Try to use long doubles if available?'
. ./myread
case "$ans" in
-y|Y)
- val="$define"
- ccflags="$ccflags -DUSE_LONG_DOUBLE"
- ;;
-*)
- val="$undef"
- ;;
+y|Y) val="$define" ;;
+*) val="$undef" ;;
esac
set uselongdouble
eval $setvar
+case "$uselongdouble" in
+"$define"|true|[yY]*)
+: Look for a hint-file generated 'call-back-unit'. If the
+: user has specified that long doubles should be used,
+: we may need to set or change some other defaults.
+ if $test -f uselongdouble.cbu; then
+ echo "Your platform has some specific hints for long doubles, using them..."
+ . ./uselongdouble.cbu
+ else
+ $cat <<EOM
+(Your platform doesn't have any specific hints for long doubles.)
+EOM
+ fi
+ ;;
+esac
cat <<EOM
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
eval $setvar
$rm -f try.c
-
-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 llseek exists
- set llseek d_llseek
- 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>
-#include <unistd.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_off64_t
- eval $setvar
-
- : check for offset_t
- echo " "
- echo $n "Checking to see if your system supports offset_t...$c" >&4
- $cat >try.c <<EOCP
-#include <sys/types.h>
-#include <unistd.h>
-offset_t foo() { offset_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_offset_t
- 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_ino64_t
- eval $setvar
-
- : check for struct flock64
- echo " "
- echo "Checking to see if your system supports struct flock64..." >&4
- if $h_fcntl; then
- set d_flock64_s flock64 l_len define fcntl.h
- eval $hasfield
- else
- val="$undef"
- set d_flock64_s
- eval $setvar
- fi
- case "$d_flock64_s" in
- "$define") echo "Yup, it does." >&4
- ;;
- *) echo "Nope, it doesn't." >&4
- ;;
- esac
-
- : check for struct dirent64
- echo " "
- echo "Checking to see if your system supports struct dirent64..." >&4
- set d_dirent64_s dirent64 d_off $i_dirent dirent.h
- eval $hasfield
- case "$d_dirent64_s" in
- "$define") echo "Yup, it does." >&4
- ;;
- *) echo "Nope, it doesn't." >&4
- ;;
- esac
-
-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_off64_t d_offset_t d_ino64_t d_flock64_s d_dirent64_s
- do
- set $xxx
- eval $setvar
- done
-fi
-
: see if dlerror exists
xxx_runnm="$runnm"
runnm=false
set fgetpos d_fgetpos
eval $inlibc
+: see if flock exists
+set flock d_flock
+eval $inlibc
+
+: see if fork exists
+set fork d_fork
+eval $inlibc
+
+: see if pathconf exists
+set pathconf d_pathconf
+eval $inlibc
+
+: see if fpathconf exists
+set fpathconf d_fpathconf
+eval $inlibc
+
+
+: see if llseek exists
+set llseek d_llseek
+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>
+#include <unistd.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_off64_t
+eval $setvar
+
+: check for fpos64_t
+echo " "
+echo $n "Checking to see if your system supports fpos64_t...$c" >&4
+$cat >try.c <<EOCP
+#include <sys/stdio.h>
+fpos64_t foo() { fpos64_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_fpos64_t
+eval $setvar
+
+: see if fseeko exists
+set fseeko d_fseeko
+eval $inlibc
+
+: see if fsetpos exists
+set fsetpos d_fsetpos
+eval $inlibc
+
if $test X"$use64bits" = X"$define"; then
: see if fgetpos64 exists
done
fi
-: see if flock exists
-set flock d_flock
-eval $inlibc
-
-: see if fork exists
-set fork d_fork
-eval $inlibc
-
-: see if pathconf exists
-set pathconf d_pathconf
-eval $inlibc
-
-: see if fpathconf exists
-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 this is a sys/param system
set sys/param.h i_sysparam
eval $inhdr
eval $setvar
$rm -f try.c try
+: see if sys/stat.h is available
+set sys/stat.h i_sysstat
+eval $inhdr
+
: see if stat knows about block sizes
echo " "
set d_statblks stat st_blocks $i_sysstat sys/stat.h
skipping the byteorder check.
EOM
- byteorder=''
+ byteorder='0xffff'
;;
*)
case "$byteorder" in
In the following, larger digits indicate more significance. A big-endian
machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
-machines may have weird orders like 3412. A Cray will report 87654321. If
-the test program works the default is probably right.
+machines may have weird orders like 3412. A Cray will report 87654321,
+an Alpha will report 12345678. If the test program works the default is
+probably right.
I'm now running the test program...
EOM
$cat >try.c <<'EOCP'
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_dirent64_s='$d_dirent64_s'
d_dirnamlen='$d_dirnamlen'
d_dlerror='$d_dlerror'
d_dlopen='$d_dlopen'
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_flock64_s='$d_flock64_s'
d_flock='$d_flock'
d_fopen64='$d_fopen64'
d_fork='$d_fork'
d_fpathconf='$d_fpathconf'
+d_fpos64_t='$d_fpos64_t'
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_fstatfs='$d_fstatfs'
d_fstatvfs='$d_fstatvfs'
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'
d_htonl='$d_htonl'
d_index='$d_index'
d_inetaton='$d_inetaton'
-d_ino64_t='$d_ino64_t'
d_int64t='$d_int64t'
d_iovec_s='$d_iovec_s'
d_isascii='$d_isascii'
d_link='$d_link'
d_llseek='$d_llseek'
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_madvise='$d_madvise'
d_mblen='$d_mblen'
d_msync='$d_msync'
d_munmap='$d_munmap'
d_mymalloc='$d_mymalloc'
-d_nextkey64='$d_nextkey64'
d_nice='$d_nice'
d_off64_t='$d_off64_t'
-d_offset_t='$d_offset_t'
d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
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'
d_pwgecos='$d_pwgecos'
d_pwpasswd='$d_pwpasswd'
d_pwquota='$d_pwquota'
-d_readdir64='$d_readdir64'
d_readdir='$d_readdir'
d_readlink='$d_readlink'
d_readv='$d_readv'
d_sanemcmp='$d_sanemcmp'
d_sched_yield='$d_sched_yield'
d_scm_rights='$d_scm_rights'
-d_seekdir64='$d_seekdir64'
d_seekdir='$d_seekdir'
d_select='$d_select'
d_sem='$d_sem'
d_sigsetjmp='$d_sigsetjmp'
d_socket='$d_socket'
d_sockpair='$d_sockpair'
-d_stat64='$d_stat64'
d_statblks='$d_statblks'
d_statfs='$d_statfs'
d_statfsflags='$d_statfsflags'
d_stdio_stream_array='$d_stdio_stream_array'
d_stdiobase='$d_stdiobase'
d_stdstdio='$d_stdstdio'
-d_store64='$d_store64'
d_strchr='$d_strchr'
d_strcoll='$d_strcoll'
d_strctcpy='$d_strctcpy'
d_system='$d_system'
d_tcgetpgrp='$d_tcgetpgrp'
d_tcsetpgrp='$d_tcsetpgrp'
-d_telldir64='$d_telldir64'
d_telldir='$d_telldir'
d_telldirproto='$d_telldirproto'
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'
* so the default case (for NeXT) is big endian to catch them.
* This might matter for NeXT 3.0.
*/
-#if defined(CROSSCOMPILE) || defined(MULTIARCH)
-# ifdef __LITTLE_ENDIAN__
-# if LONGSIZE == 4
-# define BYTEORDER 0x1234
-# else
-# if LONGSIZE == 8
-# define BYTEORDER 0x12345678
-# endif
-# endif
-# else
-# ifdef __BIG_ENDIAN__
-# if LONGSIZE == 4
-# define BYTEORDER 0x4321
-# else
-# if LONGSIZE == 8
-# define BYTEORDER 0x87654321
-# endif
-# endif
-# endif
-# endif
-# if !defined(BYTEORDER) && (defined(NeXT) || defined(__NeXT__))
-# define BYTEORDER 0x4321
-# endif
-#else
#define BYTEORDER 0x$byteorder /* large digits for MSB */
-#endif /* NeXT */
/* CASTI32:
* This symbol is defined if the C compiler can cast negative
*/
#$d_writev HAS_WRITEV /**/
-/* 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.
*/
#$i_sysstatvfs I_SYS_STATVFS /**/
-/* 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_LLSEEK:
- * This symbol, if defined, indicates that the llseek routine is
- * available to seek 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 stat64 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_llseek HAS_LLSEEK /**/
-#$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_off64_t HAS_OFF64_T /**/
-#$d_dirent64_s HAS_STRUCT_DIRENT64 /**/
+/* HAS_FPOS64_T:
+ * This symbol will be defined if the C compiler supports fpos64_t.
+ */
+#$d_off64_t HAS_OFF64_T /**/
+#$d_fpos64_t HAS_FPOS64_T /**/
/* PERL_PRIfldbl:
* This symbol, if defined, contains the string used by stdio to
*/
#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 /**/
/* HAS_STDIO_STREAM_ARRAY:
* This symbol, if defined, tells that there is an array
}
if (as_raw) {
-#if defined(O_LARGEFILE)
+#if defined(USE_64_BIT_OFFSETS) && defined(O_LARGEFILE)
rawmode |= O_LARGEFILE;
#endif
Perl_warner(aTHX_ WARN_UNOPENED, "sysseek() on unopened file");
}
SETERRNO(EBADF,RMS$_IFI);
- return -1L;
+ return (Off_t)-1;
}
int
exit 1
;;
esac
- ccflags="$ccflags `getconf XBS5_LPBIG_OFFBIG_CFLAGS 2>/dev/null`"
ccflags="$ccflags -DUSE_LONG_LONG"
- case "$cc" in
- *c89) ccflags="$ccflags -qlonglong" ;;
- # Plus AIX also requires LL prefixes for all long long constants.
- esac
+ ccflags="$ccflags `getconf XBS5_ILP32_OFFBIG_CFLAGS 2>/dev/null`"
- ldflags="$ldflags `getconf XBS5_LPBIG_OFFBIG_LDFLAGS 2>/dev/null`"
+ ldflags="$ldflags `getconf XBS5_ILP32_OFFBIG_LDFLAGS 2>/dev/null`"
# _Somehow_ in AIX 4.3.1.0 the above getconf call manages to
# insert(?) *something* to $ldflags so that later (in Configure) evaluating
# $ldflags causes a newline after the '-b64' (the result of the getconf).
esac
EOCBU
+# This script UU/uselongdouble.cbu will get 'called-back' by Configure
+# after it has prompted the user for whether to use 64 bits.
+cat > UU/uselongdouble.cbu <<'EOCBU'
+case "$uselongdouble" in
+$define|true|[yY]*)
+ ccflags="$ccflags -qlongdouble"
+ ;;
+esac
+EOCBU
+
# EOF
EOM
exit 1
fi
- ccflags="$ccflags +DD64 -D_FILE_OFFSET_BITS=64"
+ ccflags="$ccflags +DD64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
ldflags="$ldflags +DD64"
ld=/usr/bin/ld
set `echo " $libswanted " | sed -e 's@ dl @ @'`
*-n32*)
ccflags="$ccflags -DUSE_LONG_LONG"
archname64="-n32"
- d_open64="$undef"
- # In -n32 mode (ILP32LL64) we use the standard open().
- # In -64 we will use the open64().
- cat << 'EOM' >&2
-
-You may see a *** WHOA THERE!!! *** message from Configure for
-d_open64. Keep the recommended value. See hints/irix6.sh
-for more information.
-
-EOM
;;
esac
- ccflags="$ccflags -DUSE_64_BIT_FILES"
+ ccflags="$ccflags -DUSE_64_BITS"
;;
esac
EOCBU
#else /* PERL_IMPLICIT_SYS */
#include "perlsdio.h"
+#include "perl.h"
#endif /* PERL_IMPLICIT_SYS */
#include "handy.h"
-/* Some day when we have more 64-bit experience under our belts we may
- * be able to merge some of the USE_64_BIT_{FILES,OFFSETS,STDIO,DBM}. At
- * the moment (Oct 1998), though, keep them separate. --jhi
- */
#ifdef USE_64_BITS
-# ifdef USE_64_BIT_FILES
-# ifndef USE_64_BIT_OFFSETS
-# define USE_64_BIT_OFFSETS
-# endif
-# ifndef USE_64_BIT_STDIO
-# define USE_64_BIT_STDIO
-# endif
-# ifndef USE_64_BIT_DBM
-# define USE_64_BIT_DBM
-# endif
+# define USE_64_BIT_FILES
+#endif
+
+#if defined(USE_64_BIT_FILES) || defined(USE_LARGE_FILES)
+# define USE_64_BIT_OFFSETS
+# define USE_64_BIT_STDIO
+#endif
+
+#ifdef __sgi /* UGLY. See below. */
+#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_OFFSETS
+# ifdef HAS_OFF64_T
+# undef Off_t
+# define Off_t off64_t
+# undef LSEEKSIZE
+# define LSEEKSIZE 8
# endif
-/* Mention LSEEKSIZE here to get it included in %Config. */
-# ifdef USE_64_BIT_OFFSETS
-# 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
-# else
-# ifdef HAS_LLSEEK
-# define lseek llseek
-# 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(). Such systems should undefine
- * d_open64 in their hints files. --jhi */
-# if defined(HAS_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
+/* Most 64-bit environments have defines like _LARGEFILE_SOURCE that
+ * will trigger defines like the ones below. Some 64-bit environments,
+ * however, do not. */
+# if defined(USE_OPEN64)
+# define open open64
# 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
+# if defined(USE_LSEEK64)
+# define lseek lseek64
+# endif
+# if defined(USE_LLSEEK)
+# define lseek llseek
+# endif
+# if defined(USE_STAT64)
+# define stat stat64
+# endif
+# if defined(USE_FSTAT64)
+# define fstat fstat64
+# endif
+# if defined(USE_LSTAT64)
+# define lstat lstat64
+# endif
+# if defined(USE_FLOCK64)
+# define flock flock64
+# endif
+# if defined(USE_LOCKF64)
+# define lockf lockf64
+# endif
+# if defined(USE_FCNTL64)
+# define fcntl fcntl64
+# endif
+# if defined(USE_TRUNCATE64)
+# define truncate truncate64
+# endif
+# if defined(USE_FTRUNCATE64)
+# define ftruncate ftruncate64
+# endif
+#endif
+
+#ifdef USE_64_BIT_STDIO
+# ifdef HAS_FPOS64_T
+# undef Fpos_t
+# define Fpos_t fpos64_t
+# endif
+/* Most 64-bit environments have defines like _LARGEFILE_SOURCE that
+ * will trigger defines like the ones below. Some 64-bit environments,
+ * however, do not. */
+# if defined(USE_FOPEN64)
+# define fopen fopen64
+# endif
+# if defined(USE_FSEEK64)
+# define fseek fseek64
+# endif
+# if defined(USE_FTELL64)
+# define ftell ftell64
+# endif
+# if defined(USE_FSETPOS64)
+# define fsetpos fsetpos64
+# endif
+# if defined(USE_FGETPOS64)
+# define fgetpos fgetpos64
+# endif
+# if defined(USE_TMPFILE64)
+# define tmpfile tmpfile64
+# endif
+# if defined(USE_FREOPEN64)
+# define freopen freopen64
# endif
#endif
Off_t
PerlIO_tell(PerlIO *f)
{
-#ifdef HAS_FTELLO
- return ftello(f);
-#else
return ftell(f);
-#endif
}
#undef PerlIO_seek
int
PerlIO_seek(PerlIO *f, Off_t offset, int whence)
{
-#ifdef HAS_FSEEKO
- return fseeko(f,offset,whence);
-#else
return fseek(f,offset,whence);
-#endif
}
#undef PerlIO_rewind
int
PerlIO_setpos(PerlIO *f, const Fpos_t *pos)
{
+#if defined(USE_64_BIT_STDIO) && defined(HAS_FSETPOS64)
+ return fsetpos64(f, pos);
+#else
return fsetpos(f, pos);
+#endif
}
#endif
#endif
int
PerlIO_getpos(PerlIO *f, Fpos_t *pos)
{
+#if defined(USE_64_BIT_STDIO) && defined(HAS_FSETPOS64)
+ return fgetpos64(f, pos);
+#else
return fgetpos(f, pos);
+#endif
}
#endif
#endif
#define PerlIO_clearerr(f) clearerr(f)
#define PerlIO_flush(f) Fflush(f)
#define PerlIO_tell(f) ftell(f)
+#if defined(USE_64_BIT_STDIO) && defined(HAS_FTELLO) && !defined(USE_FTELL64)
+#define ftell ftello
+#endif
#if defined(VMS) && !defined(__DECC)
/* Old VAXC RTL doesn't reset EOF on seek; Perl folk seem to expect this */
# define PerlIO_seek(f,o,w) (((f) && (*f) && ((*f)->_flag &= ~_IOEOF)),fseek(f,o,w))
#else
# define PerlIO_seek(f,o,w) fseek(f,o,w)
#endif
+#if defined(USE_64_BIT_STDIO) && defined(HAS_FSEEKO) && !defined(USE_FSEEK64)
+#define fseek fseeko
+#endif
#ifdef HAS_FGETPOS
#define PerlIO_getpos(f,p) fgetpos(f,p)
#endif
#define POPi ((IV)SvIVx(POPs))
#define POPu ((UV)SvUVx(POPs))
#define POPl ((long)SvIVx(POPs))
+#define POPul ((unsigned long)SvIVx(POPs))
+#ifdef HAS_QUAD
+#define POPq ((Quad_t)SvIVx(POPs))
+#endif
#define TOPs (*sp)
#define TOPp (SvPV(TOPs, PL_na)) /* deprecated */
#define TOPi ((IV)SvIV(TOPs))
#define TOPu ((UV)SvUV(TOPs))
#define TOPl ((long)SvIV(TOPs))
+#define TOPul ((unsigned long)SvIV(TOPs))
+#ifdef HAS_QUAD
+#define TOPq ((Quad_t)SvIV(TOPs))
+#endif
/* Go to some pains in the rare event that we must extend the stack. */
#define EXTEND(p,n) STMT_START { if (PL_stack_max - p < (n)) { \
djSP;
GV *gv;
int whence = POPi;
- Off_t offset = POPl;
+ Off_t offset = (Off_t)SvIVx(POPs);
MAGIC *mg;
gv = PL_last_in_gv = (GV*)POPs;
return -1;
}
flock.l_whence = SEEK_SET;
- flock.l_start = flock.l_len = 0L;
+ flock.l_start = flock.l_len = (Off_t)0;
return fcntl(fd, (operation & LOCK_NB) ? F_SETLK : F_SETLKW, &flock);
}