linux-old/kernel/panic.c
<<
>>
Prefs
   1/*
   2 *  linux/kernel/panic.c
   3 *
   4 *  Copyright (C) 1991, 1992  Linus Torvalds
   5 */
   6
   7/*
   8 * This function is used through-out the kernel (including mm and fs)
   9 * to indicate a major problem.
  10 */
  11#include <stdarg.h>
  12
  13#include <linux/kernel.h>
  14#include <linux/sched.h>
  15
  16asmlinkage void sys_sync(void); /* it's really int */
  17
  18NORET_TYPE void panic(const char * fmt, ...)
  19{
  20        static char buf[1024];
  21        va_list args;
  22
  23        va_start(args, fmt);
  24        vsprintf(buf, fmt, args);
  25        va_end(args);
  26        printk(KERN_EMERG "Kernel panic: %s\n",buf);
  27        if (current == task[0])
  28                printk(KERN_EMERG "In swapper task - not syncing\n");
  29        else
  30                sys_sync();
  31        for(;;);
  32}
  33
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.