```D
private alias dstat = statImpl!stat;
private alias dlstat = statImpl!lstat;

private auto statImpl(alias statFunc)(in char[] name, stat_t* statbuf)
{
    char[64] tmpbuf = void;
    auto sz = ScopeBuffer!char(tmpbuf);
    sz.put(name);
    sz.put(0);
    auto result = statFunc(sz[].ptr, statbuf);
    sz.free();
    return result;
}
```