1 /*- 2 * Copyright (c) 1986 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Computer Consoles Inc. 7 * 8 * %sccs.include.redist.c% 9 * 10 * @(#)Aget_byte.c 7.1 (Berkeley) 12/06/90 11 */ 12 13 #include "align.h" 14 int get_byte (infop, address) 15 process_info *infop; 16 char *address; 17 /* 18 /* Fetch the byte at the given 'address' from memory. 19 /* Caveat: It's quite difficult to find a pte reference 20 /* fault. So I took the easy way out and just signal 21 /* an illegal access. 22 /* 23 /**************************************************/ 24 { 25 register long code; 26 27 code = readable(infop, (long)address, 1); 28 if ( code == TRUE ) { 29 return(*address); 30 } else exception (infop, ILL_ACCESS, address, code); 31 } 32