The function fgetws may also fail and set errno for any of the errors specified for the routines fflush(3), fstat(2), read(2), or malloc(3).