Fix ERESTARTSYS leak to userspace
Fix ERESTARTSYS leak to userspace by replacing it with the appropriate for userspace error codes. Fixes #320
Hi, what is your change used for? what problem do you find with the current design?
Hi @jason77-wang, current code returns error 512 in case of timeout of r/w transaction and in case of blocking read of event device. This error code is undefined in userspace and it is a common practice to keep such error codes inside kernel and instead return one of defined error codes. So that programmers don't puzzle over that error code (it's non standard so it is not described anywhere) and instead have a clear understanding of why their syscall returns an error and what to do with it. It may break existing userspace apps if they explicitly expect error code 512, in this case you need either to modify code of such apps, or just don't include that change in your XDMA module build.
Hi @jason77-wang, current code returns error 512 in case of timeout of r/w transaction and in case of blocking read of event device. This error code is undefined in userspace and it is a common practice to keep such error codes inside kernel and instead return one of defined error codes. So that programmers don't puzzle over that error code (it's non standard so it is not described anywhere) and instead have a clear understanding of why their syscall returns an error and what to do with it. It may break existing userspace apps if they explicitly expect error code 512, in this case you need either to modify code of such apps, or just don't include that change in your XDMA module build.
Got it. thanks.