Discussion:
netbsd stdlib.h srandom and initstate declarations incorrect
enh
2014-06-12 18:18:57 UTC
Permalink
netbsd:

char *initstate(unsigned long, char *, size_t);
long random(void);
char *setstate(char *);
void srandom(unsigned long);

POSIX (http://pubs.opengroup.org/onlinepubs/9699919799/functions/initstate.html):

char *initstate(unsigned seed, char *state, size_t size);
long random(void);
char *setstate(char *state);
void srandom(unsigned seed);

(note that the netbsd definitions match the netbsd declarations.)

freebsd seems to have these wrong too. openbsd has the correct
declarations and definitions.

--elliott
Christos Zoulas
2014-06-12 18:46:27 UTC
Permalink
Post by enh
char *initstate(unsigned long, char *, size_t);
long random(void);
char *setstate(char *);
void srandom(unsigned long);
POSIX
char *initstate(unsigned seed, char *state, size_t size);
long random(void);
char *setstate(char *state);
void srandom(unsigned seed);
(note that the netbsd definitions match the netbsd declarations.)
freebsd seems to have these wrong too. openbsd has the correct
declarations and definitions.
Fixed, thanks!

christos
enh
2014-06-12 20:04:27 UTC
Permalink
Post by Christos Zoulas
Post by enh
char *initstate(unsigned long, char *, size_t);
long random(void);
char *setstate(char *);
void srandom(unsigned long);
POSIX
char *initstate(unsigned seed, char *state, size_t size);
long random(void);
char *setstate(char *state);
void srandom(unsigned seed);
(note that the netbsd definitions match the netbsd declarations.)
freebsd seems to have these wrong too. openbsd has the correct
declarations and definitions.
Fixed, thanks!
i see the lib/libc change, but it looks like you missed
common/lib/libc/stdlib/random.c?
Post by Christos Zoulas
christos
Christos Zoulas
2014-06-12 20:59:07 UTC
Permalink
On Jun 12, 1:04pm, ***@google.com (enh) wrote:
-- Subject: Re: netbsd stdlib.h srandom and initstate declarations incorrect

| On Thu, Jun 12, 2014 at 11:46 AM, Christos Zoulas <***@astron.com> wrote:
| > In article <CAJgzZoqGF6i_gHDWXYCBszcp=***@mail.gmail.com>,
| > enh <***@google.com> wrote:
| >>netbsd:
| >>
| >>char *initstate(unsigned long, char *, size_t);
| >>long random(void);
| >>char *setstate(char *);
| >>void srandom(unsigned long);
| >>
| >>POSIX
| >>(http://pubs.opengroup.org/onlinepubs/9699919799/functions/initstate.html):
| >>
| >>char *initstate(unsigned seed, char *state, size_t size);
| >>long random(void);
| >>char *setstate(char *state);
| >>void srandom(unsigned seed);
| >>
| >>(note that the netbsd definitions match the netbsd declarations.)
| >>
| >>freebsd seems to have these wrong too. openbsd has the correct
| >>declarations and definitions.
| >
| > Fixed, thanks!
|
| i see the lib/libc change, but it looks like you missed
| common/lib/libc/stdlib/random.c?

Prolly forgot to commit it.

christos

Loading...