Skip to content

Commit

Permalink
linux build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyMusatkin committed Oct 30, 2023
1 parent 9382dea commit bd1779f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source/posix/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <mach/mach.h>
#else
#include <aws/common/file.h>
#include <aws/common/string.h>
#include <unistd.h>
#endif

Expand Down Expand Up @@ -83,9 +84,10 @@ int aws_memory_usage_init_for_current_process(struct aws_memory_usage_info *memo
}

memory_usage->maxrss = (size_t)info.resident_size_max;
memory_usage->rss = (size_t)info.resident_size;
memory_usage->rss = (size_t)info.resident_size;

#else
FILE* statm = aws_fopen_safe("/proc/self/statm", "r");
FILE* statm = aws_fopen_safe(aws_string_new_from_c_str("/proc/self/statm"), 'r');
if (statm == NULL) {
return aws_raise_error(AWS_ERROR_SYS_CALL_FAILURE);
}
Expand Down

0 comments on commit bd1779f

Please sign in to comment.