diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2013-10-04 10:03:17 -0700 |
---|---|---|
committer | Pavel Chupin <pavel.v.chupin@intel.com> | 2013-10-07 21:37:12 +0400 |
commit | 6fe4e8795452651862c1e02994f434ec5f0d5832 (patch) | |
tree | 5d2989a77bbf0f37e0d02f6c0deec601af1e838c /libc/tools/bionic_utils.py | |
parent | a6e9ae80e51bffa40e600beb38e7796d2ef45242 (diff) | |
download | bionic-6fe4e8795452651862c1e02994f434ec5f0d5832.zip bionic-6fe4e8795452651862c1e02994f434ec5f0d5832.tar.gz bionic-6fe4e8795452651862c1e02994f434ec5f0d5832.tar.bz2 |
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 <hjl.tools@gmail.com>
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
Diffstat (limited to 'libc/tools/bionic_utils.py')
-rw-r--r-- | libc/tools/bionic_utils.py | 14 |
1 files changed, 13 insertions, 1 deletions
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 |