Lines Matching refs:syscall
8 "internal/syscall/windows"
12 "syscall"
28 fd syscall.Handle
43 return uintptr(syscall.InvalidHandle)
49 // Unlike NewFile, it does not check that h is syscall.InvalidHandle.
50 func newFile(h syscall.Handle, name string) *File {
53 if syscall.GetConsoleMode(f.fd, &m) == nil {
62 h := syscall.Handle(fd)
63 if h == syscall.InvalidHandle {
71 data syscall.Win32finddata
85 r, e := syscall.Open(name, flag|syscall.O_CLOEXEC, syscallMode(perm))
93 maskp, e := syscall.UTF16PtrFromString(name + `\*`)
98 r, e := syscall.FindFirstFile(maskp, &d.data)
103 if e != syscall.ERROR_FILE_NOT_FOUND {
106 var fa syscall.Win32FileAttributeData
107 namep, e := syscall.UTF16PtrFromString(name)
111 e = syscall.GetFileAttributesEx(namep, syscall.GetFileExInfoStandard, (*byte)(unsafe.Pointer(&fa)))
115 if fa.FileAttributes&syscall.FILE_ATTRIBUTE_DIRECTORY == 0 {
122 d.path, e = syscall.FullPath(d.path)
139 return nil, &PathError{"open", name, syscall.ENOENT}
149 return nil, &PathError{"open", name, syscall.EISDIR}
167 return syscall.EINVAL
173 if file.fd == syscall.InvalidHandle {
174 return syscall.EINVAL
178 e = syscall.FindClose(syscall.Handle(file.fd))
180 e = syscall.CloseHandle(syscall.Handle(file.fd))
186 file.fd = syscall.InvalidHandle // so it can't be closed again
195 return nil, syscall.EINVAL
198 return nil, &PathError{"Readdir", file.name, syscall.ENOTDIR}
200 if !file.dirinfo.isempty && file.fd == syscall.InvalidHandle {
201 return nil, syscall.EINVAL
213 e := syscall.FindNextFile(syscall.Handle(file.fd), d)
215 if e == syscall.ERROR_NO_MORE_FILES {
227 name := string(syscall.UTF16ToString(d.FileName[0:]))
233 sys: syscall.Win32FileAttributeData{
260 // syscall.ReadConsole seems to fail, if given large buffer.
273 err := syscall.ReadConsole(f.fd, p, uint32(len(wchars)), &nw, nil)
300 return fixCount(syscall.Read(f.fd, b))
309 curoffset, e := syscall.Seek(f.fd, 0, 1)
313 defer syscall.Seek(f.fd, curoffset, 0)
314 o := syscall.Overlapped{
319 e = syscall.ReadFile(syscall.Handle(f.fd), b, &done, &o)
321 if e == syscall.ERROR_HANDLE_EOF {
349 // syscall.WriteConsole seems to fail, if given large buffer.
351 // discovered by experimenting with syscall.WriteConsole.
363 err = syscall.WriteConsole(f.fd, &uint16s[0], uint32(len(uint16s)), &written, nil)
381 return fixCount(syscall.Write(f.fd, b))
389 curoffset, e := syscall.Seek(f.fd, 0, 1)
393 defer syscall.Seek(f.fd, curoffset, 0)
394 o := syscall.Overlapped{
399 e = syscall.WriteFile(syscall.Handle(f.fd), b, &done, &o)
413 return syscall.Seek(f.fd, offset, whence)
434 p, e := syscall.UTF16PtrFromString(name)
441 e = syscall.DeleteFile(p)
445 e1 := syscall.RemoveDirectory(p)
452 a, e2 := syscall.GetFileAttributes(p)
456 if a&syscall.FILE_ATTRIBUTE_DIRECTORY != 0 {
475 var p [2]syscall.Handle
477 // See ../syscall/exec.go for description of lock.
478 syscall.ForkLock.RLock()
479 e := syscall.Pipe(p[0:])
481 syscall.ForkLock.RUnlock()
484 syscall.CloseOnExec(p[0])
485 syscall.CloseOnExec(p[1])
486 syscall.ForkLock.RUnlock()
493 n := uint32(syscall.MAX_PATH)
496 n, _ = syscall.GetTempPath(uint32(len(b)), &b[0])
510 n, err := syscall.UTF16PtrFromString(newname)
514 o, err := syscall.UTF16PtrFromString(oldname)
518 err = syscall.CreateHardLink(n, o, 0)
529 if syscall.LoadCreateSymbolicLink() != nil {
530 return &LinkError{"symlink", oldname, newname, syscall.EWINDOWS}
545 n, err := syscall.UTF16PtrFromString(newname)
549 o, err := syscall.UTF16PtrFromString(oldname)
556 flags |= syscall.SYMBOLIC_LINK_FLAG_DIRECTORY
558 err = syscall.CreateSymbolicLink(n, o, flags)