Blame libglnx/glnx-missing.h

rpm-build c487f7
#pragma once
rpm-build c487f7
rpm-build c487f7
/***
rpm-build c487f7
  This file was originally part of systemd.
rpm-build c487f7
rpm-build c487f7
  Copyright 2010 Lennart Poettering
rpm-build c487f7
rpm-build c487f7
  systemd is free software; you can redistribute it and/or modify it
rpm-build c487f7
  under the terms of the GNU Lesser General Public License as published by
rpm-build c487f7
  the Free Software Foundation; either version 2.1 of the License, or
rpm-build c487f7
  (at your option) any later version.
rpm-build c487f7
rpm-build c487f7
  systemd is distributed in the hope that it will be useful, but
rpm-build c487f7
  WITHOUT ANY WARRANTY; without even the implied warranty of
rpm-build c487f7
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
rpm-build c487f7
  Lesser General Public License for more details.
rpm-build c487f7
rpm-build c487f7
  You should have received a copy of the GNU Lesser General Public License
rpm-build c487f7
  along with systemd; If not, see <http://www.gnu.org/licenses/>.
rpm-build c487f7
***/
rpm-build c487f7
rpm-build c487f7
/* Missing glibc definitions to access certain kernel APIs.
rpm-build c487f7
   This file is last updated from systemd git:
rpm-build c487f7
rpm-build c487f7
   commit 71e5200f94b22589922704aa4abdf95d4fe2e528
rpm-build c487f7
   Author:     Daniel Mack <daniel@zonque.org>
rpm-build c487f7
   AuthorDate: Tue Oct 18 17:57:10 2016 +0200
rpm-build c487f7
   Commit:     Lennart Poettering <lennart@poettering.net>
rpm-build c487f7
   CommitDate: Fri Sep 22 15:24:54 2017 +0200
rpm-build c487f7
rpm-build c487f7
   Add abstraction model for BPF programs
rpm-build c487f7
*/
rpm-build c487f7
rpm-build c487f7
#include <errno.h>
rpm-build c487f7
#include <fcntl.h>
rpm-build c487f7
#include <stdlib.h>
rpm-build c487f7
#include <sys/resource.h>
rpm-build c487f7
#include <sys/syscall.h>
rpm-build c487f7
#include <uchar.h>
rpm-build c487f7
#include <unistd.h>
rpm-build c487f7
rpm-build c487f7
/* The precise definition of __O_TMPFILE is arch specific; use the
rpm-build c487f7
 * values defined by the kernel (note: some are hexa, some are octal,
rpm-build c487f7
 * duplicated as-is from the kernel definitions):
rpm-build c487f7
 * - alpha, parisc, sparc: each has a specific value;
rpm-build c487f7
 * - others: they use the "generic" value.
rpm-build c487f7
 */
rpm-build c487f7
rpm-build c487f7
#ifndef __O_TMPFILE
rpm-build c487f7
#if defined(__alpha__)
rpm-build c487f7
#define __O_TMPFILE     0100000000
rpm-build c487f7
#elif defined(__parisc__) || defined(__hppa__)
rpm-build c487f7
#define __O_TMPFILE     0400000000
rpm-build c487f7
#elif defined(__sparc__) || defined(__sparc64__)
rpm-build c487f7
#define __O_TMPFILE     0x2000000
rpm-build c487f7
#else
rpm-build c487f7
#define __O_TMPFILE     020000000
rpm-build c487f7
#endif
rpm-build c487f7
#endif
rpm-build c487f7
rpm-build c487f7
/* a horrid kludge trying to make sure that this will fail on old kernels */
rpm-build c487f7
#ifndef O_TMPFILE
rpm-build c487f7
#define O_TMPFILE (__O_TMPFILE | O_DIRECTORY)
rpm-build c487f7
#endif
rpm-build c487f7
rpm-build c487f7
#ifndef RENAME_NOREPLACE
rpm-build c487f7
#define RENAME_NOREPLACE (1 << 0)
rpm-build c487f7
#endif
rpm-build c487f7
#ifndef RENAME_EXCHANGE
rpm-build c487f7
#define RENAME_EXCHANGE (1 << 1)
rpm-build c487f7
#endif
rpm-build c487f7
rpm-build c487f7
#ifndef F_LINUX_SPECIFIC_BASE
rpm-build c487f7
#define F_LINUX_SPECIFIC_BASE 1024
rpm-build c487f7
#endif
rpm-build c487f7
rpm-build c487f7
#ifndef F_ADD_SEALS
rpm-build c487f7
#define F_ADD_SEALS (F_LINUX_SPECIFIC_BASE + 9)
rpm-build c487f7
#define F_GET_SEALS (F_LINUX_SPECIFIC_BASE + 10)
rpm-build c487f7
rpm-build c487f7
#define F_SEAL_SEAL     0x0001  /* prevent further seals from being set */
rpm-build c487f7
#define F_SEAL_SHRINK   0x0002  /* prevent file from shrinking */
rpm-build c487f7
#define F_SEAL_GROW     0x0004  /* prevent file from growing */
rpm-build c487f7
#define F_SEAL_WRITE    0x0008  /* prevent writes */
rpm-build c487f7
#endif
rpm-build c487f7
rpm-build c487f7
#ifndef MFD_ALLOW_SEALING
rpm-build c487f7
#define MFD_ALLOW_SEALING 0x0002U
rpm-build c487f7
#endif
rpm-build c487f7
rpm-build c487f7
#ifndef MFD_CLOEXEC
rpm-build c487f7
#define MFD_CLOEXEC 0x0001U
rpm-build c487f7
#endif
rpm-build c487f7
rpm-build c487f7
#include "glnx-missing-syscall.h"