From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 26414 invoked from network); 8 Dec 1998 21:19:00 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 8 Dec 1998 21:18:59 -0000 Received: from saturn.aladdin.de (saturn.aladdin.de [194.123.19.3]) by mail.redhat.com (8.8.7/8.8.7) with SMTP id QAA24650 for ; Tue, 8 Dec 1998 16:13:04 -0500 Received: by saturn.aladdin.de(Lotus SMTP MTA v4.6.2 (693.3 8-11-1998)) id 412566D4.0074F6FA ; Tue, 8 Dec 1998 22:17:34 +0100 X-Lotus-FromDomain: AKS From: "Christian Groessler" To: nbecker@fred.net cc: ericding@applix.com, axp-list@redhat.com Message-ID: <412566D4.0074F6BB.00@saturn.aladdin.de> Date: Tue, 8 Dec 1998 22:13:08 +0100 Subject: Re: How do I find/fix unaligned accesses? Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline >Isn't there a syscall to stop kernel unaligned trap fixup? The following code I've got from this mail list iirc, but cannot remember from who it was. Sorry. This program will spawn a subshell, in which unaligned accessed generate a bus fault. ------------ /* 28-May-98, chris */ #ifndef __linux__ #include #else #include #include static int setsysinfo(unsigned long op, void *buffer, unsigned long size, int *start, void *arg, unsigned long flag) { syscall(__NR_osf_setsysinfo, op, buffer, size, start, arg, flag); } #endif void trap_unaligned(void) { unsigned int buf[2]; buf[0] = SSIN_UACPROC; buf[1] = UAC_SIGBUS | UAC_NOPRINT; setsysinfo(SSI_NVPAIRS, buf, 1, 0, 0, 0); } int main(int ac) { trap_unaligned(); printf("creating subshell with SIGBUS setting!\n"); execl("/bin/bash","/bin/bash",(char *)0); return(0); /* not reached */ } ------------