(root)/
strace-6.5/
tests-m32/
printsignal.c
       1  /*
       2   * Copyright (c) 2014-2018 The strace developers.
       3   * All rights reserved.
       4   *
       5   * SPDX-License-Identifier: GPL-2.0-or-later
       6   */
       7  #include "tests.h"
       8  #include <signal.h>
       9  #include <stdio.h>
      10  #include <unistd.h>
      11  
      12  int
      13  main(void)
      14  {
      15  	const pid_t pid = getpid();
      16  	int rc = kill(pid, SIGCONT);
      17  #if XLAT_RAW
      18  	printf("kill(%d, %d) = %s\n", pid, SIGCONT, sprintrc(rc));
      19  #elif XLAT_VERBOSE
      20  	printf("kill(%d, %d /* SIGCONT */) = %s\n", pid, SIGCONT, sprintrc(rc));
      21  #else /* XLAT_ABBREV */
      22  	printf("kill(%d, SIGCONT) = %s\n", pid, sprintrc(rc));
      23  #endif
      24  
      25  	static const int sigs[] = { 0, 256, -1 };
      26  	for (unsigned int i = 0; i < ARRAY_SIZE(sigs); ++i) {
      27  		rc = kill(pid, sigs[i]);
      28  		printf("kill(%d, %d) = %s\n", pid, sigs[i], sprintrc(rc));
      29  	}
      30  
      31  	printf("+++ exited with 0 +++\n");
      32  	return 0;
      33  }