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.
37 lines
714 B
C
37 lines
714 B
C
#include <signal.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "signals_list.h"
|
|
#include "../test_helpers.h"
|
|
|
|
int handler_called = 0;
|
|
|
|
void sig_handler(int signo)
|
|
{
|
|
(void) signo;
|
|
// printf("%d called. Inside handler\n", signo);
|
|
handler_called = 1;
|
|
}
|
|
|
|
int signal_test3(int signum)
|
|
{
|
|
void (*status) (int);
|
|
status = signal(signum, sig_handler);
|
|
ERROR_IF(signal, status, == SIG_ERR);
|
|
|
|
raise(signum);
|
|
|
|
ERROR_IF(raise, handler_called, != 1);
|
|
return EXIT_SUCCESS;
|
|
}
|
|
|
|
int main(){
|
|
for (unsigned int i = 0; i < sizeof(signals_list)/sizeof(signals_list[0]); i++){
|
|
int sig = signals_list[i].signal;
|
|
if (sig == SIGKILL || sig == SIGSTOP){
|
|
continue;
|
|
}
|
|
signal_test3(sig);
|
|
}
|
|
return EXIT_SUCCESS;
|
|
} |