From 6fe4e8795452651862c1e02994f434ec5f0d5832 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 4 Oct 2013 10:03:17 -0700 Subject: Add an optional alias list to SYSCALLS.TXT This patch adds an optional alias list to SYSCALLS.TXT. It is used to create aliases for a syscall. For x86-64, lseek64 is an alias for lseek. Change-Id: Icb11fd2bb461ea4f5f0a26bfc585471d7d7cc468 Signed-off-by: H.J. Lu Signed-off-by: Pavel Chupin --- libc/tools/bionic_utils.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libc/tools/bionic_utils.py') diff --git a/libc/tools/bionic_utils.py b/libc/tools/bionic_utils.py index a00080d..0ca2178 100644 --- a/libc/tools/bionic_utils.py +++ b/libc/tools/bionic_utils.py @@ -49,7 +49,7 @@ class SysCallsTxtParser: """ parse a syscall spec line. line processing, format is - return type func_name[:syscall_name[:socketcall_id]] ( [paramlist] ) architecture_list + return type func_name[|alias_list][:syscall_name[:socketcall_id]] ( [paramlist] ) architecture_list """ pos_lparen = line.find('(') E = self.E @@ -93,6 +93,17 @@ class SysCallsTxtParser: socketcall_id = int(syscall_func[pos_colon2+1:]) syscall_func = syscall_func[:pos_colon] + alias_delim = syscall_func.find('|') + if alias_delim > 0: + alias_list = syscall_func[alias_delim+1:].strip() + syscall_func = syscall_func[:alias_delim] + alias_delim = syscall_name.find('|') + if alias_delim > 0: + syscall_name = syscall_name[:alias_delim] + syscall_aliases = string.split(alias_list, ',') + else: + syscall_aliases = [] + if pos_rparen > pos_lparen+1: syscall_params = line[pos_lparen+1:pos_rparen].split(',') params = string.join(syscall_params,',') @@ -103,6 +114,7 @@ class SysCallsTxtParser: t = { "name" : syscall_name, "func" : syscall_func, + "aliases" : syscall_aliases, "params" : syscall_params, "decl" : "%-15s %s (%s);" % (return_type, syscall_func, params), "socketcall_id" : socketcall_id -- cgit v1.1