Normal completion: stack is not affected.
If error condition was generated by a preceding system call:
The ERR system call stores the current result code into the specified variable of type sysres and clears the result code. Since errors returned by system calls generally cause all elements of the system call vector to be skipped until END or ERR, this system call effectively "partitions" the vector into independent subvectors, so the following subvector will be executed even if the preceding one fails.
If an error condition was present, ERR causes the stack to be unwound to the state it was in before the execution of the (sub)vector. This is achieved by destruction of accesses on top of stack until the stack reaches the size recorded for the current thread after the execution of the last ERR or END.
ERR always clears error condition, and stores the result code left by previous system calls into specified user variable.