Il 29/12/23 15:20, Samuel Thibault ha scritto:
Luca Dariz, le jeu. 28 déc. 2023 20:42:58 +0100, a ecrit:
+
+#define align_inline(val, n) { val = align(val, n); }
Rather name it ALIGN_INLINE, so people don't mistake this for a
function (that doesn't have side-effects on its parameters).
ok
+void
+run_test_simple(void *msg, mach_msg_size_t msglen, mach_msg_id_t msgid)
+{
+ mach_msg_header_t *head = msg;
+ mach_port_t port, receive;
+ int err;
+
+ err = syscall_mach_port_allocate (mach_task_self (),
+ MACH_PORT_RIGHT_RECEIVE, &port);
+ ASSERT_RET(err, "syscall_mach_port_allocate");
+
+ err = syscall_mach_port_allocate (mach_task_self (),
+ MACH_PORT_RIGHT_RECEIVE, &receive);
+ ASSERT_RET(err, "syscall_mach_port_allocate 2");
+
+ struct echo_params params;
+ params.rx_port = port;
+ params.rx_size = msglen;
+ params.rx_number = 1;
+ test_thread_start (mach_task_self (), echo_thread, ¶ms);
+ msleep(100);
Is this msleep really needed? If yes, this is racy. If it's just to make
the test a bit more stressful, then ok.
not really, I'll remove it
Luca