bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 11/14] add raw mach_msg tests


From: Luca Dariz
Subject: Re: [PATCH 11/14] add raw mach_msg tests
Date: Sat, 6 Jan 2024 19:33:59 +0100

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, &params);
+  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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]