~ubuntu-branches/ubuntu/wily/avr-libc/wily-proposed

« back to all changes in this revision

Viewing changes to libc/stdlib/random.c

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2009-10-31 11:52:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20091031115210-crjd42sn6ezrj52c
Tags: 1:1.6.7-1
* New upstream relese (closes: #544030)
* Added lintian overrides (closes: #553265)

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 *
29
29
 * Posix rand_r function added May 1999 by Wes Peters <wes@softweyr.com>.
30
30
 *
31
 
 * $Id: random.c,v 1.2 2007/01/08 15:06:53 joerg_wunsch Exp $
 
31
 * $Id: random.c,v 1.2.2.1 2009/04/01 23:12:11 arcanum Exp $
32
32
 */
33
33
 
34
34
/*
37
37
*/
38
38
 
39
39
#include <stdlib.h>
 
40
#include "sectionname.h"
40
41
 
 
42
ATTRIBUTE_CLIB_SECTION
41
43
static long
42
44
do_random(unsigned long *ctx)
43
45
{
64
66
}
65
67
 
66
68
 
 
69
ATTRIBUTE_CLIB_SECTION
67
70
long
68
71
random_r(unsigned long *ctx)
69
72
{
73
76
 
74
77
static unsigned long next = 1;
75
78
 
 
79
ATTRIBUTE_CLIB_SECTION
76
80
long
77
81
random(void)
78
82
{
79
83
        return do_random(&next);
80
84
}
81
85
 
 
86
ATTRIBUTE_CLIB_SECTION
82
87
void
83
88
srandom(unsigned long seed)
84
89
{