Add documentation for remaining syscalls (fixes #197, #186)

Adds support level documentation for all syscalls. Removes the Undocumented
utility function to discourage usage while leaving SupportUndocumented as the
default support level for Syscall structs.

PiperOrigin-RevId: 256281927
This commit is contained in:
Ian Lewis
2019-07-02 18:45:16 -07:00
committed by gVisor bot
parent 1178a278ae
commit 3f14caeb99
2 changed files with 262 additions and 271 deletions
File diff suppressed because it is too large Load Diff
+4 -13
View File
@@ -40,16 +40,7 @@ func Supported(name string, fn kernel.SyscallFn) kernel.Syscall {
Name: name,
Fn: fn,
SupportLevel: kernel.SupportFull,
Note: "Full Support",
}
}
// Undocumented returns a syscall that is undocumented.
func Undocumented(name string, fn kernel.SyscallFn) kernel.Syscall {
return kernel.Syscall{
Name: name,
Fn: fn,
SupportLevel: kernel.SupportUndocumented,
Note: "Fully Supported.",
}
}
@@ -75,7 +66,7 @@ func Error(name string, err syscall.Errno, note string, urls []string) kernel.Sy
return 0, nil, err
},
SupportLevel: kernel.SupportUnimplemented,
Note: fmt.Sprintf("%sReturns %q", note, err.Error()),
Note: fmt.Sprintf("%sReturns %q.", note, err.Error()),
URLs: urls,
}
}
@@ -93,7 +84,7 @@ func ErrorWithEvent(name string, err syscall.Errno, note string, urls []string)
return 0, nil, err
},
SupportLevel: kernel.SupportUnimplemented,
Note: fmt.Sprintf("%sReturns %q", note, err.Error()),
Note: fmt.Sprintf("%sReturns %q.", note, err.Error()),
URLs: urls,
}
}
@@ -115,7 +106,7 @@ func CapError(name string, c linux.Capability, note string, urls []string) kerne
return 0, nil, syserror.ENOSYS
},
SupportLevel: kernel.SupportUnimplemented,
Note: fmt.Sprintf("%sReturns %q if the process does not have %s; %q otherwise", note, syserror.EPERM, c.String(), syserror.ENOSYS),
Note: fmt.Sprintf("%sReturns %q if the process does not have %s; %q otherwise.", note, syserror.EPERM, c.String(), syserror.ENOSYS),
URLs: urls,
}
}