Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › Io › Threaded › fallbackSeedPosix Private Function fallbackSeedPosix Doc Source Private Function std.Io.Threaded.fallbackSeedPosix
fn fallbackSeedPosix (seed : *[Csprng .seed_len ]u8 ) void Params File Io/Threaded.zig: 17270
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285 fn fallbackSeedPosix (seed : *[Csprng .seed_len ]u8 ) void {
std .mem .writeInt (posix .pid_t , seed [0 ..@sizeOf (posix .pid_t )], posix .system .getpid (), .native );
const i_1 = @sizeOf (posix .pid_t );
var ts : posix .timespec = undefined ;
const Sec = @TypeOf (ts .sec );
const Nsec = @TypeOf (ts .nsec );
const i_2 = i_1 + @sizeOf (Sec );
switch (posix .errno (posix .system .clock_gettime (.REALTIME , &ts ))) {
.SUCCESS => {
std .mem .writeInt (Sec , seed [i_1 ..][0 ..@sizeOf (Sec )], ts .sec , .native );
std .mem .writeInt (Nsec , seed [i_2 ..][0 ..@sizeOf (Nsec )], ts .nsec , .native );
},
else => {},
}
}