summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-08-22 20:39:25 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-08-22 20:39:25 -0700
commita37665e615c504415d5425f71ce5af7b7175b3f2 (patch)
treea78c05024c377578245e9b7d5b7d2f399091f45f /stdlib
parentf88ab97c627291952ca39a6cdada6c923caed0a4 (diff)
downloadtxr-a37665e615c504415d5425f71ce5af7b7175b3f2.tar.gz
txr-a37665e615c504415d5425f71ce5af7b7175b3f2.tar.bz2
txr-a37665e615c504415d5425f71ce5af7b7175b3f2.zip
ffi: provide mmap through carray.
* configure: configure test for mmap depositing HAVE_MMAP into config.h. * ffi.c (struct carray): Subject to HAVE_MMAP, new mm_len member which keeps track of the size of an underlying mapping so that we can unmap it, as well as peform operations like msync on it. (make_carray): Initialize mm_len to 0. (MAP_GROWSDOWN, MAP_LOCKED, MAP_NORESERVE, MAP_POPULATE, MAP_NONBLOCK, MAP_STACK, MAP_HUGETLB, MAP_SHARED, MAP_PRIVATE, MAP_FIXED, MAP_ANON, MAP_HUGE_SHIFT, MAP_HUGE_MASK, PROT_READ, PROT_WRITE, PROT_EXEC, PROT_NONE, PROT_GROWSDOWN, PROT_GROWSUP, MADV_NORMAL, MADV_RANDOM, MADV_SEQUENTIAL, MADV_WILLNEED, MADV_DONTNEED, MADV_FREE, MADV_REMOVE, MADV_DONTFORK, MADV_DOFORK, MADV_MERGEABLE, MADV_UNMERGEABLE, MADV_HUGEPAGE, MADV_NOHUGEPAGE, MADV_DONTDUMP, MADV_DODUMP, MADV_WIPEONFORK, MADV_KEEPONFORK, MADV_HWPOISON, MS_ASYNC, MS_SYNC, MS_INVALIDATE): #define as 0 if missing. (carray_munmap_op): New static function. (carray_mmap_ops): New static structure. (mmap_wrap, munmap_wrap): New functions. (mmap_op): New static function. (mprotect_wrap, madvise_wrap, msync_wrap): New functions. (ffi_init): Register mmap, munmap, mprotect, madvise and msync as well as numerous integer variables: map-growsdown, map-locked, map-noreserve, map-populate, map-nonblock, map-stack, map-hugetlb, map-shared, map-private, map-fixed, map-anon, map-huge-shift, map-huge-mask, prot-read, prot-write, prot-exec, prot-none, prot-growsdown, prot-growsup, madv-normal, madv-random, madv-sequential, madv-willneed, madv-dontneed, madv-free, madv-remove, madv-dontfork, madv-dofork, madv-mergeable, madv-unmergeable, madv-hugepage, madv-nohugepage, madv-dontdump, madv-dodump, madv-wipeonfork, madv-keeponfork, madv-hwpoison, ms-async, ms-sync, ms-invalidate, page-size. * ffi.h (mmap_wrap, munmap_wrap, mprotect_wrap madvise_wrap, msync_wrap): Declared. * tests/017/mmap.tl: New file. * txr.1: Documented. * stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/doc-syms.tl21
1 files changed, 21 insertions, 0 deletions
diff --git a/stdlib/doc-syms.tl b/stdlib/doc-syms.tl
index b9877466..81ec7211 100644
--- a/stdlib/doc-syms.tl
+++ b/stdlib/doc-syms.tl
@@ -1165,6 +1165,12 @@
("macroexpand-1-lisp1" "N-01E62179")
("macroexpand-lisp1" "N-01E62179")
("macrolet" "N-00AC12C0")
+ ("madv-dontneed" "N-027D1E84")
+ ("madv-normal" "N-027D1E84")
+ ("madv-random" "N-027D1E84")
+ ("madv-sequential" "N-027D1E84")
+ ("madv-willneed" "N-027D1E84")
+ ("madvise" "N-02805A83")
("major" "N-02F0F482")
("make-buf" "N-011445E1")
("make-buf-stream" "N-03F5647C")
@@ -1195,6 +1201,10 @@
("make-zstruct" "N-03855D2D")
("makedev" "N-02F0F482")
("makunbound" "N-01FA4070")
+ ("map-anon" "N-029B13AF")
+ ("map-fixed" "N-029B13AF")
+ ("map-private" "N-029B13AF")
+ ("map-shared" "N-029B13AF")
("mapcar" "N-0202F92F")
("mapcar*" "N-0202F92F")
("mapdo" "N-03A943EE")
@@ -1251,10 +1261,17 @@
("mkstring" "N-033DD796")
("mlet" "N-008216E0")
("mmakunbound" "N-02964FC0")
+ ("mmap" "N-03C6CE44")
("mod" "D-003F")
("mode-t" "N-01D716FE")
+ ("mprotect" "N-02805A83")
+ ("ms-async" "N-01F782B2")
+ ("ms-invalidate" "N-01F782B2")
+ ("ms-sync" "N-01F782B2")
+ ("msync" "N-02805A83")
("multi" "N-034946BA")
("multi-sort" "N-0132852F")
+ ("munmap" "N-00E1BF52")
("n-choose-k" "N-02ACFDE6")
("n-perm-k" "N-02ACFDE6")
("name" "N-01557906")
@@ -1438,6 +1455,10 @@
("promisep" "N-00C7553F")
("prop" "N-01C6D406")
("proper-list-p" "N-03F70343")
+ ("prot-exec" "N-0212DB35")
+ ("prot-none" "N-0212DB35")
+ ("prot-read" "N-0212DB35")
+ ("prot-write" "N-0212DB35")
("pset" "N-008211EC")
("ptr" "N-027B04D0")
("ptr-in" "N-00A494BF")