This macros will help users to use this interface.

v2: Fix task_diag_for_each_vma to work with libnl // David Ahern

Signed-off-by: Andrey Vagin <[email protected]>
---
 include/uapi/linux/task_diag.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/uapi/linux/task_diag.h b/include/uapi/linux/task_diag.h
index 73d33c8..9e4c3c4 100644
--- a/include/uapi/linux/task_diag.h
+++ b/include/uapi/linux/task_diag.h
@@ -143,6 +143,11 @@ static inline struct task_diag_vma_stat 
*task_diag_vma_stat(struct task_diag_vma
        return ((void *)vma) + vma->stat_off;
 }
 
+#define task_diag_for_each_vma(vma, attr)                      \
+       for (vma = nla_data(attr);                              \
+               (void *) vma < nla_data(attr) + nla_len(attr);  \
+               vma = (void *) vma + vma->vma_len)
+
 #define TASK_DIAG_DUMP_ALL     0
 #define TASK_DIAG_DUMP_CHILDREN        1
 
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to