Use EPERM/ESPIPE in the default implementation of Resource methods
Created by: nounoursheureux
Problem: In lots of syscalls (close
, dup
, ...) the same error (EBADF
) is returned when the file descriptor is invalid and when the file descriptor is valid but the operation is not implemented for the current resource.
Solution: Change the error returned by the default implementation of the Resource
methods to EPERM
(Operation not permitted), or ESPIPE
(Illegal seek) for the seek
method.
Drawbacks: If some code relies on the fact that the default implementation returns EBADF
, il will break.
State: Ready