├── system call Bodhi.pdf ├── Eyuel Yeshambel Bodhi os (1).pdf ├── README.md └── system_call().c /system call Bodhi.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eyuel-11/Bodhi-os/HEAD/system call Bodhi.pdf -------------------------------------------------------------------------------- /Eyuel Yeshambel Bodhi os (1).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eyuel-11/Bodhi-os/HEAD/Eyuel Yeshambel Bodhi os (1).pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Bodhi os installation 2 | This repository provides comprehensive guide on installing, configuring, and optimizing Bodhi OS. The document covers essential topics, including system requirements, step-by-step installation instructions, and practical troubleshooting and solutions. And also contributions, file support system, feedback, and suggestions for further enhancements. 3 | 4 | System call bodhi 5 | 6 | The fstat() system call in Bodhi OS retrieves metadata about an open file using its file descriptor. It provides information such as file size, permissions, and modification time without requiring a path lookup. This improves efficiency in file handling and enhances security by validating access rights. fstat() helps optimize system performance by streamlining file operations. 7 | 8 | -------------------------------------------------------------------------------- /system_call().c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | int main() { 7 | const char* filename = "example.txt"; // Replace with your file int fd = open(filename, O_RDONLY); 8 | 9 | if(fd==-1) { 10 | cout << "Error: Failed to open file '" << filename << "'" << endl; return 1; 11 | } 12 | struct stat file_info; 13 | if (fstat(fd, &file_info) == -1) { 14 | cout << "Error: System call failed to retrieve file information" << endl; 15 | close(fd); 16 | return 1; 17 | } 18 | 19 | cout << "File Type & Permissions: " << file_info.st_mode << endl; cout << "Inode Number: " << file_info.st_ino << endl; 20 | cout << "Device ID: " << file_info.st_dev << endl; 21 | cout << "Number of Hard Links:"<