| 1040 | /* Retrieving exe path is completely OS dependant */ |
| 1041 | #if defined CC_BUILD_MACOS |
| 1042 | static cc_result Process_RawGetExePath(char* path, int* len) { |
| 1043 | Mem_Set(path, '\0', NATIVE_STR_LEN); |
| 1044 | cc_uint32 size = NATIVE_STR_LEN; |
| 1045 | if (_NSGetExecutablePath(path, &size)) return ERR_INVALID_ARGUMENT; |
| 1046 | |
| 1047 | /* despite what you'd assume, size is NOT changed to length of path */ |
| 1048 | *len = String_CalcLen(path, NATIVE_STR_LEN); |
| 1049 | return 0; |
| 1050 | } |
| 1051 | #elif defined CC_BUILD_LINUX || defined CC_BUILD_SERENITY |
| 1052 | static cc_result Process_RawGetExePath(char* path, int* len) { |
| 1053 | *len = readlink("/proc/self/exe", path, NATIVE_STR_LEN); |
no test coverage detected