signalfd.h 747 字节
Newer Older
1 2 3 4 5 6 7 8 9
/*
 *  include/linux/signalfd.h
 *
 *  Copyright (C) 2007  Davide Libenzi <davidel@xmailserver.org>
 *
 */
#ifndef _LINUX_SIGNALFD_H
#define _LINUX_SIGNALFD_H

10
#include <uapi/linux/signalfd.h>
11 12 13 14 15


#ifdef CONFIG_SIGNALFD

/*
D
Davide Libenzi 已提交
16
 * Deliver the signal to listening signalfd.
17 18 19
 */
static inline void signalfd_notify(struct task_struct *tsk, int sig)
{
D
Davide Libenzi 已提交
20 21
	if (unlikely(waitqueue_active(&tsk->sighand->signalfd_wqh)))
		wake_up(&tsk->sighand->signalfd_wqh);
22 23
}

24 25
extern void signalfd_cleanup(struct sighand_struct *sighand);

26 27
#else /* CONFIG_SIGNALFD */

D
Davide Libenzi 已提交
28
static inline void signalfd_notify(struct task_struct *tsk, int sig) { }
29

30 31
static inline void signalfd_cleanup(struct sighand_struct *sighand) { }

32 33 34
#endif /* CONFIG_SIGNALFD */

#endif /* _LINUX_SIGNALFD_H */