Extended error reporting
Andi Kleen describes the problem this way:
My favourite example of this is the configuration of the networking queueing disciplines, which configure complicated data structures and algorithms and in many cases have tens of different error conditions based on the input parameters -- and they all just report EINVAL.
It would be nice to provide application developers with better information than this. A brief discussion covered some of the options:
- Use printk() to put information into the system logfile.
This approach is widely used, but it bloats the kernel with string
data, risks flooding the logs, and the resulting information may not
be easily accessible to an unprivileged programmer.
- Extend specific system calls to enable them to provide richer status
information. Just adding a new version of ioctl() would
address many of the worst problems.
- Create an errno-like mechanism by which any system call could return extended information. That information could be an error string, some sort of special code, or, as Alan Cox suggested, a pointer to the structure field which caused the problem.
One could certainly argue that the narrow errno mechanism is
showing its age and could use an upgrade. Any enhancements, though, would
be Linux-specific and non-POSIX, which always tends to limit their uptake.
They would also have to be lived with forever, and, thus, would require
careful design. So we're unlikely to see a solution in the mainline
anytime soon, even if somebody does take up the challenge.
| Index entries for this article | |
|---|---|
| Kernel | Development model/User-space ABI |
| Kernel | User-space API |
