about summary refs log tree commit diff
path: root/locale
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-07-21 06:52:29 +0000
committerMiles Bader <miles@gnu.org>1996-07-21 06:52:29 +0000
commitc199a24feb079bf0f81f8cedcfe55e99c47ac415 (patch)
tree7faeed37f8ab18c8e9760e64d5d00935171623c5 /locale
parent6f9561ed067bb4eed53ec4872fe773c64a2df1c5 (diff)
downloadglibc-c199a24feb079bf0f81f8cedcfe55e99c47ac415.tar.gz
glibc-c199a24feb079bf0f81f8cedcfe55e99c47ac415.tar.xz
glibc-c199a24feb079bf0f81f8cedcfe55e99c47ac415.zip
Sun Jul 21 01:44:39 1996 Miles Bader <miles@gnu.ai.mit.edu> cvs/libc-960721
	* locale/programs/locfile.c (write_locale_data): Deal with missing
	UIO_MAXIOV.

	* sysdeps/mach/hurd/socket.c (socket): Make TYPE an int.
	* sysdeps/mach/hurd/socketpair.c (socketpair): Likewise.
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/locfile.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/locale/programs/locfile.c b/locale/programs/locfile.c
index e225e577d6..69d976160b 100644
--- a/locale/programs/locfile.c
+++ b/locale/programs/locfile.c
@@ -931,7 +931,7 @@ void
 write_locale_data (const char *output_path, const char *category,
 		   size_t n_elem, struct iovec *vec)
 {
-  size_t cnt, step;
+  size_t cnt, step, maxiov;
   int fd;
   char *fname;
 
@@ -959,11 +959,19 @@ write_locale_data (const char *output_path, const char *category,
     }
   free (fname);
 
+#ifdef UIO_MAXIOV
+  maxiov = UIO_MAXIOV;
+#else
+  maxiov = sysconf (_SC_UIO_MAXIOV);
+#endif
+
   /* Write the data using writev.  But we must take care for the
      limitation of the implementation.  */
   for (cnt = 0; cnt < n_elem; cnt += step)
     {
-      step = MIN (UIO_MAXIOV, n_elem - cnt);
+      step = n_elem - cnt;
+      if (maxiov > 0)
+	step = MIN (maxiov, step);
 
       if (writev (fd, &vec[cnt], step) < 0)
 	{