Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
5d46bf05
Commit
5d46bf05
authored
Feb 18, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libgo: Add mount flags, fallocate, statfs.
From-SVN: r184365
parent
195a2e9d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
13 deletions
+89
-13
libgo/config.h.in
+15
-0
libgo/configure
+13
-2
libgo/configure.ac
+3
-2
libgo/go/syscall/libcall_linux.go
+6
-9
libgo/mksysinfo.sh
+40
-0
libgo/runtime/go-nosys.c
+12
-0
No files found.
libgo/config.h.in
View file @
5d46bf05
...
@@ -12,6 +12,9 @@
...
@@ -12,6 +12,9 @@
/* Define to 1 if you have the `faccessat' function. */
/* Define to 1 if you have the `faccessat' function. */
#undef HAVE_FACCESSAT
#undef HAVE_FACCESSAT
/* Define to 1 if you have the `fallocate' function. */
#undef HAVE_FALLOCATE
/* Define to 1 if you have the `fchmodat' function. */
/* Define to 1 if you have the `fchmodat' function. */
#undef HAVE_FCHMODAT
#undef HAVE_FCHMODAT
...
@@ -130,6 +133,9 @@
...
@@ -130,6 +133,9 @@
/* Define to 1 if you have the <sys/mman.h> header file. */
/* Define to 1 if you have the <sys/mman.h> header file. */
#undef HAVE_SYS_MMAN_H
#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. */
/* Define to 1 if you have the <sys/prctl.h> header file. */
#undef HAVE_SYS_PRCTL_H
#undef HAVE_SYS_PRCTL_H
...
@@ -142,6 +148,9 @@
...
@@ -142,6 +148,9 @@
/* Define to 1 if you have the <sys/socket.h> header file. */
/* Define to 1 if you have the <sys/socket.h> header file. */
#undef HAVE_SYS_SOCKET_H
#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. */
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
#undef HAVE_SYS_STAT_H
...
@@ -157,6 +166,9 @@
...
@@ -157,6 +166,9 @@
/* Define to 1 if you have the <sys/utsname.h> header file. */
/* Define to 1 if you have the <sys/utsname.h> header file. */
#undef HAVE_SYS_UTSNAME_H
#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. */
/* Define to 1 if you have the `tee' function. */
#undef HAVE_TEE
#undef HAVE_TEE
...
@@ -235,3 +247,6 @@
...
@@ -235,3 +247,6 @@
# undef WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
# endif
# endif
#endif
#endif
/* Define to `long int' if <sys/types.h> does not define. */
#undef off_t
libgo/configure
View file @
5d46bf05
...
@@ -14508,7 +14508,7 @@ no)
...
@@ -14508,7 +14508,7 @@ no)
;;
;;
esac
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
:
do
:
as_ac_Header
=
`
$as_echo
"ac_cv_header_
$ac_header
"
|
$as_tr_sh
`
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
"
ac_fn_c_check_header_mongrel
"
$LINENO
"
"
$ac_header
"
"
$as_ac_Header
"
"
$ac_includes_default
"
...
@@ -14581,7 +14581,7 @@ else
...
@@ -14581,7 +14581,7 @@ else
fi
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 f
allocate f
chmodat fchownat futimesat inotify_add_watch inotify_init inotify_rm_watch mkdirat mknodat openat renameat splice tee unlinkat unshare
do
:
do
:
as_ac_var
=
`
$as_echo
"ac_cv_func_
$ac_func
"
|
$as_tr_sh
`
as_ac_var
=
`
$as_echo
"ac_cv_func_
$ac_func
"
|
$as_tr_sh
`
ac_fn_c_check_func
"
$LINENO
"
"
$ac_func
"
"
$as_ac_var
"
ac_fn_c_check_func
"
$LINENO
"
"
$ac_func
"
"
$as_ac_var
"
...
@@ -14594,6 +14594,17 @@ _ACEOF
...
@@ -14594,6 +14594,17 @@ _ACEOF
fi
fi
done
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
"
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
:
if
test
"x
$ac_cv_type_loff_t
"
=
x
""
yes
;
then
:
...
...
libgo/configure.ac
View file @
5d46bf05
...
@@ -453,7 +453,7 @@ no)
...
@@ -453,7 +453,7 @@ no)
;;
;;
esac
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], [], [],
AC_CHECK_HEADERS([linux/filter.h linux/netlink.h linux/rtnetlink.h], [], [],
[#ifdef HAVE_SYS_SOCKET_H
[#ifdef HAVE_SYS_SOCKET_H
...
@@ -467,7 +467,8 @@ AC_CHECK_FUNCS(strerror_r strsignal wait4 mincore setenv)
...
@@ -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_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = 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])
AC_CHECK_TYPES([loff_t])
CFLAGS_hold="$CFLAGS"
CFLAGS_hold="$CFLAGS"
...
...
libgo/go/syscall/libcall_linux.go
View file @
5d46bf05
...
@@ -178,9 +178,8 @@ func PtraceDetach(pid int) (err error) { return ptrace(PTRACE_DETACH, pid, 0, 0)
...
@@ -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)
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (err error)
//faccessat(dirfd int, pathname *byte, mode int, flags int) int
//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)
// //sys Fallocate(fd int, mode uint32, off int64, len int64) (err error)
//fallocate(fd int, mode int, offset Offset_t, len Offset_t) int
// //fallocate(fd int, mode int, offset Offset_t, len Offset_t) int
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
//sys Fchmodat(dirfd int, path string, mode uint32, flags int) (err error)
//fchmodat(dirfd int, pathname *byte, mode Mode_t, flags int) int
//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)
...
@@ -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)
//sys Flock(fd int, how int) (err error)
//flock(fd int, how int) int
//flock(fd int, how int) int
// FIXME: mksysinfo statfs
//sys Fstatfs(fd int, buf *Statfs_t) (err error)
// //sys Fstatfs(fd int, buf *Statfs_t) (err error)
//fstatfs(fd int, buf *Statfs_t) int
// //fstatfs(fd int, buf *Statfs_t) int
func
Gettid
()
(
tid
int
)
{
func
Gettid
()
(
tid
int
)
{
r1
,
_
,
_
:=
Syscall
(
SYS_GETTID
,
0
,
0
,
0
)
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
...
@@ -283,9 +281,8 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i
return
return
}
}
// FIXME: mksysinfo statfs
//sys Statfs(path string, buf *Statfs_t) (err error)
// //sys Statfs(path string, buf *Statfs_t) (err error)
//statfs(path *byte, buf *Statfs_t) int
// //statfs(path *byte, buf *Statfs_t) int
// FIXME: Only in glibc 2.6 and later.
// FIXME: Only in glibc 2.6 and later.
// //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
// //sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
...
...
libgo/mksysinfo.sh
View file @
5d46bf05
...
@@ -93,6 +93,15 @@ cat > sysinfo.c <<EOF
...
@@ -93,6 +93,15 @@ cat > sysinfo.c <<EOF
#if defined(HAVE_NET_IF_H)
#if defined(HAVE_NET_IF_H)
#include <net/if.h>
#include <net/if.h>
#endif
#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,
/* Constants that may only be defined as expressions on some systems,
expressions too complex for -fdump-go-spec to handle. These are
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 \
...
@@ -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
}
sed
-e
's/^\(const \)_\([^=]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
done
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
$?
exit
$?
libgo/runtime/go-nosys.c
View file @
5d46bf05
...
@@ -48,6 +48,18 @@ faccessat (int fd __attribute__ ((unused)),
...
@@ -48,6 +48,18 @@ faccessat (int fd __attribute__ ((unused)),
}
}
#endif
#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
#ifndef HAVE_FCHMODAT
int
int
fchmodat
(
int
dirfd
__attribute__
((
unused
)),
fchmodat
(
int
dirfd
__attribute__
((
unused
)),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment