$RodHat_/search
errno reference

EINVAL

Invalid argument

Linux value
22
strerror(3)
Invalid argument
On this site
52 syscalls

The catch-all. When a call returns it, check the flags and the struct size first, then check whether the kernel knows the flag at all.

Where you will see EINVAL

  • cachestat(2)Linux · Filesystem

    flags is non-zero.

  • capset(2)Linux · Security

    One of the arguments was invalid (e.g. an unsupported header version).

  • clone3(2)Linux · Processes

    Inconsistent or unknown flags, bad stack/size combination, or invalid pidfd pointer.

  • close_range(2)Linux · File descriptors

    flags is not valid, or first is greater than last.

  • copy_file_range(2)Linux · I/O

    flags != 0, fd_in == fd_out with overlapping ranges, or fd is not a regular file.

  • eventfd(2)Linux · Events

    An unsupported value was specified in flags.

  • fallocate(2)Linux · Filesystem

    offset or len are negative; mode combination is invalid; or offset/len not block-aligned for COLLAPSE_RANGE or INSERT_RANGE.

  • fanotify_init(2)Linux · Events

    Invalid value in flags or event_f_flags.

  • flock(2)Linux · File descriptors

    op is invalid.

  • fsopen(2)Linux · Filesystem

    Invalid flags; for fsmount(), also an invalid MOUNT_ATTR_* value in attr_flags.

  • getrandom(2)Linux · Security

    Invalid flag in flags.

  • io_uring_setup(2)Linux · I/O

    Non-zero resv, unsupported flag, entries out of bounds, or inconsistent flag combination.

  • ioprio_set(2)Linux · I/O

    Invalid value for which or ioprio.

  • jail(2)FreeBSD · Sandboxing

    Wrong API version, bad parameter size/range/name, or neither JAIL_CREATE nor JAIL_UPDATE.

  • kcmp(2)Linux · Processes

    type is not a valid KCMP_* value.

  • landlock_create_ruleset(2)Linux · Sandboxing

    Unknown flags, access right, or scope, or size too small.

  • madvise(2)Linux · Memory

    addr not page-aligned, invalid advice, or advice not allowed on this mapping type (e.g. MADV_FREE on shared).

  • membarrier(2)Linux · Memory

    Unknown command or nonzero flags for a command that does not accept flags.

  • memfd_create(2)Linux · Memory

    flags contained unknown bits, or name exceeded 249 bytes.

  • memfd_secret(2)Linux · Memory

    flags included unknown bits.

  • mlock(2)Linux · Memory

    addr+size overflowed, unknown flags, or MCL_ONFAULT without MCL_CURRENT/MCL_FUTURE.

  • mount_setattr(2)Linux · Filesystem

    Invalid flags, unknown MOUNT_ATTR_* combination, or contradictory atime modes.

  • mseal(2)Linux · Memory

    addr is not page-aligned, flags is non-zero, or len rounds up to overflow.

  • openat2(2)Linux · Filesystem

    Unknown flag or bad value in how, mode set without O_CREAT/O_TMPFILE, or size too small.

  • perf_event_open(2)Linux · Tracing

    Invalid event type or config, or pid=-1 and cpu=-1 simultaneously.

  • pidfd_getfd(2)Linux · File descriptors

    flags is not 0.

  • pidfd_open(2)Linux · Processes

    flags is not valid, or pid is not valid.

  • pidfd_send_signal(2)Linux · Processes

    Invalid signal, invalid flags, or caller's PID namespace can't signal the target.

  • flags is non-zero, or access_rights contains bits other than PKEY_DISABLE_ACCESS and PKEY_DISABLE_WRITE.

  • pledge(2)OpenBSD · Sandboxing

    promises is malformed or contains an invalid keyword.

  • posix_fadvise(2)Linux · I/O

    advice is not a recognised value, or offset or len is negative.

  • prctl(2)Linux · Processes

    Unrecognized op, or a bad argument for it (e.g. NO_NEW_PRIVS arg2 != 1, DUMPABLE arg2 not 0/1).

  • preadv2 / pwritev2(2)Linux · Filesystem

    Unknown flag, or offset is -1 and the fd has no current position.

  • process_madvise(2)Linux · Memory

    flags is not 0, n is too large, or the iov_len sum overflows ssize_t.

  • renameat2(2)Linux · Filesystem

    Unsupported flags combination, or the filesystem does not support the requested flag.

  • rseq(2)Linux · Scheduling

    rseq_len is not sizeof(struct rseq), or flags has unknown bits set (without RSEQ_FLAG_UNREGISTER).

  • sched_setaffinity(2)Linux · Processes

    mask has no CPUs that are physically present and permitted by cpuset cgroups.

  • sched_setattr(2)Linux · Scheduling

    Bad attr: size, or runtime/deadline/period ordering violated.

  • SCM_RIGHTSLinux · IPC

    sendmsg(2): more than SCM_MAX_FD descriptors in one message.

  • seccomp(2)Linux · Sandboxing

    Unknown operation, invalid flags, or an invalid/empty/too-long (>4096 insns) filter.

  • setns(2)Linux · Processes

    Namespace type doesn't match nstype, ancestor PID ns, or multithreaded caller joining a user ns.

  • signalfd(2)Linux · Events

    fd is not a valid signalfd, or flags is invalid.

  • SO_REUSEPORTLinux · I/O

    setsockopt(2): optlen is invalid.

  • splice(2)Linux · I/O

    Neither fd is a pipe, target is append-mode or doesn't support splicing, or both ends are the same pipe.

  • statx(2)Linux · Filesystem

    Invalid flag in flags, or the reserved STATX__RESERVED bit set in mask.

  • sync_file_range(2)Linux · I/O

    flags contains invalid bits, or offset+nbytes overflows.

  • tee(2)Linux · I/O

    fd_in or fd_out is not a pipe, or both refer to the same pipe.

  • timerfd_create(2)Linux · Events

    clockid is not valid, or flags is invalid.

  • unshare(2)Linux · Processes

    Unknown flag, or CLONE_NEWUSER requested with a multithreaded process.

  • unveil(2)OpenBSD · Sandboxing

    Invalid permissions string.

  • userfaultfd(2)Linux · Memory

    An unsupported value was specified in flags.

  • vmsplice(2)Linux · IPC

    fd is not a pipe write end, or nr_segs exceeds IOV_MAX.

Sources

  1. errno(3), Linux man-pages
  2. The meaning for each syscall is taken from that syscall's own card and the man page it cites.

Values are the Linux numbers on x86 and arm64; other architectures and the BSDs number some errors differently. BSD cards list the names the BSD man page uses. Spot one that's wrong? Tell Rod.