[git commit future] add lcong48[_r]

Peter S. Mazinger ps.m at gmx.net
Mon Apr 11 11:27:03 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=46374dd9effb20c13e26f70e23f269c14e551cee
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
 libc/stdlib/Makefile.in |    2 +-
 libc/stdlib/lcong48.c   |   29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletions(-)
 create mode 100644 libc/stdlib/lcong48.c

diff --git a/libc/stdlib/Makefile.in b/libc/stdlib/Makefile.in
index 760ccf7..4407d63 100644
--- a/libc/stdlib/Makefile.in
+++ b/libc/stdlib/Makefile.in
@@ -15,7 +15,7 @@ CSRC-y := \
 	abort.c getenv.c mkdtemp.c realpath.c canonicalize.c mkstemp.c \
 	rand.c random.c random_r.c setenv.c div.c ldiv.c lldiv.c \
 	getpt.c drand48-iter.c jrand48.c \
-	jrand48_r.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
+	jrand48_r.c lcong48.c lrand48.c lrand48_r.c mrand48.c mrand48_r.c nrand48.c \
 	nrand48_r.c rand_r.c srand48.c srand48_r.c seed48.c seed48_r.c \
 	valloc.c a64l.c l64a.c __uc_malloc.c
 CSRC-$(UCLIBC_HAS_ADVANCED_REALTIME) += posix_memalign.c
diff --git a/libc/stdlib/lcong48.c b/libc/stdlib/lcong48.c
new file mode 100644
index 0000000..06cab66
--- /dev/null
+++ b/libc/stdlib/lcong48.c
@@ -0,0 +1,29 @@
+/* vi: set sw=4 ts=4: */
+/* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */
+
+#include <features.h>
+
+#if defined __USE_SVID || defined __USE_XOPEN
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+static int __lcong48_r (unsigned short int param[7], struct drand48_data *buffer)
+{
+	/* Store the given values. */
+	memcpy (buffer->__x, &param[0], sizeof (buffer->__x));
+	buffer->__a = ((uint64_t) param[5] << 32 | (uint32_t) param[4] << 16 | param[3]);
+	buffer->__c = param[6];
+	buffer->__init = 1;
+
+	return 0;
+}
+# ifdef __USE_MISC
+strong_alias(__lcong48_r,lcong48_r)
+# endif
+
+void lcong48 (unsigned short int param[7])
+{
+	(void) __lcong48_r (param, &__libc_drand48_data);
+}
+#endif
-- 
1.7.3.4



More information about the uClibc-cvs mailing list