blob: dd6f826697dc430d4c913aa333f7827499f944fd [file] [log] [blame]
Mike Frysinger50e31fa2018-01-19 18:59:49 -05001/* Copyright 2016 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
Jorge Lucangeli Obes13650612016-09-02 11:27:29 -04004 */
5
6#include "syscall_wrapper.h"
7
8#define _GNU_SOURCE
9#include <sys/syscall.h>
10#include <unistd.h>
11
Mike Frysinger8022e142018-01-25 00:31:45 -050012/*
13 * Older glibc builds predate seccomp inclusion. These arches are the ones
14 * AOSP needs and doesn't provide anything newer. All other targets can upgrade
15 * their kernel headers.
16 */
17#ifndef SYS_seccomp
18# if defined(__x86_64__)
19# define SYS_seccomp 317
20# elif defined(__i386__)
21# define SYS_seccomp 354
22# elif defined(__aarch64__)
23# define SYS_seccomp 277
24# elif defined(__arm__)
25# define SYS_seccomp 383
26# else
27# error "Update your kernel headers"
28# endif
29#endif
30
Jorge Lucangeli Obes13650612016-09-02 11:27:29 -040031int sys_seccomp(unsigned int operation, unsigned int flags, void *args)
32{
33 return syscall(SYS_seccomp, operation, flags, args);
34}