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
f04e40af
Commit
f04e40af
authored
Apr 22, 2012
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mksysinfo: More fixes to emulate master Go library.
From-SVN: r186685
parent
df32732f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
13 deletions
+30
-13
libgo/config.h.in
+3
-0
libgo/configure
+1
-1
libgo/configure.ac
+1
-1
libgo/go/os/stat.go
+2
-2
libgo/go/os/stat_solaris.go
+2
-2
libgo/go/syscall/libcall_linux.go
+1
-1
libgo/go/syscall/socket.go
+1
-1
libgo/mksysinfo.sh
+19
-5
No files found.
libgo/config.h.in
View file @
f04e40af
...
@@ -48,6 +48,9 @@
...
@@ -48,6 +48,9 @@
/* Define to 1 if you have the <linux/filter.h> header file. */
/* Define to 1 if you have the <linux/filter.h> header file. */
#undef HAVE_LINUX_FILTER_H
#undef HAVE_LINUX_FILTER_H
/* Define to 1 if you have the <linux/fs.h> header file. */
#undef HAVE_LINUX_FS_H
/* Define to 1 if you have the <linux/if_addr.h> header file. */
/* Define to 1 if you have the <linux/if_addr.h> header file. */
#undef HAVE_LINUX_IF_ADDR_H
#undef HAVE_LINUX_IF_ADDR_H
...
...
libgo/configure
View file @
f04e40af
...
@@ -14508,7 +14508,7 @@ no)
...
@@ -14508,7 +14508,7 @@ no)
;;
;;
esac
esac
for
ac_header
in
sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h
for
ac_header
in
sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/
fs.h linux/
reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.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
"
...
...
libgo/configure.ac
View file @
f04e40af
...
@@ -453,7 +453,7 @@ no)
...
@@ -453,7 +453,7 @@ no)
;;
;;
esac
esac
AC_CHECK_HEADERS(sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h)
AC_CHECK_HEADERS(sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/
fs.h linux/
reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h)
AC_CHECK_HEADERS([linux/filter.h linux/if_addr.h linux/if_ether.h linux/if_tun.h linux/netlink.h linux/rtnetlink.h], [], [],
AC_CHECK_HEADERS([linux/filter.h linux/if_addr.h linux/if_ether.h linux/if_tun.h linux/netlink.h linux/rtnetlink.h], [], [],
[#ifdef HAVE_SYS_SOCKET_H
[#ifdef HAVE_SYS_SOCKET_H
...
...
libgo/go/os/stat.go
View file @
f04e40af
...
@@ -19,7 +19,7 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
...
@@ -19,7 +19,7 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
fs
:=
&
fileStat
{
fs
:=
&
fileStat
{
name
:
basename
(
name
),
name
:
basename
(
name
),
size
:
int64
(
st
.
Size
),
size
:
int64
(
st
.
Size
),
modTime
:
timespecToTime
(
st
.
Mtim
e
),
modTime
:
timespecToTime
(
st
.
Mtim
),
sys
:
st
,
sys
:
st
,
}
}
fs
.
mode
=
FileMode
(
st
.
Mode
&
0777
)
fs
.
mode
=
FileMode
(
st
.
Mode
&
0777
)
...
@@ -52,5 +52,5 @@ func timespecToTime(ts syscall.Timespec) time.Time {
...
@@ -52,5 +52,5 @@ func timespecToTime(ts syscall.Timespec) time.Time {
// For testing.
// For testing.
func
atime
(
fi
FileInfo
)
time
.
Time
{
func
atime
(
fi
FileInfo
)
time
.
Time
{
return
timespecToTime
(
fi
.
Sys
()
.
(
*
syscall
.
Stat_t
)
.
Atim
e
)
return
timespecToTime
(
fi
.
Sys
()
.
(
*
syscall
.
Stat_t
)
.
Atim
)
}
}
libgo/go/os/stat_solaris.go
View file @
f04e40af
...
@@ -19,7 +19,7 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
...
@@ -19,7 +19,7 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
fs
:=
&
fileStat
{
fs
:=
&
fileStat
{
name
:
basename
(
name
),
name
:
basename
(
name
),
size
:
int64
(
st
.
Size
),
size
:
int64
(
st
.
Size
),
modTime
:
timestrucToTime
(
st
.
Mtim
e
),
modTime
:
timestrucToTime
(
st
.
Mtim
),
sys
:
st
,
sys
:
st
,
}
}
fs
.
mode
=
FileMode
(
st
.
Mode
&
0777
)
fs
.
mode
=
FileMode
(
st
.
Mode
&
0777
)
...
@@ -52,5 +52,5 @@ func timestrucToTime(ts syscall.Timestruc) time.Time {
...
@@ -52,5 +52,5 @@ func timestrucToTime(ts syscall.Timestruc) time.Time {
// For testing.
// For testing.
func
atime
(
fi
FileInfo
)
time
.
Time
{
func
atime
(
fi
FileInfo
)
time
.
Time
{
return
timestrucToTime
(
fi
.
(
*
fileStat
)
.
Sys
()
.
(
*
syscall
.
Stat_t
)
.
Atim
e
)
return
timestrucToTime
(
fi
.
(
*
fileStat
)
.
Sys
()
.
(
*
syscall
.
Stat_t
)
.
Atim
)
}
}
libgo/go/syscall/libcall_linux.go
View file @
f04e40af
...
@@ -335,7 +335,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i
...
@@ -335,7 +335,7 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i
//sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error)
//sys Tee(rfd int, wfd int, len int, flags int) (n int64, err error)
//tee(rfd int, wfd int, len Size_t, flags uint) Ssize_t
//tee(rfd int, wfd int, len Size_t, flags uint) Ssize_t
func
Tgkill
(
tgid
,
tid
int
,
sig
Signal
)
error
{
func
Tgkill
(
tgid
int
,
tid
int
,
sig
Signal
)
error
{
r1
,
_
,
errno
:=
Syscall
(
SYS_TGKILL
,
uintptr
(
tgid
),
uintptr
(
tid
),
uintptr
(
sig
))
r1
,
_
,
errno
:=
Syscall
(
SYS_TGKILL
,
uintptr
(
tgid
),
uintptr
(
tid
),
uintptr
(
sig
))
if
r1
<
0
{
if
r1
<
0
{
return
errno
return
errno
...
...
libgo/go/syscall/socket.go
View file @
f04e40af
...
@@ -22,7 +22,7 @@ type Sockaddr interface {
...
@@ -22,7 +22,7 @@ type Sockaddr interface {
type
RawSockaddrAny
struct
{
type
RawSockaddrAny
struct
{
Addr
RawSockaddr
Addr
RawSockaddr
Pad
[
12
]
int8
Pad
[
96
]
int8
}
}
const
SizeofSockaddrAny
=
0x1c
const
SizeofSockaddrAny
=
0x1c
...
...
libgo/mksysinfo.sh
View file @
f04e40af
...
@@ -151,6 +151,9 @@ cat > sysinfo.c <<EOF
...
@@ -151,6 +151,9 @@ cat > sysinfo.c <<EOF
#if defined(HAVE_LINUX_ETHER_H)
#if defined(HAVE_LINUX_ETHER_H)
#include <linux/ether.h>
#include <linux/ether.h>
#endif
#endif
#if defined(HAVE_LINUX_FS_H)
#include <linux/fs.h>
#endif
#if defined(HAVE_LINUX_REBOOT_H)
#if defined(HAVE_LINUX_REBOOT_H)
#include <linux/reboot.h>
#include <linux/reboot.h>
#endif
#endif
...
@@ -271,6 +274,10 @@ done
...
@@ -271,6 +274,10 @@ done
grep
'^const __PC'
gen-sysinfo.go |
grep
'^const __PC'
gen-sysinfo.go |
sed
-e
's/^\(const \)__\(PC[^= ]*\)\(.*\)$/\1\2 = __\2/'
>>
${
OUT
}
sed
-e
's/^\(const \)__\(PC[^= ]*\)\(.*\)$/\1\2 = __\2/'
>>
${
OUT
}
# The PATH_MAX constant.
grep
'^const _PATH_MAX '
gen-sysinfo.go |
echo
'const PathMax = _PATH_MAX'
>>
${
OUT
}
# epoll constants.
# epoll constants.
grep
'^const _EPOLL'
gen-sysinfo.go |
grep
'^const _EPOLL'
gen-sysinfo.go |
sed
-e
's/^\(const \)_\(EPOLL[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
sed
-e
's/^\(const \)_\(EPOLL[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
...
@@ -470,9 +477,9 @@ fi | sed -e 's/type _stat64/type Stat_t/' \
...
@@ -470,9 +477,9 @@ fi | sed -e 's/type _stat64/type Stat_t/' \
-e
's/st_size/Size/'
\
-e
's/st_size/Size/'
\
-e
's/st_blksize/Blksize/'
\
-e
's/st_blksize/Blksize/'
\
-e
's/st_blocks/Blocks/'
\
-e
's/st_blocks/Blocks/'
\
-e
's/st_atim/Atim
e
/'
\
-e
's/st_atim/Atim/'
\
-e
's/st_mtim/Mtim
e
/'
\
-e
's/st_mtim/Mtim/'
\
-e
's/st_ctim/Ctim
e
/'
\
-e
's/st_ctim/Ctim/'
\
-e
's/\([^a-zA-Z0-9_]\)_timeval\([^a-zA-Z0-9_]\)/\1Timeval\2/g'
\
-e
's/\([^a-zA-Z0-9_]\)_timeval\([^a-zA-Z0-9_]\)/\1Timeval\2/g'
\
-e
's/\([^a-zA-Z0-9_]\)_timespec_t\([^a-zA-Z0-9_]\)/\1Timespec\2/g'
\
-e
's/\([^a-zA-Z0-9_]\)_timespec_t\([^a-zA-Z0-9_]\)/\1Timespec\2/g'
\
-e
's/\([^a-zA-Z0-9_]\)_timespec\([^a-zA-Z0-9_]\)/\1Timespec\2/g'
\
-e
's/\([^a-zA-Z0-9_]\)_timespec\([^a-zA-Z0-9_]\)/\1Timespec\2/g'
\
...
@@ -791,6 +798,7 @@ grep '^type _in_pktinfo ' gen-sysinfo.go | \
...
@@ -791,6 +798,7 @@ grep '^type _in_pktinfo ' gen-sysinfo.go | \
-e
's/ipi_ifindex/Ifindex/'
\
-e
's/ipi_ifindex/Ifindex/'
\
-e
's/ipi_spec_dst/Spec_dst/'
\
-e
's/ipi_spec_dst/Spec_dst/'
\
-e
's/ipi_addr/Addr/'
\
-e
's/ipi_addr/Addr/'
\
-e
's/_in_addr/[4]byte/g'
\
>>
${
OUT
}
>>
${
OUT
}
# The in6_pktinfo struct.
# The in6_pktinfo struct.
...
@@ -826,7 +834,7 @@ for n in IGNBRK BRKINT IGNPAR PARMRK INPCK ISTRIP INLCR IGNCR ICRNL IUCLC \
...
@@ -826,7 +834,7 @@ for n in IGNBRK BRKINT IGNPAR PARMRK INPCK ISTRIP INLCR IGNCR ICRNL IUCLC \
TCSAFLUSH TCIFLUSH TCOFLUSH TCIOFLUSH TCOOFF TCOON TCIOFF TCION B0 B50
\
TCSAFLUSH TCIFLUSH TCOFLUSH TCIOFLUSH TCOOFF TCOON TCIOFF TCION B0 B50
\
B75 B110 B134 B150 B200 B300 B600 B1200 B1800 B2400 B4800 B9600 B19200
\
B75 B110 B134 B150 B200 B300 B600 B1200 B1800 B2400 B4800 B9600 B19200
\
B38400 B57600 B115200 B230400 B460800 B500000 B576000 B921600 B1000000
\
B38400 B57600 B115200 B230400 B460800 B500000 B576000 B921600 B1000000
\
B1152000 B1500000 B2000000 B2500000 B3000000 B4000000
;
do
B1152000 B1500000 B2000000 B2500000 B3000000 B
3500000 B
4000000
;
do
grep
"^const _
$n
"
gen-sysinfo.go |
\
grep
"^const _
$n
"
gen-sysinfo.go |
\
sed
-e
's/^\(const \)_\([^=]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
sed
-e
's/^\(const \)_\([^=]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
...
@@ -910,6 +918,8 @@ grep '^type _rlimit ' gen-sysinfo.go | \
...
@@ -910,6 +918,8 @@ grep '^type _rlimit ' gen-sysinfo.go | \
# The RLIMIT constants.
# The RLIMIT constants.
grep
'^const _RLIMIT_'
gen-sysinfo.go |
grep
'^const _RLIMIT_'
gen-sysinfo.go |
sed
-e
's/^\(const \)_\(RLIMIT_[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
sed
-e
's/^\(const \)_\(RLIMIT_[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
grep
'^const _RLIM_'
gen-sysinfo.go |
sed
-e
's/^\(const \)_\(RLIM_[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
# The sysinfo struct.
# The sysinfo struct.
grep
'^type _sysinfo '
gen-sysinfo.go |
\
grep
'^type _sysinfo '
gen-sysinfo.go |
\
...
@@ -990,6 +1000,7 @@ grep '^type _nlmsgerr ' gen-sysinfo.go | \
...
@@ -990,6 +1000,7 @@ grep '^type _nlmsgerr ' gen-sysinfo.go | \
sed
-e
's/_nlmsgerr/NlMsgerr/'
\
sed
-e
's/_nlmsgerr/NlMsgerr/'
\
-e
's/error/Error/'
\
-e
's/error/Error/'
\
-e
's/msg/Msg/'
\
-e
's/msg/Msg/'
\
-e
's/_nlmsghdr/NlMsghdr/'
\
>>
${
OUT
}
>>
${
OUT
}
# The GNU/Linux rtnexthop struct.
# The GNU/Linux rtnexthop struct.
...
@@ -1004,6 +1015,8 @@ grep '^type _rtnexthop ' gen-sysinfo.go | \
...
@@ -1004,6 +1015,8 @@ grep '^type _rtnexthop ' gen-sysinfo.go | \
# The GNU/Linux netlink flags.
# The GNU/Linux netlink flags.
grep
'^const _NETLINK_'
gen-sysinfo.go |
\
grep
'^const _NETLINK_'
gen-sysinfo.go |
\
sed
-e
's/^\(const \)_\(NETLINK_[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
sed
-e
's/^\(const \)_\(NETLINK_[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
grep
'^const _NLA_'
gen-sysinfo.go |
\
sed
-e
's/^\(const \)_\(NLA_[^= ]*\)\(.*\)$/\1\2 = _\2/'
>>
${
OUT
}
# The GNU/Linux packet socket flags.
# The GNU/Linux packet socket flags.
grep
'^const _PACKET_'
gen-sysinfo.go |
\
grep
'^const _PACKET_'
gen-sysinfo.go |
\
...
@@ -1018,6 +1031,7 @@ grep '^type _inotify_event ' gen-sysinfo.go | \
...
@@ -1018,6 +1031,7 @@ grep '^type _inotify_event ' gen-sysinfo.go | \
-e
's/len/Len/'
\
-e
's/len/Len/'
\
-e
's/name/Name/'
\
-e
's/name/Name/'
\
-e
's/\[\]/[0]/'
\
-e
's/\[\]/[0]/'
\
-e
's/\[0\]byte/[0]int8/'
\
>>
${
OUT
}
>>
${
OUT
}
# The Solaris 11 Update 1 _zone_net_addr_t struct.
# The Solaris 11 Update 1 _zone_net_addr_t struct.
...
@@ -1028,7 +1042,7 @@ grep '^type _zone_net_addr_t ' gen-sysinfo.go | \
...
@@ -1028,7 +1042,7 @@ grep '^type _zone_net_addr_t ' gen-sysinfo.go | \
# Struct sizes.
# Struct sizes.
set
cmsghdr Cmsghdr ip_mreq IPMreq ip_mreqn IPMreqn ipv6_mreq IPv6Mreq
\
set
cmsghdr Cmsghdr ip_mreq IPMreq ip_mreqn IPMreqn ipv6_mreq IPv6Mreq
\
ifaddrmsg IfAddrmsg ifinfomsg IfInfomsg in_pktinfo Inet4Pktinfo
\
ifaddrmsg IfAddrmsg ifinfomsg IfInfomsg in_pktinfo Inet4Pktinfo
\
in6_pktinfo Inet6Pkt
I
nfo inotify_event InotifyEvent linger Linger
\
in6_pktinfo Inet6Pkt
i
nfo inotify_event InotifyEvent linger Linger
\
msghdr Msghdr nlattr NlAttr nlmsgerr NlMsgerr nlmsghdr NlMsghdr
\
msghdr Msghdr nlattr NlAttr nlmsgerr NlMsgerr nlmsghdr NlMsghdr
\
rtattr RtAttr rtgenmsg RtGenmsg rtmsg RtMsg rtnexthop RtNexthop
\
rtattr RtAttr rtgenmsg RtGenmsg rtmsg RtMsg rtnexthop RtNexthop
\
sock_filter SockFilter sock_fprog SockFprog ucred Ucred
sock_filter SockFilter sock_fprog SockFprog ucred Ucred
...
...
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