diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-14 00:58:03 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-14 00:58:03 +0000 |
commit | af0172162f7c653cad6a11ed1c1a5459bc154465 (patch) | |
tree | 70031dad1e7286d58762da7b9e3d3f93d043c278 /libc/misc/dirent | |
parent | c8609543a9a8bf6559c2931dbbef6b3c41b3fbf2 (diff) |
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed
Diffstat (limited to 'libc/misc/dirent')
-rw-r--r-- | libc/misc/dirent/alphasort.c | 4 | ||||
-rw-r--r-- | libc/misc/dirent/alphasort64.c | 3 | ||||
-rw-r--r-- | libc/misc/dirent/closedir.c | 9 | ||||
-rw-r--r-- | libc/misc/dirent/dirfd.c | 11 | ||||
-rw-r--r-- | libc/misc/dirent/dirstream.h | 4 | ||||
-rw-r--r-- | libc/misc/dirent/opendir.c | 19 | ||||
-rw-r--r-- | libc/misc/dirent/readdir.c | 6 | ||||
-rw-r--r-- | libc/misc/dirent/readdir64.c | 6 | ||||
-rw-r--r-- | libc/misc/dirent/readdir64_r.c | 4 | ||||
-rw-r--r-- | libc/misc/dirent/readdir_r.c | 4 | ||||
-rw-r--r-- | libc/misc/dirent/rewinddir.c | 3 | ||||
-rw-r--r-- | libc/misc/dirent/scandir.c | 40 | ||||
-rw-r--r-- | libc/misc/dirent/scandir64.c | 13 | ||||
-rw-r--r-- | libc/misc/dirent/seekdir.c | 4 |
14 files changed, 73 insertions, 57 deletions
diff --git a/libc/misc/dirent/alphasort.c b/libc/misc/dirent/alphasort.c index feae021e6..ea45829d3 100644 --- a/libc/misc/dirent/alphasort.c +++ b/libc/misc/dirent/alphasort.c @@ -2,9 +2,11 @@ #include <string.h> #include "dirstream.h" +libc_hidden_proto(strcmp) + int alphasort(const void * a, const void * b) { - return __strcmp ((*(const struct dirent **) a)->d_name, + return strcmp ((*(const struct dirent **) a)->d_name, (*(const struct dirent **) b)->d_name); } diff --git a/libc/misc/dirent/alphasort64.c b/libc/misc/dirent/alphasort64.c index c6cfcdacf..2bba1fcc9 100644 --- a/libc/misc/dirent/alphasort64.c +++ b/libc/misc/dirent/alphasort64.c @@ -16,9 +16,10 @@ #include <string.h> #include "dirstream.h" +libc_hidden_proto(strcmp) int alphasort64(const void * a, const void * b) { - return __strcmp ((*(const struct dirent64 **) a)->d_name, + return strcmp ((*(const struct dirent64 **) a)->d_name, (*(const struct dirent64 **) b)->d_name); } diff --git a/libc/misc/dirent/closedir.c b/libc/misc/dirent/closedir.c index 8066b5861..870414a87 100644 --- a/libc/misc/dirent/closedir.c +++ b/libc/misc/dirent/closedir.c @@ -4,7 +4,10 @@ #include <unistd.h> #include "dirstream.h" -int attribute_hidden __closedir(DIR * dir) +libc_hidden_proto(closedir) +libc_hidden_proto(close) + +int closedir(DIR * dir) { int fd; @@ -24,6 +27,6 @@ int attribute_hidden __closedir(DIR * dir) __pthread_mutex_unlock(&(dir->dd_lock)); free(dir->dd_buf); free(dir); - return __close(fd); + return close(fd); } -strong_alias(__closedir,closedir) +libc_hidden_def(closedir) diff --git a/libc/misc/dirent/dirfd.c b/libc/misc/dirent/dirfd.c index 48e955450..236614642 100644 --- a/libc/misc/dirent/dirfd.c +++ b/libc/misc/dirent/dirfd.c @@ -1,8 +1,14 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + #include <dirent.h> #include <errno.h> #include "dirstream.h" -int attribute_hidden __dirfd(DIR * dir) +int dirfd(DIR * dir) { if (!dir || dir->dd_fd == -1) { __set_errno(EBADF); @@ -11,4 +17,5 @@ int attribute_hidden __dirfd(DIR * dir) return dir->dd_fd; } -strong_alias(__dirfd,dirfd) +libc_hidden_proto(dirfd) +libc_hidden_def(dirfd) diff --git a/libc/misc/dirent/dirstream.h b/libc/misc/dirent/dirstream.h index 15c70858f..713204c03 100644 --- a/libc/misc/dirent/dirstream.h +++ b/libc/misc/dirent/dirstream.h @@ -72,10 +72,10 @@ struct __dirstream { extern ssize_t __getdents(int fd, char *buf, size_t count) attribute_hidden; -extern struct dirent *__readdir (DIR *__dirp) __nonnull ((1)) attribute_hidden; +libc_hidden_proto(readdir) #ifdef __UCLIBC_HAS_LFS__ extern ssize_t __getdents64 (int fd, char *buf, size_t count) attribute_hidden; -extern struct dirent64 *__readdir64 (DIR *__dirp) __nonnull ((1)) attribute_hidden; +libc_hidden_proto(readdir64) #endif #endif /* dirent.h */ diff --git a/libc/misc/dirent/opendir.c b/libc/misc/dirent/opendir.c index 82e7f364f..707bf45dc 100644 --- a/libc/misc/dirent/opendir.c +++ b/libc/misc/dirent/opendir.c @@ -7,32 +7,37 @@ #include <sys/stat.h> #include "dirstream.h" +libc_hidden_proto(opendir) +libc_hidden_proto(open) +libc_hidden_proto(fcntl) +libc_hidden_proto(close) +libc_hidden_proto(stat) /* opendir just makes an open() call - it return NULL if it fails * (open sets errno), otherwise it returns a DIR * pointer. */ -DIR attribute_hidden *__opendir(const char *name) +DIR *opendir(const char *name) { int fd; struct stat statbuf; char *buf; DIR *ptr; - if (__stat(name, &statbuf)) + if (stat(name, &statbuf)) return NULL; if (!S_ISDIR(statbuf.st_mode)) { __set_errno(ENOTDIR); return NULL; } - if ((fd = __open(name, O_RDONLY)) < 0) + if ((fd = open(name, O_RDONLY)) < 0) return NULL; /* According to POSIX, directory streams should be closed when * exec. From "Anna Pluzhnikov" <besp@midway.uchicago.edu>. */ - if (__fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) + if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) return NULL; if (!(ptr = malloc(sizeof(*ptr)))) { - __close(fd); + close(fd); __set_errno(ENOMEM); return NULL; } @@ -45,7 +50,7 @@ DIR attribute_hidden *__opendir(const char *name) ptr->dd_max = 512; if (!(buf = calloc(1, ptr->dd_max))) { - __close(fd); + close(fd); free(ptr); __set_errno(ENOMEM); return NULL; @@ -54,4 +59,4 @@ DIR attribute_hidden *__opendir(const char *name) __pthread_mutex_init(&(ptr->dd_lock), NULL); return ptr; } -strong_alias(__opendir,opendir) +libc_hidden_def(opendir) diff --git a/libc/misc/dirent/readdir.c b/libc/misc/dirent/readdir.c index 2d4ad4aeb..e26479c13 100644 --- a/libc/misc/dirent/readdir.c +++ b/libc/misc/dirent/readdir.c @@ -7,7 +7,9 @@ #include <dirent.h> #include "dirstream.h" -struct dirent attribute_hidden *__readdir(DIR * dir) +libc_hidden_proto(readdir) + +struct dirent *readdir(DIR * dir) { ssize_t bytes; struct dirent *de; @@ -46,4 +48,4 @@ all_done: __pthread_mutex_unlock(&(dir->dd_lock)); return de; } -strong_alias(__readdir,readdir) +libc_hidden_def(readdir) diff --git a/libc/misc/dirent/readdir64.c b/libc/misc/dirent/readdir64.c index 177af3fc9..2134d19fe 100644 --- a/libc/misc/dirent/readdir64.c +++ b/libc/misc/dirent/readdir64.c @@ -20,7 +20,9 @@ #include <dirent.h> #include "dirstream.h" -struct dirent64 attribute_hidden *__readdir64(DIR * dir) +libc_hidden_proto(readdir64) + +struct dirent64 *readdir64(DIR * dir) { ssize_t bytes; struct dirent64 *de; @@ -60,4 +62,4 @@ all_done: return de; } -strong_alias(__readdir64,readdir64) +libc_hidden_def(readdir64) diff --git a/libc/misc/dirent/readdir64_r.c b/libc/misc/dirent/readdir64_r.c index 1cbaf3156..b8de4fa6f 100644 --- a/libc/misc/dirent/readdir64_r.c +++ b/libc/misc/dirent/readdir64_r.c @@ -19,6 +19,8 @@ #include <dirent.h> #include "dirstream.h" +libc_hidden_proto(memcpy) + int readdir64_r(DIR *dir, struct dirent64 *entry, struct dirent64 **result) { int ret; @@ -59,7 +61,7 @@ int readdir64_r(DIR *dir, struct dirent64 *entry, struct dirent64 **result) if (de == NULL) { *result = NULL; } else { - *result = __memcpy (entry, de, de->d_reclen); + *result = memcpy (entry, de, de->d_reclen); } ret = 0; diff --git a/libc/misc/dirent/readdir_r.c b/libc/misc/dirent/readdir_r.c index 25cb80b63..769352f0a 100644 --- a/libc/misc/dirent/readdir_r.c +++ b/libc/misc/dirent/readdir_r.c @@ -5,6 +5,8 @@ #include <dirent.h> #include "dirstream.h" +libc_hidden_proto(memcpy) + int readdir_r(DIR *dir, struct dirent *entry, struct dirent **result) { int ret; @@ -45,7 +47,7 @@ int readdir_r(DIR *dir, struct dirent *entry, struct dirent **result) if (de == NULL) { *result = NULL; } else { - *result = __memcpy (entry, de, de->d_reclen); + *result = memcpy (entry, de, de->d_reclen); } ret = 0; diff --git a/libc/misc/dirent/rewinddir.c b/libc/misc/dirent/rewinddir.c index 18d6547a8..ec89f17a7 100644 --- a/libc/misc/dirent/rewinddir.c +++ b/libc/misc/dirent/rewinddir.c @@ -3,6 +3,7 @@ #include <unistd.h> #include "dirstream.h" +libc_hidden_proto(lseek) /* rewinddir() just does an lseek(fd,0,0) - see close for comments */ void rewinddir(DIR * dir) @@ -12,7 +13,7 @@ void rewinddir(DIR * dir) return; } __pthread_mutex_lock(&(dir->dd_lock)); - __lseek(dir->dd_fd, 0, SEEK_SET); + lseek(dir->dd_fd, 0, SEEK_SET); dir->dd_nextoff = dir->dd_nextloc = dir->dd_size = 0; __pthread_mutex_unlock(&(dir->dd_lock)); } diff --git a/libc/misc/dirent/scandir.c b/libc/misc/dirent/scandir.c index 72929fb57..41491baee 100644 --- a/libc/misc/dirent/scandir.c +++ b/libc/misc/dirent/scandir.c @@ -1,28 +1,8 @@ -/* Copyright (C) 1992-1998, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. - */ - -/* Modified for uClibc by Erik Andersen - */ - -#define qsort __qsort -#define opendir __opendir -#define closedir __closedir +/* + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ #include <dirent.h> #include <stdio.h> @@ -32,6 +12,12 @@ #include <sys/types.h> #include "dirstream.h" +libc_hidden_proto(memcpy) +libc_hidden_proto(readdir) +libc_hidden_proto(opendir) +libc_hidden_proto(closedir) +libc_hidden_proto(qsort) + int scandir(const char *dir, struct dirent ***namelist, int (*selector) (const struct dirent *), int (*compar) (const void *, const void *)) @@ -49,7 +35,7 @@ int scandir(const char *dir, struct dirent ***namelist, __set_errno (0); pos = 0; - while ((current = __readdir (dp)) != NULL) + while ((current = readdir (dp)) != NULL) if (selector == NULL || (*selector) (current)) { struct dirent *vnew; @@ -76,7 +62,7 @@ int scandir(const char *dir, struct dirent ***namelist, if (vnew == NULL) break; - names[pos++] = (struct dirent *) __memcpy (vnew, current, dsize); + names[pos++] = (struct dirent *) memcpy (vnew, current, dsize); } if (unlikely(errno != 0)) diff --git a/libc/misc/dirent/scandir64.c b/libc/misc/dirent/scandir64.c index e77b88d3c..44252b6f0 100644 --- a/libc/misc/dirent/scandir64.c +++ b/libc/misc/dirent/scandir64.c @@ -20,10 +20,6 @@ /* Modified for uClibc by Erik Andersen */ -#define qsort __qsort -#define opendir __opendir -#define closedir __closedir - #include <features.h> #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 @@ -47,6 +43,11 @@ #include <sys/types.h> #include "dirstream.h" +libc_hidden_proto(memcpy) +libc_hidden_proto(opendir) +libc_hidden_proto(closedir) +libc_hidden_proto(qsort) + int scandir64(const char *dir, struct dirent64 ***namelist, int (*selector) (const struct dirent64 *), int (*compar) (const void *, const void *)) @@ -64,7 +65,7 @@ int scandir64(const char *dir, struct dirent64 ***namelist, __set_errno (0); pos = 0; - while ((current = __readdir64 (dp)) != NULL) + while ((current = readdir64 (dp)) != NULL) if (selector == NULL || (*selector) (current)) { struct dirent64 *vnew; @@ -91,7 +92,7 @@ int scandir64(const char *dir, struct dirent64 ***namelist, if (vnew == NULL) break; - names[pos++] = (struct dirent64 *) __memcpy (vnew, current, dsize); + names[pos++] = (struct dirent64 *) memcpy (vnew, current, dsize); } if (unlikely(errno != 0)) diff --git a/libc/misc/dirent/seekdir.c b/libc/misc/dirent/seekdir.c index 6e841291a..5aa848b2a 100644 --- a/libc/misc/dirent/seekdir.c +++ b/libc/misc/dirent/seekdir.c @@ -3,6 +3,8 @@ #include <unistd.h> #include "dirstream.h" +libc_hidden_proto(lseek) + void seekdir(DIR * dir, long int offset) { if (!dir) { @@ -10,7 +12,7 @@ void seekdir(DIR * dir, long int offset) return; } __pthread_mutex_lock(&(dir->dd_lock)); - dir->dd_nextoff = __lseek(dir->dd_fd, offset, SEEK_SET); + dir->dd_nextoff = lseek(dir->dd_fd, offset, SEEK_SET); dir->dd_size = dir->dd_nextloc = 0; __pthread_mutex_unlock(&(dir->dd_lock)); } |