Working on "Use std::filesystem. Remove Boost Filesystem & System" #20744, I found an unfortunate [pitfall](https://github.com/bitcoin/bitcoin/pull/20744#issuecomment-946046666) -- `boost/process.hpp` depends on `boost::filesystem` when cross-compiling for Windows. It happens in Guix environment as well.

The goal of this issue is to discuss and find a solution to get rid of `boost::filesystem`.
{
#ifndef WIN32
    FILE* file = fsbridge::fopen(dirname, "r");
    if (file) {
        fsync(fileno(file));
        fclose(file);
    }
#endif
}
bool TruncateFile(FILE *file, unsigned int length) {
#if defined(WIN32)
    return _chsize(_fileno(file), length) == 0;
#else
    return ftruncate(fileno(file), length) == 0;
#endif
}
/**
 * this function tries to raise the file descriptor limit to the requested number.
 * It returns the actual file descriptor limit (which may be more or less than nMinFD)
 */
int RaiseFileDescriptorLimit(int nMinFD) {