|
From: Jeremy F. <je...@go...> - 2004-01-20 01:54:46
|
CVS commit by fitzhardinge:
Some clarifications to README_MISSING_SYSCALL_OR_IOCTL.
M +27 -10 README_MISSING_SYSCALL_OR_IOCTL 1.7
--- valgrind/README_MISSING_SYSCALL_OR_IOCTL #1.6:1.7
@@ -79,6 +79,10 @@
}
-The POST() function won't be called if the syscall failed, so you don't need
-to worry about checking that in the POST() function.
+The POST() function won't be called if the syscall failed, so you
+don't need to worry about checking that in the POST() function.
+(Note: this is sometimes a bug; some syscalls do return results when
+they "fail" - for example, nanosleep returns the amount of unslept
+time if interrupted. TODO: add another per-syscall flag for this
+case.)
@@ -93,8 +97,14 @@
This should tell you something like __NR_mysyscallname.
-
+ Copy this entry to coregrind/vg_unistd.h.
2. Do 'man 2 mysyscallname' to get some idea of what the syscall
- does.
+ does. Note that the actual kernel interface can differ from this,
+ so you might also want to check a version of the Linux kernel
+ source.
+
+ NOTE: any syscall which has something to do with signals or
+ threads is probably "special", and needs more careful handling.
+ Post something to valgrind-developers if you aren't sure.
@@ -111,7 +121,8 @@
(There's no need for post_mem_read calls.)
- Also, add it to the sys_info[] array; use SYSBA if it requires a PRE()
- and POST() function, and SYSB_ if it only requires a PRE() function.
- The 2nd arg of these macros indicate if the syscall is blocking.
+ Also, add it to the sys_info[] array; use SYSBA if it requires a
+ PRE() and POST() function, and SYSB_ if it only requires a PRE()
+ function. The 2nd arg of these macros indicate if the syscall
+ could possibly block.
If you find this difficult, read the wrappers for other syscalls
@@ -120,6 +131,10 @@
starting point.
- If you have to #include headers for structure definitions,
- put your #includes into vg_unsafe.h.
+ If you need structure definitions for your syscall, you can copy
+ structure definitions from the kernel headers into
+ include/vg_kerneliface.h, with the appropriate vki_* name
+ mangling. Alternatively, you can #include headers for structure
+ definitions, put your #includes into vg_unsafe.h (copying
+ syscall-related things into vg_kerneliface.h is preferred though).
Test it.
@@ -140,5 +155,7 @@
Writing your own ioctl wrappers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Is pretty much the same as writing syscall wrappers.
+
+Is pretty much the same as writing syscall wrappers, except that all
+the action happens within PRE(ioctl) and POST(ioctl).
There's a default case, sometimes it isn't correct and you have to write a
|