syscall: Permit non-blocking syscalls.

Permit system calls to be designated as non-blocking, meaning
that we simply call them without involving the scheduler.

This change by itself is mostly performance neutral.  In
combination with a following change to the net package there
is a performance advantage.

R=rsc, dfc, r2, iant2, rsc1
CC=golang-dev
https://golang.org/cl/4278055
This commit is contained in:
Ian Lance Taylor 2011-03-16 19:03:01 -07:00
parent e39dc76884
commit 4fd41e494a
25 changed files with 579 additions and 383 deletions

View file

@ -29,7 +29,7 @@ func Openat(dirfd int, path string, flags int, mode uint32) (fd int, errno int)
return openat(dirfd, path, flags|O_LARGEFILE, mode)
}
//sys pipe(p *[2]_C_int) (errno int)
//sysnb pipe(p *[2]_C_int) (errno int)
func Pipe(p []int) (errno int) {
if len(p) != 2 {
return EINVAL
@ -688,10 +688,10 @@ func Reboot(cmd int) (errno int) {
//sys Chroot(path string) (errno int)
//sys Close(fd int) (errno int)
//sys Creat(path string, mode uint32) (fd int, errno int)
//sys Dup(oldfd int) (fd int, errno int)
//sys Dup2(oldfd int, newfd int) (fd int, errno int)
//sys EpollCreate(size int) (fd int, errno int)
//sys EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int)
//sysnb Dup(oldfd int) (fd int, errno int)
//sysnb Dup2(oldfd int, newfd int) (fd int, errno int)
//sysnb EpollCreate(size int) (fd int, errno int)
//sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (errno int)
//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, errno int)
//sys Exit(code int) = SYS_EXIT_GROUP
//sys Faccessat(dirfd int, path string, mode uint32, flags int) (errno int)
@ -704,18 +704,18 @@ func Reboot(cmd int) (errno int) {
//sys Fdatasync(fd int) (errno int)
//sys Fsync(fd int) (errno int)
//sys Getdents(fd int, buf []byte) (n int, errno int) = SYS_GETDENTS64
//sys Getpgid(pid int) (pgid int, errno int)
//sys Getpgrp() (pid int)
//sys Getpid() (pid int)
//sys Getppid() (ppid int)
//sys Getrlimit(resource int, rlim *Rlimit) (errno int)
//sys Getrusage(who int, rusage *Rusage) (errno int)
//sys Gettid() (tid int)
//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno int)
//sys InotifyInit() (fd int, errno int)
//sys InotifyInit1(flags int) (fd int, errno int)
//sys InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int)
//sys Kill(pid int, sig int) (errno int)
//sysnb Getpgid(pid int) (pgid int, errno int)
//sysnb Getpgrp() (pid int)
//sysnb Getpid() (pid int)
//sysnb Getppid() (ppid int)
//sysnb Getrlimit(resource int, rlim *Rlimit) (errno int)
//sysnb Getrusage(who int, rusage *Rusage) (errno int)
//sysnb Gettid() (tid int)
//sys InotifyAddWatch(fd int, pathname string, mask uint32) (watchdesc int, errno int)
//sysnb InotifyInit() (fd int, errno int)
//sysnb InotifyInit1(flags int) (fd int, errno int)
//sysnb InotifyRmWatch(fd int, watchdesc uint32) (success int, errno int)
//sysnb Kill(pid int, sig int) (errno int)
//sys Klogctl(typ int, buf []byte) (n int, errno int) = SYS_SYSLOG
//sys Link(oldpath string, newpath string) (errno int)
//sys Mkdir(path string, mode uint32) (errno int)
@ -733,19 +733,19 @@ func Reboot(cmd int) (errno int) {
//sys Rmdir(path string) (errno int)
//sys Setdomainname(p []byte) (errno int)
//sys Sethostname(p []byte) (errno int)
//sys Setpgid(pid int, pgid int) (errno int)
//sys Setrlimit(resource int, rlim *Rlimit) (errno int)
//sys Setsid() (pid int, errno int)
//sys Settimeofday(tv *Timeval) (errno int)
//sys Setuid(uid int) (errno int)
//sysnb Setpgid(pid int, pgid int) (errno int)
//sysnb Setrlimit(resource int, rlim *Rlimit) (errno int)
//sysnb Setsid() (pid int, errno int)
//sysnb Settimeofday(tv *Timeval) (errno int)
//sysnb Setuid(uid int) (errno int)
//sys Symlink(oldpath string, newpath string) (errno int)
//sys Sync()
//sys Sysinfo(info *Sysinfo_t) (errno int)
//sysnb Sysinfo(info *Sysinfo_t) (errno int)
//sys Tee(rfd int, wfd int, len int, flags int) (n int64, errno int)
//sys Tgkill(tgid int, tid int, sig int) (errno int)
//sys Times(tms *Tms) (ticks uintptr, errno int)
//sys Umask(mask int) (oldmask int)
//sys Uname(buf *Utsname) (errno int)
//sysnb Tgkill(tgid int, tid int, sig int) (errno int)
//sysnb Times(tms *Tms) (ticks uintptr, errno int)
//sysnb Umask(mask int) (oldmask int)
//sysnb Uname(buf *Utsname) (errno int)
//sys Unlink(path string) (errno int)
//sys Unlinkat(dirfd int, path string) (errno int)
//sys Unmount(target string, flags int) (errno int) = SYS_UMOUNT2