Skip to content
  • Jesper Juhl's avatar
    [PATCH] new valid_signal() function · e5bdd883
    Jesper Juhl authored
    
    
    This patch adds a new function valid_signal() that tests if its argument is
    a valid signal number.
    
    The reasons for adding this new function are:
    
    - some code currently testing _NSIG directly has off-by-one errors.
      Using this function instead avoids such errors.
    
    - some code currently tests unsigned signal numbers for <0 which is
      pointless and generates warnings when building with gcc -W.  Using this
      function instead avoids such warnings.
    
    I considered various places to add this function but eventually settled on
    include/linux/signal.h as the most logical place for it.  If there's some
    reason this is a bad choice then please let me know (hints as to a better
    location are then welcome of course).
    
    Signed-off-by: default avatarJesper Juhl <juhl-lkml@dif.dk>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    e5bdd883