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.
33 lines
593 B
C
33 lines
593 B
C
#include <signal.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "../test_helpers.h"
|
|
|
|
int handler_called = 0;
|
|
|
|
void sig_handler(int signo)
|
|
{
|
|
(void) signo;
|
|
printf("SIGCHLD called. Inside handler\n");
|
|
handler_called = 1;
|
|
}
|
|
|
|
int main()
|
|
{
|
|
void (*status) (int);
|
|
status = signal(SIGCHLD, sig_handler);
|
|
ERROR_IF(signal, status, == SIG_ERR);
|
|
|
|
status = signal(SIGCHLD,SIG_DFL);
|
|
ERROR_IF(signal, status, != sig_handler);
|
|
|
|
//same comparison error from handle_return
|
|
|
|
raise(SIGCHLD);
|
|
|
|
if (handler_called == 1) {
|
|
return EXIT_FAILURE;
|
|
}
|
|
handler_called = 0;
|
|
return EXIT_SUCCESS;
|
|
}
|