[Haiku-commits] r21840 - haiku/trunk/src/system/libroot/posix/unistd

korli at BerliOS korli at mail.berlios.de
Mon Aug 6 20:03:53 CEST 2007


Author: korli
Date: 2007-08-06 20:03:52 +0200 (Mon, 06 Aug 2007)
New Revision: 21840
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=21840&view=rev

Modified:
   haiku/trunk/src/system/libroot/posix/unistd/conf.c
Log:
now behaves like the BeOS version


Modified: haiku/trunk/src/system/libroot/posix/unistd/conf.c
===================================================================
--- haiku/trunk/src/system/libroot/posix/unistd/conf.c	2007-08-06 17:43:59 UTC (rev 21839)
+++ haiku/trunk/src/system/libroot/posix/unistd/conf.c	2007-08-06 18:03:52 UTC (rev 21840)
@@ -101,11 +101,22 @@
 }
 
 
+#define min_c(a,b) ((a)>(b)?(b):(a))
+
 size_t 
 confstr(int name, char *buf, size_t len)
 {
-	// ToDo: find out what BeOS supports here
-	errno = EINVAL;
-	return 0;
+	size_t string_len = 1;
+	char *string = "";
+	switch (name) {
+		case 0:
+			break;
+		default:
+			errno = EINVAL;
+			return 0;
+	}
+	if (buf != NULL)
+		strncpy(buf, string, min_c(len, string_len));
+	return string_len;
 }
 




More information about the Haiku-commits mailing list