]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Remove __libc_creat function name.
authorJoseph Myers <joseph@codesourcery.com>
Thu, 30 Oct 2014 19:44:31 +0000 (19:44 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 30 Oct 2014 19:44:31 +0000 (19:44 +0000)
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.

ChangeLog
include/fcntl.h
io/creat.c
sysdeps/unix/sysv/linux/alpha/creat.c
sysdeps/unix/sysv/linux/generic/creat.c
sysdeps/unix/sysv/linux/syscalls.list
sysdeps/unix/sysv/linux/wordsize-64/syscalls.list

index a28bb3b3452f682753a443453cbd823b1e4c3267..898055e20d16539bc2d85ab18950ebb19d7577fb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2014-10-30  Joseph Myers  <joseph@codesourcery.com>
+
+       * 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.
+
 2014-10-29  Carlos O'Donell  <carlos@redhat.com>
 
        * manual/llio.texi: Add comments discussing why write() may be
index a636f388f441e9fe5903c6bb9dbbe4cde2a73d4f..de2372883c99e9d419817f668551de6368691a06 100644 (file)
@@ -8,7 +8,6 @@ libc_hidden_proto (__open64)
 extern int __libc_open64 (const char *file, int oflag, ...);
 extern int __libc_open (const char *file, int oflag, ...);
 libc_hidden_proto (__libc_open)
-extern int __libc_creat (const char *file, mode_t mode);
 extern int __libc_fcntl (int fd, int cmd, ...);
 #ifndef NO_CANCELLATION
 extern int __fcntl_nocancel (int fd, int cmd, ...) attribute_hidden;
index 0ff524cca20a3887d080d9dbbb895565ab02938e..49c2085039ff0b32ae29cad82cae7efdaf4529b4 100644 (file)
 
 /* Create FILE with protections MODE.  */
 int
-__libc_creat (file, mode)
+creat (file, mode)
      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 ();
index 9e661bab04c0f5f42826de09dd8b5652b6e2cb3f..7a5afed58c887c87d5f0479d5445fa71d11c2c80 100644 (file)
@@ -5,4 +5,4 @@
    could have overridden that with a create64.c, but we might as well do
    the right thing and set up creat64 as an alias.  */
 #include <io/creat.c>
-weak_alias(__libc_creat, creat64)
+weak_alias(creat, creat64)
index f5d046060ca6b19dd2bd57b8faf6fbfef8a27436..d74719b750f4c615892cfd24e787e9406111c856 100644 (file)
 
 /* 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
index a0b8de80a63f5ee13d69dcf24386cb440d4518f0..a9e5c7b7824142439aa398c62cfdc5beeeb5d623 100644 (file)
@@ -6,7 +6,7 @@ bdflush         EXTRA   bdflush         i:ii    bdflush
 capget         EXTRA   capget          i:pp    capget
 capset         EXTRA   capset          i:pp    capset
 clock_adjtime  EXTRA   clock_adjtime   i:ip    clock_adjtime
-creat          -       creat           Ci:si   __libc_creat creat
+creat          -       creat           Ci:si   creat
 create_module  EXTRA   create_module   3       create_module
 delete_module  EXTRA   delete_module   3       delete_module
 epoll_create   EXTRA   epoll_create    i:i     epoll_create
index 74732ab98bd7435ff817bbcf1a8a2f3ec6e0236e..77aa246435e5307451b2664a02c95b6d0b771bfc 100644 (file)
@@ -15,7 +15,7 @@ setrlimit     -       setrlimit       i:ip    __setrlimit     setrlimit setrlimit64
 readahead      -       readahead       i:iii   __readahead     readahead
 sendfile       -       sendfile        i:iipi  sendfile        sendfile64
 sync_file_range        -       sync_file_range Ci:iiii sync_file_range
-creat          -       creat           Ci:si   __libc_creat    creat creat64
+creat          -       creat           Ci:si   creat           creat64
 open           -       open            Ci:siv  __libc_open     __open open __open64 open64
 prlimit                EXTRA   prlimit64       i:iipp  prlimit         prlimit64