diff options
| author | Takashi Iwai <tiwai@suse.de> | 2011-08-08 08:30:29 -0400 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2011-08-08 08:30:29 -0400 |
| commit | 0a2d31b62dba9b5b92a38c67c9cc42630513662a (patch) | |
| tree | f755d74ec85248de645e10c45ed1a2ed467530f6 /kernel/sys.c | |
| parent | 8039290a91c5dc4414093c086987a5d7738fe2fd (diff) | |
| parent | df944f66784e6d4f2f50739263a4947885d8b6ae (diff) | |
Merge branch 'fix/kconfig' into for-linus
Diffstat (limited to 'kernel/sys.c')
| -rw-r--r-- | kernel/sys.c | 32 |
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 | */ | ||
| 331 | int register_reboot_notifier(struct notifier_block *nb) | ||
| 332 | { | ||
| 333 | return blocking_notifier_chain_register(&reboot_notifier_list, nb); | ||
| 334 | } | ||
| 335 | EXPORT_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 | */ | ||
| 346 | int unregister_reboot_notifier(struct notifier_block *nb) | ||
| 347 | { | ||
| 348 | return blocking_notifier_chain_unregister(&reboot_notifier_list, nb); | ||
| 349 | } | ||
| 350 | EXPORT_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 |
