ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/getpagesize.c
Revision: 2.3
Committed: Wed Oct 20 11:44:30 1993 UTC (30 years, 6 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.2: +10 -2 lines
Log Message:
added entry for Solaris

File Contents

# Content
1 /* Copyright (c) 1993 Regents of the University of California */
2
3 #ifndef lint
4 static char SCCSid[] = "$SunId$ LBL";
5 #endif
6
7 /*
8 * Return system page size for non-BSD machine.
9 */
10
11 #ifndef BSD
12
13 #if defined(_AUX_SOURCE) /* Apple's A/UX */
14
15 #include <sys/var.h>
16 int
17 getpagesize() /* use var structure to get page size */
18 {
19 struct var v;
20 uvar(&v);
21 return(1 << v.v_pageshift);
22 }
23
24 #else
25 #if defined(hpux) /* Hewlett Packard's HPUX */
26
27 #include <machine/param.h>
28 int
29 getpagesize()
30 {
31 return(NBPG_PA83); /* This is supposed to be ok for PA-RISC 1.0, but
32 I don't know about 1.1 (i.e. Snakes) */
33 }
34
35 #else
36 #if defined(sparc)
37
38 #include <unistd.h>
39 int getpagesize()
40 {
41 return (int)sysconf(_SC_PAGESIZE);
42 }
43 #else /* Unknown version of UNIX */
44 #ifndef PAGESIZE
45 #define PAGESIZE 8192 /* Guess on the high side */
46 #endif
47 int
48 getpagesize()
49 {
50 return(PAGESIZE);
51 }
52
53 #endif
54 #endif
55 #endif
56
57 #endif /* !BSD */