@@ -239,6 +239,20 @@ TEST(SyscallExit, acceptX_UNIX)
239
239
int connected_socket_fd = syscall (__NR_accept, server_socket_fd, NULL , NULL );
240
240
assert_syscall_state (SYSCALL_SUCCESS, " accept (server)" , connected_socket_fd, NOT_EQUAL, -1 );
241
241
242
+ /* In unix sockets the maximum queue length seems to be 512. */
243
+ FILE *f = fopen (" /proc/sys/net/unix/max_dgram_qlen" , " r" );
244
+ if (f == NULL )
245
+ {
246
+ FAIL () << " 'fopen' must not fail." << std::endl;
247
+ }
248
+ int unix_max_queue_len = 0 ;
249
+ if (fscanf (f, " %d" , &unix_max_queue_len) != 1 )
250
+ {
251
+ fclose (f);
252
+ FAIL () << " 'fscanf' must not fail." << std::endl;
253
+ }
254
+ fclose (f);
255
+
242
256
/* Cleaning phase */
243
257
syscall (__NR_shutdown, connected_socket_fd, 2 );
244
258
syscall (__NR_shutdown, server_socket_fd, 2 );
@@ -282,17 +296,6 @@ TEST(SyscallExit, acceptX_UNIX)
282
296
evt_test->assert_numeric_param (4 , (uint32_t )0 );
283
297
284
298
/* Parameter 5: queuemax (type: PT_UINT32) */
285
- /* In unix sockets the maximum queue length seems to be 512. */
286
- FILE *f = fopen (" /proc/sys/net/unix/max_dgram_qlen" , " r" );
287
- if (f == NULL )
288
- {
289
- FAIL () << " 'fopen' must not fail." << std::endl;
290
- }
291
- int unix_max_queue_len = 0 ;
292
- if (fscanf (f, " %d" , &unix_max_queue_len) != 1 )
293
- {
294
- FAIL () << " 'fscanf' must not fail." << std::endl;
295
- }
296
299
evt_test->assert_numeric_param (5 , (uint32_t )unix_max_queue_len);
297
300
298
301
/* =============================== ASSERT PARAMETERS ===========================*/
0 commit comments