b9874d0941
Add redbear-usb-storage-check in-guest binary that validates USB mass storage read and write I/O: discovers /scheme/disk/ devices, writes a test pattern to sector 2048, reads it back, verifies match, restores original content. Updates test-usb-storage-qemu.sh with write-proof verification step. Includes all accumulated Red Bear OS work: kernel patches, relibc patches, driver infrastructure, DRM/GPU, KDE recipes, firmware, validation tooling, build system hardening, and documentation.
24 lines
486 B
C
24 lines
486 B
C
#include <stdio.h>
|
|
#include <unistd.h>
|
|
|
|
#include "test_helpers.h"
|
|
|
|
int main(void) {
|
|
const char *msg = "Hello, %s";
|
|
|
|
int fd = dup(STDOUT_FILENO);
|
|
ERROR_IF(dup, fd, == -1);
|
|
|
|
int result = dprintf(fd, msg, "world");
|
|
ERROR_IF(dprintf, result, != sizeof("Hello, world") - 1);
|
|
UNEXP_IF(dprintf, result, < 0);
|
|
|
|
result = dprintf(fd, "\na\n");
|
|
UNEXP_IF(dprintf, result, < 0);
|
|
ERROR_IF(dprintf, result, != sizeof("\na\n") - 1);
|
|
|
|
close(fd);
|
|
|
|
return 0;
|
|
}
|