From d4e157aaaead89474366f58fa57e035441a2bd8b Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 30 Oct 2014 19:44:31 +0000 Subject: Remove __libc_creat function name. glibc has lots of __libc_* function names that no longer serve any purpose (are not used for any calls or exported at a public symbol version). This patch removes __libc_creat. It has the effect of creat becoming a strong symbol instead of a weak symbol in various cases, but that's fine; in shared libraries it doesn't matter at all, while for static linking the only other symbol sometimes defined in the same object is creat64, and whenever creat64 is a reserved name so is creat. Other such cases of unnecessary __libc_* symbols are expected to be dealt with in separate patches over time. Tested for x86_64 (testsuite, and that the disassembly of installed shared libraries is unchanged by the patch). * include/fcntl.h (__libc_creat): Remove declaration. * io/creat.c (__libc_creat): Rename to creat. (creat): Do not define as alias. * sysdeps/unix/sysv/linux/alpha/creat.c (creat64): Define as alias of creat instead of __libc_creat. * sysdeps/unix/sysv/linux/generic/creat.c (__libc_creat): Rename to creat. (creat): Do not define as alias. [__WORDSIZE == 64] (creat64): Define as alias of creat instead of __libc_creat. * sysdeps/unix/sysv/linux/syscalls.list (creat): Do not define __libc_creat name. * sysdeps/unix/sysv/linux/wordsize-64/syscalls.list (creat): Likewise. --- sysdeps/unix/sysv/linux/generic/creat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sysdeps/unix/sysv/linux/generic') diff --git a/sysdeps/unix/sysv/linux/generic/creat.c b/sysdeps/unix/sysv/linux/generic/creat.c index f5d046060c..d74719b750 100644 --- a/sysdeps/unix/sysv/linux/generic/creat.c +++ b/sysdeps/unix/sysv/linux/generic/creat.c @@ -24,15 +24,14 @@ /* Create FILE with protections MODE. */ int -__libc_creat (const char *file, mode_t mode) +creat (const char *file, mode_t mode) { return __open (file, O_WRONLY | O_CREAT | O_TRUNC, mode); } -weak_alias (__libc_creat, creat) /* __open handles cancellation. */ LIBC_CANCEL_HANDLED (); #if __WORDSIZE == 64 -weak_alias (__libc_creat, creat64) +weak_alias (creat, creat64) #endif -- cgit 1.4.1