summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/dirent/opendir.c2
-rw-r--r--libc/misc/dirent/rewinddir.c2
-rw-r--r--libc/misc/dirent/scandir.c2
-rw-r--r--libc/misc/dirent/scandir64.c2
-rw-r--r--libc/misc/dirent/seekdir.c2
-rw-r--r--libc/misc/error/error.c1
-rw-r--r--libc/misc/file/lockf.c4
-rw-r--r--libc/misc/file/lockf64.c5
-rw-r--r--libc/misc/ftw/ftw.c4
-rw-r--r--libc/misc/glob/glob.c2
-rw-r--r--libc/misc/glob/glob64.c4
-rw-r--r--libc/misc/internals/__uClibc_main.c4
-rw-r--r--libc/misc/locale/locale.c1
-rw-r--r--libc/misc/mntent/mntent.c1
-rw-r--r--libc/misc/syslog/syslog.c2
-rw-r--r--libc/misc/utmp/utent.c12
-rw-r--r--libc/misc/utmp/wtent.c4
-rw-r--r--libc/misc/wchar/wstdio.c1
18 files changed, 29 insertions, 26 deletions
diff --git a/libc/misc/dirent/opendir.c b/libc/misc/dirent/opendir.c
index efa6daba6..82e7f364f 100644
--- a/libc/misc/dirent/opendir.c
+++ b/libc/misc/dirent/opendir.c
@@ -29,7 +29,7 @@ DIR attribute_hidden *__opendir(const char *name)
/* 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);
diff --git a/libc/misc/dirent/rewinddir.c b/libc/misc/dirent/rewinddir.c
index f41ecc389..18d6547a8 100644
--- a/libc/misc/dirent/rewinddir.c
+++ b/libc/misc/dirent/rewinddir.c
@@ -12,7 +12,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 cc76bed5e..72929fb57 100644
--- a/libc/misc/dirent/scandir.c
+++ b/libc/misc/dirent/scandir.c
@@ -49,7 +49,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;
diff --git a/libc/misc/dirent/scandir64.c b/libc/misc/dirent/scandir64.c
index 377f55fe6..7a661996b 100644
--- a/libc/misc/dirent/scandir64.c
+++ b/libc/misc/dirent/scandir64.c
@@ -64,7 +64,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;
diff --git a/libc/misc/dirent/seekdir.c b/libc/misc/dirent/seekdir.c
index 507131097..6e841291a 100644
--- a/libc/misc/dirent/seekdir.c
+++ b/libc/misc/dirent/seekdir.c
@@ -10,7 +10,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));
}
diff --git a/libc/misc/error/error.c b/libc/misc/error/error.c
index 5427e9568..119396570 100644
--- a/libc/misc/error/error.c
+++ b/libc/misc/error/error.c
@@ -24,6 +24,7 @@
#define strerror __strerror
#define vfprintf __vfprintf
+#define fflush __fflush
#include <stdio.h>
#include <stdarg.h>
diff --git a/libc/misc/file/lockf.c b/libc/misc/file/lockf.c
index dd5b90b3e..63d6a39c9 100644
--- a/libc/misc/file/lockf.c
+++ b/libc/misc/file/lockf.c
@@ -41,7 +41,7 @@ int attribute_hidden __lockf (int fd, int cmd, off_t len)
/* Test the lock: return 0 if FD is unlocked or locked by this process;
return -1, set errno to EACCES, if another process holds the lock. */
fl.l_type = F_RDLCK;
- if (fcntl (fd, F_GETLK, &fl) < 0)
+ if (__fcntl (fd, F_GETLK, &fl) < 0)
return -1;
if (fl.l_type == F_UNLCK || fl.l_pid == __getpid ())
return 0;
@@ -66,6 +66,6 @@ int attribute_hidden __lockf (int fd, int cmd, off_t len)
return -1;
}
- return fcntl(fd, cmd, &fl);
+ return __fcntl(fd, cmd, &fl);
}
strong_alias(__lockf,lockf)
diff --git a/libc/misc/file/lockf64.c b/libc/misc/file/lockf64.c
index 23f88f179..8440202d5 100644
--- a/libc/misc/file/lockf64.c
+++ b/libc/misc/file/lockf64.c
@@ -41,11 +41,12 @@
#include <sys/syscall.h>
#ifdef __NR_fcntl64
-extern int fcntl64 (int fd, int cmd, ...);
#define flock flock64
-#define fcntl fcntl64
+#define fcntl __fcntl64
#define F_GETLK F_GETLK64
#define F_SETLK F_SETLK64
+#else
+#define fcntl __fcntl
#endif
/* lockf is a simplified interface to fcntl's locking facilities. */
diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c
index 30009def9..4bd186561 100644
--- a/libc/misc/ftw/ftw.c
+++ b/libc/misc/ftw/ftw.c
@@ -219,7 +219,7 @@ open_dir_stream (struct ftw_data *data, struct dir_data *dirp)
struct dirent *d;
size_t actsize = 0;
- while ((d = readdir (st)) != NULL)
+ while ((d = __readdir (st)) != NULL)
{
size_t this_len = _D_EXACT_NAMLEN (d);
if (actsize + this_len + 2 >= bufsize)
@@ -443,7 +443,7 @@ ftw_dir (struct ftw_data *data, struct STAT *st)
*startp++ = '/';
data->ftw.base = startp - data->dirbuf;
- while (dir.stream != NULL && (d = readdir (dir.stream)) != NULL)
+ while (dir.stream != NULL && (d = __readdir (dir.stream)) != NULL)
{
result = process_entry (data, &dir, d->d_name, _D_EXACT_NAMLEN (d));
if (result != 0)
diff --git a/libc/misc/glob/glob.c b/libc/misc/glob/glob.c
index 795030388..aa90ae418 100644
--- a/libc/misc/glob/glob.c
+++ b/libc/misc/glob/glob.c
@@ -428,7 +428,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob)
}
else
{
- struct dirent *d = readdir ((DIR *) stream);
+ struct dirent *d = __readdir ((DIR *) stream);
if (d == NULL)
break;
if (! (d->d_ino != 0))
diff --git a/libc/misc/glob/glob64.c b/libc/misc/glob/glob64.c
index 5829fec14..17e6838aa 100644
--- a/libc/misc/glob/glob64.c
+++ b/libc/misc/glob/glob64.c
@@ -19,7 +19,7 @@
#include <sys/stat.h>
#define dirent dirent64
-#define readdir(dirp) readdir64 (dirp)
+#define __readdir(dirp) __readdir64(dirp)
#define glob_t glob64_t
#define glob(pattern, flags, errfunc, pglob) \
@@ -28,7 +28,7 @@
#undef stat
#define stat stat64
-#define lstat lstat64
+#define __lstat __lstat64
#define __GLOB64 1
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 3760ae275..f3fda108b 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -81,14 +81,12 @@ const char *__progname = 0;
# define O_NOFOLLOW 0
#endif
-extern int __libc_fcntl(int fd, int cmd, ...);
-
#ifdef __ARCH_HAS_MMU__
static void __check_one_fd(int fd, int mode)
{
/* Check if the specified fd is already open */
- if (unlikely(__libc_fcntl(fd, F_GETFD)==-1 && *(__errno_location())==EBADF))
+ if (unlikely(__fcntl(fd, F_GETFD)==-1 && *(__errno_location())==EBADF))
{
/* The descriptor is probably not open, so try to use /dev/null */
struct stat st;
diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c
index bf0628ee1..0d7060950 100644
--- a/libc/misc/locale/locale.c
+++ b/libc/misc/locale/locale.c
@@ -48,6 +48,7 @@
#define stpcpy __stpcpy
#define strtok_r __strtok_r
+/* #define fflush __fflush */
#define _GNU_SOURCE
diff --git a/libc/misc/mntent/mntent.c b/libc/misc/mntent/mntent.c
index 7e9febb1f..49251479d 100644
--- a/libc/misc/mntent/mntent.c
+++ b/libc/misc/mntent/mntent.c
@@ -1,6 +1,7 @@
#define strtok_r __strtok_r
#define strstr __strstr
#define atoi __atoi
+#define fseek __fseek
#include <stdio.h>
#include <stdlib.h>
diff --git a/libc/misc/syslog/syslog.c b/libc/misc/syslog/syslog.c
index 649f36d65..a4bb56bfc 100644
--- a/libc/misc/syslog/syslog.c
+++ b/libc/misc/syslog/syslog.c
@@ -153,7 +153,7 @@ retry:
UNLOCK;
return;
}
- /* fcntl(LogFile, F_SETFD, 1); */
+ /* __fcntl(LogFile, F_SETFD, 1); */
}
}
diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c
index 374b53b93..3ad5bc828 100644
--- a/libc/misc/utmp/utent.c
+++ b/libc/misc/utmp/utent.c
@@ -49,9 +49,9 @@ void attribute_hidden __setutent(void)
}
}
/* Make sure the file will be closed on exec() */
- ret = fcntl(static_fd, F_GETFD, 0);
+ ret = __fcntl(static_fd, F_GETFD, 0);
if (ret >= 0) {
- ret = fcntl(static_fd, F_GETFD, 0);
+ ret = __fcntl(static_fd, F_GETFD, 0);
}
if (ret < 0) {
bummer:
@@ -61,7 +61,7 @@ bummer:
return;
}
}
- lseek(static_fd, 0, SEEK_SET);
+ __lseek(static_fd, 0, SEEK_SET);
UNLOCK;
return;
}
@@ -151,14 +151,14 @@ struct utmp *pututline (const struct utmp *utmp_entry)
LOCK;
/* Ignore the return value. That way, if they've already positioned
the file pointer where they want it, everything will work out. */
- lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
+ __lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
if (__getutid(utmp_entry) != NULL) {
- lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
+ __lseek(static_fd, (off_t) - sizeof(struct utmp), SEEK_CUR);
if (__write(static_fd, utmp_entry, sizeof(struct utmp)) != sizeof(struct utmp))
return NULL;
} else {
- lseek(static_fd, (off_t) 0, SEEK_END);
+ __lseek(static_fd, (off_t) 0, SEEK_END);
if (__write(static_fd, utmp_entry, sizeof(struct utmp)) != sizeof(struct utmp))
return NULL;
}
diff --git a/libc/misc/utmp/wtent.c b/libc/misc/utmp/wtent.c
index bfedeaa70..35947f19e 100644
--- a/libc/misc/utmp/wtent.c
+++ b/libc/misc/utmp/wtent.c
@@ -52,9 +52,9 @@ extern void updwtmp(const char *wtmp_file, const struct utmp *lutmp)
fd = __open(wtmp_file, O_APPEND | O_WRONLY, 0);
if (fd >= 0) {
- if (lockf(fd, F_LOCK, 0)==0) {
+ if (__lockf(fd, F_LOCK, 0)==0) {
__write(fd, (const char *) lutmp, sizeof(struct utmp));
- lockf(fd, F_ULOCK, 0);
+ __lockf(fd, F_ULOCK, 0);
__close(fd);
}
}
diff --git a/libc/misc/wchar/wstdio.c b/libc/misc/wchar/wstdio.c
index 91917683a..b4ca4973f 100644
--- a/libc/misc/wchar/wstdio.c
+++ b/libc/misc/wchar/wstdio.c
@@ -53,6 +53,7 @@
#define wcsrtombs __wcsrtombs
#define mbrtowc __mbrtowc
#define wcrtomb __wcrtomb
+#define fflush_unlocked __fflush_unlocked
#define _GNU_SOURCE
#include <stdio.h>