POSIX specifies that calling getcwd w/ a NULL buffer is undefined behavior. Linux and macOS offer an extension to the POSIX behavior of automatically allocating a sufficiently large buffer if the argument is NULL.
Since FileSystemGs is targeting POSIX, it should allocate a sufficiently large buffer.