Welcome to mini-libc, a lightweight and freestanding implementation of the standard C library for Linux systems! This project is built from the ground up to replace the default system libc, relying solely on Linux system calls. By crafting a minimal yet functional libc, you'll dive deep into string manipulation, memory management, and low-level file I/O operations.
- 🔍 Understand the structure and purpose of the C standard library
- 🏗️ Develop a freestanding implementation using only syscalls
- 📝 Implement fundamental string and memory functions
- 📂 Provide essential file I/O and process utilities
- ⚙️ Gain insights into Linux syscall interfaces
Efficient string-handling functions:
strcpy()
/strncpy()
✅strcat()
/strncat()
✅strlen()
✅strcmp()
/strncmp()
✅strstr()
/strrstr()
✅memcpy()
/memmove()
✅memset()
/memcmp()
✅
puts()
– Simple string printing viasyscall(__NR_write)
📢
Essential POSIX-compliant file operations:
open()
/close()
🔑lseek()
🔄stat()
/fstat()
📊truncate()
/ftruncate()
✂️
nanosleep()
/sleep()
💤
Lightweight dynamic memory allocation:
malloc()
/free()
🔄calloc()
✅realloc()
/reallocarray()
🔧mmap()
/mremap()
/munmap()
🗂️
errno
variable management for system call failures ❌
cd src/
make