Does sysrq break something?

From: Tetsuo Handa
Date: Mon May 12 2008 - 08:16:48 EST


Hello.

I'm trying to get a sysrq dump when the system hangs.
But unfortunately, typing sysrq key from the keyboard
doesn't work after the system hangs.
So, I'm trying to get a sysrq dump by automatically
writing to /proc/sysrq-trigger using a program.

#include <stdio.h>
#include <unistd.h>

int main(int argc, char *argv[]) {
FILE *fp = fopen("/proc/sys/kernel/sysrq", "w");
if (!fp) return 1;
fprintf(fp, "1\n");
fclose(fp);
fp = fopen("/proc/sysrq-trigger", "w");
if (!fp) return 1;
while (1) {
sleep(60);
fprintf(fp, "t\n");
fflush(fp);
}
return 0;
}

Is running this program safe?

In other words, does invoking sysrq routine break or taint something?

Regards.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/