diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-02-02 06:40:11 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2012-02-02 06:40:11 +0000 |
commit | 10f5ffa4e9ec1e8393eecf074e9a554d7c0b9c66 (patch) | |
tree | f0406ea048fa501e26dea13d4175bc61ad8dd25e /libgo | |
parent | 3375a6c94c6d4102d51c497aa51e7d9b56fc268c (diff) | |
download | gcc-10f5ffa4e9ec1e8393eecf074e9a554d7c0b9c66.zip gcc-10f5ffa4e9ec1e8393eecf074e9a554d7c0b9c66.tar.gz gcc-10f5ffa4e9ec1e8393eecf074e9a554d7c0b9c66.tar.bz2 |
syscall: Add syscall.Times.
From-SVN: r183826
Diffstat (limited to 'libgo')
-rw-r--r-- | libgo/go/syscall/libcall_posix.go | 11 | ||||
-rwxr-xr-x | libgo/mksysinfo.sh | 10 |
2 files changed, 15 insertions, 6 deletions
diff --git a/libgo/go/syscall/libcall_posix.go b/libgo/go/syscall/libcall_posix.go index d90e595..414b8ed 100644 --- a/libgo/go/syscall/libcall_posix.go +++ b/libgo/go/syscall/libcall_posix.go @@ -133,15 +133,15 @@ type FdSet struct { } func FDSet(fd int, set *FdSet) { - set.Bits[fd / nfdbits] |= (1 << (uint)(fd % nfdbits)) + set.Bits[fd/nfdbits] |= (1 << (uint)(fd%nfdbits)) } func FDClr(fd int, set *FdSet) { - set.Bits[fd / nfdbits] &^= (1 << (uint)(fd % nfdbits)) + set.Bits[fd/nfdbits] &^= (1 << (uint)(fd%nfdbits)) } func FDIsSet(fd int, set *FdSet) bool { - if set.Bits[fd / nfdbits] & (1 << (uint)(fd % nfdbits)) != 0 { + if set.Bits[fd/nfdbits]&(1<<(uint)(fd%nfdbits)) != 0 { return true } else { return false @@ -323,9 +323,8 @@ func Settimeofday(tv *Timeval) (err error) { // //sysnb Time(t *Time_t) (tt Time_t, err error) // //time(t *Time_t) Time_t -// FIXME: mksysinfo Tms -// //sysnb Times(tms *Tms) (ticks uintptr, err error) -// //times(tms *Tms) _clock_t +//sysnb Times(tms *Tms) (ticks uintptr, err error) +//times(tms *Tms) _clock_t //sysnb Umask(mask int) (oldmask int) //umask(mask Mode_t) Mode_t diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh index 16635d2..bca814c 100755 --- a/libgo/mksysinfo.sh +++ b/libgo/mksysinfo.sh @@ -66,6 +66,7 @@ cat > sysinfo.c <<EOF #include <sys/socket.h> #include <sys/stat.h> #include <sys/time.h> +#include <sys/times.h> #include <sys/wait.h> #include <sys/un.h> #if defined(HAVE_SYS_USER_H) @@ -368,6 +369,15 @@ if test "$timestruc" != ""; then -e 's/tv_nsec *[a-zA-Z0-9_]*/Nsec Timestruc_nsec_t/' >> ${OUT} fi +# The tms struct. +grep '^type _tms ' gen-sysinfo.go | \ + sed -e 's/type _tms/type Tms/' \ + -e 's/tms_utime/Utime/' \ + -e 's/tms_stime/Stime/' \ + -e 's/tms_cutime/Cutime/' \ + -e 's/tms_cstime/Cstime/' \ + >> ${OUT} + # The stat type. # Prefer largefile variant if available. stat=`grep '^type _stat64 ' gen-sysinfo.go || true` |