missing: move fs or mount related definitions to missing_fs.h

This also fixes errnous definition MS_REC -> MS_SLAVE.
This commit is contained in:
Yu Watanabe 2018-12-06 06:57:27 +01:00
parent 311c1a5d0a
commit 503f480f8e
4 changed files with 66 additions and 61 deletions

View file

@ -99,6 +99,7 @@ basic_sources = files('''
missing_fcntl.h
missing_fib_rules.h
missing_fou.h
missing_fs.h
missing_if_bridge.h
missing_if_link.h
missing_if_tunnel.h

View file

@ -7,70 +7,11 @@
#include <inttypes.h>
#include <sys/syscall.h>
#ifndef FS_NOCOW_FL
#define FS_NOCOW_FL 0x00800000
#endif
#ifndef MS_MOVE
#define MS_MOVE 8192
#endif
#ifndef MS_REC
#define MS_REC 16384
#endif
#ifndef MS_PRIVATE
#define MS_PRIVATE (1<<18)
#endif
#ifndef MS_REC
#define MS_REC (1<<19)
#endif
#ifndef MS_SHARED
#define MS_SHARED (1<<20)
#endif
#ifndef MS_RELATIME
#define MS_RELATIME (1<<21)
#endif
#ifndef MS_KERNMOUNT
#define MS_KERNMOUNT (1<<22)
#endif
#ifndef MS_I_VERSION
#define MS_I_VERSION (1<<23)
#endif
#ifndef MS_STRICTATIME
#define MS_STRICTATIME (1<<24)
#endif
#ifndef MS_LAZYTIME
#define MS_LAZYTIME (1<<25)
#endif
#ifndef CIFS_MAGIC_NUMBER
# define CIFS_MAGIC_NUMBER 0xFF534D42
#endif
#ifndef RENAME_NOREPLACE
#define RENAME_NOREPLACE (1 << 0)
#endif
#ifndef EXT4_IOC_RESIZE_FS
# define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64)
#endif
#ifndef NS_GET_NSTYPE
#define NS_GET_NSTYPE _IO(0xb7, 0x3)
#endif
#include "missing_audit.h"
#include "missing_btrfs_tree.h"
#include "missing_capability.h"
#include "missing_fcntl.h"
#include "missing_fs.h"
#include "missing_input.h"
#include "missing_magic.h"
#include "missing_mman.h"

63
src/basic/missing_fs.h Normal file
View file

@ -0,0 +1,63 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
/* linux/fs.h */
#ifndef RENAME_NOREPLACE /* 0a7c3937a1f23f8cb5fc77ae01661e9968a51d0c (3.15) */
#define RENAME_NOREPLACE (1 << 0)
#endif
/* linux/fs.h or sys/mount.h */
#ifndef MS_MOVE
#define MS_MOVE 8192
#endif
#ifndef MS_REC
#define MS_REC 16384
#endif
#ifndef MS_PRIVATE
#define MS_PRIVATE (1<<18)
#endif
#ifndef MS_SLAVE
#define MS_SLAVE (1<<19)
#endif
#ifndef MS_SHARED
#define MS_SHARED (1<<20)
#endif
#ifndef MS_RELATIME
#define MS_RELATIME (1<<21)
#endif
#ifndef MS_KERNMOUNT
#define MS_KERNMOUNT (1<<22)
#endif
#ifndef MS_I_VERSION
#define MS_I_VERSION (1<<23)
#endif
#ifndef MS_STRICTATIME
#define MS_STRICTATIME (1<<24)
#endif
#ifndef MS_LAZYTIME
#define MS_LAZYTIME (1<<25)
#endif
/* Not exposed yet. Defined at fs/ext4/ext4.h */
#ifndef EXT4_IOC_RESIZE_FS
#define EXT4_IOC_RESIZE_FS _IOW('f', 16, __u64)
#endif
/* Not exposed yet. Defined at fs/cifs/cifsglob.h */
#ifndef CIFS_MAGIC_NUMBER
#define CIFS_MAGIC_NUMBER 0xFF534D42
#endif
/* linux/nsfs.h */
#ifndef NS_GET_NSTYPE /* d95fa3c76a66b6d76b1e109ea505c55e66360f3c (4.11) */
#define NS_GET_NSTYPE _IO(0xb7, 0x3)
#endif

View file

@ -6,6 +6,7 @@
#include <errno.h>
#include <getopt.h>
#include <grp.h>
#include <linux/fs.h>
#include <linux/loop.h>
#include <pwd.h>
#include <sched.h>
@ -17,7 +18,6 @@
#include <stdlib.h>
#include <string.h>
#include <sys/file.h>
#include <sys/mount.h>
#include <sys/personality.h>
#include <sys/prctl.h>
#include <sys/types.h>