(root)/
strace-6.5/
tests/
filter_seccomp-perf.c
       1  /*
       2   * Check seccomp filter performance.
       3   *
       4   * Copyright (c) 2019 Paul Chaignon <paul.chaignon@gmail.com>
       5   * Copyright (c) 2018-2021 The strace developers.
       6   * All rights reserved.
       7   *
       8   * SPDX-License-Identifier: GPL-2.0-or-later
       9   */
      10  
      11  #include "tests.h"
      12  #include <signal.h>
      13  #include <stdbool.h>
      14  #include <stdio.h>
      15  #include <unistd.h>
      16  
      17  static volatile bool stop = false;
      18  
      19  static void
      20  handler(int signo)
      21  {
      22  	stop = true;
      23  }
      24  
      25  int
      26  main(void)
      27  {
      28  	unsigned int i;
      29  	int rc = 0;
      30  
      31  	signal(SIGALRM, handler);
      32  	alarm(3);
      33  
      34  	for (i = 0; !stop; i++) {
      35  		rc |= chdir(".");
      36  	}
      37  	printf("%d\n", i);
      38  	return rc;
      39  }