| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#include <aws/common/file.h> |
| 6 |
#include <aws/common/private/system_info_priv.h> |
| 7 |
|
| 8 |
int aws_system_environment_load_platform_impl(struct aws_system_environment *env) { |
| 9 |
|
| 10 |
aws_byte_buf_init_from_file_with_size_hint( |
| 11 |
&env->virtualization_vendor, env->allocator, "/sys/devices/virtual/dmi/id/sys_vendor", 32 ); |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
aws_byte_buf_init_from_file_with_size_hint( |
| 16 |
&env->product_name, env->allocator, "/sys/devices/virtual/dmi/id/product_name", 32 ); |
| 17 |
|
| 18 |
return AWS_OP_SUCCESS; |
| 19 |
} |
| 20 |
|
| 21 |
void aws_system_environment_destroy_platform_impl(struct aws_system_environment *env) { |
| 22 |
aws_byte_buf_clean_up(&env->virtualization_vendor); |
| 23 |
aws_byte_buf_clean_up(&env->product_name); |
| 24 |
} |