+#if 0
+ if (si->locking_disabled_p &&
+ si->nolock_reason &&
+ *si->nolock_reason)
+ {
+ /* If locking is disabled, it's because xscreensaver was launched
+ by root, and has relinquished its user id (most likely we are
+ now running as "nobody".) This means we won't be able to dump
+ core, since "nobody" can't write files; so don't even try.
+ */
+ fprintf(real_stderr, "%s: NOT dumping core (%s)\n", blurb(),
+ si->nolock_reason);
+ }
+ else
+#endif
+ {
+ /* Note that the Linux man page for setuid() says If uid is
+ different from the old effective uid, the process will be
+ forbidden from leaving core dumps.
+ */
+
+ char cwd[4096]; /* should really be PATH_MAX, but who cares. */
+ fprintf(real_stderr, "%s: dumping core (%s)\n", blurb(),
+ dump_core_reason);
+
+# if defined(HAVE_GETCWD)
+ getcwd (cwd, sizeof(cwd));
+# elif defined(HAVE_GETWD)
+ getwd (cwd);
+# else
+ strcpy(cwd, "unknown.");
+# endif
+ fprintf (real_stderr, "%s: current directory is %s\n", blurb(), cwd);
+ describe_uids (si, real_stderr);
+
+ /* Do this to drop a core file, so that we can get a stack trace. */
+ abort();
+ }