summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-10-27 17:19:06 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-10-27 17:19:06 +0000
commitad27e871a1c17d37a6de5332709e86e420b3b750 (patch)
tree6e22184d5a011982a35c8ed5ef2047b7d2bd7d7f
parent1ae6be1c7649fa55b3105031a58ffe146fa4f2fd (diff)
downloadperl-ad27e871a1c17d37a6de5332709e86e420b3b750.tar.gz
Regen Configure.
p4raw-id: //depot/cfgperl@4470
-rwxr-xr-xConfigure88
-rw-r--r--Porting/Glossary15
-rw-r--r--Porting/config.sh6
-rw-r--r--Porting/config_H39
-rw-r--r--config_h.SH37
-rw-r--r--perl.c24
-rw-r--r--perl.h12
7 files changed, 113 insertions, 108 deletions
diff --git a/Configure b/Configure
index f397079482..72bab7c6f3 100755
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Wed Oct 27 16:30:21 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Wed Oct 27 20:27:00 EET DST 1999 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.com)
cat >/tmp/c1$$ <<EOF
@@ -353,6 +353,7 @@ d_fgetpos=''
d_flexfnam=''
d_flock=''
d_fork=''
+d_fs_data_s=''
d_fseeko=''
d_fsetpos=''
d_fstatfs=''
@@ -371,6 +372,7 @@ d_phostname=''
d_uname=''
d_gethostprotos=''
d_getlogin=''
+d_getmnt=''
d_getmntent=''
d_getnbyaddr=''
d_getnbyname=''
@@ -513,8 +515,6 @@ sockethdr=''
socketlib=''
d_sqrtl=''
d_statblks=''
-d_fs_data_s=''
-d_statfs=''
d_statfs_f_flags=''
d_statfs_s=''
d_fstatvfs=''
@@ -8700,44 +8700,8 @@ eval $inhdr
set sys/types.h i_systypes
eval $inhdr
-: see if this is a sys/vfs.h system
-set sys/vfs.h i_sysvfs
-eval $inhdr
-
-: see if this is a sys/statfs.h system
-set sys/statfs.h i_sysstatfs
-eval $inhdr
-
-
-: see if statfs exists
-set statfs d_statfs
-eval $inlibc
-
-echo "Checking to see if your system supports struct statfs..." >&4
-set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
-eval $hasstruct
-case "$d_statfs_s" in
-"$define") echo "Yup, it does." >&4 ;;
-*) echo "Nope, it doesn't." >&4 ;;
-esac
-
-: see if struct statfs knows about f_flags
-case "$d_statfs_s" in
-define)
- echo "Checking to see if your struct statfs has f_flags field..." >&4
- set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
- eval $hasfield
- ;;
-*) val="$undef"
- set d_statfs_f_flags
- eval $setvar
- ;;
-esac
-case "$d_statfs_f_flags" in
-"$define") echo "Yup, it does." >&4 ;;
-*) echo "Nope, it doesn't." >&4 ;;
-esac
+echo " "
echo "Checking to see if your system supports struct fs_data..." >&4
set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
eval $hasstruct
@@ -8887,6 +8851,10 @@ eval $hasproto
set getlogin d_getlogin
eval $inlibc
+: see if getmnt exists
+set getmnt d_getmnt
+eval $inlibc
+
: see if getmntent exists
set getmntent d_getmntent
eval $inlibc
@@ -10407,6 +10375,44 @@ echo " "
set d_statblks stat st_blocks $i_sysstat sys/stat.h
eval $hasfield
+: see if this is a sys/vfs.h system
+set sys/vfs.h i_sysvfs
+eval $inhdr
+
+: see if this is a sys/statfs.h system
+set sys/statfs.h i_sysstatfs
+eval $inhdr
+
+
+echo " "
+echo "Checking to see if your system supports struct statfs..." >&4
+set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
+eval $hasstruct
+case "$d_statfs_s" in
+"$define") echo "Yup, it does." >&4 ;;
+*) echo "Nope, it doesn't." >&4 ;;
+esac
+
+
+
+: see if struct statfs knows about f_flags
+case "$d_statfs_s" in
+define)
+ echo " "
+ echo "Checking to see if your struct statfs has f_flags field..." >&4
+ set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
+ eval $hasfield
+ ;;
+*) val="$undef"
+ set d_statfs_f_flags
+ eval $setvar
+ ;;
+esac
+case "$d_statfs_f_flags" in
+"$define") echo "Yup, it does." >&4 ;;
+*) echo "Nope, it doesn't." >&4 ;;
+esac
+
: see if _ptr and _cnt from stdio act std
echo " "
if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
@@ -13665,6 +13671,7 @@ d_gethent='$d_gethent'
d_gethname='$d_gethname'
d_gethostprotos='$d_gethostprotos'
d_getlogin='$d_getlogin'
+d_getmnt='$d_getmnt'
d_getmntent='$d_getmntent'
d_getnbyaddr='$d_getnbyaddr'
d_getnbyname='$d_getnbyname'
@@ -13813,7 +13820,6 @@ d_socket='$d_socket'
d_sockpair='$d_sockpair'
d_sqrtl='$d_sqrtl'
d_statblks='$d_statblks'
-d_statfs='$d_statfs'
d_statfs_f_flags='$d_statfs_f_flags'
d_statfs_s='$d_statfs_s'
d_statvfs='$d_statvfs'
diff --git a/Porting/Glossary b/Porting/Glossary
index f3f99f2349..3e128e0056 100644
--- a/Porting/Glossary
+++ b/Porting/Glossary
@@ -538,7 +538,7 @@ d_fpathconf (d_pathconf.U):
d_fpos64_t (io64.U):
This symbol will be defined if the C compiler supports fpos64_t.
-d_fs_data_s (d_statfs.U):
+d_fs_data_s (d_fs_data_s.U):
This variable conditionally defines the HAS_STRUCT_FS_DATA symbol,
which indicates that the struct fs_data is supported.
@@ -616,6 +616,11 @@ d_getlogin (d_getlogin.U):
indicates to the C program that the getlogin() routine is available
to get the login name.
+d_getmnt (d_getmnt.U):
+ This variable conditionally defines the HAS_GETMNT symbol, which
+ indicates to the C program that the getmnt() routine is available
+ to retrieve one or more mount info blocks by filename.
+
d_getmntent (d_getmntent.U):
This variable conditionally defines the HAS_GETMNTENT symbol, which
indicates to the C program that the getmntent() routine is available
@@ -1331,17 +1336,13 @@ d_statblks (d_statblks.U):
if this system has a stat structure declaring
st_blksize and st_blocks.
-d_statfs (d_statfs.U):
- This variable conditionally defines the HAS_STATFS symbol, which
- indicates to the C program that the statfs() routine is available.
-
-d_statfs_f_flags (d_statfs.U):
+d_statfs_f_flags (d_statfs_f_flags.U):
This variable conditionally defines the HAS_STRUCT_STATFS_F_FLAGS
symbol, which indicates to struct statfs from has f_flags member.
This kind of struct statfs is coming from sys/mount.h (BSD),
not from sys/statfs.h (SYSV).
-d_statfs_s (d_statfs.U):
+d_statfs_s (d_statfs_s.U):
This variable conditionally defines the HAS_STRUCT_STATFS symbol,
which indicates that the struct statfs is supported.
diff --git a/Porting/config.sh b/Porting/config.sh
index 13636b688c..7b0dd0863c 100644
--- a/Porting/config.sh
+++ b/Porting/config.sh
@@ -8,7 +8,7 @@
# Package name : perl5
# Source directory : .
-# Configuration time: Wed Oct 27 16:33:32 EET DST 1999
+# Configuration time: Wed Oct 27 20:21:09 EET DST 1999
# Configured by : jhi
# Target system : osf1 alpha.hut.fi v4.0 878 alpha
@@ -56,7 +56,7 @@ ccflags='-pthread -std -DLANGUAGE_C'
ccsymbols='__LANGUAGE_C__=1 _LONGLONG=1 LANGUAGE_C=1 SYSTYPE_BSD=1'
cf_by='jhi'
cf_email='yourname@yourhost.yourplace.com'
-cf_time='Wed Oct 27 16:33:32 EET DST 1999'
+cf_time='Wed Oct 27 20:21:09 EET DST 1999'
chgrp=''
chmod=''
chown=''
@@ -163,6 +163,7 @@ d_gethent='define'
d_gethname='define'
d_gethostprotos='define'
d_getlogin='define'
+d_getmnt='undef'
d_getmntent='undef'
d_getnbyaddr='define'
d_getnbyname='define'
@@ -311,7 +312,6 @@ d_socket='define'
d_sockpair='define'
d_sqrtl='define'
d_statblks='define'
-d_statfs='define'
d_statfs_f_flags='define'
d_statfs_s='define'
d_statvfs='define'
diff --git a/Porting/config_H b/Porting/config_H
index 6b728e0784..66abec565e 100644
--- a/Porting/config_H
+++ b/Porting/config_H
@@ -17,7 +17,7 @@
/*
* Package name : perl5
* Source directory : .
- * Configuration time: Wed Oct 27 16:33:32 EET DST 1999
+ * Configuration time: Wed Oct 27 20:21:09 EET DST 1999
* Configured by : jhi
* Target system : osf1 alpha.hut.fi v4.0 878 alpha
*/
@@ -2178,6 +2178,12 @@
*/
/*#define HAS_ENDSPENT / **/
+/* HAS_STRUCT_FS_DATA:
+ * This symbol, if defined, indicates that the struct fs_data
+ * to do statfs() is supported.
+ */
+/*#define HAS_STRUCT_FS_DATA / **/
+
/* HAS_FSEEKO:
* This symbol, if defined, indicates that the fseeko routine is
* available to fseek beyond 32 bits (useful for ILP32 hosts).
@@ -2195,6 +2201,12 @@
*/
/*#define HAS_FTELLO / **/
+/* HAS_GETMNT:
+ * This symbol, if defined, indicates that the getmnt routine is
+ * available to get filesystem mount info by filename.
+ */
+/*#define HAS_GETMNT / **/
+
/* HAS_GETMNTENT:
* This symbol, if defined, indicates that the getmntent routine is
* available to iterate through mounted file systems to get their info.
@@ -2264,32 +2276,23 @@
*/
#define HAS_SQRTL /**/
-/* HAS_STATFS:
- * This symbol, if defined, indicates that the statfs routine is
- * available to stat filesystems by filenames.
- */
-/* HAS_STRUCT_STATFS:
- * This symbol, if defined, indicates that the struct statfs
- * to do statfs() is supported.
- */
-/* HAS_STRUCT_FS_DATA:
- * This symbol, if defined, indicates that the struct fs_data
- * to do statfs() is supported.
- */
/* HAS_STRUCT_STATFS_F_FLAGS:
* This symbol, if defined, indicates that the struct statfs
* does have the f_flags member containing the mount flags of
* the filesystem containing the file.
* This kind of struct statfs is coming from <sys/mount.h> (BSD 4.3),
* not from <sys/statfs.h> (SYSV). Older BSDs (like Ultrix) do not
- * have statfs() and struct statfs, they have ustat() and statfs()
- * with struct fs_data.
+ * have statfs() and struct statfs, they have ustat() and getmnt()
+ * with struct ustat and struct fs_data.
*/
-#define HAS_STATFS /**/
-#define HAS_STRUCT_STATFS /**/
-/*#define HAS_STRUCT_FS_DATA / **/
#define HAS_STRUCT_STATFS_F_FLAGS /**/
+/* HAS_STRUCT_STATFS:
+ * This symbol, if defined, indicates that the struct statfs
+ * to do statfs() is supported.
+ */
+#define HAS_STRUCT_STATFS /**/
+
/* HAS_FSTATVFS:
* This symbol, if defined, indicates that the fstatvfs routine is
* available to stat filesystems by file descriptors.
diff --git a/config_h.SH b/config_h.SH
index a12916e59e..fc5d9edfe5 100644
--- a/config_h.SH
+++ b/config_h.SH
@@ -2192,6 +2192,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_endspent HAS_ENDSPENT /**/
+/* HAS_STRUCT_FS_DATA:
+ * This symbol, if defined, indicates that the struct fs_data
+ * to do statfs() is supported.
+ */
+#$d_fs_data_s HAS_STRUCT_FS_DATA /**/
+
/* HAS_FSEEKO:
* This symbol, if defined, indicates that the fseeko routine is
* available to fseek beyond 32 bits (useful for ILP32 hosts).
@@ -2209,6 +2215,12 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_ftello HAS_FTELLO /**/
+/* HAS_GETMNT:
+ * This symbol, if defined, indicates that the getmnt routine is
+ * available to get filesystem mount info by filename.
+ */
+#$d_getmnt HAS_GETMNT /**/
+
/* HAS_GETMNTENT:
* This symbol, if defined, indicates that the getmntent routine is
* available to iterate through mounted file systems to get their info.
@@ -2278,32 +2290,23 @@ sed <<!GROK!THIS! >config.h -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-
*/
#$d_sqrtl HAS_SQRTL /**/
-/* HAS_STATFS:
- * This symbol, if defined, indicates that the statfs routine is
- * available to stat filesystems by filenames.
- */
-/* HAS_STRUCT_STATFS:
- * This symbol, if defined, indicates that the struct statfs
- * to do statfs() is supported.
- */
-/* HAS_STRUCT_FS_DATA:
- * This symbol, if defined, indicates that the struct fs_data
- * to do statfs() is supported.
- */
/* HAS_STRUCT_STATFS_F_FLAGS:
* This symbol, if defined, indicates that the struct statfs
* does have the f_flags member containing the mount flags of
* the filesystem containing the file.
* This kind of struct statfs is coming from <sys/mount.h> (BSD 4.3),
* not from <sys/statfs.h> (SYSV). Older BSDs (like Ultrix) do not
- * have statfs() and struct statfs, they have ustat() and statfs()
- * with struct fs_data.
+ * have statfs() and struct statfs, they have ustat() and getmnt()
+ * with struct ustat and struct fs_data.
*/
-#$d_statfs HAS_STATFS /**/
-#$d_statfs_s HAS_STRUCT_STATFS /**/
-#$d_fs_data_s HAS_STRUCT_FS_DATA /**/
#$d_statfs_f_flags HAS_STRUCT_STATFS_F_FLAGS /**/
+/* HAS_STRUCT_STATFS:
+ * This symbol, if defined, indicates that the struct statfs
+ * to do statfs() is supported.
+ */
+#$d_statfs_s HAS_STRUCT_STATFS /**/
+
/* HAS_FSTATVFS:
* This symbol, if defined, indicates that the fstatvfs routine is
* available to stat filesystems by file descriptors.
diff --git a/perl.c b/perl.c
index c2864468e1..c14bfee948 100644
--- a/perl.c
+++ b/perl.c
@@ -2194,10 +2194,10 @@ S_fd_on_nosuid_fs(pTHX_ int fd)
int check_okay = 0; /* able to do all the required sys/libcalls */
int on_nosuid = 0; /* the fd is on a nosuid fs */
/*
- * Preferred order: fstatvfs(), fstatfs(), ustat()+statfs(), getmntent().
+ * Preferred order: fstatvfs(), fstatfs(), ustat()+getmnt(), getmntent().
* fstatvfs() is UNIX98.
* fstatfs() is 4.3 BSD.
- * ustat()+statfs() is pre-4.3 BSD.
+ * ustat()+getmnt() is pre-4.3 BSD.
* getmntent() is O(number-of-mounted-filesystems) and can hang on
* an irrelevant filesystem while trying to reach the right one.
*/
@@ -2208,21 +2208,26 @@ S_fd_on_nosuid_fs(pTHX_ int fd)
on_nosuid = check_okay && (stfs.f_flag & ST_NOSUID);
# else
# ifdef PERL_MOUNT_NOSUID
-# if defined(HAS_FSTATFS) && defined(HAS_STRUCT_STATFS_F_FLAGS)
+# if defined(HAS_FSTATFS) && \
+ defined(HAS_STRUCT_STATFS) && \
+ defined(HAS_STRUCT_STATFS_F_FLAGS)
struct statfs stfs;
check_okay = fstatfs(fd, &stfs) == 0;
on_nosuid = check_okay && (stfs.f_flags & PERL_MOUNT_NOSUID);
# else
# if defined(HAS_FSTAT) && \
defined(HAS_USTAT) && \
- defined(HAS_STATFS) && \
- defined(HAS_STRUCT_FS_DATA) /* no struct statfs */
+ defined(HAS_GETMNT) && \
+ defined(HAS_STRUCT_FS_DATA) &&
+ defined(NOSTAT_ONE)
struct stat fdst;
if (fstat(fd, &fdst) == 0) {
struct ustat us;
if (ustat(fdst.st_dev, &us) == 0) {
struct fs_data fsd;
- if (statfs(PL_origfilename, &fsd) == 0) {
+ /* NOSTAT_ONE here because we're not examining fields which
+ * vary between that case and STAT_ONE. */
+ if (getmnt((int*)0, &fsd, (int)0, NOSTAT_ONE, us.f_fname) == 0) {
size_t cmplen = sizeof(us.f_fname);
if (sizeof(fsd.fd_req.path) < cmplen)
cmplen = sizeof(fsd.fd_req.path);
@@ -2235,8 +2240,8 @@ S_fd_on_nosuid_fs(pTHX_ int fd)
}
}
}
-# endif /* fstat+ustat+statfs */
-# endif /* statfs */
+# endif /* fstat+ustat+getmnt */
+# endif /* fstatfs */
# else
# if defined(HAS_GETMNTENT) && \
defined(HAS_HASMNTOPT) && \
@@ -2260,7 +2265,7 @@ S_fd_on_nosuid_fs(pTHX_ int fd)
}
if (mtab)
fclose(mtab);
-# endif /* getmntent */
+# endif /* getmntent+hasmntopt */
# endif /* PERL_MOUNT_NOSUID: fstatfs or fstat+ustat+statfs */
# endif /* statvfs */
@@ -3215,4 +3220,3 @@ read_e_script(pTHXo_ int idx, SV *buf_sv, int maxlen)
return 1;
}
-
diff --git a/perl.h b/perl.h
index be20e42746..0392a04f61 100644
--- a/perl.h
+++ b/perl.h
@@ -3234,18 +3234,6 @@ typedef struct am_table_short AMTS;
# define PERL_MOUNT_NOSUID M_NOSUID
#endif
-#ifdef HAS_STRUCT_STATFS
-# define PERL_STRUCT_STATFS statfs
-# ifdef HAS_STRUCT_STATFS_F_FLAGS
-# define PERL_STRUCT_STATFS_FLAGS(s) s.f_flags
-# endif
-#else
-# ifdef HAS_STRUCT_FS_DATA
-# define PERL_STRUCT_STATFS statfs
-# define PERL_STRUCT_STATFS_FLAGS(s) s.fd_req.flags
-# endif
-#endif
-
#endif /* IAMSUID */
/* and finally... */