missing: move statx related definitions to missing_stat.h

This commit is contained in:
Yu Watanabe
2018-12-04 08:27:50 +01:00
parent 1e54f0ab15
commit e01819f84b
4 changed files with 54 additions and 44 deletions
+1
View File
@@ -104,6 +104,7 @@ basic_sources = files('''
missing_magic.h
missing_network.h
missing_securebits.h
missing_stat.h
missing_syscall.h
missing_vxcan.h
mkdir-label.c
+1 -44
View File
@@ -14,15 +14,10 @@
#include <stdlib.h>
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <uchar.h>
#include <unistd.h>
#if WANT_LINUX_STAT_H
#include <linux/stat.h>
#endif
#if HAVE_AUDIT
#include <libaudit.h>
#endif
@@ -388,45 +383,6 @@ struct sockaddr_vm {
#define PF_KTHREAD 0x00200000
#endif
#if ! HAVE_STRUCT_STATX
struct statx_timestamp {
int64_t tv_sec;
uint32_t tv_nsec;
uint32_t __reserved;
};
struct statx {
uint32_t stx_mask;
uint32_t stx_blksize;
uint64_t stx_attributes;
uint32_t stx_nlink;
uint32_t stx_uid;
uint32_t stx_gid;
uint16_t stx_mode;
uint16_t __spare0[1];
uint64_t stx_ino;
uint64_t stx_size;
uint64_t stx_blocks;
uint64_t stx_attributes_mask;
struct statx_timestamp stx_atime;
struct statx_timestamp stx_btime;
struct statx_timestamp stx_ctime;
struct statx_timestamp stx_mtime;
uint32_t stx_rdev_major;
uint32_t stx_rdev_minor;
uint32_t stx_dev_major;
uint32_t stx_dev_minor;
uint64_t __spare2[14];
};
#endif
#ifndef STATX_BTIME
#define STATX_BTIME 0x00000800U
#endif
#ifndef AT_STATX_DONT_SYNC
#define AT_STATX_DONT_SYNC 0x4000
#endif
/* The maximum thread/process name length including trailing NUL byte. This mimics the kernel definition of the same
* name, which we need in userspace at various places but is not defined in userspace currently, neither under this
* name nor any other. */
@@ -438,4 +394,5 @@ struct statx {
#include "missing_input.h"
#include "missing_magic.h"
#include "missing_network.h"
#include "missing_syscall.h"
+51
View File
@@ -0,0 +1,51 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include <linux/types.h>
#include <sys/stat.h>
#if WANT_LINUX_STAT_H
#include <linux/stat.h>
#endif
/* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */
#if !HAVE_STRUCT_STATX
struct statx_timestamp {
int64_t tv_sec;
uint32_t tv_nsec;
uint32_t __reserved;
};
struct statx {
uint32_t stx_mask;
uint32_t stx_blksize;
uint64_t stx_attributes;
uint32_t stx_nlink;
uint32_t stx_uid;
uint32_t stx_gid;
uint16_t stx_mode;
uint16_t __spare0[1];
uint64_t stx_ino;
uint64_t stx_size;
uint64_t stx_blocks;
uint64_t stx_attributes_mask;
struct statx_timestamp stx_atime;
struct statx_timestamp stx_btime;
struct statx_timestamp stx_ctime;
struct statx_timestamp stx_mtime;
uint32_t stx_rdev_major;
uint32_t stx_rdev_minor;
uint32_t stx_dev_major;
uint32_t stx_dev_minor;
uint64_t __spare2[14];
};
#endif
/* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */
#ifndef STATX_BTIME
#define STATX_BTIME 0x00000800U
#endif
/* a528d35e8bfcc521d7cb70aaf03e1bd296c8493f (4.11) */
#ifndef AT_STATX_DONT_SYNC
#define AT_STATX_DONT_SYNC 0x4000
#endif
+1
View File
@@ -6,6 +6,7 @@
#include <sys/types.h>
#include "missing_keyctl.h"
#include "missing_stat.h"
#if !HAVE_PIVOT_ROOT
static inline int missing_pivot_root(const char *new_root, const char *put_old) {