summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix possible deadlock in 'lock-mutex'.Olivier Dion2022-11-201-9/+10
| | | | | | | | | | | | | | | If we got interrupted while waiting on our condition variable, we unlock the kernel mutex momentarily while executing asynchronous operations before putting us back into the waiting queue. However, we have to retry acquiring the mutex before getting back into the queue, otherwise it's possible that we wait indefinitely since nobody could be the owner for a while. * libguile/threads.c (lock_mutex): Try acquring the mutex after signal interruption. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Work around unwanted stack retention when using prompts.Ludovic Courtès2022-11-201-5/+12
| | | | | | | | | | Fixes <https://bugs.gnu.org/59021>. Previously, the stack allocated in 'capture_stack' and stored in 'p->stack_bottom' could be retained, leading to heap growth. * libguile/vm.c (capture_stack): Make a single 'scm_gc_malloc' call instead of two.
* doc: Fix typo in VM instruction name.Ludovic Courtès2022-11-011-2/+2
| | | | | * doc/ref/vm.texi (Intrinsic Call Instructions): Fix name of 'call-scm<-thread'.
* disassembler: Show intrinsic name for 'call-' instructions.Ludovic Courtès2022-11-012-1/+51
| | | | | | | * module/system/vm/disassembler.scm (code-annotation)[intrinsic-name]: New procedure. Add clauses for intrinsics. * NEWS: Update.
* Update NEWS.Maxime Devos2022-10-211-0/+12
| | | | Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Define Scheme bindings to ‘openat’ when available.Maxime Devos2022-10-216-22/+168
| | | | | | | | | | | | | | | | * configure.ac: Detect if ‘openat’ is defined. * libguile/filesys.c (flags_to_mode): Extract from ... (scm_mode): ... here. (scm_open_fdes_at, scm_openat): Define the Scheme bindings. * libguile/filesys.h (scm_open_fdes_at, scm_openat): Make them part of the API. * doc/ref/posix.texi (File System): Document them. * test-suite/tests/filesys.test ("openat"): Test ‘openat’. * libguile/syscalls.h (openat_or_openat64): Decide between ‘openat’ and ‘openat64’. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Define a Scheme binding to ‘fstatat’ when available.Maxime Devos2022-10-216-2/+131
| | | | | | | | | | | * configure.ac: Detect if ‘fstatat’ is defined. * libguile/filesys.c (scm_statat): Define a Scheme binding to ‘fstatat’. * libguile/filesys.h (scm_statat): Make it part of the C API. * doc/ref/posix.texi (File System): Document it. * libguile/syscalls.h (fstatat_or_fstatat64): Choose between ‘fstatat’ and ‘fstatat64’. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Define a Scheme binding to ‘fchownat’ when it exists.Maxime Devos2022-10-214-2/+49
| | | | | | | | | | * configure.ac: Detect whether ‘fchownat’ is available. * libguile/filesys.c (scm_chownat): Define a Scheme binding to ‘fchownat’ when available. * libguile/filesys.h (scm_chownat): Make it part of the API. * doc/ref/posix.texi (File System): Document it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Define a Scheme binding to ‘unlinkat’ when it exists.Maxime Devos2022-10-215-2/+107
| | | | | | | | | | | | | | | | ‘unlinkat’ is used for both unlinking regular files and removing empty directories. * configure.ac: Detect if ‘unlinkat’ exists. * doc/ref/posix.texi (File System): Document why there is no ‘rmdirat’ procedure, and document the ‘delete-file-at’ procedure. * libguile/filesys.c (scm_rmdir): Adjust the docstring here as well. (scm_delete_file_at): Define a Scheme binding to ‘unlinkat’. * libguile/filesys.h (scm_delete_file_at): Make ‘scm_delete_file_at’ part of the C API. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Define a Scheme binding to ‘fchmodat’ when it exists.Maxime Devos2022-10-214-2/+92
| | | | | | | | | * configure.ac: Detect existence of fchmodat. * libguile/filesys.c (scm_chmodat): New procedure. * libguile/filesys.h (scm_chmodat): Make it part of the API. * test-suite/tests/filesys.test ("chmodat"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Define a Scheme binding to ‘renameat’ when it exists.Maxime Devos2022-10-215-1/+149
| | | | | | | | | | | * configure.ac: Detect if ‘renameat’ is defined. * libguile/filesys.c (scm_renameat): Define a Scheme binding to the ‘renameat’ system call. * doc/ref/posix.texi (File System): Document it. * libguile/filesys.h (scm_renameat): Make it part of the C API. * test-suite/tests/filesys.test ("rename-file-at"): New tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Define AT_REMOVEDIR and others when available.Maxime Devos2022-10-211-0/+6
| | | | | | | * libguile/posix.c (scm_init_posix): Define (in Scheme) AT_REMOVEDIR and AT_EACCESS when defined (in C). Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Correct documentation of ‘mkdir’ w.r.t. the umask.Maxime Devos2022-10-211-1/+2
| | | | | | | * doc/ref/posix.texi (mkdir): Note that the umask is applied even if the mode argument is set. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Define bindings to ‘mkdirat’ when the C function exists.Maxime Devos2022-10-215-1/+71
| | | | | | | | * configure.ac: Detect if ‘mkdirat’ exists. * libguile/filesys.c (scm_mkdirat): Define the Scheme binding. * doc/ref/posix.texi (File System): Document it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Define ‘symlinkat’ wrapper when supported.Maxime Devos2022-10-215-1/+58
| | | | | | | | | | | * configure.ac: Detect whether ‘symlinkat’ exists. * libguile/filesys.c (scm_symlinkat): Define a Scheme binding when it exists. * libguile/filesys.h: Make the binding part of the public C API. * doc/ref/posix.texi (File System): Document the binding. * test-suite/tests/filesys.test ("symlinkat"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Allow file ports in ‘utime’.Maxime Devos2022-10-215-14/+106
| | | | | | | | | | | | Ports representing symbolic links are currently unsupported. * configure.ac: Detect 'futimens'. * doc/ref/posix.texi (utime): Update documentation. * libguile/posix.c (scm_utime): Support ports. * libguile/posix.h (scm_utime): Rename argument. * test-suite/tests/posix.test ("utime"): Add more tests. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Allow file ports in ‘readlink’.Maxime Devos2022-10-214-12/+112
| | | | | | | | | | | * configure.ac: Detect whether ‘readlinkat’ is defined. * libguile/filesys.c (scm_readlink): Support file ports when ‘readlinkat’ exists. (scm_init_filesys): Provide ‘chdir-ports’ when it exists. * doc/ref/posix.texi (File System): Document it. * test-suite/tests/filesys.test ("readlink"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Allow file ports in ‘chdir’ when supported.Maxime Devos2022-10-215-4/+71
| | | | | | | | | | | | | * configure.ac: Check for ‘fchdir’. * libguile/filesys.c (scm_chdir): Support file ports. (scm_init_filesys): Report support of file ports. * doc/ref/posix.texi (Processes): Update accordingly. * doc/ref/guile.texi: Add copyright line for new documentation in this patch and later patches. * test-suite/tests/filesys.test ("chdir"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Fixes arg type for scm_integer_from_mpzMichael Gran2022-10-151-1/+1
| | | | | | | | The definition and the declaration for scm_integer_from_mpz do not match * libguile/integers.c (scm_integer_from_mpz): takes const mpz_t arg No callers need to be changed.
* autoupdate acinclude.m4Michael Gran2022-10-141-22/+18
| | | | | | | | Autoconf's autoupdates replaces AC_TRY_CPP, AC_TRY_LINK, AC_LANG_C * acinclude (GUILE_READLINE, GUILE_STRUCT_UTIMBUF, UTIMBUF_NEEDS_POSIX): updated using autoupdate
* Presumes signal handler return voidMichael Gran2022-10-142-18/+7
| | | | | | | | | | Since Guile requires a C99 compiler, we can rely on signal handlers returning void, not int. * configure.ac: remove AC_TYPE_SIGNAL * libguile/scmsigs.c (SIGRETTYPE): remove SIGRETTYPE (take_signal): returns void (scm_sigaction_for_thread): presumes handlers return void
* Modernizes labels-as-values.m4Michael Gran2022-10-141-7/+6
| | | | | | | labels-as-values.m4 uses deprecated AC_TRY_COMPILE and has a K&R-type C function declaration * m4/labels-as-values.m4: updated
* Remove special logic for the obscure CMU C library's libc.hMike Gran2022-10-144-56/+1
| | | | | | | * acinclude.m4 (GUILE_HEADER_LIBC_WITH_UNISTD): removed * configure.ac: remove GUILE_HEADER_LIBC_WITH_UNISTD, don't check for libc.h * libguile/filesys.c [LIBC_H_WITH_UNISTD_H]: remove libc.h inclusion * libguile/posix.c [LIBC_H_WITH_UNISTD_H]: remove libc.h inclusion
* Presume time.h and sys/time.h don't conflict when includedMike Gran2022-10-143-25/+5
| | | | | | | | | | | | Systems on which time.h and sys/time.h conflicted are obsolescent. * configure.ac: remove AC_HEADER_TIME. remove conditional in tm.tm_gmtoff test. * libguile/filesys.c [TIME_WITH_SYS_TIME]: remove conditional * libguile/posix.c [TIME_WITH_SYS_TIME]: remove conditional # Conflicts: # libguile/filesys.c
* Presume ISO C90 functions are always availableMike Gran2022-10-144-21/+5
| | | | | | | | | | * configure.ac: don't check for rename, setlocale, system, memcpy, and strcoll * libguile/i18n.c [HAVE_SETLOCALE] (setlocale): remove static setlocale Don't use HAVE_SETLOCALE * libguile/posix.c: include <locale.h>, remove HAVE_SETLOCALE (scm_setlocale): always include. remove HAVE_SETLOCALE * libguile/simpos.c (scm_system): always include. remove HAVE_SYSTEM
* Presume ISO C90 headers are always availableMike Gran2022-10-1412-70/+21
| | | | | | | | | | | | | | | | | | | | | | | | This includes <assert.h>, <ctype.h>, <errno.h>, <float.h>, <iso646.h>, <limits.h>, <locale.h>, <math.h>, <setjmp.h>, <signal.h>, <stdarg.h>, <stddef.h>, <stdio.h>, <stdlib.h>, <string.h>, <time.h>, <wchar.h>, and <wctype.h>. * configure.ac: don't check for <limits.h>, <string.h>, <time.h>, <assert.h>. Remove AC_INCLUDES_DEFAULT macro * libguile/bytevectors.c: include <limits.h>, remove HAVE_LIMITS_H * libguile/filesys.c: include <string.h>, remove HAVE_STRING_H * libguile/fports.c: include <string.h>, remove HAVE_STRING_H * libguile/gen-scmconfig.c: remove HAVE_LIMITS_H, HAVE_TIME_H, STDC_HEADERS Remove SCM_HAVE_STDC_HEADERS * libguile/hash.c: include <wchar.h>, remove HAVE_WCHAR_H * libguile/net_db.c: include <string.h>, remove HAVE_STRING_H * libguile/numbers.h: remove SCM_HAVE_STDC_HEADERS * libguile/regex-posix.c: include <wchar.h>, remove HAVE_WCHAR_H (fixup_multibyte_match): always defined (scm_regexp_exec): use fixup_multibyte_match * libguile/scmsigs.c: remove STDC_HEADERS * libguile/socket.c: include <string.h>, remove HAVE_STRING_H * test-suite/standalone/test-unwind.c: include <string.h>, remove HAVE_STRING_H
* Remove AC_HEADER_STDC from configure.acMike Gran2022-10-141-1/+0
| | | | | | Requiring C99 implies standard headers are available * configure.ac: remove AC_HEADER_STDC
* Remove obsolete macro AM_PROG_CC_C_O in configure scriptMike Gran2022-10-141-3/+0
| | | | | | It has been replaced by new functionality in AC_PROG_CC * configure.ac: remove AM_PROG_CC_C_O
* Use autoconf's ability to choose the latest version of CMike Gran2022-10-141-12/+4
| | | | | | Modern AC_PROG_CC will add flags to enable C11 when necessary. * configure.ac: remove AC_PROG_CC_C99, rely on updated AC_PROG_CC
* Presume const is always availableMike Gran2022-10-141-2/+0
| | | | * configure.ac (AC_C_CONST): removed
* Update libtool initialization in configure scriptMike Gran2022-10-141-4/+1
| | | | | | * configure.ac (AC_LIBTOOL_WIN32_DLL, AC_LIBTOOL_DLOPEN): removed (AC_PROG_LIBTOOL): removed (LT_INIT): added
* doc: Document how (ice-9 format) replaces 'format'.Jean Abou Samra2022-10-122-1/+18
| | | | | | | * doc/ref/misc-modules.texi (Formatted Output): Add paragraph. * module/ice-9/format.scm: Add comment. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* Define SO_RCVTIMEO and SO_SNDTIMEO.Christopher Baines2022-10-122-0/+46
| | | | | | | | | | | | | These are important for reliable networking, since they prevent network operations from hanging indefinitely. * libguile/socket.c (scm_init_socket): Define SO_RCVTIMEO and SO_SNDTIMEO. (scm_getsockopt, scm_setsockopt): Include SO_RCVTIMEO and SO_SNDTIMEO in docstring and handle them. * doc/ref/posix.texi (Network Sockets and Communication): Document them. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* Update reference to the GNU Coding Standards.Daniel Llorens2022-10-121-3/+2
|
* Test for out of range depth in fluid-ref*Daniel Llorens2022-10-031-0/+4
| | | | | Test for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58154, which was fixed in c0004442b7691f59a0e37869ef288eb26382ad9e.
* Modifies command line quoting in c-api.testMike Gran2022-10-021-1/+1
| | | | | | | | | On MinGW, 'system' uses a non-posix shell that does not handle apostrophe as a quoting character. For this test, quoting a command-line with double quotes allows it to be run with both /bin/sh and cmd.exe. * test-suite/tests/c-api.test (egrep): use double quotes when quoting command line
* Avoids deprecated egrep in c-api.testMike Gran2022-10-021-2/+2
| | | | | | | The standalone egrep script has been deprecated by GNU grep. 'grep -E' is the suggested replacement. * test-suite/tests/c-api.test (egrep): replace egrep with grep -E
* srfi-35: Fix expansion of 'condition' for compound conditions.Ludovic Courtès2022-10-012-5/+19
| | | | | | | * module/srfi/srfi-35.scm (condition): Use 'make-exception' instead of 'make-compound-condition', which is unbound in this module. * test-suite/tests/srfi-35.test ("syntax")["compound condition, hygienic macro expansion"]: New test.
* doc: Fix typo in 'coverage-data->lcov' example.Antoine Kalmbach2022-10-011-1/+1
| | | | | | | * doc/ref/api-coverage.texi (Code Coverage): Close PORT, not FILE, in the example. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* doc: Fix typo under "CPS Soup".Fulbert2022-10-011-1/+1
| | | | | | | * doc/ref/compiler.texi (CPS Soup) : fix small typo in doc (closing paren out of @code{} tag). Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* doc: Clarify reference to (sxml transform) module.Fulbert2022-10-011-8/+8
| | | | | | | | * doc/ref/sxml.texi (7.21.4 Transforming SXML): Adds a mention to the module to be imported for the procedures introduced in this section of the documentation.. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* Baseline compiler no longer crashes on (not (list 1 2)).Ludovic Courtès2022-10-013-2/+12
| | | | | | | | | | Fixes <https://bugs.gnu.org/58217>. * module/language/tree-il/compile-bytecode.scm (canonicalize) [finish-conditional](predicate?): Do not assume 'lookup-primitive' returns true. * test-suite/tests/compiler.test ("regression tests") ["(not (list 1 2))"]: New test.
* Finalization thread exits when it gets EOF on its pipe.Ludovic Courtès2022-10-011-3/+6
| | | | | | | | Avoids spurious "error in finalization thread: Success" messages when the finalization pipe gets closed. * libguile/finalizers.c (finalization_thread_proc): Return when 'data.n' is zero.
* Fix doc for string args to error C APIDaniel Llorens2022-09-301-7/+7
|
* Fix bad arguments to range_error() in numbers.cDaniel Llorens2022-09-301-2/+2
| | | | Fixes https://debbugs.gnu.org/cgi/bugreport.cgi?bug=58154. Ouch.
* in ftw test, skip EACCESS test on MinGWMike Gran2022-09-201-3/+9
| | | | | | | | MinGW ACL-based permissions don't follow POSIX standard, so 'chmod' has unexpected behavior. * test-suite/tests/ftw.test (mingw?): new define ("file system fold: EACCES"): skip test on MinGW
* in ftw test, don't presume symlink is definedMike Gran2022-09-201-34/+40
| | | | | | * test-suite/tests/ftw.test (dangling symlink and lstat) (dangling symlink and stat, symlink to directory): skip if symlink undefined
* When fork unavailable, skip standalone tests that require itMichael Gran2022-09-202-1/+7
| | | | | | | MinGW is missing fork. * test-suite/standalone/test-close-on-exec: modified * test-suite/standalone/test-signal-fork: modified
* test-suite: Remove obsolete use of 'debug-enable'.Ludovic Courtès2022-09-191-3/+2
| | | | * test-suite/guile-test (enable-debug-mode): Remove 'debug-enable' call.
* 'pipe' now takes an optional 'flags' parameter.Ludovic Courtès2022-09-196-9/+110
| | | | | | | | | | | | | This is the same strategy as used for the 'accept4' bindings introduced in 6e0965104c579431e5a786b60e1a964a112c73b8. * libguile/posix.c (scm_pipe): Rename to... (scm_pipe2): ... this. Add an optional 'flags' parameter and honor it. (scm_pipe): Rewrite as a call to 'scm_pipe2'. * libguile/posix.h (scm_pipe2): New declaration. * test-suite/tests/posix.test ("pipe"): New tests. * configure.ac: Look for 'pipe2'. * NEWS: Update.