Error Codes Wiki

Linux errno 22 (EINVAL) — Invalid Argument

Warningerrno

Overview

Linux errno 22 (EINVAL) means an invalid argument was passed to a system call or library function.

Key Details

  • EINVAL — one of the arguments is invalid
  • Generic error for parameter validation failures
  • Check man page for valid argument ranges
  • Common in mount, ioctl, and socket operations

Common Causes

  • Invalid parameter value (out of range, null, etc.)
  • Incorrect combination of flags
  • Wrong data type or structure format
  • Unsupported operation for the file type

Steps

  1. 1Check the man page for valid argument values
  2. 2Verify all parameters are within valid ranges
  3. 3Use strace to see the exact system call and arguments
  4. 4Check dmesg for kernel-level error details

Tags

linuxerrnoerrno 22 einvaltroubleshootingfix

More in Errno

Frequently Asked Questions

Use strace to see the exact system call: strace -e trace=open,read,write command