Commit 10f5ffa4 by Ian Lance Taylor

syscall: Add syscall.Times.

From-SVN: r183826
parent 3375a6c9
...@@ -133,15 +133,15 @@ type FdSet struct { ...@@ -133,15 +133,15 @@ type FdSet struct {
} }
func FDSet(fd int, set *FdSet) { 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) { 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 { 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 return true
} else { } else {
return false return false
...@@ -323,9 +323,8 @@ func Settimeofday(tv *Timeval) (err error) { ...@@ -323,9 +323,8 @@ func Settimeofday(tv *Timeval) (err error) {
// //sysnb Time(t *Time_t) (tt Time_t, err error) // //sysnb Time(t *Time_t) (tt Time_t, err error)
// //time(t *Time_t) Time_t // //time(t *Time_t) Time_t
// FIXME: mksysinfo Tms //sysnb Times(tms *Tms) (ticks uintptr, err error)
// //sysnb Times(tms *Tms) (ticks uintptr, err error) //times(tms *Tms) _clock_t
// //times(tms *Tms) _clock_t
//sysnb Umask(mask int) (oldmask int) //sysnb Umask(mask int) (oldmask int)
//umask(mask Mode_t) Mode_t //umask(mask Mode_t) Mode_t
......
...@@ -66,6 +66,7 @@ cat > sysinfo.c <<EOF ...@@ -66,6 +66,7 @@ cat > sysinfo.c <<EOF
#include <sys/socket.h> #include <sys/socket.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/times.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/un.h> #include <sys/un.h>
#if defined(HAVE_SYS_USER_H) #if defined(HAVE_SYS_USER_H)
...@@ -368,6 +369,15 @@ if test "$timestruc" != ""; then ...@@ -368,6 +369,15 @@ if test "$timestruc" != ""; then
-e 's/tv_nsec *[a-zA-Z0-9_]*/Nsec Timestruc_nsec_t/' >> ${OUT} -e 's/tv_nsec *[a-zA-Z0-9_]*/Nsec Timestruc_nsec_t/' >> ${OUT}
fi 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. # The stat type.
# Prefer largefile variant if available. # Prefer largefile variant if available.
stat=`grep '^type _stat64 ' gen-sysinfo.go || true` stat=`grep '^type _stat64 ' gen-sysinfo.go || true`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment