Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
4aaddf8a
Commit
4aaddf8a
authored
Apr 29, 2010
by
Joe Poirier
Committed by
Russ Cox
Apr 29, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: mingw Sleep
R=rsc, brainman CC=golang-dev
https://golang.org/cl/961047
parent
77817e08
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
1 deletion
+16
-1
src/pkg/syscall/syscall_mingw.go
src/pkg/syscall/syscall_mingw.go
+9
-0
src/pkg/syscall/zsyscall_mingw_386.go
src/pkg/syscall/zsyscall_mingw_386.go
+7
-1
No files found.
src/pkg/syscall/syscall_mingw.go
View file @
4aaddf8a
...
...
@@ -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"
...
...
src/pkg/syscall/zsyscall_mingw_386.go
View file @
4aaddf8a
// mksyscall_mingw.sh -l32 syscall_mingw.go syscall_mingw_386.go
// mksyscall_mingw.sh -l32 syscall_mingw.go
z
syscall_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
}
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