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
d5b18b0b
Commit
d5b18b0b
authored
Oct 17, 2013
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: Add Dup3, {Get,List,Remove,Set}xattr, {Get,Set}priority.
From-SVN: r203788
parent
82e33890
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
99 additions
and
2 deletions
+99
-2
libgo/config.h.in
+15
-0
libgo/configure
+1
-1
libgo/configure.ac
+1
-1
libgo/go/syscall/libcall_linux.go
+15
-0
libgo/go/syscall/libcall_posix.go
+6
-0
libgo/mksysinfo.sh
+4
-0
libgo/runtime/go-nosys.c
+57
-0
No files found.
libgo/config.h.in
View file @
d5b18b0b
...
@@ -39,6 +39,9 @@
...
@@ -39,6 +39,9 @@
/* Define to 1 if you have the `dl_iterate_phdr' function. */
/* Define to 1 if you have the `dl_iterate_phdr' function. */
#undef HAVE_DL_ITERATE_PHDR
#undef HAVE_DL_ITERATE_PHDR
/* Define to 1 if you have the `dup3' function. */
#undef HAVE_DUP3
/* Define to 1 if you have the `epoll_create1' function. */
/* Define to 1 if you have the `epoll_create1' function. */
#undef HAVE_EPOLL_CREATE1
#undef HAVE_EPOLL_CREATE1
...
@@ -66,6 +69,9 @@
...
@@ -66,6 +69,9 @@
/* Define if _Unwind_GetIPInfo is available. */
/* Define if _Unwind_GetIPInfo is available. */
#undef HAVE_GETIPINFO
#undef HAVE_GETIPINFO
/* Define to 1 if you have the `getxattr' function. */
#undef HAVE_GETXATTR
/* Define to 1 if you have the `inotify_add_watch' function. */
/* Define to 1 if you have the `inotify_add_watch' function. */
#undef HAVE_INOTIFY_ADD_WATCH
#undef HAVE_INOTIFY_ADD_WATCH
...
@@ -111,6 +117,9 @@
...
@@ -111,6 +117,9 @@
/* Define to 1 if you have the <linux/rtnetlink.h> header file. */
/* Define to 1 if you have the <linux/rtnetlink.h> header file. */
#undef HAVE_LINUX_RTNETLINK_H
#undef HAVE_LINUX_RTNETLINK_H
/* Define to 1 if you have the `listxattr' function. */
#undef HAVE_LISTXATTR
/* Define to 1 if the system has the type `loff_t'. */
/* Define to 1 if the system has the type `loff_t'. */
#undef HAVE_LOFF_T
#undef HAVE_LOFF_T
...
@@ -171,6 +180,9 @@
...
@@ -171,6 +180,9 @@
/* Define to 1 if you have the `pipe2' function. */
/* Define to 1 if you have the `pipe2' function. */
#undef HAVE_PIPE2
#undef HAVE_PIPE2
/* Define to 1 if you have the `removexattr' function. */
#undef HAVE_REMOVEXATTR
/* Define to 1 if you have the `renameat' function. */
/* Define to 1 if you have the `renameat' function. */
#undef HAVE_RENAMEAT
#undef HAVE_RENAMEAT
...
@@ -180,6 +192,9 @@
...
@@ -180,6 +192,9 @@
/* Define to 1 if you have the `setenv' function. */
/* Define to 1 if you have the `setenv' function. */
#undef HAVE_SETENV
#undef HAVE_SETENV
/* Define to 1 if you have the `setxattr' function. */
#undef HAVE_SETXATTR
/* Define to 1 if you have the `sinl' function. */
/* Define to 1 if you have the `sinl' function. */
#undef HAVE_SINL
#undef HAVE_SINL
...
...
libgo/configure
View file @
d5b18b0b
...
@@ -14706,7 +14706,7 @@ else
...
@@ -14706,7 +14706,7 @@ else
fi
fi
for
ac_func
in
accept4
epoll_create1 faccessat fallocate fchmodat fchownat futimesat inotify_add_watch inotify_init inotify_init1 inotify_rm_watch mkdirat mknodat openat pipe2 renameat
sync_file_range splice tee unlinkat unshare utimensat
for
ac_func
in
accept4
dup3 epoll_create1 faccessat fallocate fchmodat fchownat futimesat getxattr inotify_add_watch inotify_init inotify_init1 inotify_rm_watch listxattr mkdirat mknodat openat pipe2 removexattr renameat setxattr
sync_file_range splice tee unlinkat unshare utimensat
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
"
...
...
libgo/configure.ac
View file @
d5b18b0b
...
@@ -503,7 +503,7 @@ AC_CHECK_FUNCS(strerror_r strsignal wait4 mincore setenv dl_iterate_phdr)
...
@@ -503,7 +503,7 @@ AC_CHECK_FUNCS(strerror_r strsignal wait4 mincore setenv dl_iterate_phdr)
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(accept4
epoll_create1 faccessat fallocate fchmodat fchownat futimesat inotify_add_watch inotify_init inotify_init1 inotify_rm_watch mkdirat mknodat openat pipe2 renameat
sync_file_range splice tee unlinkat unshare utimensat)
AC_CHECK_FUNCS(accept4
dup3 epoll_create1 faccessat fallocate fchmodat fchownat futimesat getxattr inotify_add_watch inotify_init inotify_init1 inotify_rm_watch listxattr mkdirat mknodat openat pipe2 removexattr renameat setxattr
sync_file_range splice tee unlinkat unshare utimensat)
AC_TYPE_OFF_T
AC_TYPE_OFF_T
AC_CHECK_TYPES([loff_t])
AC_CHECK_TYPES([loff_t])
...
...
libgo/go/syscall/libcall_linux.go
View file @
d5b18b0b
...
@@ -190,6 +190,9 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {
...
@@ -190,6 +190,9 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {
//sys Adjtimex(buf *Timex) (state int, err error)
//sys Adjtimex(buf *Timex) (state int, err error)
//adjtimex(buf *Timex) _C_int
//adjtimex(buf *Timex) _C_int
//sysnb Dup3(oldfd int, newfd int, flags int) (err error)
//dup3(oldfd _C_int, newfd _C_int, flags _C_int) _C_int
//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 _C_int, pathname *byte, mode _C_int, flags _C_int) _C_int
//faccessat(dirfd _C_int, pathname *byte, mode _C_int, flags _C_int) _C_int
...
@@ -268,6 +271,9 @@ func ParseDirent(buf []byte, max int, names []string) (consumed int, count int,
...
@@ -268,6 +271,9 @@ func ParseDirent(buf []byte, max int, names []string) (consumed int, count int,
return
origlen
-
len
(
buf
),
count
,
names
return
origlen
-
len
(
buf
),
count
,
names
}
}
//sys Getxattr(path string, attr string, dest []byte) (sz int, err error)
//getxattr(path *byte, attr *byte, buf *byte, count Size_t) Ssize_t
//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error)
//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, err error)
//inotify_add_watch(fd _C_int, pathname *byte, mask uint32) _C_int
//inotify_add_watch(fd _C_int, pathname *byte, mask uint32) _C_int
...
@@ -283,6 +289,9 @@ func ParseDirent(buf []byte, max int, names []string) (consumed int, count int,
...
@@ -283,6 +289,9 @@ func ParseDirent(buf []byte, max int, names []string) (consumed int, count int,
//sys Klogctl(typ int, buf []byte) (n int, err error)
//sys Klogctl(typ int, buf []byte) (n int, err error)
//klogctl(typ _C_int, bufp *byte, len _C_int) _C_int
//klogctl(typ _C_int, bufp *byte, len _C_int) _C_int
//sys Listxattr(path string, dest []byte) (sz int, err error)
//listxattr(path *byte, list *byte, size Size_t) Ssize_t
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
//mkdirat(dirfd _C_int, path *byte, mode Mode_t) _C_int
//mkdirat(dirfd _C_int, path *byte, mode Mode_t) _C_int
...
@@ -305,6 +314,9 @@ func Pipe2(p []int, flags int) (err error) {
...
@@ -305,6 +314,9 @@ func Pipe2(p []int, flags int) (err error) {
//sys PivotRoot(newroot string, putold string) (err error)
//sys PivotRoot(newroot string, putold string) (err error)
//pivot_root(newroot *byte, putold *byte) _C_int
//pivot_root(newroot *byte, putold *byte) _C_int
//sys Removexattr(path string, attr string) (err error)
//removexattr(path *byte, name *byte) _C_int
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//sys Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//renameat(olddirfd _C_int, oldpath *byte, newdirfd _C_int, newpath *byte) _C_int
//renameat(olddirfd _C_int, oldpath *byte, newdirfd _C_int, newpath *byte) _C_int
...
@@ -338,6 +350,9 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
...
@@ -338,6 +350,9 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sysnb Setresuid(ruid int, eguid int, suid int) (err error)
//sysnb Setresuid(ruid int, eguid int, suid int) (err error)
//setresuid(ruid Uid_t, euid Uid_t, suid Uid_t) _C_int
//setresuid(ruid Uid_t, euid Uid_t, suid Uid_t) _C_int
//sys Setxattr(path string, attr string, data []byte, flags int) (err error)
//setxattr(path *byte, name *byte, value *byte, size Size_t, flags _C_int) _C_int
//sys splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
//sys splice(rfd int, roff *_loff_t, wfd int, woff *_loff_t, len int, flags int) (n int64, err error)
//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
//splice(rfd _C_int, roff *_loff_t, wfd _C_int, woff *_loff_t, len Size_t, flags _C_uint) Ssize_t
func
Splice
(
rfd
int
,
roff
*
int64
,
wfd
int
,
woff
*
int64
,
len
int
,
flags
int
)
(
n
int64
,
err
error
)
{
func
Splice
(
rfd
int
,
roff
*
int64
,
wfd
int
,
woff
*
int64
,
len
int
,
flags
int
)
(
n
int64
,
err
error
)
{
...
...
libgo/go/syscall/libcall_posix.go
View file @
d5b18b0b
...
@@ -238,6 +238,9 @@ func FDZero(set *FdSet) {
...
@@ -238,6 +238,9 @@ func FDZero(set *FdSet) {
//sysnb Getppid() (ppid int)
//sysnb Getppid() (ppid int)
//getppid() Pid_t
//getppid() Pid_t
//sys Getpriority(which int, who int) (prio int, err error)
//getpriority(which _C_int, who _C_int) _C_int
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
//getrlimit(resource _C_int, rlim *Rlimit) _C_int
//getrlimit(resource _C_int, rlim *Rlimit) _C_int
...
@@ -307,6 +310,9 @@ func Gettimeofday(tv *Timeval) (err error) {
...
@@ -307,6 +310,9 @@ func Gettimeofday(tv *Timeval) (err error) {
//sysnb Setpgid(pid int, pgid int) (err error)
//sysnb Setpgid(pid int, pgid int) (err error)
//setpgid(pid Pid_t, pgid Pid_t) _C_int
//setpgid(pid Pid_t, pgid Pid_t) _C_int
//sys Setpriority(which int, who int, prio int) (err error)
//setpriority(which _C_int, who _C_int, prio _C_int) _C_int
//sysnb Setreuid(ruid int, euid int) (err error)
//sysnb Setreuid(ruid int, euid int) (err error)
//setreuid(ruid Uid_t, euid Uid_t) _C_int
//setreuid(ruid Uid_t, euid Uid_t) _C_int
...
...
libgo/mksysinfo.sh
View file @
d5b18b0b
...
@@ -1035,6 +1035,10 @@ grep '^type _utimbuf ' gen-sysinfo.go | \
...
@@ -1035,6 +1035,10 @@ grep '^type _utimbuf ' gen-sysinfo.go | \
grep
'^const _LOCK_'
gen-sysinfo.go |
grep
'^const _LOCK_'
gen-sysinfo.go |
sed
-e
's/^\(const \)_\(LOCK_[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
sed
-e
's/^\(const \)_\(LOCK_[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
# The PRIO constants.
grep
'^const _PRIO_'
gen-sysinfo.go |
\
sed
-e
's/^\(const \)_\(PRIO_[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
# The GNU/Linux LINUX_REBOOT flags.
# The GNU/Linux LINUX_REBOOT flags.
grep
'^const _LINUX_REBOOT_'
gen-sysinfo.go |
grep
'^const _LINUX_REBOOT_'
gen-sysinfo.go |
sed
-e
's/^\(const \)_\(LINUX_REBOOT_[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
sed
-e
's/^\(const \)_\(LINUX_REBOOT_[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
...
...
libgo/runtime/go-nosys.c
View file @
d5b18b0b
...
@@ -43,6 +43,17 @@ accept4 (int sockfd __attribute__ ((unused)),
...
@@ -43,6 +43,17 @@ accept4 (int sockfd __attribute__ ((unused)),
}
}
#endif
#endif
#ifndef HAVE_DUP3
int
dup3
(
int
oldfd
__attribute__
((
unused
)),
int
newfd
__attribute__
((
unused
)),
int
flags
__attribtue__
((
unused
)))
{
errno
=
ENOSYS
;
return
-
1
;
}
#endif
#ifndef HAVE_EPOLL_CREATE1
#ifndef HAVE_EPOLL_CREATE1
int
int
epoll_create1
(
int
flags
__attribute__
((
unused
)))
epoll_create1
(
int
flags
__attribute__
((
unused
)))
...
@@ -112,6 +123,18 @@ futimesat (int dirfd __attribute__ ((unused)),
...
@@ -112,6 +123,18 @@ futimesat (int dirfd __attribute__ ((unused)),
}
}
#endif
#endif
#ifndef HAVE_GETXATTR
ssize_t
getxattr
(
const
char
*
path
__attribute__
((
unused
)),
const
char
*
name
__attribute__
((
unused
)),
void
*
value
__attribute__
((
unused
)),
size_t
size
__attribute__
((
unused
)))
{
errno
=
ENOSYS
;
return
-
1
;
}
#endif
#ifndef HAVE_INOTIFY_ADD_WATCH
#ifndef HAVE_INOTIFY_ADD_WATCH
int
int
inotify_add_watch
(
int
fd
__attribute__
((
unused
)),
inotify_add_watch
(
int
fd
__attribute__
((
unused
)),
...
@@ -151,6 +174,17 @@ inotify_rm_watch (int fd __attribute__ ((unused)),
...
@@ -151,6 +174,17 @@ inotify_rm_watch (int fd __attribute__ ((unused)),
}
}
#endif
#endif
#ifndef HAVE_LISTXATTR
ssize_t
listxattr
(
const
char
*
path
__attribute__
((
unused
)),
char
*
list
__attribute__
((
unused
)),
size_t
size
__attribute__
((
unused
)))
{
errno
=
ENOSYS
;
return
-
1
;
}
#endif
#ifndef HAVE_MKDIRAT
#ifndef HAVE_MKDIRAT
int
int
mkdirat
(
int
dirfd
__attribute__
((
unused
)),
mkdirat
(
int
dirfd
__attribute__
((
unused
)),
...
@@ -196,6 +230,16 @@ pipe2 (int pipefd[2] __attribute__ ((unused)),
...
@@ -196,6 +230,16 @@ pipe2 (int pipefd[2] __attribute__ ((unused)),
}
}
#endif
#endif
#ifndef HAVE_REMOVEXATTR
int
removexattr
(
const
char
*
path
__attribute__
((
unused
)),
const
char
*
name
__attribute__
((
unused
)))
{
errno
=
ENOSYS
;
return
-
1
;
}
#endif
#ifndef HAVE_RENAMEAT
#ifndef HAVE_RENAMEAT
int
int
renameat
(
int
olddirfd
__attribute__
((
unused
)),
renameat
(
int
olddirfd
__attribute__
((
unused
)),
...
@@ -208,6 +252,19 @@ renameat (int olddirfd __attribute__ ((unused)),
...
@@ -208,6 +252,19 @@ renameat (int olddirfd __attribute__ ((unused)),
}
}
#endif
#endif
#ifndef HAVE_SETXATTR
int
setxattr
(
const
char
*
path
__attribute__
((
unused
)),
const
char
*
name
__attribute__
((
unused
)),
const
void
*
value
__attribute__
((
unused
)),
size_t
size
__attribute__
((
unused
)),
int
flags
__attribute__
((
unused
)))
{
errno
=
ENOSYS
;
return
-
1
;
}
#endif
#ifndef HAVE_SPLICE
#ifndef HAVE_SPLICE
int
int
splice
(
int
fd
__attribute__
((
unused
)),
splice
(
int
fd
__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