From c9da332cce903ebd4bec97da1d78d363fcf41f6d Mon Sep 17 00:00:00 2001
From: Elliott Hughes <enh@google.com>
Date: Tue, 15 Oct 2013 18:18:58 -0700
Subject: [PATCH] Remove support for the useless 'custom' option in
 SYSCALLS.TXT.

This cruft dates from a time when bionic would only output syscall
contants for the syscalls mentioned in SYSCALLS.TXT. I fixed that
a long time ago, but never followed through with the removal of what
was then confusingly called "stub" and was recently renamed "custom".

Change-Id: I8f3872a200b2dc8325e357cc5ee505ea4212ef95
---
 libc/SYSCALLS.TXT          | 9 +--------
 libc/tools/bionic_utils.py | 4 +---
 2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index 0d1e808b3..1d6c75f8d 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -5,7 +5,7 @@
 # return_type func_name[|alias_list][:syscall_name[:socketcall_id]]([parameter_list]) arch_list
 #
 # where:
-#       arch_list ::= "all" | "custom" | arch+
+#       arch_list ::= "all" | arch+
 #       arch      ::= "arm" | "mips" | "x86" | "x86_64"
 #
 # Note:
@@ -22,9 +22,6 @@
 #
 #      - Each parameter type is assumed to be stored in 32 bits.
 #
-#      - The arch list can be the word "custom" meaning "do not generate any stubs".
-#        In this case, a hand-written custom stub must be provided.
-#
 # This file is processed by a python script named gensyscalls.py.
 
 # process management
@@ -65,7 +62,6 @@ int     setgid:setgid32(gid_t)     arm,x86
 int     setgid:setgid(gid_t)       mips,x86_64
 int     setuid:setuid32(uid_t)    arm,x86
 int     setuid:setuid(uid_t)      mips,x86_64
-int     seteuid:seteuid32(uid_t)   custom
 int     setreuid:setreuid32(uid_t, uid_t)   arm,x86
 int     setreuid:setreuid(uid_t, uid_t)     mips,x86_64
 int     setresuid:setresuid32(uid_t, uid_t, uid_t)   arm,x86
@@ -87,7 +83,6 @@ int     getrlimit:getrlimit(int resource, struct rlimit* rlp)  mips,x86_64
 int     getrusage(int who, struct rusage*  r_usage)  all
 int     setgroups:setgroups32(int, const gid_t*)   arm,x86
 int     setgroups:setgroups(int, const gid_t*)     mips,x86_64
-pid_t   getpgrp(void)  custom
 int     setpgid(pid_t, pid_t)  all
 pid_t   vfork(void)  arm,x86_64
 int     setregid:setregid32(gid_t, gid_t)  arm,x86
@@ -110,7 +105,6 @@ ssize_t     pwrite64(int, void*, size_t, off64_t) all
 int         __open:open(const char*, int, mode_t)  all
 int         __openat:openat(int, const char*, int, mode_t) all
 int         close(int)                      all
-int         creat(const char*, mode_t)       custom
 off_t       lseek(int, off_t, int)           arm,x86,mips
 off_t       lseek|lseek64(int, off_t, int)   x86_64
 int         __llseek:_llseek(int, unsigned long, unsigned long, off64_t*, int)  arm,x86,mips
@@ -175,7 +169,6 @@ int     chown:chown(const char*, uid_t, gid_t)    mips,x86_64
 int     lchown:lchown32(const char*, uid_t, gid_t)  arm,x86
 int     lchown:lchown(const char*, uid_t, gid_t)  mips,x86_64
 int     mount(const char*, const char*, const char*, unsigned long, const void*)  all
-int     umount(const char*)  custom
 int     umount2(const char*, int)  all
 int     fstat:fstat64(int, struct stat*)    arm,x86,mips
 int     fstat(int, struct stat*)    x86_64
diff --git a/libc/tools/bionic_utils.py b/libc/tools/bionic_utils.py
index 0ca217826..f8d889732 100644
--- a/libc/tools/bionic_utils.py
+++ b/libc/tools/bionic_utils.py
@@ -122,9 +122,7 @@ class SysCallsTxtParser:
 
         # Parse the architecture list.
         arch_list = line[pos_rparen+1:].strip()
-        if arch_list == "custom":
-            pass
-        elif arch_list == "all":
+        if arch_list == "all":
             for arch in all_arches:
                 t[arch] = True
         else: