struct timeval is a possible return value of getsockopt (e.g. SO_RCVTIMEO
and SO_SNDTIMEO), but it is not included in the scm_t_getsockopt_result
union, which may then be too small (and is on Debian amd64).
* libguile/socket.c: add struct timeval to scm_t_getsockopt union
[rlb@defaultvalue.org: adjust commit message; add NEWS]
Closes: 76907
The tests share a "log" for custom port events and didn't always
explicitly close the test ports, so the close might come later, during
another test. Change the tests to always close their ports immediately,
and clear the log after checking for expected "inter-test" events.
test-suite/tests/r6rs-ports.test: don't race with gc close in custom
port tests.
Without -ffat-lto-objects libguile.a ends up with no symbols, visible
via "nm t libguile.a".
cf. https://lintian.debian.org/tags/no-code-sections.html
* configure.ac: enable -ffat-lto-objects with -flto when available.
doc/ref/posix.texi: note setlocale raises a system-error when locale
doesn't exist
Thanks to Francesco P. Lovergine for suggesting the
addition (https://bugs.debian.org/1078681).
This is an amendment to 84bf840322.
The warning was only emitted for calling `environ', even if only reading
and no mutation occurred.
However, it is correct to read the environment in a multi-threaded
process. It is however unsafe to mutate it.
The same logic also applies to `putenv'.
* libguile/posix.c
(maybe_warn_about_environ_mutation): New private procedure ...
(scm_environ): ... called here when mutating the environment ...
(scm_putenv): ... and here.
* NEWS: Update.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Fixes <https://bugs.gnu.org/76343>.
Fixes a bug whereby “echo '(environ)' | guile” would wrongfully trigger
the multiple-thread warning.
* libguile/finalizers.c (finalizer_thread): New variable.
(finalization_thread_proc): Set it.
(scm_i_is_finalizer_thread): New function.
(run_finalization_thread): Clear FINALIZER_THREAD.
* libguile/finalizers.h (scm_i_is_finalizer_thread): New declaration.
* libguile/threads.c (scm_all_threads): Use it.
* NEWS: Update.
Reported-by: Simon Josefsson <simon@josefsson.org>
The tutorial was removed in commit f75c5849cd.
* doc/README: Remove reference to a tutorial that no longer exists
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* libguile/scm.h: BUILDING_LIBGUILE is not always defined. This is
signaled by -Werror=undef in code using libguile. This patch fixes
commit dc3a3a84f9
* NEWS: Update.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* module/ice-9/custom-ports.scm (make-custom-port): Code fails if
(fluid-ref %default-port-encoding) returns #f. In fact this was the
case why readline support on MSYS2 failed for guile 3.0.10, ref.
https://github.com/msys2/MSYS2-packages/issues/5079
But later used canonicalize-encoding is prepared to handle #f for
encoding. So allow encoding to also handle this case.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
The omission was discovered while cross-compiling LilyPond with mingw
11.0.1: without this addition, linking with libguile causes the error
undefined reference to `BCryptGenRandom'
* meta/Makefile.am (dependency_substitutions): Add ‘LIB_GETRANDOM’.
* meta/guile-3.0-uninstalled.pc.in (Libs.private): Likewise.
* meta/guile-3.0.pc.in (Libs.private): Likewise.
* NEWS: Update.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
The ~V is supposed to print ISO week number, not a week number. This
commit fixes that.
* module/srfi/srfi-19.scm (date-week-number-iso): New procedure taken
from the reference implementation.
(directives)<#\V>: Use it.
* test-suite/tests/srfi-19.test ("date->string ~V"): Add tests taken
from the reference test suite.
* doc/ref/srfi-modules.texi (SRFI-19 Date to string): Mention ISO-8601
in description for ~V.
Fixes <https://bugs.gnu.org/74841>.
Edited by lloda <lloda@sarc.name>.
RISC-V uses a0-a7 registers for argument passing. Float/double arguments
use f0-f7 first and continue in a0-a7 if needed.
Once registers are consumed, stack is used.
This commit changes how lightening passes arguments in order to allow
this behavior.
Optional variables are needed because the structure of the makefile
is prepared to run on Guix but Guix doesn't support RISCV yet, so it's
better to set them as optional and let the user decide how do they want
to compile this thing.
* doc/ref/srfi-modules.texi (SRFI-64 Writing Basic Test Suites): Fix
typo. Add default test runner example. Add test-approximate and
test-error examples. Document valid error types in Guile for test-error.
(SRFI-64 Conditonal Test Suites and Other Advanced Features): Fix typo.
Fixes <https://bugs.gnu.org/75041>.
Suggested-by: Arne Babenhauserheide <arne_bab@web.de>
In some situations, ttyname may return ENODEV even though isatty is
true. From ttyname(3):
A process that keeps a file descriptor that refers to a pts(4) device
open when switching to another mount namespace that uses a different
/dev/ptmx instance may still accidentally find that a device path of
the same name for that file descriptor exists. However, this device
path refers to a different device and thus can't be used to access the
device that the file descriptor refers to. Calling ttyname() or
ttyname_r() on the file descriptor in the new mount namespace will
cause these functions to return NULL and set errno to ENODEV.
Observed in a Debian riscv64 porterbox schroot.
When ttyname fails with ENODEV, just include the file descriptor integer
value instead. Call ttyname() directly to avoid having to catch the
ENODEV.
* libguile/fports.c (fport_print): fall back to the integer fd when
ttyname() fails with ENODEV.
Only hold scm_i_misc_mutex while making the C calls. This also avoids
the need for a dynamic-wind. Add SCM_I_LOCKED_SYSCALL (similar to
SCM_SYSCALL) to handle the locking and EINTR loop.
libguile/filesys.c (scm_readdir): rely on SCM_I_LOCKED_SYSCALL to limit
locking.
libguile/filesys.c (scm_ttyname): rely on SCM_I_LOCKED_SYSCALL to limit
locking.
libguile/syscalls.h: add SCM_I_LOCKED_SYSCALL.