"errors"
"runtime"
"syscall"
+ "unsafe"
)
func (p *Process) Wait(options int) (w *Waitmsg, err error) {
func init() {
var argc int32
- cmd := GetCommandLine()
- argv, e := CommandLineToArgv(cmd, &argc)
+ cmd := syscall.GetCommandLine()
+ argv, e := syscall.CommandLineToArgv(cmd, &argc)
if e != nil {
return
}
- defer LocalFree(Handle(uintptr(unsafe.Pointer(argv))))
+ defer syscall.LocalFree(syscall.Handle(uintptr(unsafe.Pointer(argv))))
Args = make([]string, argc)
for i, v := range (*argv)[:argc] {
- Args[i] = string(UTF16ToString((*v)[:]))
+ Args[i] = string(syscall.UTF16ToString((*v)[:]))
}
}
"runtime"
"sync"
"syscall"
+ "unicode/utf16"
)
// File represents an open file descriptor.
// TempDir returns the default directory to use for temporary files.
func TempDir() string {
const pathSep = '\\'
- dirw := make([]uint16, MAX_PATH)
+ dirw := make([]uint16, syscall.MAX_PATH)
n, _ := syscall.GetTempPath(uint32(len(dirw)), &dirw[0])
if n > uint32(len(dirw)) {
dirw = make([]uint16, n)
void
runtime·goenvs(void)
{
- extern Slice os·Envs;
+ extern Slice syscall·envs;
uint16 *env;
String *s;
s[i] = runtime·gostringw(p);
p += runtime·findnullw(p)+1;
}
- os·Envs.array = (byte*)s;
- os·Envs.len = n;
- os·Envs.cap = n;
+ syscall·envs.array = (byte*)s;
+ syscall·envs.len = n;
+ syscall·envs.cap = n;
runtime·stdcall(runtime·FreeEnvironmentStringsW, 1, env);
}
package syscall
import (
- "errors"
"unicode/utf16"
"unsafe"
)
printf("\n// Go names for Windows errors.\n");
printf("const (\n");
for(i=0; i<nelem(goerrors); i++) {
- printf("\t%s = %s\n", goerrors[i].goname, goerrors[i].winname);
+ printf("\t%s Errno = %s\n", goerrors[i].goname, goerrors[i].winname);
}
printf(")\n");
for(i=0; i<nelem(errors); i++) {
printf("\t%s", errors[i].name);
if(iota) {
- printf(" = APPLICATION_ERROR + iota");
+ printf(" Errno = APPLICATION_ERROR + iota");
iota = !iota;
}
printf("\n");
return nil
}
-func Sleep(nsec int64) (err error) {
- sleep(uint32((nsec + 1e6 - 1) / 1e6)) // round up to milliseconds
- return nil
-}
-
func Pipe(p []Handle) (err error) {
if len(p) != 2 {
return EINVAL
-// mkerrors_windows.sh -f -m32
+// mkerrors_windows.sh -m32
// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package syscall