summaryrefslogtreecommitdiff
path: root/libc/misc/internals
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc/internals')
-rw-r--r--libc/misc/internals/__uClibc_main.c6
-rw-r--r--libc/misc/internals/tempname.c22
2 files changed, 15 insertions, 13 deletions
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 48b3b6e7d..a46465398 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -80,9 +80,9 @@ const char *__progname = 0;
#endif
extern int __libc_fcntl(int fd, int cmd, ...);
-extern int __libc_open(const char *file, int flags, ...);
#ifdef __ARCH_HAS_MMU__
+
static void __check_one_fd(int fd, int mode)
{
/* Check if the specified fd is already open */
@@ -90,7 +90,7 @@ static void __check_one_fd(int fd, int mode)
{
/* The descriptor is probably not open, so try to use /dev/null */
struct stat st;
- int nullfd = __libc_open(_PATH_DEVNULL, mode);
+ int nullfd = __open(_PATH_DEVNULL, mode);
/* /dev/null is major=1 minor=3. Make absolutely certain
* that is in fact the device that we have opened and not
* some other wierd file... */
@@ -229,7 +229,7 @@ __uClibc_main(int (*main)(int, char **, char **), int argc,
while (*aux_dat) {
ElfW(auxv_t) *auxv_entry = (ElfW(auxv_t) *) aux_dat;
if (auxv_entry->a_type <= AT_EGID) {
- memcpy(&(auxvt[auxv_entry->a_type]), auxv_entry, sizeof(ElfW(auxv_t)));
+ __memcpy(&(auxvt[auxv_entry->a_type]), auxv_entry, sizeof(ElfW(auxv_t)));
}
aux_dat += 2;
}
diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c
index 589d627ae..360c76879 100644
--- a/libc/misc/internals/tempname.c
+++ b/libc/misc/internals/tempname.c
@@ -31,6 +31,8 @@
* Use brain damaged getpid() if real random fails.
*/
+#define open64 __open64
+
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
@@ -72,7 +74,7 @@ int attribute_hidden __path_search (char *tmpl, size_t tmpl_len, const char *dir
}
else
{
- plen = strlen (pfx);
+ plen = __strlen (pfx);
if (plen > 5)
plen = 5;
}
@@ -94,7 +96,7 @@ int attribute_hidden __path_search (char *tmpl, size_t tmpl_len, const char *dir
{
if (direxists (P_tmpdir))
dir = P_tmpdir;
- else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
+ else if (__strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
dir = "/tmp";
else
{
@@ -103,7 +105,7 @@ int attribute_hidden __path_search (char *tmpl, size_t tmpl_len, const char *dir
}
}
- dlen = strlen (dir);
+ dlen = __strlen (dir);
while (dlen > 1 && dir[dlen - 1] == '/')
dlen--; /* remove trailing slashes */
@@ -126,13 +128,13 @@ static unsigned int fillrand(unsigned char *buf, unsigned int len)
{
int fd;
unsigned int result = -1;
- fd = open("/dev/urandom", O_RDONLY);
+ fd = __open("/dev/urandom", O_RDONLY);
if (fd < 0) {
- fd = open("/dev/random", O_RDONLY | O_NONBLOCK);
+ fd = __open("/dev/random", O_RDONLY | O_NONBLOCK);
}
if (fd >= 0) {
- result = read(fd, buf, len);
- close(fd);
+ result = __read(fd, buf, len);
+ __close(fd);
}
return result;
}
@@ -182,8 +184,8 @@ int attribute_hidden __gen_tempname (char *tmpl, int kind)
int len, i, count, fd, save_errno = errno;
unsigned char randomness[6];
- len = strlen (tmpl);
- if (len < 6 || strcmp (&tmpl[len - 6], "XXXXXX"))
+ len = __strlen (tmpl);
+ if (len < 6 || __strcmp (&tmpl[len - 6], "XXXXXX"))
{
__set_errno (EINVAL);
return -1;
@@ -223,7 +225,7 @@ int attribute_hidden __gen_tempname (char *tmpl, int kind)
continue;
}
case __GT_FILE:
- fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+ fd = __open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
break;
#if defined __UCLIBC_HAS_LFS__
case __GT_BIGFILE: