mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Schwartzmeyer <>
Subject Re: Review Request 54335: Add `os::var()` to Stout.
Date Thu, 15 Dec 2016 23:44:04 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated Dec. 15, 2016, 11:44 p.m.)

Review request for mesos, Alex Clemmer and Joseph Wu.

Bugs: MESOS-6677 and MESOS-6722

Repository: mesos

Description (updated)

Returns `/var` on POSIX and (usually) `C:\ProgramData` on Windows. Uses
Windows COM API to look up correct location for persistent,
app-local (but not per user) variable data. Returns standard location on

The addition of `os::var()` is a continuation of the fix in #54336. The
correct place for variable runtime data on Windows is not necessarily in
`os::temp()`, but in the analogous location `ProgramData`. Thus we need
a platform-agnostic way to refer to `var`.

The call to `ShGetKnownFolder` is not RAII because it is a C API, and
the ATL `CComHeapPtr` class is not used in this commit due to Windows
header issues. Thus the buffer allocated by the C API is freed
immediately after the data is copied into a `std::wstring`. Because the
Windows API returns a UTF-16 string, and Unicode characters are valid in
Windows path names, we have to correctly convert it to UTF-8 using

Diffs (updated)

  3rdparty/stout/include/stout/posix/os.hpp 05d27a0beacfdd706b0c5c2e5d28465ca3e118fb 
  3rdparty/stout/include/stout/windows.hpp d89c70902cf60544441608c2cb290b0727cbb45c 
  3rdparty/stout/include/stout/windows/os.hpp 51c8dcfab135d0323369e4605c67cf6df4a9671e 



make && make check on Linux: no failures.
msbuild and attach to a master on Windows: no failures.


Andrew Schwartzmeyer

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message