mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-29 22:40:34 +02:00
ice-9/poll: verify sizeof(struct pollfd)
* libguile/poll.c (scm_init_poll): Define %sizeof-struct-pollfd. * module/ice-9/poll.scm: Check %sizeof-struct-pollfd.
This commit is contained in:
parent
8500b18696
commit
6d346bb61a
2 changed files with 4 additions and 0 deletions
|
@ -184,6 +184,7 @@ scm_init_poll (void)
|
||||||
{
|
{
|
||||||
#if HAVE_POLL
|
#if HAVE_POLL
|
||||||
scm_c_define_gsubr ("primitive-poll", 4, 0, 0, scm_primitive_poll);
|
scm_c_define_gsubr ("primitive-poll", 4, 0, 0, scm_primitive_poll);
|
||||||
|
scm_c_define ("%sizeof-struct-pollfd", scm_from_size_t (sizeof (struct pollfd)));
|
||||||
#else
|
#else
|
||||||
scm_misc_error ("%init-poll", "`poll' unavailable on this platform", SCM_EOL);
|
scm_misc_error ("%init-poll", "`poll' unavailable on this platform", SCM_EOL);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -38,6 +38,9 @@
|
||||||
(load-extension (string-append "libguile-" (effective-version))
|
(load-extension (string-append "libguile-" (effective-version))
|
||||||
"scm_init_poll"))
|
"scm_init_poll"))
|
||||||
|
|
||||||
|
(if (not (= %sizeof-struct-pollfd 8))
|
||||||
|
(error "Unexpected struct pollfd size" %sizeof-struct-pollfd))
|
||||||
|
|
||||||
(if (defined? 'POLLIN)
|
(if (defined? 'POLLIN)
|
||||||
(export POLLIN))
|
(export POLLIN))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue