9.87 failure_policy

#define MEM_FAIL_PANIC      1
#define MEM_FAIL_SOFT_KILL  2
#define MEM_FAIL_HARD_KILL  3
#define OOM_ALLOW_PROC_KILL 1
struct fail_modes {
    uint64_t mem_policy;
    uint64_t oom_policy;
};

int failure_policy(struct fail_modes *old, struct fail_modes *new);

This syscall fetches and customized kernel behaviour on a series of failure conditions. old, if not null, can be used for fetching the values used at the time of calling, while new, if not null, will be used to set new values.

The valid values for mem_policy are:

MEM_FAIL_PANIC

When set to this value, a hardware memory failure will cause the kernel to panic. This is the default.

MEM_FAIL_SOFT_KILL

When set to this value, hardware failures will result in no immediate action, when a process steps on the faulty memory, an exception will be raised on the spot.

MEM_FAIL_HARD_KILL

When set to this value, hardware failures will result on the processes holding the faulty memory to be eagerly terminated.

The valid values for oom_policy are:

OOM_ALLOW_PROC_KILL

When set, this value will make the kernel able to kill processes if deemed necessary for the prolonged function of the system, if not set, the kernel will not kill user processes at any cost.

This syscall returns 0 on success or -1 on failure, with the errno:

EINVAL

When setting new values with new, the passed values were not valid.

EFAULT

The passed buffers were pointing to invalid memory.

EACCES

When setting new values with new, the calling process did not have the capability MAC_CAP_SYSMAC.