[ltrace-commits] 01/01: Add support for mman.h to libc.so.conf

Petr Machata pmachata-guest at moszumanska.debian.org
Mon Jan 19 17:22:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

pmachata-guest pushed a commit to branch master
in repository ltrace.

commit 5811427aa7b9a9daf0fb88dc9c48cda6d963e0a1
Author: Petr Machata <pmachata at redhat.com>
Date:   Mon Jan 19 18:21:28 2015 +0100

    Add support for mman.h to libc.so.conf
    
    - Reported ages ago in
      https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=553189.
---
 TODO             |  6 ++++++
 etc/libc.so.conf | 24 +++++++++++++++++++++++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/TODO b/TODO
index af1198c..7267056 100644
--- a/TODO
+++ b/TODO
@@ -142,6 +142,12 @@
 
     | void func(X=void*, long*, out string(X)); |
 
+*** Support for elementary arithmetic
+    Necessary in particular for:
+    : int mincore(void *addr, size_t length, unsigned char *vec);
+    ... where we need the following prototype:
+    : int mincore(addr, size_t, +array(hex(char), (arg2 + 4095) / 4096)*);
+
 ** Support for functions that never return
    This would be useful for __cxa_throw, presumably also for longjmp
    (do we handle that at all?) and perhaps a handful of others.
diff --git a/etc/libc.so.conf b/etc/libc.so.conf
index 48b3b01..8a209b4 100644
--- a/etc/libc.so.conf
+++ b/etc/libc.so.conf
@@ -54,11 +54,12 @@ typedef FILE = addr;
 
 # XXX We can't represent the following portably without having either
 # uulong, or directly uint64_t.'
-
 typedef ino_t = ulong;
 typedef ino_t64 = ulong;
 typedef off_t = ulong;
 typedef off_t64 = ulong;
+typedef size_t = ulong;
+typedef ssize_t = long;
 
 typedef dirent = struct(ino_t, hide(off_t), hide(ushort), hide(char), string(array(char, zero(256))));
 typedef dirent64 = struct(ino_t64, hide(off_t64), hide(ushort), hide(char), string(array(char, zero(256))));
@@ -545,3 +546,24 @@ mntent *getmntent(addr);
 mntent *getmntent_r(file, +mntent*, string, int);
 mntent *__getmntent_r(file, +mntent*, string, int);
 string hasmntopt(mntent*, string);
+
+# XXX the third argument is a bitfield
+typedef mmap_flags_t = enum(MAP_SHARED=1, MAP_PRIVATE=2);
+addr mmap(addr, size_t, hex(int), mmap_flags_t, int, off_t);
+addr mmap64(addr, size_t, hex(int), mmap_flags_t, int, off_t64);
+void munmap(addr, size_t);
+int mprotect(addr, ulong, hex(int));
+int msync(addr, size_t, hex(int));
+int madvise(addr, size_t, enum(MADV_NORMAL=0, MADV_RANDOM=1, MADV_SEQUENTIAL=2, MADV_WILLNEED=3, MADV_DONTNEED=4, MADV_REMOVE=9, MADV_DONTFORK=10, MADV_DOFORK=11, MADV_MERGEABLE=12, MADV_UNMERGEABLE=13, MADV_HUGEPAGE=14, MADV_NOHUGEPAGE=15, MADV_DONTDUMP=16, MADV_DODUMP=17, MADV_HWPOISON=100));
+int posix_madvise (addr, size_t, enum(POSIX_MADV_NORMAL=0, POSIX_MADV_RANDOM=1, POSIX_MADV_SEQUENTIAL=2, POSIX_MADV_WILLNEED=3, POSIX_MADV_DONTNEED=4));
+int mlock(addr, size_t);
+int munlock(addr, size_t);
+int mlockall(hex(int));
+int munlockall();
+# XXX the 16 should really be (arg2 + 4095 / 4096), but ltrace can't
+# express that
+int mincore(addr, size_t, +array(hex(char), 16)*);
+addr mremap(addr, size_t, size_t, hex(int));
+int remap_file_pages(addr, size_t, int, size_t, mmap_flags_t);
+int shm_open(string, hex(int), oct(int));
+int shm_unlink(string);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/collab-maint/ltrace.git



More information about the ltrace-commits mailing list