[Suspend2][ 04/13] [Suspend2] Notify userspace of a new message.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wake up a userspace process when we have a new netlink message for it to
process.

Signed-off-by: Nigel Cunningham <[email protected]>

 kernel/power/netlink.c |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/kernel/power/netlink.c b/kernel/power/netlink.c
index 82a9f6d..c8c543a 100644
--- a/kernel/power/netlink.c
+++ b/kernel/power/netlink.c
@@ -65,3 +65,17 @@ static void put_skb(struct user_helper_d
 		kfree_skb(skb);
 }
 
+
+static void suspend_notify_userspace(void* data)
+{
+	struct task_struct *t;
+	struct user_helper_data *uhd = (struct user_helper_data *) data;
+
+	BUG_ON(!uhd);
+
+	read_lock(&tasklist_lock);
+	if ((t = find_task_by_pid(uhd->pid)))
+		wake_up_process(t);
+	read_unlock(&tasklist_lock);
+}
+

--
Nigel Cunningham		nigel at suspend2 dot net
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux