!m4/ltsugar.m4
!m4/ltversion.m4
!m4/lt~obsolete.m4
+
+# libuuid depends on AX_TLS macro
+!m4/tls.m4
nanosleep \
personality \
updwtmp \
+ jrand48 \
lchown \
llseek \
lseek64 \
])
+AC_ARG_ENABLE([tls],
+ AS_HELP_STRING([--disable-tls], [disable use of thread local support]),
+ [], enable_tls=yes
+)
+if test "x$enable_tls" = xyes; then
+ AX_TLS
+fi
+
+
AC_ARG_ENABLE([mount],
AS_HELP_STRING([--disable-mount], [do not build mount utilities]),
[], enable_mount=check
--- /dev/null
+# from http://autoconf-archive.cryp.to/ax_tls.html
+#
+# This was licensed under the GPL with the following exception:
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you make
+# and distribute a modified version of the Autoconf Macro, you may
+# extend this special exception to the GPL to apply to your modified
+# version as well.
+#
+AC_DEFUN([AX_TLS], [
+ AC_MSG_CHECKING(for thread local storage (TLS) class)
+ AC_CACHE_VAL(ac_cv_tls, [
+ ax_tls_keywords="__thread __declspec(thread) none"
+ for ax_tls_keyword in $ax_tls_keywords; do
+ case $ax_tls_keyword in
+ none) ac_cv_tls=none ; break ;;
+ *)
+ AC_TRY_COMPILE(
+ [#include <stdlib.h>
+ static void
+ foo(void) {
+ static ] $ax_tls_keyword [ int bar;
+ exit(1);
+ }],
+ [],
+ [ac_cv_tls=$ax_tls_keyword ; break],
+ ac_cv_tls=none
+ )
+ esac
+ done
+])
+
+ if test "$ac_cv_tls" != "none"; then
+ dnl AC_DEFINE([TLS], [], [If the compiler supports a TLS storage class define it to that here])
+ AC_DEFINE_UNQUOTED([TLS], $ac_cv_tls, [If the compiler supports a TLS storage class define it to that here])
+ fi
+ AC_MSG_RESULT($ac_cv_tls)
+])
int i, n = nbytes, fd = get_random_fd();
int lose_counter = 0;
unsigned char *cp = (unsigned char *) buf;
- unsigned short tmp_seed[3];
if (fd >= 0) {
while (n > 0) {
*/
for (cp = buf, i = 0; i < nbytes; i++)
*cp++ ^= (rand() >> 7) & 0xFF;
+
#ifdef DO_JRAND_MIX
- memcpy(tmp_seed, jrand_seed, sizeof(tmp_seed));
- jrand_seed[2] = jrand_seed[2] ^ syscall(__NR_gettid);
- for (cp = buf, i = 0; i < nbytes; i++)
- *cp++ ^= (jrand48(tmp_seed) >> 7) & 0xFF;
- memcpy(jrand_seed, tmp_seed,
- sizeof(jrand_seed)-sizeof(unsigned short));
+ {
+ unsigned short tmp_seed[3];
+
+ memcpy(tmp_seed, jrand_seed, sizeof(tmp_seed));
+ jrand_seed[2] = jrand_seed[2] ^ syscall(__NR_gettid);
+ for (cp = buf, i = 0; i < nbytes; i++)
+ *cp++ ^= (jrand48(tmp_seed) >> 7) & 0xFF;
+ memcpy(jrand_seed, tmp_seed,
+ sizeof(jrand_seed)-sizeof(unsigned short));
+ }
#endif
return;
return 0;
}
+#if defined(USE_UUIDD) && defined(HAVE_SYS_UN_H)
+/* used in get_uuid_via_daemon() only */
static ssize_t read_all(int fd, char *buf, size_t count)
{
ssize_t ret;
close(i);
}
-
/*
* Try using the uuidd daemon to generate the UUID
*
*/
static int get_uuid_via_daemon(int op, uuid_t out, int *num)
{
-#if defined(USE_UUIDD) && defined(HAVE_SYS_UN_H)
char op_buf[64];
int op_len;
int s;
fail:
close(s);
-#endif
return -1;
}
+#else /* !defined(USE_UUIDD) && defined(HAVE_SYS_UN_H) */
+static int get_uuid_via_daemon(int op, uuid_t out, int *num)
+{
+ return -1;
+}
+#endif
+
void uuid__generate_time(uuid_t out, int *num)
{
static unsigned char node_id[6];