Skip to content

Commit

Permalink
Move mempolicy.h to its own module. (#99)
Browse files Browse the repository at this point in the history
After regenerating all the generated files, I noticed that mempolicy.h
was pulling in the errno codes for all architectures, so I think it's
best for it to be in its own module.
  • Loading branch information
sunfishcode committed Nov 30, 2023
1 parent a60a303 commit 48af48b
Show file tree
Hide file tree
Showing 40 changed files with 3,741 additions and 3,091 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ general = []
if_ether = []
io_uring = []
ioctl = []
mempolicy = []
net = []
netlink = []
prctl = []
Expand Down
1 change: 0 additions & 1 deletion gen/modules/general.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include <linux/inotify.h>
#include <linux/limits.h>
#include <linux/magic.h>
#include <linux/mempolicy.h>
#include <linux/mman.h>
#include <linux/poll.h>
#include <linux/random.h>
Expand Down
2 changes: 2 additions & 0 deletions gen/modules/mempolicy.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "support.h"
#include <linux/mempolicy.h>
171 changes: 0 additions & 171 deletions src/aarch64/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1455,158 +1455,6 @@ pub const UDF_SUPER_MAGIC: u32 = 352400198;
pub const DMA_BUF_MAGIC: u32 = 1145913666;
pub const DEVMEM_MAGIC: u32 = 1162691661;
pub const SECRETMEM_MAGIC: u32 = 1397048141;
pub const EPERM: u32 = 1;
pub const ENOENT: u32 = 2;
pub const ESRCH: u32 = 3;
pub const EINTR: u32 = 4;
pub const EIO: u32 = 5;
pub const ENXIO: u32 = 6;
pub const E2BIG: u32 = 7;
pub const ENOEXEC: u32 = 8;
pub const EBADF: u32 = 9;
pub const ECHILD: u32 = 10;
pub const EAGAIN: u32 = 11;
pub const ENOMEM: u32 = 12;
pub const EACCES: u32 = 13;
pub const EFAULT: u32 = 14;
pub const ENOTBLK: u32 = 15;
pub const EBUSY: u32 = 16;
pub const EEXIST: u32 = 17;
pub const EXDEV: u32 = 18;
pub const ENODEV: u32 = 19;
pub const ENOTDIR: u32 = 20;
pub const EISDIR: u32 = 21;
pub const EINVAL: u32 = 22;
pub const ENFILE: u32 = 23;
pub const EMFILE: u32 = 24;
pub const ENOTTY: u32 = 25;
pub const ETXTBSY: u32 = 26;
pub const EFBIG: u32 = 27;
pub const ENOSPC: u32 = 28;
pub const ESPIPE: u32 = 29;
pub const EROFS: u32 = 30;
pub const EMLINK: u32 = 31;
pub const EPIPE: u32 = 32;
pub const EDOM: u32 = 33;
pub const ERANGE: u32 = 34;
pub const EDEADLK: u32 = 35;
pub const ENAMETOOLONG: u32 = 36;
pub const ENOLCK: u32 = 37;
pub const ENOSYS: u32 = 38;
pub const ENOTEMPTY: u32 = 39;
pub const ELOOP: u32 = 40;
pub const EWOULDBLOCK: u32 = 11;
pub const ENOMSG: u32 = 42;
pub const EIDRM: u32 = 43;
pub const ECHRNG: u32 = 44;
pub const EL2NSYNC: u32 = 45;
pub const EL3HLT: u32 = 46;
pub const EL3RST: u32 = 47;
pub const ELNRNG: u32 = 48;
pub const EUNATCH: u32 = 49;
pub const ENOCSI: u32 = 50;
pub const EL2HLT: u32 = 51;
pub const EBADE: u32 = 52;
pub const EBADR: u32 = 53;
pub const EXFULL: u32 = 54;
pub const ENOANO: u32 = 55;
pub const EBADRQC: u32 = 56;
pub const EBADSLT: u32 = 57;
pub const EDEADLOCK: u32 = 35;
pub const EBFONT: u32 = 59;
pub const ENOSTR: u32 = 60;
pub const ENODATA: u32 = 61;
pub const ETIME: u32 = 62;
pub const ENOSR: u32 = 63;
pub const ENONET: u32 = 64;
pub const ENOPKG: u32 = 65;
pub const EREMOTE: u32 = 66;
pub const ENOLINK: u32 = 67;
pub const EADV: u32 = 68;
pub const ESRMNT: u32 = 69;
pub const ECOMM: u32 = 70;
pub const EPROTO: u32 = 71;
pub const EMULTIHOP: u32 = 72;
pub const EDOTDOT: u32 = 73;
pub const EBADMSG: u32 = 74;
pub const EOVERFLOW: u32 = 75;
pub const ENOTUNIQ: u32 = 76;
pub const EBADFD: u32 = 77;
pub const EREMCHG: u32 = 78;
pub const ELIBACC: u32 = 79;
pub const ELIBBAD: u32 = 80;
pub const ELIBSCN: u32 = 81;
pub const ELIBMAX: u32 = 82;
pub const ELIBEXEC: u32 = 83;
pub const EILSEQ: u32 = 84;
pub const ERESTART: u32 = 85;
pub const ESTRPIPE: u32 = 86;
pub const EUSERS: u32 = 87;
pub const ENOTSOCK: u32 = 88;
pub const EDESTADDRREQ: u32 = 89;
pub const EMSGSIZE: u32 = 90;
pub const EPROTOTYPE: u32 = 91;
pub const ENOPROTOOPT: u32 = 92;
pub const EPROTONOSUPPORT: u32 = 93;
pub const ESOCKTNOSUPPORT: u32 = 94;
pub const EOPNOTSUPP: u32 = 95;
pub const EPFNOSUPPORT: u32 = 96;
pub const EAFNOSUPPORT: u32 = 97;
pub const EADDRINUSE: u32 = 98;
pub const EADDRNOTAVAIL: u32 = 99;
pub const ENETDOWN: u32 = 100;
pub const ENETUNREACH: u32 = 101;
pub const ENETRESET: u32 = 102;
pub const ECONNABORTED: u32 = 103;
pub const ECONNRESET: u32 = 104;
pub const ENOBUFS: u32 = 105;
pub const EISCONN: u32 = 106;
pub const ENOTCONN: u32 = 107;
pub const ESHUTDOWN: u32 = 108;
pub const ETOOMANYREFS: u32 = 109;
pub const ETIMEDOUT: u32 = 110;
pub const ECONNREFUSED: u32 = 111;
pub const EHOSTDOWN: u32 = 112;
pub const EHOSTUNREACH: u32 = 113;
pub const EALREADY: u32 = 114;
pub const EINPROGRESS: u32 = 115;
pub const ESTALE: u32 = 116;
pub const EUCLEAN: u32 = 117;
pub const ENOTNAM: u32 = 118;
pub const ENAVAIL: u32 = 119;
pub const EISNAM: u32 = 120;
pub const EREMOTEIO: u32 = 121;
pub const EDQUOT: u32 = 122;
pub const ENOMEDIUM: u32 = 123;
pub const EMEDIUMTYPE: u32 = 124;
pub const ECANCELED: u32 = 125;
pub const ENOKEY: u32 = 126;
pub const EKEYEXPIRED: u32 = 127;
pub const EKEYREVOKED: u32 = 128;
pub const EKEYREJECTED: u32 = 129;
pub const EOWNERDEAD: u32 = 130;
pub const ENOTRECOVERABLE: u32 = 131;
pub const ERFKILL: u32 = 132;
pub const EHWPOISON: u32 = 133;
pub const MPOL_F_STATIC_NODES: u32 = 32768;
pub const MPOL_F_RELATIVE_NODES: u32 = 16384;
pub const MPOL_F_NUMA_BALANCING: u32 = 8192;
pub const MPOL_MODE_FLAGS: u32 = 57344;
pub const MPOL_F_NODE: u32 = 1;
pub const MPOL_F_ADDR: u32 = 2;
pub const MPOL_F_MEMS_ALLOWED: u32 = 4;
pub const MPOL_MF_STRICT: u32 = 1;
pub const MPOL_MF_MOVE: u32 = 2;
pub const MPOL_MF_MOVE_ALL: u32 = 4;
pub const MPOL_MF_LAZY: u32 = 8;
pub const MPOL_MF_INTERNAL: u32 = 16;
pub const MPOL_MF_VALID: u32 = 7;
pub const MPOL_F_SHARED: u32 = 1;
pub const MPOL_F_MOF: u32 = 8;
pub const MPOL_F_MORON: u32 = 16;
pub const RECLAIM_ZONE: u32 = 1;
pub const RECLAIM_WRITE: u32 = 2;
pub const RECLAIM_UNMAP: u32 = 4;
pub const PROT_READ: u32 = 1;
pub const PROT_WRITE: u32 = 2;
pub const PROT_EXEC: u32 = 4;
Expand Down Expand Up @@ -2680,13 +2528,6 @@ pub const SPLICE_F_MOVE: u32 = 1;
pub const SPLICE_F_NONBLOCK: u32 = 2;
pub const SPLICE_F_MORE: u32 = 4;
pub const SPLICE_F_GIFT: u32 = 8;
pub const MPOL_DEFAULT: _bindgen_ty_1 = _bindgen_ty_1::MPOL_DEFAULT;
pub const MPOL_PREFERRED: _bindgen_ty_1 = _bindgen_ty_1::MPOL_PREFERRED;
pub const MPOL_BIND: _bindgen_ty_1 = _bindgen_ty_1::MPOL_BIND;
pub const MPOL_INTERLEAVE: _bindgen_ty_1 = _bindgen_ty_1::MPOL_INTERLEAVE;
pub const MPOL_LOCAL: _bindgen_ty_1 = _bindgen_ty_1::MPOL_LOCAL;
pub const MPOL_PREFERRED_MANY: _bindgen_ty_1 = _bindgen_ty_1::MPOL_PREFERRED_MANY;
pub const MPOL_MAX: _bindgen_ty_1 = _bindgen_ty_1::MPOL_MAX;
#[repr(u32)]
#[non_exhaustive]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
Expand All @@ -2703,18 +2544,6 @@ FSCONFIG_CMD_RECONFIGURE = 7,
#[repr(u32)]
#[non_exhaustive]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_1 {
MPOL_DEFAULT = 0,
MPOL_PREFERRED = 1,
MPOL_BIND = 2,
MPOL_INTERLEAVE = 3,
MPOL_LOCAL = 4,
MPOL_PREFERRED_MANY = 5,
MPOL_MAX = 6,
}
#[repr(u32)]
#[non_exhaustive]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum membarrier_cmd {
MEMBARRIER_CMD_QUERY = 0,
MEMBARRIER_CMD_GLOBAL = 1,
Expand Down
173 changes: 173 additions & 0 deletions src/aarch64/mempolicy.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
/* automatically generated by rust-bindgen 0.66.1 */

pub const EPERM: u32 = 1;
pub const ENOENT: u32 = 2;
pub const ESRCH: u32 = 3;
pub const EINTR: u32 = 4;
pub const EIO: u32 = 5;
pub const ENXIO: u32 = 6;
pub const E2BIG: u32 = 7;
pub const ENOEXEC: u32 = 8;
pub const EBADF: u32 = 9;
pub const ECHILD: u32 = 10;
pub const EAGAIN: u32 = 11;
pub const ENOMEM: u32 = 12;
pub const EACCES: u32 = 13;
pub const EFAULT: u32 = 14;
pub const ENOTBLK: u32 = 15;
pub const EBUSY: u32 = 16;
pub const EEXIST: u32 = 17;
pub const EXDEV: u32 = 18;
pub const ENODEV: u32 = 19;
pub const ENOTDIR: u32 = 20;
pub const EISDIR: u32 = 21;
pub const EINVAL: u32 = 22;
pub const ENFILE: u32 = 23;
pub const EMFILE: u32 = 24;
pub const ENOTTY: u32 = 25;
pub const ETXTBSY: u32 = 26;
pub const EFBIG: u32 = 27;
pub const ENOSPC: u32 = 28;
pub const ESPIPE: u32 = 29;
pub const EROFS: u32 = 30;
pub const EMLINK: u32 = 31;
pub const EPIPE: u32 = 32;
pub const EDOM: u32 = 33;
pub const ERANGE: u32 = 34;
pub const EDEADLK: u32 = 35;
pub const ENAMETOOLONG: u32 = 36;
pub const ENOLCK: u32 = 37;
pub const ENOSYS: u32 = 38;
pub const ENOTEMPTY: u32 = 39;
pub const ELOOP: u32 = 40;
pub const EWOULDBLOCK: u32 = 11;
pub const ENOMSG: u32 = 42;
pub const EIDRM: u32 = 43;
pub const ECHRNG: u32 = 44;
pub const EL2NSYNC: u32 = 45;
pub const EL3HLT: u32 = 46;
pub const EL3RST: u32 = 47;
pub const ELNRNG: u32 = 48;
pub const EUNATCH: u32 = 49;
pub const ENOCSI: u32 = 50;
pub const EL2HLT: u32 = 51;
pub const EBADE: u32 = 52;
pub const EBADR: u32 = 53;
pub const EXFULL: u32 = 54;
pub const ENOANO: u32 = 55;
pub const EBADRQC: u32 = 56;
pub const EBADSLT: u32 = 57;
pub const EDEADLOCK: u32 = 35;
pub const EBFONT: u32 = 59;
pub const ENOSTR: u32 = 60;
pub const ENODATA: u32 = 61;
pub const ETIME: u32 = 62;
pub const ENOSR: u32 = 63;
pub const ENONET: u32 = 64;
pub const ENOPKG: u32 = 65;
pub const EREMOTE: u32 = 66;
pub const ENOLINK: u32 = 67;
pub const EADV: u32 = 68;
pub const ESRMNT: u32 = 69;
pub const ECOMM: u32 = 70;
pub const EPROTO: u32 = 71;
pub const EMULTIHOP: u32 = 72;
pub const EDOTDOT: u32 = 73;
pub const EBADMSG: u32 = 74;
pub const EOVERFLOW: u32 = 75;
pub const ENOTUNIQ: u32 = 76;
pub const EBADFD: u32 = 77;
pub const EREMCHG: u32 = 78;
pub const ELIBACC: u32 = 79;
pub const ELIBBAD: u32 = 80;
pub const ELIBSCN: u32 = 81;
pub const ELIBMAX: u32 = 82;
pub const ELIBEXEC: u32 = 83;
pub const EILSEQ: u32 = 84;
pub const ERESTART: u32 = 85;
pub const ESTRPIPE: u32 = 86;
pub const EUSERS: u32 = 87;
pub const ENOTSOCK: u32 = 88;
pub const EDESTADDRREQ: u32 = 89;
pub const EMSGSIZE: u32 = 90;
pub const EPROTOTYPE: u32 = 91;
pub const ENOPROTOOPT: u32 = 92;
pub const EPROTONOSUPPORT: u32 = 93;
pub const ESOCKTNOSUPPORT: u32 = 94;
pub const EOPNOTSUPP: u32 = 95;
pub const EPFNOSUPPORT: u32 = 96;
pub const EAFNOSUPPORT: u32 = 97;
pub const EADDRINUSE: u32 = 98;
pub const EADDRNOTAVAIL: u32 = 99;
pub const ENETDOWN: u32 = 100;
pub const ENETUNREACH: u32 = 101;
pub const ENETRESET: u32 = 102;
pub const ECONNABORTED: u32 = 103;
pub const ECONNRESET: u32 = 104;
pub const ENOBUFS: u32 = 105;
pub const EISCONN: u32 = 106;
pub const ENOTCONN: u32 = 107;
pub const ESHUTDOWN: u32 = 108;
pub const ETOOMANYREFS: u32 = 109;
pub const ETIMEDOUT: u32 = 110;
pub const ECONNREFUSED: u32 = 111;
pub const EHOSTDOWN: u32 = 112;
pub const EHOSTUNREACH: u32 = 113;
pub const EALREADY: u32 = 114;
pub const EINPROGRESS: u32 = 115;
pub const ESTALE: u32 = 116;
pub const EUCLEAN: u32 = 117;
pub const ENOTNAM: u32 = 118;
pub const ENAVAIL: u32 = 119;
pub const EISNAM: u32 = 120;
pub const EREMOTEIO: u32 = 121;
pub const EDQUOT: u32 = 122;
pub const ENOMEDIUM: u32 = 123;
pub const EMEDIUMTYPE: u32 = 124;
pub const ECANCELED: u32 = 125;
pub const ENOKEY: u32 = 126;
pub const EKEYEXPIRED: u32 = 127;
pub const EKEYREVOKED: u32 = 128;
pub const EKEYREJECTED: u32 = 129;
pub const EOWNERDEAD: u32 = 130;
pub const ENOTRECOVERABLE: u32 = 131;
pub const ERFKILL: u32 = 132;
pub const EHWPOISON: u32 = 133;
pub const MPOL_F_STATIC_NODES: u32 = 32768;
pub const MPOL_F_RELATIVE_NODES: u32 = 16384;
pub const MPOL_F_NUMA_BALANCING: u32 = 8192;
pub const MPOL_MODE_FLAGS: u32 = 57344;
pub const MPOL_F_NODE: u32 = 1;
pub const MPOL_F_ADDR: u32 = 2;
pub const MPOL_F_MEMS_ALLOWED: u32 = 4;
pub const MPOL_MF_STRICT: u32 = 1;
pub const MPOL_MF_MOVE: u32 = 2;
pub const MPOL_MF_MOVE_ALL: u32 = 4;
pub const MPOL_MF_LAZY: u32 = 8;
pub const MPOL_MF_INTERNAL: u32 = 16;
pub const MPOL_MF_VALID: u32 = 7;
pub const MPOL_F_SHARED: u32 = 1;
pub const MPOL_F_MOF: u32 = 8;
pub const MPOL_F_MORON: u32 = 16;
pub const RECLAIM_ZONE: u32 = 1;
pub const RECLAIM_WRITE: u32 = 2;
pub const RECLAIM_UNMAP: u32 = 4;
pub const MPOL_DEFAULT: _bindgen_ty_1 = _bindgen_ty_1::MPOL_DEFAULT;
pub const MPOL_PREFERRED: _bindgen_ty_1 = _bindgen_ty_1::MPOL_PREFERRED;
pub const MPOL_BIND: _bindgen_ty_1 = _bindgen_ty_1::MPOL_BIND;
pub const MPOL_INTERLEAVE: _bindgen_ty_1 = _bindgen_ty_1::MPOL_INTERLEAVE;
pub const MPOL_LOCAL: _bindgen_ty_1 = _bindgen_ty_1::MPOL_LOCAL;
pub const MPOL_PREFERRED_MANY: _bindgen_ty_1 = _bindgen_ty_1::MPOL_PREFERRED_MANY;
pub const MPOL_MAX: _bindgen_ty_1 = _bindgen_ty_1::MPOL_MAX;
#[repr(u32)]
#[non_exhaustive]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_1 {
MPOL_DEFAULT = 0,
MPOL_PREFERRED = 1,
MPOL_BIND = 2,
MPOL_INTERLEAVE = 3,
MPOL_LOCAL = 4,
MPOL_PREFERRED_MANY = 5,
MPOL_MAX = 6,
}
Loading

0 comments on commit 48af48b

Please sign in to comment.