summaryrefslogtreecommitdiff
path: root/guix/build/syscalls.scm
Commit message (Collapse)AuthorAge
* syscalls: Add ioctl flags for the Hurd.Jan (janneke) Nieuwenhuizen2020-05-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use #include <stdio.h> #include <net/if.h> #include <hurd/ioctl.h> int main () { printf ("SIOCSIFFLAGS #x%x\n", SIOCSIFFLAGS); printf ("SIOCGIFADDR #x%x\n", SIOCGIFADDR); printf ("SIOCSIFADDR #x%x\n", SIOCSIFADDR); printf ("SIOCGIFNETMASK #x%x\n", SIOCGIFNETMASK); printf ("SIOCSIFNETMASK #x%x\n", SIOCSIFNETMASK); #if 0 printf ("SIOCADDRT #x%x\n", SIOCADDRT); printf ("SIOCDELRT #x%x\n", SIOCDELRT); #endif } to fill in some blanks. Adding and removing route apparently not supported. * guix/build/syscalls.scm (SIOCSIFFLAGS SIOCGIFADDR, SIOCSIFADDR, SIOCGIFNETMASK, SIOCSIFNETMASK):
* syscalls: 'define-c-struct' supports cross-compilation.Ludovic Courtès2020-05-05
| | | | | | | | | | Reported by Jan (janneke) Nieuwenhuizen <janneke@gnu.org>. Before that, we'd always use the 'sizeof' and 'alignof' value obtained from the host at macro-expansion time. * guix/build/syscalls.scm (sizeof*, alignof*): When the target word size differs from the host word size, emit a call to 'sizeof'/'alignof'.
* syscalls: Fix Linux detection in 'readdir*'.Julien Lepiller2020-04-20
| | | | | * guix/build/syscalls.scm (readdir*): Fix Linux detection for `arm-unknown-linux-gnueabihf'.
* syscalls: 'readdir*' chooses between the Linux and Hurd code at run time.Ludovic Courtès2020-04-16
| | | | | | | | | | | | | | | | | | | | Partly fixes <https://bugs.gnu.org/40574>. Reported by Jan Nieuwenhuizen <janneke@gnu.org>. Previously, we'd choose at expansion time whether to use the Hurd or the Linux variant, taking the cross-compilation target into account. This would lead to the wrong decision when (guix build syscalls) is evaluated while we're cross-compiling to GNU/Hurd. This is a followup to 1ab9e483391f8b62b873833ea71cb0074efa03e7. * guix/build/syscalls.scm (define-generic-identifier) (read-dirent-header, %struct-dirent-header, sizeof-dirent-header): Remove. (readdir*): Rename to... (readdir-procedure): ... this, and add parameters. (readdir*): Define as a call to 'readdir-procedure' as a function of %HOST-TYPE.
* syscalls: 'with-file-lock' re-grabs lock when reentering its dynamic extent.Ludovic Courtès2020-03-22
| | | | | | | * guix/build/syscalls.scm (call-with-file-lock) (call-with-file-lock/no-wait): Initialize PORT in the 'dynamic-wind' "in" handler. This allows us to re-enter a captured continuation and have the lock grabbed anew.
* syscalls: Pass the right 'throw' arguments in 'call-with-file-lock/no-wait'.Ludovic Courtès2020-01-19
| | | | | | | | Reported by Matt Wette <matt.wette@gmail.com> in <https://bugs.gnu.org/39194>. * guix/build/syscalls.scm (call-with-file-lock/no-wait): When re-throwing, pass KEY in addition to ARGS.
* file-systems: Add support for 'strict-atime' and 'lazy-time' flags.Guillaume Le Vaillant2019-12-07
| | | | | | | | | | * guix/build/syscalls.scm (MS_LAZYTIME): New variable. * gnu/build/file-systems.scm (mount-flags->bit-mask): Add match rules for 'strict-atime' and 'lazy-time'. * doc/guix.texi (File Systems): Add 'strict-atime' and 'lazy-time' to the list of supported flags. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* ui: 'with-profile-lock' keeps going upon ENOLCK.Ludovic Courtès2019-11-29
| | | | | | * guix/build/syscalls.scm (call-with-file-lock/no-wait): Really pass ARGS to HANDLER. Return #f when HANDLER is called. * guix/ui.scm (profile-lock-handler): Emit a mere warning upon ENOLCK.
* guix: Add file-locking with no wait.Julien Lepiller2019-11-08
| | | | | * guix/build/syscalls.scm (with-file-lock/no-wait): New procedure. (lock-file): Take a #:wait? key.
* syscalls: Add 'add-to-entropy-count'.Ludovic Courtès2019-10-05
| | | | | | * guix/build/syscalls.scm (RNDADDTOENTCNT): New variable. (add-to-entropy-count): New procedure. * tests/syscalls.scm ("add-to-entropy-count"): New test.
* syscalls: 'define-as-needed' does not re-export local variables.Ludovic Courtès2019-07-19
| | | | | | | | | Fixes <https://bugs.gnu.org/36723>. Reported by Timothy Sample <samplet@ngyro.com>. * guix/build/syscalls.scm (define-as-needed): Rewrite to use lower-level module primitives; define VARIABLE only if it's not already defined to avoid "re-exporting local variable" error.
* syscalls: Use 'define-as-needed' for 'AT_' constants introduced in Guile 2.2.5.Ludovic Courtès2019-07-15
| | | | | | * guix/build/syscalls.scm (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR) (AT_SYMLINK_FOLLOW, AT_NO_AUTOMOUNT, AT_EMPTY_PATH): Define using 'define-as-needed'.
* syscalls: Add 'terminal-rows'.Ludovic Courtès2019-06-27
| | | | | | | * guix/build/syscalls.scm (terminal-dimension): New procedure. (terminal-columns): Rewrite in terms of 'terminal-dimension'. (terminal-rows): New procedure. * tests/syscalls.scm ("terminal-rows"): New test.
* syscalls: 'with-lock-file' catches ENOSYS.Ludovic Courtès2019-06-05
| | | | | * guix/build/syscalls.scm (call-with-file-lock): Catch ENOSYS raised by 'lock-file'.
* syscalls: 'with-file-lock' expands to a call to 'call-with-file-lock'.Ludovic Courtès2019-06-05
| | | | | * guix/build/syscalls.scm (call-with-file-lock): New procedure. (with-file-lock): Expand to a call to 'call-with-file-lock'.
* syscalls: Add 'with-file-lock' macro.Ludovic Courtès2019-06-05
| | | | | | * guix/scripts/offload.scm (lock-file, unlock-file, with-file-lock): Move to... * guix/build/syscalls.scm: ... here.
* syscalls: Add 'arp-network-interface?'.Marius Bakke2019-05-09
| | | | | * guix/build/syscalls.scm (IFF_NOARP): New variable. (arp-network-interface?): New public procedure.
* guix: Fix typo in docstring.Tobias Geerinckx-Rice2019-04-30
| | | | * guix/build/syscalls.scm (device-in-use?)<docstring>: Fix typo.
* file-systems: Support the 'no-atime' flag.rendaw2019-04-29
| | | | | | | | | * guix/build/syscalls.scm (MS_NOATIME): New variable. * gnu/build/file-systems.scm (mount-flags->bit-mask): Support it. * doc/guix.texi (File Systems): Document it and add cross-references to the relevant documentation. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* syscalls: 'device-in-use?' returns #f upon EINVAL.Ludovic Courtès2019-01-17
| | | | | | | This mirrors the behavior of the 'fdisk_device_is_used' function of util-linux. * guix/build/syscalls.scm (device-in-use?): Return #f upon EINVAL.
* syscalls: 'device-in-use?' does not create a port.Ludovic Courtès2019-01-17
| | | | | * guix/build/syscalls.scm (device-in-use?): Use 'open-fdes' rather than 'open-file'.
* build: syscalls: Add device-in-use?.Mathieu Othacehe2019-01-17
| | | | | | | | | This new procedure uses BLKRRPART to determine whether or not a device is busy. It is useful when a device does not appear as mounted but is maybe used by the kernel. This is the case with overlayfs lowerdir backend device for example. * guix/build/syscalls.scm (device-in-use?): New exported procedure.
* maint: Remove 'cond-expand' forms for Guile 2.0.Ludovic Courtès2019-01-09
| | | | | | | | | | | | | | | | | | | | | | Note: Leave 'cond-expand' forms used in the build-side modules that can run on %BOOTSTRAP-GUILE, which is currently Guile 2.0. * guix/build/compile.scm: Move 'use-modules' clause from 'cond-expand' to 'define-module' form. (%default-optimizations): Remove 'cond-expand'. * guix/build/download.scm (tls-wrap): Remove 'cond-expand'. * guix/build/syscalls.scm: Remove 'cond-expand' form around '%set-automatic-finalization-enabled?!' and 'without-automatic-finalization'. * guix/inferior.scm (port->inferior): Remove 'cond-expand'. * guix/scripts/pack.scm (wrapped-package)[build]: Remove 'cond-expand'. * guix/status.scm (build-event-output-port): Remove 'cond-expand'. * guix/store.scm (open-inet-socket): Remove 'cond-expand'. * guix/ui.scm (install-locale): Remove 'cond-expand'. * tests/status.scm ("current-build-output-port, UTF-8 + garbage"): Remove 'cond-expand'. * tests/store.scm ("current-build-output-port, UTF-8 + garbage"): Remove 'cond-expand'.
* syscalls: Report lack of a libc symbol as ENOSYS.Ludovic Courtès2018-09-10
| | | | | * guix/build/syscalls.scm (syscall->procedure): Throw to 'system-error with ENOSYS when NAME cannot be found.
* syscalls: Define AT_SYMLINK_NOFOLLOW et al.Ludovic Courtès2018-07-03
| | | | | | * guix/build/syscalls.scm (AT_FDCWD, AT_SYMLINK_NOFOLLOW, AT_REMOVEDIR) (AT_SYMLINK_FOLLOW, AT_NO_AUTOMOUNT, AT_EMPTY_PATH): New variables. * tests/syscalls.scm ("utime with AT_SYMLINK_NOFOLLOW"): New test.
* build: Require Guile >= 2.0.13.Ludovic Courtès2018-02-26
| | | | | | | | | | | | | | | | | | * README, configure.ac, doc/guix.texi (Requirements): Increase minimum Guile version from 2.0.9 to 2.0.13. * config-daemon.ac: Remove use of 'GUIX_CHECK_UNBUFFERED_CBIP'. * m4/guix.m4 (GUIX_CHECK_UNBUFFERED_CBIP): Remove. * guix/build/download.scm (current-http-proxy): Remove. * guix/build/syscalls.scm (%libc-errno-pointer, errno): Remove. (syscall->procedure): Use #:return-errno unconditionally. * guix/hash.scm (open-sha256-input-port)[unbuffered]: Remove outdated comment. * guix/http-client.scm (when-guile<=2.0.5-or-otherwise-broken): Remove. <top level>: Remove 'when-guile<=2.0.5-or-otherwise-broken' block. * guix/scripts/substitute.scm (fetch): Remove 'guile-version>?' conditional. * tests/hash.scm (supports-unbuffered-cbip?): Remove. <top level>: Remove 'test-skip' call.
* syscalls: Define 'input-flags' for 'tcgetattr' and friends.Ludovic Courtès2017-12-06
| | | | * guix/build/syscalls.scm (input-flags): New macro.
* syscalls: clone: Define syscall-id for aarch64.Eric Bavier2017-10-09
| | | | * guix/build/syscalls.scm (clone): Define syscall-id for aarch64 machines.
* Merge branch 'master' into core-updatesLeo Famulari2017-07-23
|\
| * syscalls: Add network-interface-running?Danny Milosavljevic2017-07-12
| | | | | | | | | | | | | | | | * guix/build/syscalls.scm (network-interface-running?): New variable. Export it. * tests/syscalls.scm: Add test. Co-authored-by: John Darrington <jmd@gnu.org>
* | syscalls: Delay resolution of "scm_set_automatic_finalization_enabled".Ludovic Courtès2017-07-18
|/ | | | | * guix/build/syscalls.scm (%set-automatic-finalization-enabled?!) [guile-2.2]: Wrap in 'delay'.
* syscalls: Adjust 'dirent64' struct for GNU/Hurd.Ludovic Courtès2017-07-10
| | | | | | | | | | | | | Reported by rennes@openmailbox.org. * guix/build/syscalls.scm (file-type->symbol): New procedure. (%struct-dirent-header): Rename to... (%struct-dirent-header/linux): ... this. Rename introduced bindings as well. (%struct-dirent-header/hurd): New C struct. (define-generic-identifier): New macro. (read-dirent-header, %struct-dirent-header, sizeof-dirent-header): Define in terms of 'define-generic-identifier'.
* syscalls: 'opendir*' error message shows the file name.Ludovic Courtès2017-06-18
| | | | | * guix/build/syscalls.scm (opendir*): Add NAME to the 'system-error' message.
* syscalls: Add 'scandir*'.Ludovic Courtès2017-06-16
| | | | | | | | | * guix/build/syscalls.scm (%struct-dirent-header): New C struct. (string->pointer/utf-8, pointer->string/utf-8): New procedures. (opendir*, closedir*, readdir*, scandir*): New procedures. * tests/syscalls.scm ("scandir*, ENOENT") ("scandir*, ASCII file names", "scandir*, UTF-8 file names") ("scandir*, properties): New tests.
* syscalls: Provide 'free-disk-space'.Ludovic Courtès2017-06-02
| | | | | | * guix/build/syscalls.scm (free-disk-space): New procedure. * guix/scripts/gc.scm (guix-gc)[ensure-free-space]: Use it instead of 'statfs'.
* syscalls: Add 'thread-name' and 'set-thread-name'.Ludovic Courtès2017-05-28
| | | | | | | * guix/build/syscalls.scm (PR_SET_NAME, PR_GET_NAME) (%max-thread-name-length): New variables. (%prctl, set-thread-name, thread-name): New procedures. * tests/syscalls.scm ("set-thread-name"): New test.
* syscalls: Add load-linux-module.Mathieu Othacehe2017-04-11
| | | | | | | * guix/build/syscalls.scm (load-linux-module): New procedure. Reimplemented from guile-linux-syscalls.patch. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* syscalls: Use define-as-needed for network-interface syscalls.Mathieu Othacehe2017-04-11
| | | | | | | | | | * guix/build/syscalls.scm (network-interface-flags): Use define-as-needed macro and remove from export list. (set-network-interface-flags): Ditto. (set-network-interface-address): Ditto. (IFF_UP, IFF_BROADCAST and IFF_LOOPBACK): Ditto. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* syscalls: Use define-as-needed for mount and umount.Mathieu Othacehe2017-04-11
| | | | | | | | * guix/build/syscalls.scm (mount): Use define-as-needed macro and remove from export list. (umount): Ditto. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* syscalls: Add reboot.Mathieu Othacehe2017-04-11
| | | | | | | | | * guix/build/syscalls.scm (define-as-needed): New macro. (reboot): New procedure. Reimplemented from guile-linux-syscalls.patch. (RB_AUTOBOOT, ..., RB_KEXEC): New flags copied from static Guile patch. Co-Authored-By: Ludovic Courtès <ludo@gnu.org> Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* syscalls: Allow mount and umount use from static Guile.Mathieu Othacehe2017-04-07
| | | | | | | | | | * guix/build/syscalls.scm (mount): Use Guile core mount if called from static Guile, otherwise use FFI based mount implementation. (umount): Ditto. This allows to use (guix build syscalls) from a module independently of calling context. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* syscalls: Adjust 'clone' to Guile 2.2.Ludovic Courtès2017-03-15
| | | | | | | | | | | | | | | | | | | Before that, something like: (call-with-container (lambda () (match (primitive-fork) …))) would hang in 'primitive-fork' as the child process (the one started in the container) would try to pthread_join the finalization thread in 'stop_finalization_thread' in libguile, not knowing that this thread is nonexistent. * guix/build/syscalls.scm (%set-automatic-finalization-enabled?!): New procedure. (without-automatic-finalization): New macro. (clone): Wrap PROC call in 'without-automatic-finalization'.
* syscalls: Adjust 'define-bits' to macro literal semantics of 2.2.Ludovic Courtès2017-03-12
| | | | | | * guix/build/syscalls.scm (define-bits): Do not define NAMES... as top-level variables since that prevents literal matches in 2.2. Instead, determine constant values at expansion time.
* syscalls: Export 'read-utmpx'.Ludovic Courtès2017-01-24
| | | | | | * guix/build/syscalls.scm (read-utmpx-from-port): New procedure. * tests/syscalls.scm ("read-utmpx, EOF") ("read-utmpx"): New tests.
* syscalls: Add utmpx procedures and data structure.Ludovic Courtès2017-01-19
| | | | | | | * guix/build/syscalls.scm (<utmpx-entry>): New record type. (%utmpx): New C struct. (login-type): New bits. (setutxent, endutxent, getutxent, utmpx-entries): New procedures.
* syscalls: Extract 'bytes->string'.Ludovic Courtès2017-01-19
| | | | | * guix/build/syscalls.scm (bytes->string): New procedure. (bytevector->string-list): Use it.
* syscalls: 'terminal-columns' swallows ENOSYS.Ludovic Courtès2017-01-01
| | | | * guix/build/syscalls.scm (terminal-columns): Catch ENOSYS.
* syscalls: Add 'add-network-route/gateway' and 'delete-network-route'.Ludovic Courtès2016-11-21
| | | | | | | | | * guix/build/syscalls.scm (SIOCADDRT, SIOCDELRT): New variables. (%rtentry): New C struct. (RTF_UP, RTF_GATEWAY, %sockaddr-any): New variables. (add-network-route/gateway, delete-network-route): New procedures. * tests/syscalls.scm ("add-network-route/gateway") ("delete-network-route"): New tests.
* syscalls: Add 'c-struct-field-offset'.Ludovic Courtès2016-11-21
| | | | | | * guix/build/syscalls.scm (define-c-struct-macro): New macro. (define-c-struct): Use it. (c-struct-field-offset): New macro.
* syscalls: 'configure-network-interface' has a #:netmask parameter.Ludovic Courtès2016-11-17
| | | | | * guix/build/syscalls.scm (configure-network-interface): Add #:netmask keyword parameter and honor it.