diff options
author | Mark H Weaver <mhw@netris.org> | 2013-03-28 05:09:53 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2013-03-28 05:09:53 -0400 |
commit | 26d148066f9cb20e395a7dc4fefdf2e2ef0b2fb0 (patch) | |
tree | 40f13bc6355adb822bb8cd01fee5bcd9fd5430f9 /libguile/random.c | |
parent | 8ae26afefee947c71314733c419519fb616bf36d (diff) | |
parent | 579127cce488ce208d62e68e679e34fbbdc17367 (diff) | |
download | guile-26d148066f9cb20e395a7dc4fefdf2e2ef0b2fb0.tar.gz |
Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
configure.ac
libguile/deprecated.c
libguile/deprecated.h
libguile/filesys.h
libguile/fluids.c
libguile/fports.c
libguile/gc.c
libguile/guile.c
libguile/numbers.c
libguile/objcodes.c
libguile/r6rs-ports.c
libguile/smob.c
libguile/socket.c
libguile/threads.h
module/language/scheme/decompile-tree-il.scm
module/language/tree-il/peval.scm
test-suite/tests/syncase.test
Diffstat (limited to 'libguile/random.c')
-rw-r--r-- | libguile/random.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libguile/random.c b/libguile/random.c index 2db19f729..c0b04bc05 100644 --- a/libguile/random.c +++ b/libguile/random.c @@ -1,4 +1,5 @@ -/* Copyright (C) 1999,2000,2001, 2003, 2005, 2006, 2009, 2010 Free Software Foundation, Inc. +/* Copyright (C) 1999, 2000, 2001, 2003, 2005, 2006, 2009, 2010, + * 2012, 2013 Free Software Foundation, Inc. * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation; either version 3 of @@ -17,7 +18,7 @@ -/* Author: Mikael Djurfeldt <djurfeldt@nada.kth.se> */ +/* Original Author: Mikael Djurfeldt <djurfeldt@nada.kth.se> */ #ifdef HAVE_CONFIG_H # include <config.h> @@ -29,6 +30,12 @@ #include <stdio.h> #include <math.h> #include <string.h> +#include <sys/types.h> + +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif + #include "libguile/smob.h" #include "libguile/numbers.h" #include "libguile/feature.h" @@ -665,7 +672,8 @@ random_state_of_last_resort (void) SCM time_of_day = scm_gettimeofday (); SCM sources = scm_list_n (scm_from_unsigned_integer (SCM_UNPACK (time_of_day)), /* heap addr */ - scm_getpid (), /* process ID */ + /* Avoid scm_getpid, since it depends on HAVE_POSIX. */ + scm_from_unsigned_integer (getpid ()), /* process ID */ scm_get_internal_real_time (), /* high-resolution process timer */ scm_from_unsigned_integer ((scm_t_bits) &time_of_day), /* stack addr */ scm_car (time_of_day), /* seconds since midnight 1970-01-01 UTC */ |