GNU bug report logs -
#27782
[wishlist] scheme level mmap
Previous Next
Full log
Message #29 received at 27782 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Actually I've been using a FFI version of mmap in my working code, with my
previous patch to Guile it's very easy to handle errno. Just few lines code
is enough to bind mmap.
I am not sure if C version binding is still the best option to maintain.
2017年11月25日 22:42,"Matt Wette" <matt.wette <at> gmail.com>写道:
> here is a start on test-suite/tests/mmap.test
>
> +;;;; mmap.test --- test suite for Guile's mmap functions -*- scheme -*-
> +;;;;
> +
> +(define-module (test-mmap)
> + #:use-module (test-suite lib))
> +
> +(use-modules (rnrs bytevectors))
> +
> +(with-test-prefix "mmap"
> +
> + (pass-if "basics"
> + (let* ((siz #x10000)
> + (reg (mmap 0 siz)))
> + (and (eqv? (bytevector-length reg) siz)
> + (begin (bytevector-u8-set! reg 0 99)
> + (eqv? (bytevector-u8-ref reg 0) 99))
> + (begin (bytevector-u8-set! reg (1- siz) 98)
> + (eqv? (bytevector-u8-ref reg (1- siz)) 98))
> + #t)))
> +
> + )
> +
> +;;;; --- last line ---
>
>
>
>
>
[Message part 2 (text/html, inline)]
This bug report was last modified 2 years and 105 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.