Expert guidance for working with the mbuffer measuring buffer tool - a high-performance C buffering utility with multi-threading, networking, and tape support
Provides expert guidance when working with the mbuffer measuring buffer tool codebase.
This skill gives you deep understanding of the mbuffer project architecture, build system, testing infrastructure, and threading model. Use it when modifying, debugging, or extending the mbuffer measuring buffer tool.
mbuffer is a high-performance data buffering tool written in C with:
1. **Standard build:**
```bash
./configure
make
```
2. **Build with specific flags:**
```bash
env CFLAGS="-O -g -m64" ./configure
make
```
3. **Run test suite:**
```bash
make check
```
4. **Install:**
```bash
make install
```
5. **Clean build artifacts:**
```bash
make clean # Remove build artifacts
make distclean # Remove all generated files
```
```bash
cmake .
cmake --build .
ctest # If ENABLE_TESTING is enabled
```
**Main Program:**
**I/O Components:**
**Supporting Infrastructure:**
**Producer-Consumer Pattern:**
**Synchronization Primitives:**
**Test Location:** `tests/` directory (test0.sh through test7.sh)
**Test Coverage:**
**Test Dependencies:**
Tests validate functionality using tar archives and MD5 checksums.
**Config File Load Order:**
1. `/etc/mbuffer.rc`
2. `${SYSCONFDIR}/mbuffer.rc`
3. `~/.mbuffer.rc`
4. File in `$MBUFFERRC` environment variable
**Version Generation:**
| Platform | Status | Notes |
|----------|--------|-------|
| Linux | Fully supported | Primary development platform |
| Solaris | Fully supported | Full feature parity |
| FreeBSD | Supported | Some caveats apply |
| macOS | **Not supported** | Missing `sem_getvalue()` - see README |
**Requirements:**
1. **macOS limitation:** The project explicitly does not support macOS due to missing POSIX semaphore functionality
2. **Thread safety:** All buffer access must respect semaphore/mutex protocol
3. **Multi-volume operations:** Require careful state management across volume boundaries
4. **Network mode:** IPv4/IPv6 support depends on system capabilities
1. **Threading changes:** Ensure proper synchronization with existing semaphores/mutexes
2. **Buffer operations:** Respect circular buffer boundaries and watermark thresholds
3. **I/O changes:** Test with both file and device backends
4. **Network code:** Verify both IPv4 and IPv6 paths
5. **Build changes:** Update both Autoconf and CMake files if modifying build logic
6. **Testing:** Add appropriate tests to `tests/` directory and update `make check` target
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/mbuffer-codebase-assistant/raw