[kernel] Add new zero_ok flag to syscall params

The new zero_ok flag is similar to optional for reference parameters,
but only in cases where there is a length parameter. If that parameter
is a reference parameter itself and is null, or it is non-null and
contains a non-zero length, or there is no length parameter, then the
main parameter may not be null.
This commit is contained in:
Justin C. Miller
2022-01-30 14:21:08 -08:00
parent b6218a1121
commit da5c1e9833
3 changed files with 37 additions and 13 deletions

View File

@@ -62,5 +62,7 @@ class Param:
@property
def optional(self):
return "optional" in self.options
if "zero_ok" in self.options: return "zero_ok"
elif "optional" in self.options: return "optional"
else: return "required"