aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index e4128b278f23..a101ba36c444 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -8,7 +8,6 @@
8#include <linux/mm.h> 8#include <linux/mm.h>
9#include <linux/utsname.h> 9#include <linux/utsname.h>
10#include <linux/mman.h> 10#include <linux/mman.h>
11#include <linux/notifier.h>
12#include <linux/reboot.h> 11#include <linux/reboot.h>
13#include <linux/prctl.h> 12#include <linux/prctl.h>
14#include <linux/highuid.h> 13#include <linux/highuid.h>
@@ -320,6 +319,37 @@ void kernel_restart_prepare(char *cmd)
320} 319}
321 320
322/** 321/**
322 * register_reboot_notifier - Register function to be called at reboot time
323 * @nb: Info about notifier function to be called
324 *
325 * Registers a function with the list of functions
326 * to be called at reboot time.
327 *
328 * Currently always returns zero, as blocking_notifier_chain_register()
329 * always returns zero.
330 */
331int register_reboot_notifier(struct notifier_block *nb)
332{
333 return blocking_notifier_chain_register(&reboot_notifier_list, nb);
334}
335EXPORT_SYMBOL(register_reboot_notifier);
336
337/**
338 * unregister_reboot_notifier - Unregister previously registered reboot notifier
339 * @nb: Hook to be unregistered
340 *
341 * Unregisters a previously registered reboot
342 * notifier function.
343 *
344 * Returns zero on success, or %-ENOENT on failure.
345 */
346int unregister_reboot_notifier(struct notifier_block *nb)
347{
348 return blocking_notifier_chain_unregister(&reboot_notifier_list, nb);
349}
350EXPORT_SYMBOL(unregister_reboot_notifier);
351
352/**
323 * kernel_restart - reboot the system 353 * kernel_restart - reboot the system
324 * @cmd: pointer to buffer containing command to execute for restart 354 * @cmd: pointer to buffer containing command to execute for restart
325 * or %NULL 355 * or %NULL