You need to sign in or sign up before continuing.
Commit 4aaddf8a authored by Joe Poirier's avatar Joe Poirier Committed by Russ Cox
Browse files

syscall: mingw Sleep

R=rsc, brainman
CC=golang-dev
https://golang.org/cl/961047
parent 77817e08
master go1.12-nxd go18-fannkuch-entryshift go19 x/sched y/unqotechar-err weekly.2012-03-27 weekly.2012-03-22 weekly.2012-03-13 weekly.2012-03-04 weekly.2012-02-22 weekly.2012-02-14 weekly.2012-02-07 weekly.2012-01-27 weekly.2012-01-20 weekly.2012-01-15 weekly.2011-12-22 weekly.2011-12-14 weekly.2011-12-06 weekly.2011-12-02 weekly.2011-12-01 weekly.2011-11-18 weekly.2011-11-09 weekly.2011-11-08 weekly.2011-11-02 weekly.2011-11-01 weekly.2011-10-26 weekly.2011-10-25 weekly.2011-10-18 weekly.2011-10-06 weekly.2011-09-21 weekly.2011-09-16 weekly.2011-09-07 weekly.2011-09-01 weekly.2011-08-17 weekly.2011-08-10 weekly.2011-07-29 weekly.2011-07-19 weekly.2011-07-07 weekly.2011-06-23 weekly.2011-06-16 weekly.2011-06-09 weekly.2011-06-02 weekly.2011-05-22 weekly.2011-04-27 weekly.2011-04-13 weekly.2011-04-04 weekly.2011-03-28 weekly.2011-03-15 weekly.2011-03-07.1 weekly.2011-03-07 weekly.2011-02-24 weekly.2011-02-15 weekly.2011-02-01.1 weekly.2011-02-01 weekly.2011-01-20 weekly.2011-01-19 weekly.2011-01-12 weekly.2011-01-06 weekly.2010-12-22 weekly.2010-12-15.1 weekly.2010-12-15 weekly.2010-12-08 weekly.2010-12-02 weekly.2010-11-23 weekly.2010-11-10 weekly.2010-11-02 weekly.2010-10-27 weekly.2010-10-20 weekly.2010-10-13.1 weekly.2010-10-13 weekly.2010-09-29 weekly.2010-09-22 weekly.2010-09-15 weekly.2010-09-06 weekly.2010-08-25 weekly.2010-08-11 weekly.2010-08-04 weekly.2010-07-29 weekly.2010-07-14 weekly.2010-07-01 weekly.2010-06-21 weekly.2010-06-09 weekly.2010-05-27 weekly.2010-05-04 weekly release.r60.3 release.r60.2 release.r60.1 release.r60 release.r59 release.r58.2 release.r58.1 release.r58 release.r57.2 release.r57.1 release.r57 release.r56 go1.9 go1.9rc2 go1.9rc1 go1.9beta2 go1.9beta1 go1.8.3 go1.8.2 go1.8.1 go1.8 go1.8rc3 go1.8rc2 go1.8rc1 go1.8beta2 go1.8beta1 go1.7.6 go1.7.5 go1.7.4 go1.7.3 go1.7.2 go1.7.1 go1.7 go1.7rc6 go1.7rc5 go1.7rc4 go1.7rc3 go1.7rc2 go1.7rc1 go1.7beta2 go1.7beta1 go1.6.4 go1.6.3 go1.6.2 go1.6.1 go1.6 go1.6rc2 go1.6rc1 go1.6beta2 go1.6beta1 go1.5.4 go1.5.3 go1.5.2 go1.5.1 go1.5 go1.5rc1 go1.5beta3 go1.5beta2 go1.5beta1 go1.4.3 go1.4.2 go1.4.1 go1.4 go1.4rc2 go1.4rc1 go1.4beta1 go1.3.3 go1.3.2 go1.3.1 go1.3 go1.3rc2 go1.3rc1 go1.3beta2 go1.3beta1 go1.2.2 go1.2.1 go1.2 go1.2rc5 go1.2rc4 go1.2rc3 go1.2rc2 go1.1.2 go1.1.1 go1.1 go1.1rc3 go1.1rc2 go1.0.3 go1.0.2 go1.0.1 go1
No related merge requests found
Showing with 16 additions and 1 deletion
+16 -1
......@@ -121,9 +121,18 @@ func getSysProcAddr(m uint32, pname string) uintptr {
//sys GetComputerName(buf *uint16, n *uint32) (ok bool, errno int) = GetComputerNameW
//sys SetEndOfFile(handle int32) (ok bool, errno int)
//sys GetSystemTimeAsFileTime(time *Filetime)
//sys sleep(msec uint32) = Sleep
// syscall interface implementation for other packages
func Sleep(nsec int64) (errno int) {
nsec += 999999 // round up to milliseconds
msec := uint32(nsec / 1e6)
sleep(msec)
errno = 0
return
}
func Errstr(errno int) string {
if errno == EMINGW {
return "not supported by windows"
......
// mksyscall_mingw.sh -l32 syscall_mingw.go syscall_mingw_386.go
// mksyscall_mingw.sh -l32 syscall_mingw.go zsyscall_mingw_386.go
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package syscall
......@@ -33,6 +33,7 @@ var (
procGetComputerNameW = getSysProcAddr(modKERNEL32, "GetComputerNameW")
procSetEndOfFile = getSysProcAddr(modKERNEL32, "SetEndOfFile")
procGetSystemTimeAsFileTime = getSysProcAddr(modKERNEL32, "GetSystemTimeAsFileTime")
procSleep = getSysProcAddr(modKERNEL32, "Sleep")
)
func GetLastError() (lasterrno int) {
......@@ -315,3 +316,8 @@ func GetSystemTimeAsFileTime(time *Filetime) {
Syscall(procGetSystemTimeAsFileTime, uintptr(unsafe.Pointer(time)), 0, 0)
return
}
func sleep(msec uint32) {
Syscall(procSleep, uintptr(msec), 0, 0)
return
}
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