EProcess is raised with that function as the message formatter, I just simply parse the error code after the colon and pass it to FormatMessage.
The error code is system dependent (CMIIW, but does Linux defines 2 as "File not found"?), every OS has its own code for particular error. If only LCL/FCL/RTL has this kind of function, I mean something like:
function OSErrorMsg(const ErrorCode: Integer): String;
var
Buf: PChar;
begin
{$ifdef windows}
FormatMessage(
...
)
Result:=StrPas(Buf);
{$else}
...
{$endif}
end;