#include <iostream>
#include <fstream>
#include <string>
int main() {
std::ifstream file("/proc/version");
std::string osVersion;
if (file.is_open()) {
std::getline(file, osVersion);
std::cout << "Operating System: " << osVersion << "\n";
} else {
std::cout << "Unable to open /proc/version file.\n";
}
return 0;
}
/*
run:
Operating System: Linux version 6.6.72+ (builder@92247b5e083e) (Chromium OS 17.0_pre498229-r33 clang version 17.0.0 (/var/cache/chromeos-cache/distfiles/egit-src/external/github.com/llvm/llvm-project 14f0776550b5a49e1c42f49a00213f7f3fa047bf), LLD 17.0.0) #1 SMP PREEMPT_DYNAMIC Sat Feb 8 10:02:01 UTC 2025
*/