bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27782: mmap for guile


From: Nala Ginrut
Subject: bug#27782: mmap for guile
Date: Sun, 26 Nov 2017 00:17:11 +0800

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" <address@hidden>写道:
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 ---





reply via email to

[Prev in Thread] Current Thread [Next in Thread]