Skip to content

Commit

Permalink
Solaris: getcwd buffer size changed.
Browse files Browse the repository at this point in the history
  • Loading branch information
nykytenko committed May 5, 2016
1 parent b7459ec commit 6dca376
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions std/file.d
Original file line number Diff line number Diff line change
Expand Up @@ -2522,9 +2522,10 @@ version(Windows) string getcwd()
}
else version (Solaris) string getcwd()
{
enum MAXPATHLEN = 2048;
/* BUF_SIZE >= PATH_MAX */
enum BUF_SIZE = 4096;
/* The user should be able to specify any size buffer > 0 */
auto p = cenforce(core.sys.posix.unistd.getcwd(null, MAXPATHLEN),
auto p = cenforce(core.sys.posix.unistd.getcwd(null, BUF_SIZE),
"cannot get cwd");
scope(exit) core.stdc.stdlib.free(p);
return p[0 .. core.stdc.string.strlen(p)].idup;
Expand Down

0 comments on commit 6dca376

Please sign in to comment.