code-intelligence.com/cifuzz@v0.40.0/third-party/minijail/syscall_wrapper.c (about)

     1  /* 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.
     4   */
     5  
     6  #include "syscall_wrapper.h"
     7  
     8  #define _GNU_SOURCE
     9  #include <sys/syscall.h>
    10  #include <unistd.h>
    11  
    12  /*
    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  
    31  int sys_seccomp(unsigned int operation, unsigned int flags, void *args)
    32  {
    33  	return syscall(SYS_seccomp, operation, flags, args);
    34  }