diff --git a/src/tests/system/kernel/Jamfile b/src/tests/system/kernel/Jamfile index 2a68ba76cf..b6472bf292 100644 --- a/src/tests/system/kernel/Jamfile +++ b/src/tests/system/kernel/Jamfile @@ -63,6 +63,11 @@ SimpleTest yield_test : yield_test.cpp ; +SimpleTest lock_node_test : + lock_node_test.cpp + : be + ; + SubInclude HAIKU_TOP src tests system kernel cache ; #SubInclude HAIKU_TOP src tests system kernel disk_device_manager ; SubInclude HAIKU_TOP src tests system kernel util ; diff --git a/src/tests/system/kernel/lock_node_test.cpp b/src/tests/system/kernel/lock_node_test.cpp new file mode 100644 index 0000000000..82d7a4c91b --- /dev/null +++ b/src/tests/system/kernel/lock_node_test.cpp @@ -0,0 +1,36 @@ +#include + +#include +#include + + +int +main(int argc, char **argv) +{ + if (argc != 2) { + fprintf(stderr, "usage: lock_node \n"); + return 1; + } + + BNode node; + status_t status = node.SetTo(argv[1]); + if (status != B_OK) { + fprintf(stderr, "lock_node: could not open \"%s\": %s\n", argv[1], strerror(status)); + return 1; + } + + status = node.Lock(); + if (status != B_OK) { + fprintf(stderr, "lock_node: could not lock \"%s\": %s\n", argv[1], strerror(status)); + return 1; + } + + puts("press to continue..."); + char a[5]; + fgets(a, 5, stdin); + + node.Unlock(); + node.Unset(); + return 0; +} +