~ubuntu-branches/ubuntu/utopic/coreutils/utopic-proposed

« back to all changes in this revision

Viewing changes to lib/sig-handler.h

  • Committer: Colin Watson
  • Date: 2013-10-30 15:48:33 UTC
  • mfrom: (8.3.5 sid)
  • Revision ID: cjwatson@canonical.com-20131030154833-xdt6e1yfffqom1c4
merge from Debian 8.21-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Convenience declarations when working with <signal.h>.
2
2
 
3
 
   Copyright (C) 2008-2012 Free Software Foundation, Inc.
 
3
   Copyright (C) 2008-2013 Free Software Foundation, Inc.
4
4
 
5
5
   This program is free software: you can redistribute it and/or modify
6
6
   it under the terms of the GNU General Public License as published by
20
20
 
21
21
#include <signal.h>
22
22
 
 
23
_GL_INLINE_HEADER_BEGIN
 
24
#ifndef SIG_HANDLER_INLINE
 
25
# define SIG_HANDLER_INLINE _GL_INLINE
 
26
#endif
 
27
 
23
28
/* Convenience type when working with signal handlers.  */
24
29
typedef void (*sa_handler_t) (int);
25
30
 
26
31
/* Return the handler of a signal, as a sa_handler_t value regardless
27
32
   of its true type.  The resulting function can be compared to
28
33
   special values like SIG_IGN but it is not portable to call it.  */
29
 
static inline sa_handler_t
 
34
SIG_HANDLER_INLINE sa_handler_t
30
35
get_handler (struct sigaction const *a)
31
36
{
32
37
#ifdef SA_SIGINFO
41
46
  return a->sa_handler;
42
47
}
43
48
 
 
49
_GL_INLINE_HEADER_END
 
50
 
44
51
#endif /* _GL_SIG_HANDLER_H */