What would perror() be in the kernel? I can't tell what the error codes are from the error values ,i.e -22 alone.
The Linux kernel just uses negated errno codes as a convention. So look in asm-generic/errno-base.h
or asm-generic/errno.h
and find...
#define EINVAL 22 /* Invalid argument */
This can happen if you pass NULL
to a function that doesn't accept NULL
, for example. It depends on the function.
perror
, but it's about how to interpret error codes in the kernel. The perror
function is only available in userspace, it's not available in the kernel - Dietrich Epp 2017-06-07 19:18
perror()
, not about the meaning of the error codes. So this is not a good answer - user3629249 2017-06-07 14:40