Bug 87697 - devel/valgrind-snapshot does not support FreeBSD uuidgen() syscall
Summary: devel/valgrind-snapshot does not support FreeBSD uuidgen() syscall
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Simon Barner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-20 02:20 UTC by Craig Rodrigues
Modified: 2005-10-20 11:41 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (657 bytes, patch)
2005-10-20 02:20 UTC, Craig Rodrigues
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Rodrigues 2005-10-20 02:20:17 UTC
Recently I needed to use devel/valgrind-snapshot to test some code on FreeBSD
which calls the uuidgen() system call.  valgrind complains
that it does not support syscall 392, which is uuidgen.

If something like the attached patch could be added to the FreeBSD
version of valgrind, that would be very helpful!

How-To-Repeat: Try running valgrind on code like this:

#include <sys/types.h>
#include <sys/uuid.h>
int main(int argc, char *argv[]) { struct uuid blah; uuidgen(&blah, 1); }
Comment 1 Craig Rodrigues freebsd_committer freebsd_triage 2005-10-20 02:22:15 UTC
Responsible Changed
From-To: freebsd-ports-bugs->barner

Over to maintainer
Comment 2 Craig Rodrigues 2005-10-20 03:08:52 UTC
Hi,

I messed the patch up a little bit in my submission.
It should be:

--- vg_syscalls.c.orig  Fri Jul 16 13:21:08 2004
+++ vg_syscalls.c   Wed Oct 19 21:04:27 2005
@@ -1574,6 +1614,21 @@
    VG_TRACK( post_mem_write, arg1, arg2 );
 }

+#if __FreeBSD__ >= 5
+PRE(uuidgen)
+{
+   /* int uuidgen(struct uuid *store, int count); */
+   MAYBE_PRINTF("uuidgen ( %p, %d )\n", arg1, arg2);
+   SYSCALL_TRACK( pre_mem_write, tid, "uuidgen(store, count)", arg1, arg2);
+}
+
+POST(uuidgen)
+{
+   VG_TRACK( post_mem_write, arg1, arg2 );
+}
+
+#endif
+
 #endif

 PRE(setresgid)
@@ -6827,6 +6882,9 @@
    SYSBA(kldstat,      False),
    SYSB_(kldfirstmod,      False),
    SYSBA(__getcwd,     False),
+#if __FreeBSD__ >= 5
+   SYSBA(uuidgen,      False),
+#endif
 };
 #define MAX_SYS_INFO       (sizeof(sys_info)/sizeof(sys_info[0]))


-- 
Craig Rodrigues        
rodrigc@crodrigues.org
Comment 3 Simon Barner freebsd_committer freebsd_triage 2005-10-20 11:41:29 UTC
State Changed
From-To: open->closed

Committed. Thanks!