diagdummy Test concurrent openfs

This commit is contained in:
2025-11-10 20:23:28 +01:00
parent 7e3b162591
commit d81d1133dd
3 changed files with 20 additions and 11 deletions

View File

@ -1,6 +0,0 @@
#ifndef DIAGDUMMY_BLOCK_H_
#define DIAGDUMMY_BLOCK_H_
void diagdummy_block(void);
#endif // DIAGDUMMY_BLOCK_H_

View File

@ -1,5 +1,7 @@
#include <ulib.h> #include <ulib.h>
#include "block.h"
#define CMDS(X) \
X(block) X(openf)
void main(void) { void main(void) {
if (argslen() == 0) { if (argslen() == 0) {
@ -9,9 +11,13 @@ void main(void) {
char *cmd = args()[0]; char *cmd = args()[0];
if (string_strcmp(cmd, "block") == 0) { #define X(name) if (string_strcmp(cmd, #name) == 0) { \
diagdummy_block(); extern void diagdummy_ ## name(void); \
} else { diagdummy_ ## name(); \
uprintf("diagdummy: unknown cmd %s\n", cmd); return; \
} }
CMDS(X)
#undef X
uprintf("diagdummy: unknown cmd %s\n", cmd);
} }

9
user/diagdummy/openf.c Normal file
View File

@ -0,0 +1,9 @@
#include <stdint.h>
#include <stddef.h>
#include <ulib.h>
void diagdummy_openf(void) {
fsh_t h = fs_openf("base:/bin/init", FS_OF_READ);
uprintf("h = %d\n", h);
for(;;);
}