STREAMS includes the function StrmSetError for setting errors. It performs the equivalent of an assignment to u.u_error (Section 31.3.4.2) by storing an error code in a per-thread location for the stream head to retrieve after the return of the open or close procedure of the driver/module.
VOID StrmSetError( IN CHAR errno );