Mirror of strace – the linux syscall tracer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

kill_save_errno.h 449B

123456789101112131415161718192021222324
  1. /*
  2. * Copyright (c) 2012-2018 The strace developers.
  3. * All rights reserved.
  4. *
  5. * SPDX-License-Identifier: LGPL-2.1-or-later
  6. */
  7. #ifndef STRACE_KILL_SAVE_ERRNO_H
  8. # define STRACE_KILL_SAVE_ERRNO_H
  9. # include <sys/types.h>
  10. # include <signal.h>
  11. # include <errno.h>
  12. static inline int
  13. kill_save_errno(pid_t pid, int sig)
  14. {
  15. int saved_errno = errno;
  16. int rc = kill(pid, sig);
  17. errno = saved_errno;
  18. return rc;
  19. }
  20. #endif /* !STRACE_KILL_SAVE_ERRNO_H */