unit SysRandom;
interface
;
implementation
{$ifdef UNIX}
;
const
RandomDeviceName = '/dev/urandom';
var
RandomNumber: Cardinal;
RandomReader: File of Cardinal;
begin
Assign(RandomReader, RandomDeviceName);
{$push}
{turn off runtime error gen}
{$IOChecks off}
Reset(RandomReader);
if IOResult() = 0 then
begin
Read(RandomReader, RandomNumber);
if IOResult() = 0 then
begin
System.RandSeed := RandomNumber;
Close(RandomReader);
end
else System.Randomize;
end
{$pop}
else
begin
System.Randomize;
end;
end;
{$else}
;
begin
System.Randomize;
end;
{$endif}
end.