public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* initstate/setstate
@ 2008-05-12  6:52 Yaakov (Cygwin Ports)
  2008-05-13  8:50 ` initstate/setstate Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Yaakov (Cygwin Ports) @ 2008-05-12  6:52 UTC (permalink / raw)
  To: cygwin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Apparently cygwin has exported initstate and setstate for over ten years
(see winsup/cygwin/ChangeLog-1997), but I can't find a header definition
for it in 1.5.25-11.  POSIX requires these to be declared in <stdlib.h>.

Also, the signatures seem to differ slightly.  winsup/cygwin/random.cc
declares these as:

char *initstate(unsigned long seed, char *arg_state, long n);	
char *setstate(char *state);

but POSIX requires:

char *initstate(unsigned seed, char *state, size_t size);
char *setstate(const char *state);

Could someone please clarify?


Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAkgnofYACgkQpiWmPGlmQSNQ7wCguXnKxYpxHY4dDNmmmO/GF5Dz
sosAn09l+y7AJS23MpWBk7ZpciSODDnJ
=GlzA
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: initstate/setstate
  2008-05-12  6:52 initstate/setstate Yaakov (Cygwin Ports)
@ 2008-05-13  8:50 ` Corinna Vinschen
  2008-05-13 14:53   ` initstate/setstate Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2008-05-13  8:50 UTC (permalink / raw)
  To: cygwin

On May 11 20:48, Yaakov (Cygwin Ports) wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Apparently cygwin has exported initstate and setstate for over ten years
> (see winsup/cygwin/ChangeLog-1997), but I can't find a header definition
> for it in 1.5.25-11.  POSIX requires these to be declared in <stdlib.h>.

stdlib.h is a newlib file.  You could just send a patch to the newlib
mailing list.

> Also, the signatures seem to differ slightly.  winsup/cygwin/random.cc
> declares these as:
>
> char *initstate(unsigned long seed, char *arg_state, long n);	
> char *setstate(char *state);
>
> but POSIX requires:
>
> char *initstate(unsigned seed, char *state, size_t size);
> char *setstate(const char *state);
>
> Could someone please clarify?

I'll align the Cygwin functions with POSIX.


Thanks for the report,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: initstate/setstate
  2008-05-13  8:50 ` initstate/setstate Corinna Vinschen
@ 2008-05-13 14:53   ` Corinna Vinschen
  2008-05-14  1:34     ` initstate/setstate Yaakov (Cygwin Ports)
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2008-05-13 14:53 UTC (permalink / raw)
  To: cygwin

On May 13 09:59, Corinna Vinschen wrote:
> On May 11 20:48, Yaakov (Cygwin Ports) wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA256
> >
> > Apparently cygwin has exported initstate and setstate for over ten years
> > (see winsup/cygwin/ChangeLog-1997), but I can't find a header definition
> > for it in 1.5.25-11.  POSIX requires these to be declared in <stdlib.h>.
> 
> stdlib.h is a newlib file.  You could just send a patch to the newlib
> mailing list.

I forgot that we have a cygwin-specific cygwin/stdlib.h file.  I added
both functions to that file.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: initstate/setstate
  2008-05-13 14:53   ` initstate/setstate Corinna Vinschen
@ 2008-05-14  1:34     ` Yaakov (Cygwin Ports)
  2008-05-14  8:57       ` initstate/setstate Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Yaakov (Cygwin Ports) @ 2008-05-14  1:34 UTC (permalink / raw)
  To: cygwin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Corinna Vinschen wrote:
| I forgot that we have a cygwin-specific cygwin/stdlib.h file.  I added
| both functions to that file.

Thanks!  I presume that the patch is only going into 1.7?


Yaakov
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEAREIAAYFAkgqJvoACgkQpiWmPGlmQSNdTgCghBGpcH4YiObQplIcEkRVbNlI
gOUAnRso8YnTahugp1acw9GrgkS9hJgW
=iu5q
-----END PGP SIGNATURE-----

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: initstate/setstate
  2008-05-14  1:34     ` initstate/setstate Yaakov (Cygwin Ports)
@ 2008-05-14  8:57       ` Corinna Vinschen
  0 siblings, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2008-05-14  8:57 UTC (permalink / raw)
  To: cygwin

On May 13 18:40, Yaakov (Cygwin Ports) wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> Corinna Vinschen wrote:
> | I forgot that we have a cygwin-specific cygwin/stdlib.h file.  I added
> | both functions to that file.
>
> Thanks!  I presume that the patch is only going into 1.7?

Yes.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-05-14  8:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-12  6:52 initstate/setstate Yaakov (Cygwin Ports)
2008-05-13  8:50 ` initstate/setstate Corinna Vinschen
2008-05-13 14:53   ` initstate/setstate Corinna Vinschen
2008-05-14  1:34     ` initstate/setstate Yaakov (Cygwin Ports)
2008-05-14  8:57       ` initstate/setstate Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).