---
 src/ar.c      | 4 ++++
 src/ranlib.c  | 4 ++++
 src/strings.c | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/src/ar.c b/src/ar.c
index 03118c4..7a8ca01 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -434,7 +434,11 @@ copy_content (Elf *elf, int newfd, off_t off, size_t n)
   /* Tell the kernel we will read all the pages sequentially.  */
   size_t ps = sysconf (_SC_PAGESIZE);
   if (n > 2 * ps)
+#ifdef __UCLIBC__
+    madvise (rawfile + (off & ~(ps - 1)), n, POSIX_MADV_SEQUENTIAL);
+#else
     posix_madvise (rawfile + (off & ~(ps - 1)), n, POSIX_MADV_SEQUENTIAL);
+#endif
 
   return write_retry (newfd, rawfile + off, n) != (ssize_t) n;
 }
diff --git a/src/ranlib.c b/src/ranlib.c
index 073df8c..5e2cf8c 100644
--- a/src/ranlib.c
+++ b/src/ranlib.c
@@ -124,7 +124,11 @@ copy_content (Elf *elf, int newfd, off_t off, size_t n)
   /* Tell the kernel we will read all the pages sequentially.  */
   size_t ps = sysconf (_SC_PAGESIZE);
   if (n > 2 * ps)
+#ifdef __UCLIBC__
+    madvise (rawfile + (off & ~(ps - 1)), n, POSIX_MADV_SEQUENTIAL);
+#else
     posix_madvise (rawfile + (off & ~(ps - 1)), n, POSIX_MADV_SEQUENTIAL);
+#endif
 
   return write_retry (newfd, rawfile + off, n) != (ssize_t) n;
 }
diff --git a/src/strings.c b/src/strings.c
index fe0f3a4..41abae2 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -477,7 +477,11 @@ map_file (int fd, off_t start_off, off_t fdlen, size_t *map_sizep)
       if (mem != MAP_FAILED)
 	{
 	  /* We will go through the mapping sequentially.  */
+#ifdef __UCLIBC__
+	  (void) madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
+#else
 	  (void) posix_madvise (mem, map_size, POSIX_MADV_SEQUENTIAL);
+#endif	  
 	  break;
 	}
       if (errno != EINVAL && errno != ENOMEM)
-- 
2.34.1

