Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
カーネルでは perror() は何になりますか? エラー値、つまり -22 だけでは、エラー コードが何であるかわかりません。
Linux カーネルは、規則として否定された errno コードを使用するだけです。中をのぞいasm-generic/errno-base.hたりasm-generic/errno.h、見つけたり...
asm-generic/errno-base.h
asm-generic/errno.h
#define EINVAL 22 /* Invalid argument */
これは、たとえば、 をNULL受け入れない関数に渡した場合に発生する可能性があります。NULL機能によります。
NULL