diff --git a/script/testdata/Makefile b/script/testdata/Makefile index 9db92fd549..22ffd1d0bf 100644 --- a/script/testdata/Makefile +++ b/script/testdata/Makefile @@ -14,8 +14,9 @@ COMMON_CFLAGS := -O3 \ -I deps/ckb-c-stdlib/libc \ -I deps/ckb-c-stdlib/molecule \ -Wall -Werror \ - -fno-builtin -nostdinc -nostartfiles \ - -Wno-stringop-overflow + -fno-builtin -nostdinc -nostartfiles \ + -Wno-stringop-overflow \ + -Wno-array-bounds # enable ckb-c-stdlib's printf COMMON_CFLAGS += -DCKB_C_STDLIB_PRINTF -DCKB_C_STDLIB_PRINTF_BUFFER_SIZE=1024 diff --git a/script/testdata/cpop_lock b/script/testdata/cpop_lock index 983cacff78..efc1e4a3fb 100755 Binary files a/script/testdata/cpop_lock and b/script/testdata/cpop_lock differ diff --git a/script/testdata/debugger b/script/testdata/debugger index c679d6289d..62d9fad082 100755 Binary files a/script/testdata/debugger and b/script/testdata/debugger differ diff --git a/script/testdata/exec_configurable_callee b/script/testdata/exec_configurable_callee index 0fd19349a2..233a136d14 100755 Binary files a/script/testdata/exec_configurable_callee and b/script/testdata/exec_configurable_callee differ diff --git a/script/testdata/infinite_loop b/script/testdata/infinite_loop index 778627008a..841054ff28 100755 Binary files a/script/testdata/infinite_loop and b/script/testdata/infinite_loop differ diff --git a/script/testdata/load_arithmetic b/script/testdata/load_arithmetic index df1c203761..a86fffdc5a 100755 Binary files a/script/testdata/load_arithmetic and b/script/testdata/load_arithmetic differ diff --git a/script/testdata/spawn_callee_exec_caller b/script/testdata/spawn_callee_exec_caller index 671dd0acd2..e49d3caaef 100755 Binary files a/script/testdata/spawn_callee_exec_caller and b/script/testdata/spawn_callee_exec_caller differ diff --git a/script/testdata/spawn_callee_strcat b/script/testdata/spawn_callee_strcat index 8f5d76ed3b..d480d3acd5 100755 Binary files a/script/testdata/spawn_callee_strcat and b/script/testdata/spawn_callee_strcat differ diff --git a/script/testdata/spawn_callee_strcat.c b/script/testdata/spawn_callee_strcat.c index 56daa801d8..07e7c76ba9 100644 --- a/script/testdata/spawn_callee_strcat.c +++ b/script/testdata/spawn_callee_strcat.c @@ -18,7 +18,7 @@ int main(int argc, char *argv[]) { size_t content_size = (uint64_t)strlen(content); uint64_t fds[2] = {0}; uint64_t length = countof(fds); - err = ckb_inherited_file_descriptors(fds, &length); + err = ckb_inherited_fds(fds, &length); CHECK(err); CHECK2(length == 2, ErrorCommon); size_t content_size2 = content_size; diff --git a/script/testdata/spawn_caller_current_cycles b/script/testdata/spawn_caller_current_cycles index d4d464dd27..22c07bcc7c 100755 Binary files a/script/testdata/spawn_caller_current_cycles and b/script/testdata/spawn_caller_current_cycles differ diff --git a/script/testdata/spawn_caller_out_of_cycles b/script/testdata/spawn_caller_out_of_cycles index 158c256802..1ec80d63ea 100755 Binary files a/script/testdata/spawn_caller_out_of_cycles and b/script/testdata/spawn_caller_out_of_cycles differ diff --git a/script/testdata/spawn_caller_strcat b/script/testdata/spawn_caller_strcat index f56aafa13f..2c556fab73 100755 Binary files a/script/testdata/spawn_caller_strcat and b/script/testdata/spawn_caller_strcat differ diff --git a/script/testdata/spawn_caller_strcat_wrap b/script/testdata/spawn_caller_strcat_wrap index 10aa1fa266..cd8c70cb06 100755 Binary files a/script/testdata/spawn_caller_strcat_wrap and b/script/testdata/spawn_caller_strcat_wrap differ diff --git a/script/testdata/spawn_cases b/script/testdata/spawn_cases index 2742af8b3e..f01661b8b9 100755 Binary files a/script/testdata/spawn_cases and b/script/testdata/spawn_cases differ diff --git a/script/testdata/spawn_cases.c b/script/testdata/spawn_cases.c index 1729bf0bea..1aa3aa7cb9 100644 --- a/script/testdata/spawn_cases.c +++ b/script/testdata/spawn_cases.c @@ -33,7 +33,7 @@ int child_simple_read_write() { int err = 0; uint64_t inherited_fds[2]; size_t inherited_fds_length = 2; - err = ckb_inherited_file_descriptors(inherited_fds, &inherited_fds_length); + err = ckb_inherited_fds(inherited_fds, &inherited_fds_length); // read for (size_t i = 0; i < 11; i++) { uint8_t block[7] = {0}; @@ -76,7 +76,7 @@ int child_write_dead_lock() { int err = 0; uint64_t inherited_fds[3] = {0}; size_t inherited_fds_length = 3; - err = ckb_inherited_file_descriptors(inherited_fds, &inherited_fds_length); + err = ckb_inherited_fds(inherited_fds, &inherited_fds_length); CHECK(err); uint8_t data[10]; size_t data_length = sizeof(data); @@ -174,7 +174,7 @@ int child_read_write_with_close() { int err = 0; uint64_t inherited_fds[2]; size_t inherited_fds_length = 2; - err = ckb_inherited_file_descriptors(inherited_fds, &inherited_fds_length); + err = ckb_inherited_fds(inherited_fds, &inherited_fds_length); CHECK(err); // read 100 bytes and close @@ -235,20 +235,20 @@ int child_inherited_fds() { // correct way to get fd length size_t fds_length = 0; - err = ckb_inherited_file_descriptors(0, &fds_length); + err = ckb_inherited_fds(0, &fds_length); CHECK2(fds_length == 10, -2); // get part of fds uint64_t fds[11] = {0}; fds_length = 1; - err = ckb_inherited_file_descriptors(fds, &fds_length); + err = ckb_inherited_fds(fds, &fds_length); CHECK(err); CHECK2(fds_length == 10, -2); CHECK2(fds[0] == 2, -2); // get all fds fds_length = 10; - err = ckb_inherited_file_descriptors(fds, &fds_length); + err = ckb_inherited_fds(fds, &fds_length); CHECK(err); CHECK2(fds_length == 10, -2); for (size_t i = 0; i < 10; i++) { @@ -298,7 +298,7 @@ int child_read_then_close() { int err = 0; uint64_t fds[2] = {0}; uint64_t fds_length = 2; - err = ckb_inherited_file_descriptors(fds, &fds_length); + err = ckb_inherited_fds(fds, &fds_length); CHECK(err); uint8_t data[8]; size_t data_len = sizeof(data); @@ -404,7 +404,7 @@ int child_write_closed_fd() { int err = 0; uint64_t inherited_fds[2]; size_t inherited_fds_length = 2; - err = ckb_inherited_file_descriptors(inherited_fds, &inherited_fds_length); + err = ckb_inherited_fds(inherited_fds, &inherited_fds_length); CHECK(err); uint8_t block[7] = {0}; @@ -459,7 +459,7 @@ int child_pid() { int err = 0; uint64_t fds[2] = {0}; uint64_t fds_length = 2; - err = ckb_inherited_file_descriptors(fds, &fds_length); + err = ckb_inherited_fds(fds, &fds_length); CHECK(err); // send pid diff --git a/script/testdata/spawn_configurable_callee b/script/testdata/spawn_configurable_callee index 20b1024ecd..df6ab63772 100755 Binary files a/script/testdata/spawn_configurable_callee and b/script/testdata/spawn_configurable_callee differ diff --git a/script/testdata/spawn_configurable_callee.c b/script/testdata/spawn_configurable_callee.c index 92b849b35b..019f304868 100644 --- a/script/testdata/spawn_configurable_callee.c +++ b/script/testdata/spawn_configurable_callee.c @@ -9,7 +9,7 @@ int main() { uint64_t fds[2] = {0}; uint64_t fds_len = countof(fds); - err = ckb_inherited_file_descriptors(fds, &fds_len); + err = ckb_inherited_fds(fds, &fds_len); CHECK(err); CHECK2(fds_len == 2, ErrorCommon); diff --git a/script/testdata/spawn_configurable_caller b/script/testdata/spawn_configurable_caller index f1620466f9..72c04e613c 100755 Binary files a/script/testdata/spawn_configurable_caller and b/script/testdata/spawn_configurable_caller differ diff --git a/script/testdata/spawn_cycles b/script/testdata/spawn_cycles index 77d40c54fe..83f88f4df0 100755 Binary files a/script/testdata/spawn_cycles and b/script/testdata/spawn_cycles differ diff --git a/script/testdata/spawn_cycles.c b/script/testdata/spawn_cycles.c index a338d73d4b..6b8dcec067 100644 --- a/script/testdata/spawn_cycles.c +++ b/script/testdata/spawn_cycles.c @@ -155,7 +155,7 @@ int main() { case 4: len = 2; toc = tic(); - err = ckb_inherited_file_descriptors(fds[cid][1], &len); + err = ckb_inherited_fds(fds[cid][1], &len); CHECK(err); toc = tic(); CHECK2(toc > cal_cycles_floor(1, 1, 0), ErrorCommon); diff --git a/script/testdata/spawn_dag b/script/testdata/spawn_dag index b88dedb7fd..10648d6abd 100755 Binary files a/script/testdata/spawn_dag and b/script/testdata/spawn_dag differ diff --git a/script/testdata/spawn_fuzzing b/script/testdata/spawn_fuzzing index 0c1602e09a..8110861896 100755 Binary files a/script/testdata/spawn_fuzzing and b/script/testdata/spawn_fuzzing differ diff --git a/script/testdata/spawn_fuzzing.c b/script/testdata/spawn_fuzzing.c index 7702717c0a..c93a31751b 100644 --- a/script/testdata/spawn_fuzzing.c +++ b/script/testdata/spawn_fuzzing.c @@ -97,7 +97,7 @@ int child_entry() { int err = 0; uint64_t inherited_fds[2]; size_t inherited_fds_length = 2; - err = ckb_inherited_file_descriptors(inherited_fds, &inherited_fds_length); + err = ckb_inherited_fds(inherited_fds, &inherited_fds_length); CHECK(err); random_read_write(inherited_fds, 0); diff --git a/script/testdata/spawn_huge_swap b/script/testdata/spawn_huge_swap index 3d7ab1ca7a..dc36e34714 100755 Binary files a/script/testdata/spawn_huge_swap and b/script/testdata/spawn_huge_swap differ diff --git a/script/testdata/spawn_huge_swap.c b/script/testdata/spawn_huge_swap.c index 2666857631..8376a45cc1 100644 --- a/script/testdata/spawn_huge_swap.c +++ b/script/testdata/spawn_huge_swap.c @@ -32,7 +32,7 @@ int main() { } else if (current_pid == 1) { uint64_t inherited_fds[3]; size_t fds_len = 3; - err = ckb_inherited_file_descriptors(inherited_fds, &fds_len); + err = ckb_inherited_fds(inherited_fds, &fds_len); CHECK(err); uint8_t buf[1] = {0}; while (true) { @@ -43,7 +43,7 @@ int main() { } else if (current_pid == 2) { uint64_t inherited_fds[3]; size_t fds_len = 3; - err = ckb_inherited_file_descriptors(inherited_fds, &fds_len); + err = ckb_inherited_fds(inherited_fds, &fds_len); CHECK(err); uint8_t buf[1] = {0}; while (true) { @@ -62,4 +62,4 @@ int main() { exit: return err; -} \ No newline at end of file +} diff --git a/script/testdata/spawn_io_cycles b/script/testdata/spawn_io_cycles index e77022ac8b..83a7aaea7c 100755 Binary files a/script/testdata/spawn_io_cycles and b/script/testdata/spawn_io_cycles differ diff --git a/script/testdata/spawn_io_cycles.c b/script/testdata/spawn_io_cycles.c index e58151f4d8..c250b3477f 100644 --- a/script/testdata/spawn_io_cycles.c +++ b/script/testdata/spawn_io_cycles.c @@ -42,7 +42,7 @@ int child(ScriptArgs* args, uint8_t* buffer) { int err = 0; uint64_t inherited_fds[2]; size_t inherited_fds_length = 2; - err = ckb_inherited_file_descriptors(inherited_fds, &inherited_fds_length); + err = ckb_inherited_fds(inherited_fds, &inherited_fds_length); CHECK(err); uint64_t buf_len = args->io_size; diff --git a/script/testdata/spawn_recursive b/script/testdata/spawn_recursive index 80d777b5be..500c26dd55 100755 Binary files a/script/testdata/spawn_recursive and b/script/testdata/spawn_recursive differ diff --git a/script/testdata/spawn_saturate_memory b/script/testdata/spawn_saturate_memory index 08e51f96c8..ef1cd12cd8 100755 Binary files a/script/testdata/spawn_saturate_memory and b/script/testdata/spawn_saturate_memory differ diff --git a/script/testdata/spawn_saturate_memory.c b/script/testdata/spawn_saturate_memory.c index de977b10db..545671ab23 100644 --- a/script/testdata/spawn_saturate_memory.c +++ b/script/testdata/spawn_saturate_memory.c @@ -21,7 +21,7 @@ int main(int argc, const char* argv[]) { dirty_all_pages(); uint64_t inherited_fds[2]; size_t inherited_fds_length = 2; - err = ckb_inherited_file_descriptors(inherited_fds, &inherited_fds_length); + err = ckb_inherited_fds(inherited_fds, &inherited_fds_length); uint64_t length = MAX_MEMORY; // Write a piece of data starting from address 0 with a size of 4M. // It should not consume any memory. diff --git a/script/testdata/spawn_times b/script/testdata/spawn_times index 0eed0c30ae..b6fe69fad9 100755 Binary files a/script/testdata/spawn_times and b/script/testdata/spawn_times differ