The only way, AFAIK, is to let them run in a separate thread. The
easiest and reasonably fast approach would be to use a worker task:

auto t = runWorkerTaskH({ createDirectory(dir); }, dir);
t.join();
});

OK, that makes sense. I need to deal with blocking NFS system calls, so I
cannot even use runWorkerTaskH, because it would block all
threads in the pool after some time...

Seems I need to create separate threads to deal with such system calls...