Browse Source

Implement __x versions

Peter S. Mazinger 20 năm trước cách đây
mục cha
commit
942357a798

+ 2 - 2
libc/misc/dirent/closedir.c

@@ -4,8 +4,7 @@
 #include <unistd.h>
 #include "dirstream.h"
 
-
-int closedir(DIR * dir)
+int attribute_hidden __closedir(DIR * dir)
 {
 	int fd;
 
@@ -27,3 +26,4 @@ int closedir(DIR * dir)
 	free(dir);
 	return __close(fd);
 }
+strong_alias(__closedir,closedir)

+ 2 - 1
libc/misc/dirent/opendir.c

@@ -11,7 +11,7 @@
 /* opendir just makes an open() call - it return NULL if it fails
  * (open sets errno), otherwise it returns a DIR * pointer.
  */
-DIR *opendir(const char *name)
+DIR attribute_hidden *__opendir(const char *name)
 {
 	int fd;
 	struct stat statbuf;
@@ -54,3 +54,4 @@ DIR *opendir(const char *name)
 	__pthread_mutex_init(&(ptr->dd_lock), NULL);
 	return ptr;
 }
+strong_alias(__opendir,opendir)

+ 3 - 2
libc/sysdeps/linux/common/ioctl.c

@@ -12,9 +12,10 @@
 #include <sys/ioctl.h>
 
 #define __NR___syscall_ioctl __NR_ioctl
+static inline
 _syscall3(int, __syscall_ioctl, int, fd, unsigned long int, request, void *, arg);
 
-int ioctl(int fd, unsigned long int request, ...)
+int attribute_hidden __ioctl(int fd, unsigned long int request, ...)
 {
     void *arg;
     va_list list;
@@ -25,4 +26,4 @@ int ioctl(int fd, unsigned long int request, ...)
     va_end(list);
     return __syscall_ioctl(fd, request, arg);
 }
-
+strong_alias(__ioctl,ioctl)

+ 3 - 1
libc/sysdeps/linux/common/unlink.c

@@ -9,4 +9,6 @@
 
 #include "syscalls.h"
 #include <unistd.h>
-_syscall1(int, unlink, const char *, pathname);
+#define __NR___unlink __NR_unlink
+attribute_hidden _syscall1(int, __unlink, const char *, pathname);
+strong_alias(__unlink,unlink)