Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *  include/linux/signalfd.h
0004  *
0005  *  Copyright (C) 2007  Davide Libenzi <davidel@xmailserver.org>
0006  *
0007  */
0008 #ifndef _LINUX_SIGNALFD_H
0009 #define _LINUX_SIGNALFD_H
0010 
0011 #include <uapi/linux/signalfd.h>
0012 #include <linux/sched/signal.h>
0013 
0014 #ifdef CONFIG_SIGNALFD
0015 
0016 /*
0017  * Deliver the signal to listening signalfd.
0018  */
0019 static inline void signalfd_notify(struct task_struct *tsk, int sig)
0020 {
0021     if (unlikely(waitqueue_active(&tsk->sighand->signalfd_wqh)))
0022         wake_up(&tsk->sighand->signalfd_wqh);
0023 }
0024 
0025 extern void signalfd_cleanup(struct sighand_struct *sighand);
0026 
0027 #else /* CONFIG_SIGNALFD */
0028 
0029 static inline void signalfd_notify(struct task_struct *tsk, int sig) { }
0030 
0031 static inline void signalfd_cleanup(struct sighand_struct *sighand) { }
0032 
0033 #endif /* CONFIG_SIGNALFD */
0034 
0035 #endif /* _LINUX_SIGNALFD_H */