57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering This file is part of systemd.
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering Copyright 2014 Lennart Poettering
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering systemd is free software; you can redistribute it and/or modify it
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering under the terms of the GNU Lesser General Public License as published by
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering the Free Software Foundation; either version 2.1 of the License, or
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering (at your option) any later version.
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering systemd is distributed in the hope that it will be useful, but
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering Lesser General Public License for more details.
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering You should have received a copy of the GNU Lesser General Public License
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poetteringconst char* seccomp_arch_to_string(uint32_t c) {
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering return "native";
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poettering return "x86-64";
57183d117a1d6a96d71ce99d648beb0d2b36228dLennart Poetteringint seccomp_arch_from_string(const char *n, uint32_t *ret) {
e9642be2cce7f5e90406980092a6f71f504a16afLennart Poetteringint seccomp_add_secondary_archs(scmp_filter_ctx *c) {
e9642be2cce7f5e90406980092a6f71f504a16afLennart Poettering#if defined(__i386__) || defined(__x86_64__)
e9642be2cce7f5e90406980092a6f71f504a16afLennart Poettering /* Add in all possible secondary archs we are aware of that
e9642be2cce7f5e90406980092a6f71f504a16afLennart Poettering * this kernel might support. */
e9642be2cce7f5e90406980092a6f71f504a16afLennart Poettering if (r < 0 && r != -EEXIST)
e9642be2cce7f5e90406980092a6f71f504a16afLennart Poettering r = seccomp_arch_add(c, SCMP_ARCH_X86_64);
e9642be2cce7f5e90406980092a6f71f504a16afLennart Poettering if (r < 0 && r != -EEXIST)
e9642be2cce7f5e90406980092a6f71f504a16afLennart Poettering if (r < 0 && r != -EEXIST)