mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-08-03 15:23:04 +00:00
seccomp: Use own seccomp_metadata_t type
On fedora rawhide seccomp_metadata for some reason is not defined (while in kernel it introduced together with PTRACE_SECCOMP_GET_METADATA). So lets do a trick for a while -- define own alias. Once system headers get settled down we might find more suitable solution. Because it's a part of kernel API we're on the safe side. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
2a63e3983b
commit
39cf3060a3
2 changed files with 9 additions and 5 deletions
|
|
@ -52,13 +52,17 @@
|
|||
|
||||
#ifndef PTRACE_SECCOMP_GET_METADATA
|
||||
# define PTRACE_SECCOMP_GET_METADATA 0x420d
|
||||
#endif /* PTRACE_SECCOMP_GET_METADATA */
|
||||
|
||||
struct seccomp_metadata {
|
||||
/*
|
||||
* struct seccomp_metadata is not yet
|
||||
* settled down well in headers so use
|
||||
* own identical definition for a while.
|
||||
*/
|
||||
typedef struct {
|
||||
uint64_t filter_off; /* Input: which filter */
|
||||
uint64_t flags; /* Output: filter's flags */
|
||||
};
|
||||
|
||||
#endif /* PTRACE_SECCOMP_GET_METADATA */
|
||||
} seccomp_metadata_t;
|
||||
|
||||
#ifdef PTRACE_EVENT_STOP
|
||||
# if PTRACE_EVENT_STOP == 7 /* Bad value from Linux 3.1-3.3, fixed in 3.4 */
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ int seccomp_dump_thread(pid_t tid_real, ThreadCoreEntry *thread_core)
|
|||
|
||||
static int collect_filter(struct seccomp_entry *entry)
|
||||
{
|
||||
struct seccomp_metadata meta_buf, *meta = &meta_buf;
|
||||
seccomp_metadata_t meta_buf, *meta = &meta_buf;
|
||||
struct seccomp_filter_chain *chain, *prev;
|
||||
struct sock_filter buf[BPF_MAXINSNS];
|
||||
size_t i;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue