Commit 77054310 authored by Alex Brainman's avatar Alex Brainman Committed by Russ Cox

syscall: remove unused windows code and comments

R=golang-dev, vcc.163, rsc
CC=golang-dev
https://golang.org/cl/4826042
parent 3a07d516
...@@ -76,7 +76,7 @@ func StringToUTF16Ptr(s string) *uint16 { return &StringToUTF16(s)[0] } ...@@ -76,7 +76,7 @@ func StringToUTF16Ptr(s string) *uint16 { return &StringToUTF16(s)[0] }
// dll helpers // dll helpers
// implemented in ../runtime/windows/syscall.cgo // Implemented in ../runtime/windows/syscall.goc
func Syscall(trap, nargs, a1, a2, a3 uintptr) (r1, r2, err uintptr) func Syscall(trap, nargs, a1, a2, a3 uintptr) (r1, r2, err uintptr)
func Syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr) func Syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
func Syscall9(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr) func Syscall9(trap, nargs, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2, err uintptr)
...@@ -105,14 +105,9 @@ func Getpagesize() int { return 4096 } ...@@ -105,14 +105,9 @@ func Getpagesize() int { return 4096 }
// Converts a Go function to a function pointer conforming // Converts a Go function to a function pointer conforming
// to the stdcall calling convention. This is useful when // to the stdcall calling convention. This is useful when
// interoperating with Windows code requiring callbacks. // interoperating with Windows code requiring callbacks.
// Implemented in ../runtime/windows/syscall.cgo // Implemented in ../runtime/windows/syscall.goc
func NewCallback(fn interface{}) uintptr func NewCallback(fn interface{}) uintptr
// TODO
func Sendfile(outfd int, infd int, offset *int64, count int) (written int, errno int) {
return -1, ENOSYS
}
// windows api calls // windows api calls
//sys GetLastError() (lasterrno int) //sys GetLastError() (lasterrno int)
...@@ -728,24 +723,3 @@ func Geteuid() (euid int) { return -1 } ...@@ -728,24 +723,3 @@ func Geteuid() (euid int) { return -1 }
func Getgid() (gid int) { return -1 } func Getgid() (gid int) { return -1 }
func Getegid() (egid int) { return -1 } func Getegid() (egid int) { return -1 }
func Getgroups() (gids []int, errno int) { return nil, EWINDOWS } func Getgroups() (gids []int, errno int) { return nil, EWINDOWS }
// TODO(brainman): fix all this meaningless code, it is here to compile exec.go
func read(fd Handle, buf *byte, nbuf int) (n int, errno int) {
return 0, EWINDOWS
}
func fcntl(fd Handle, cmd, arg int) (val int, errno int) {
return 0, EWINDOWS
}
const (
PTRACE_TRACEME = 1 + iota
WNOHANG
WSTOPPED
WUNTRACED
SYS_CLOSE
SYS_WRITE
SYS_EXIT
SYS_READ
)
package syscall package syscall
// TODO(brainman): autogenerate types in ztypes_windows_386.go
//import "unsafe"
// Constants
const (
sizeofPtr = 0x4
sizeofShort = 0x2
sizeofInt = 0x4
sizeofLong = 0x4
sizeofLongLong = 0x8
PathMax = 0x1000
SizeofLinger = 0x8
SizeofMsghdr = 0x1c
SizeofCmsghdr = 0xc
)
const ( const (
// Windows errors. // Windows errors.
ERROR_FILE_NOT_FOUND = 2 ERROR_FILE_NOT_FOUND = 2
...@@ -179,16 +162,6 @@ const ( ...@@ -179,16 +162,6 @@ const (
CRYPT_DEFAULT_CONTAINER_OPTIONAL = 0x00000080 CRYPT_DEFAULT_CONTAINER_OPTIONAL = 0x00000080
) )
// Types
type _C_short int16
type _C_int int32
type _C_long int32
type _C_long_long int64
// Invented values to support what package os expects. // Invented values to support what package os expects.
type Timeval struct { type Timeval struct {
Sec int32 Sec int32
...@@ -393,38 +366,23 @@ type WSABuf struct { ...@@ -393,38 +366,23 @@ type WSABuf struct {
Buf *byte Buf *byte
} }
// TODO(brainman): fix all needed for os // Invented values to support what package os expects.
const ( const (
PROT_READ = 0x1 S_IFMT = 0x1f000
PROT_WRITE = 0x2 S_IFIFO = 0x1000
MAP_SHARED = 0x1 S_IFCHR = 0x2000
SYS_FORK = 0 S_IFDIR = 0x4000
SYS_PTRACE = 0 S_IFBLK = 0x6000
SYS_CHDIR = 0 S_IFREG = 0x8000
SYS_DUP2 = 0 S_IFLNK = 0xa000
SYS_FCNTL = 0 S_IFSOCK = 0xc000
SYS_EXECVE = 0 S_ISUID = 0x800
F_GETFD = 0x1 S_ISGID = 0x400
F_SETFD = 0x2 S_ISVTX = 0x200
F_GETFL = 0x3 S_IRUSR = 0x100
F_SETFL = 0x4 S_IWRITE = 0x80
FD_CLOEXEC = 0 S_IWUSR = 0x80
S_IFMT = 0x1f000 S_IXUSR = 0x40
S_IFIFO = 0x1000
S_IFCHR = 0x2000
S_IFDIR = 0x4000
S_IFBLK = 0x6000
S_IFREG = 0x8000
S_IFLNK = 0xa000
S_IFSOCK = 0xc000
S_ISUID = 0x800
S_ISGID = 0x400
S_ISVTX = 0x200
S_IRUSR = 0x100
S_IWRITE = 0x80
S_IWUSR = 0x80
S_IXUSR = 0x40
) )
const ( const (
......
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