Revert "Remove the return type from the syscall lists and parser."
This reverts commit 83f08aa3c6aaaa810319e7068c1bb3f63bfdb6a0.
Reason for revert: DroidMonitor: Potential culprit for b/395697512 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted.
Change-Id: I891cb76071b5745743676eada6154302cc3f5dae
diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py
index aa4f1cb..6eb0d5e 100755
--- a/libc/tools/gensyscalls.py
+++ b/libc/tools/gensyscalls.py
@@ -338,11 +338,8 @@
def parse_line(self, line):
""" parse a syscall spec line.
- format is one syscall per line:
-
- func_name[|alias_list][:syscall_name[:socketcall_id]] ( [paramlist] ) architecture_list
-
- with no line breaking/continuation allowed.
+ line processing, format is
+ return type func_name[|alias_list][:syscall_name[:socketcall_id]] ( [paramlist] ) architecture_list
"""
pos_lparen = line.find('(')
E = self.E
@@ -355,7 +352,12 @@
E("missing or misplaced right parenthesis in '%s'" % line)
return
- syscall_func = line[:pos_lparen]
+ return_type = line[:pos_lparen].strip().split()
+ if len(return_type) < 2:
+ E("missing return type in '%s'" % line)
+ return
+
+ syscall_func = return_type[-1]
socketcall_id = -1
pos_colon = syscall_func.find(':')