|
@@ -39,12 +39,18 @@
|
|
|
|
|
|
|
|
|
#define __endmntent endmntent
|
|
|
-#define __fxstat64(vers, fd, buf) fstat64(fd, buf)
|
|
|
#define __getmntent_r getmntent_r
|
|
|
#define __setmntent setmntent
|
|
|
#define __statfs statfs
|
|
|
#define __libc_close close
|
|
|
-#define __libc_open open
|
|
|
+#ifdef __UCLIBC_HAS_LFS__
|
|
|
+# define __libc_open open64
|
|
|
+# define __fxstat64(vers, fd, buf) fstat64(fd, buf)
|
|
|
+#else
|
|
|
+# define __libc_open open
|
|
|
+# define __fxstat64(vers, fd, buf) fstat(fd, buf)
|
|
|
+# define stat64 stat
|
|
|
+#endif
|
|
|
#define __libc_write write
|
|
|
|
|
|
|
|
@@ -85,10 +91,10 @@ __where_is_shmfs (void)
|
|
|
|
|
|
this does not exist through /etc/fstab to find the mount point. */
|
|
|
fp = __setmntent ("/proc/mounts", "r");
|
|
|
- if (__builtin_expect (fp == NULL, 0))
|
|
|
+ if (unlikely (fp == NULL))
|
|
|
{
|
|
|
fp = __setmntent (_PATH_MNTTAB, "r");
|
|
|
- if (__builtin_expect (fp == NULL, 0))
|
|
|
+ if (unlikely (fp == NULL))
|
|
|
|
|
|
return;
|
|
|
}
|
|
@@ -168,13 +174,8 @@ check_add_mapping (const char *name, size_t namelen, int fd, sem_t *existing)
|
|
|
sem_t *result = SEM_FAILED;
|
|
|
|
|
|
|
|
|
-#ifdef __UCLIBC_HAS_LFS__
|
|
|
struct stat64 st;
|
|
|
if (__fxstat64 (_STAT_VER, fd, &st) == 0)
|
|
|
-#else
|
|
|
- struct stat st;
|
|
|
- if (fstat (fd, &st) == 0)
|
|
|
-#endif
|
|
|
{
|
|
|
|
|
|
lll_lock (__sem_mappings_lock, LLL_PRIVATE);
|