In practice, no: if a syscall passes through several "hurdles" at which an error can occur, it normally stops and returns error at the first one, because proceeding with a shaky state into the second hurdle is just likely to cause another error, or produce suboptimal results.Cognition wrote:Wouldn't it be easier to simply use a bitmask to return multiple error conditions? It seems like it'd work under most scenarios pretty well, perhaps there are some scenarios were you would have to worry about handling more than 32 or 64 error conditions but I can't imagine there would be many. At any rate in such scenarios calling several syscalls to resolve the error would definitely be a huge performance hit as well.
If the syscall is of such a nature that it can be completed sanely with one or more unusual flags occuring then the API would normally just provide a "FORCE_OPERATION" flag that the app explicitly passes to bypass a certain hurdle if it has knowledge of the ramifications. In practice, since continuing with unstable state into a syscall past an error point would produce more errors, and possibly corrupt system state, the kernel usually just returns an error code for the first encountered error and then leaves the onus on the application to rectify it and call in again, etc.
An error bitfield would end up unintentionally just becoming a single-error value since it will rarely ever have more than one bit set on return.
--Peace out
gravaera