Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/coreclr/src/hosts/unixcoreruncommon/coreruncommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,43 @@ bool GetEntrypointExecutableAbsolutePath(std::string& entrypointExecutable)
{
result = false;
}
#elif defined(__sun)
const char *path;
if ((path = getexecname()) == NULL)
{
result = false;
}
else if (*path != '/')
{
char *cwd;
if ((cwd = getcwd(NULL, PATH_MAX)) == NULL)
{
result = false;
}
else
{
char *joined;
if (asprintf(&joined, "%s/%s", cwd, path) < 0)
{
result = false;
}
else
{
entrypointExecutable.assign(joined);
result = true;
free(joined);
}

free(cwd);
}
}
else
{
entrypointExecutable.assign(path);
result = true;
}

free((void*)path);
#else

#if HAVE_GETAUXVAL && defined(AT_EXECFN)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/src/nativeresources/processrc.awk
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ BEGIN {
var = var + 0;

# Extract string content starting with either " or L"
idx = match($0, /L?\"/);
idx = match($0, /L?"/);
content = substr($0, idx);

# remove the L prefix from strings
Expand Down