aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2004-09-24 06:29:07 +0000
committerNeil Conway <neilc@samurai.com>2004-09-24 06:29:07 +0000
commitae72283816e7466ee9e7e93c9d36f5f5c362680f (patch)
tree79cfdf612776d1f3026deb4a230551a3f8b9aeb4 /src
parent3331180bb4bb04d5d3ba3c39fbf721184b9f08b7 (diff)
downloadpostgresql-ae72283816e7466ee9e7e93c9d36f5f5c362680f.tar.gz
postgresql-ae72283816e7466ee9e7e93c9d36f5f5c362680f.zip
Cleanup some ancient Ultrix / Alpha code in main() that is intended to
modify how unaligned memory accesses are dealt with. Document that this is really what is going on, and merge the NOFIXADE and NOPRINTADE code paths.
Diffstat (limited to 'src')
-rw-r--r--src/backend/main/main.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/backend/main/main.c b/src/backend/main/main.c
index df9c776b602..bcab85cbc57 100644
--- a/src/backend/main/main.c
+++ b/src/backend/main/main.c
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/main/main.c,v 1.89 2004/08/29 05:06:43 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/main/main.c,v 1.90 2004/09/24 06:29:07 neilc Exp $
*
*-------------------------------------------------------------------------
*/
@@ -71,18 +71,23 @@ main(int argc, char *argv[])
#if defined(__alpha) /* no __alpha__ ? */
#ifdef NOFIXADE
- int buffer[] = {SSIN_UACPROC, UAC_SIGBUS};
-#endif /* NOFIXADE */
-#ifdef NOPRINTADE
- int buffer[] = {SSIN_UACPROC, UAC_NOPRINT};
-#endif /* NOPRINTADE */
+ int buffer[] = {SSIN_UACPROC, UAC_SIGBUS | UAC_NOPRINT};
+#endif
#endif /* __alpha */
#ifdef WIN32
char *env_locale;
#endif
-#if defined(NOFIXADE) || defined(NOPRINTADE)
+ /*
+ * On some platforms, unaligned memory accesses result in a kernel
+ * trap; the default kernel behavior is to emulate the memory
+ * access, but this results in a significant performance
+ * penalty. We ought to fix PG not to make such unaligned memory
+ * accesses, so this code disables the kernel emulation: unaligned
+ * accesses will result in SIGBUS instead.
+ */
+#ifdef NOFIXADE
#if defined(ultrix4)
syscall(SYS_sysmips, MIPS_FIXADE, 0, NULL, NULL, NULL);
@@ -94,7 +99,7 @@ main(int argc, char *argv[])
write_stderr("%s: setsysinfo failed: %s\n",
argv[0], strerror(errno));
#endif
-#endif /* NOFIXADE || NOPRINTADE */
+#endif /* NOFIXADE */
#if defined(WIN32)
{