# $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
d_flexfnam=''
d_flock=''
d_fork=''
+d_fs_data_s=''
d_fseeko=''
d_fsetpos=''
d_fstatfs=''
d_uname=''
d_gethostprotos=''
d_getlogin=''
+d_getmnt=''
d_getmntent=''
d_getnbyaddr=''
d_getnbyname=''
socketlib=''
d_sqrtl=''
d_statblks=''
-d_fs_data_s=''
-d_statfs=''
d_statfs_f_flags=''
d_statfs_s=''
d_fstatvfs=''
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
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
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
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'
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'
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.
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
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.
# 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
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=''
d_gethname='define'
d_gethostprotos='define'
d_getlogin='define'
+d_getmnt='undef'
d_getmntent='undef'
d_getnbyaddr='define'
d_getnbyname='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'
/*
* 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
*/
*/
/*#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).
*/
/*#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.
*/
#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.
*/
#$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).
*/
#$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.
*/
#$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.
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.
*/
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);
}
}
}
-# endif /* fstat+ustat+statfs */
-# endif /* statfs */
+# endif /* fstat+ustat+getmnt */
+# endif /* fstatfs */
# else
# if defined(HAS_GETMNTENT) && \
defined(HAS_HASMNTOPT) && \
}
if (mtab)
fclose(mtab);
-# endif /* getmntent */
+# endif /* getmntent+hasmntopt */
# endif /* PERL_MOUNT_NOSUID: fstatfs or fstat+ustat+statfs */
# endif /* statvfs */
return 1;
}
-
# 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... */