summaryrefslogtreecommitdiff
path: root/src/util/uv.cpp
blob: 94f074bfa149b750e6ecc6e917ccaff52c9d4c10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <mbgl/util/uv.hpp>

#include <uv.h>

namespace uv {

std::string cwd() {
    size_t max = 0;
    std::string dir;
    do {
        max += 256;
        dir.resize(max);
        uv_cwd(const_cast<char *>(dir.data()), max);
    } while (max == dir.size());
    dir.resize(max - 1);
    return dir;
}

}