mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-27 22:03:57 +08:00
libgo: Add mount flags, fallocate, statfs.
From-SVN: r184365
This commit is contained in:
parent
195a2e9d1f
commit
5d46bf0538
@ -12,6 +12,9 @@
|
||||
/* Define to 1 if you have the `faccessat' function. */
|
||||
#undef HAVE_FACCESSAT
|
||||
|
||||
/* Define to 1 if you have the `fallocate' function. */
|
||||
#undef HAVE_FALLOCATE
|
||||
|
||||
/* Define to 1 if you have the `fchmodat' function. */
|
||||
#undef HAVE_FCHMODAT
|
||||
|
||||
@ -130,6 +133,9 @@
|
||||
/* Define to 1 if you have the <sys/mman.h> header file. */
|
||||
#undef HAVE_SYS_MMAN_H
|
||||
|
||||
/* Define to 1 if you have the <sys/mount.h> header file. */
|
||||
#undef HAVE_SYS_MOUNT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/prctl.h> header file. */
|
||||
#undef HAVE_SYS_PRCTL_H
|
||||
|
||||
@ -142,6 +148,9 @@
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
#undef HAVE_SYS_SOCKET_H
|
||||
|
||||
/* Define to 1 if you have the <sys/statfs.h> header file. */
|
||||
#undef HAVE_SYS_STATFS_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
@ -157,6 +166,9 @@
|
||||
/* Define to 1 if you have the <sys/utsname.h> header file. */
|
||||
#undef HAVE_SYS_UTSNAME_H
|
||||
|
||||
/* Define to 1 if you have the <sys/vfs.h> header file. */
|
||||
#undef HAVE_SYS_VFS_H
|
||||
|
||||
/* Define to 1 if you have the `tee' function. */
|
||||
#undef HAVE_TEE
|
||||
|
||||
@ -235,3 +247,6 @@
|
||||
# undef WORDS_BIGENDIAN
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Define to `long int' if <sys/types.h> does not define. */
|
||||
#undef off_t
|
||||
|
15
libgo/configure
vendored
15
libgo/configure
vendored
@ -14508,7 +14508,7 @@ no)
|
||||
;;
|
||||
esac
|
||||
|
||||
for ac_header in sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h sys/prctl.h
|
||||
for ac_header in sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h
|
||||
do :
|
||||
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
|
||||
@ -14581,7 +14581,7 @@ else
|
||||
fi
|
||||
|
||||
|
||||
for ac_func in epoll_create1 faccessat fchmodat fchownat futimesat inotify_add_watch inotify_init inotify_rm_watch mkdirat mknodat openat renameat splice tee unlinkat unshare
|
||||
for ac_func in epoll_create1 faccessat fallocate fchmodat fchownat futimesat inotify_add_watch inotify_init inotify_rm_watch mkdirat mknodat openat renameat splice tee unlinkat unshare
|
||||
do :
|
||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||
@ -14594,6 +14594,17 @@ _ACEOF
|
||||
fi
|
||||
done
|
||||
|
||||
ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
|
||||
if test "x$ac_cv_type_off_t" = x""yes; then :
|
||||
|
||||
else
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define off_t long int
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
ac_fn_c_check_type "$LINENO" "loff_t" "ac_cv_type_loff_t" "$ac_includes_default"
|
||||
if test "x$ac_cv_type_loff_t" = x""yes; then :
|
||||
|
||||
|
@ -453,7 +453,7 @@ no)
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h sys/prctl.h)
|
||||
AC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h)
|
||||
|
||||
AC_CHECK_HEADERS([linux/filter.h linux/netlink.h linux/rtnetlink.h], [], [],
|
||||
[#ifdef HAVE_SYS_SOCKET_H
|
||||
@ -467,7 +467,8 @@ AC_CHECK_FUNCS(strerror_r strsignal wait4 mincore setenv)
|
||||
AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
|
||||
AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = yes)
|
||||
|
||||
AC_CHECK_FUNCS(epoll_create1 faccessat fchmodat fchownat futimesat inotify_add_watch inotify_init inotify_rm_watch mkdirat mknodat openat renameat splice tee unlinkat unshare)
|
||||
AC_CHECK_FUNCS(epoll_create1 faccessat fallocate fchmodat fchownat futimesat inotify_add_watch inotify_init inotify_rm_watch mkdirat mknodat openat renameat splice tee unlinkat unshare)
|
||||
AC_TYPE_OFF_T
|
||||
AC_CHECK_TYPES([loff_t])
|
||||
|
||||
CFLAGS_hold="$CFLAGS"
|
||||
|
@ -178,9 +178,8 @@ func PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pid, 0, 0)
|
||||
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||
//faccessat(dirfd int, pathname *byte, mode int, flags int) int
|
||||
|
||||
// FIXME: Only in glibc 2.10 and later.
|
||||
// //sys Fallocate(fd int, mode uint32, off int64, len int64) (err error)
|
||||
// //fallocate(fd int, mode int, offset Offset_t, len Offset_t) int
|
||||
//sys Fallocate(fd int, mode uint32, off int64, len int64) (err error)
|
||||
//fallocate(fd int, mode int, offset Offset_t, len Offset_t) int
|
||||
|
||||
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
|
||||
//fchmodat(dirfd int, pathname *byte, mode Mode_t, flags int) int
|
||||
@ -191,9 +190,8 @@ func PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pid, 0, 0)
|
||||
//sys Flock(fd int, how int) (err error)
|
||||
//flock(fd int, how int) int
|
||||
|
||||
// FIXME: mksysinfo statfs
|
||||
// //sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||
// //fstatfs(fd int, buf *Statfs_t) int
|
||||
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
|
||||
//fstatfs(fd int, buf *Statfs_t) int
|
||||
|
||||
func Gettid() (tid int) {
|
||||
r1, _, _ := Syscall(SYS_GETTID, 0, 0, 0)
|
||||
@ -283,9 +281,8 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i
|
||||
return
|
||||
}
|
||||
|
||||
// FIXME: mksysinfo statfs
|
||||
// //sys Statfs(path string, buf *Statfs_t) (err error)
|
||||
// //statfs(path *byte, buf *Statfs_t) int
|
||||
//sys Statfs(path string, buf *Statfs_t) (err error)
|
||||
//statfs(path *byte, buf *Statfs_t) int
|
||||
|
||||
// FIXME: Only in glibc 2.6 and later.
|
||||
// //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
|
||||
|
@ -93,6 +93,15 @@ cat > sysinfo.c <<EOF
|
||||
#if defined(HAVE_NET_IF_H)
|
||||
#include <net/if.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_MOUNT_H)
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_VFS_H)
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
#if defined(HAVE_STATFS_H)
|
||||
#include <sys/statfs.h>
|
||||
#endif
|
||||
|
||||
/* Constants that may only be defined as expressions on some systems,
|
||||
expressions too complex for -fdump-go-spec to handle. These are
|
||||
@ -766,4 +775,35 @@ for n in IGNBRK BRKINT IGNPAR PARMRK INPCK ISTRIP INLCR IGNCR ICRNL IUCLC \
|
||||
sed -e 's/^\(const \)_\([^=]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
|
||||
done
|
||||
|
||||
# The mount flags
|
||||
grep '^const _MS_' gen-sysinfo.go |
|
||||
sed -e 's/^\(const \)_\(MS_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
|
||||
|
||||
# The fallocate flags.
|
||||
grep '^const _FALLOC_' gen-sysinfo.go |
|
||||
sed -e 's/^\(const \)_\(FALLOC_[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
|
||||
|
||||
# The statfs struct.
|
||||
# Prefer largefile variant if available.
|
||||
statfs=`grep '^type _statfs64 ' gen-sysinfo.go || true`
|
||||
if test "$statfs" != ""; then
|
||||
grep '^type _statfs64 ' gen-sysinfo.go
|
||||
else
|
||||
grep '^type _statfs ' gen-sysinfo.go
|
||||
fi | sed -e 's/type _statfs64/type Statfs_t/' \
|
||||
-e 's/type _statfs/type Statfs_t/' \
|
||||
-e 's/f_type/Type/' \
|
||||
-e 's/f_bsize/Bsize/' \
|
||||
-e 's/f_blocks/Blocks/' \
|
||||
-e 's/f_bfree/Bfree/' \
|
||||
-e 's/f_bavail/Bavail/' \
|
||||
-e 's/f_files/Files/' \
|
||||
-e 's/f_ffree/Ffree/' \
|
||||
-e 's/f_fsid/Fsid/' \
|
||||
-e 's/f_namelen/Namelen/' \
|
||||
-e 's/f_frsize/Frsize/' \
|
||||
-e 's/f_flags/Flags/' \
|
||||
-e 's/f_spare/Spare/' \
|
||||
>> ${OUT}
|
||||
|
||||
exit $?
|
||||
|
@ -48,6 +48,18 @@ faccessat (int fd __attribute__ ((unused)),
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FALLOCATE
|
||||
int
|
||||
fallocate (int fd __attribute__ ((unused)),
|
||||
int mode __attribute__ ((unused)),
|
||||
off_t offset __attribute __ ((unused)),
|
||||
off_t len __attribute__ ((unused)))
|
||||
{
|
||||
errno = ENOSYS;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_FCHMODAT
|
||||
int
|
||||
fchmodat (int dirfd __attribute__ ((unused)),
|
||||
|
Loading…
Reference in New Issue
Block a user