2 * cvfs.c -- ckkv() function for lsof library
7 * Copyright 1998 Purdue Research Foundation, West Lafayette, Indiana
8 * 47907. All rights reserved.
10 * Written by Victor A. Abell
12 * This software is not subject to any license of the American Telephone
13 * and Telegraph Company or the Regents of the University of California.
15 * Permission is granted to anyone to use this software for any purpose on
16 * any computer system, and to alter it and redistribute it freely, subject
17 * to the following restrictions:
19 * 1. Neither the authors nor Purdue University are responsible for any
20 * consequences of the use of this software.
22 * 2. The origin of this software must not be misrepresented, either by
23 * explicit claim or by omission. Credit to the authors and Purdue
24 * University must appear in documentation and sources.
26 * 3. Altered versions must be plainly marked as such, and must not be
27 * misrepresented as being the original software.
29 * 4. This notice may not be removed or altered.
33 #include "../machine.h"
35 #if defined(USE_LIB_CKKV)
38 static char copyright[] =
39 "@(#) Copyright 1998 Purdue Research Foundation.\nAll rights reserved.\n";
40 static char *rcsid = "$Id: ckkv.c,v 1.3 2008/10/21 16:12:36 abe Exp $";
41 # endif /* !defined(lint) */
44 #include <sys/utsname.h>
48 * ckkv() - check kernel version
53 char *d; /* dialect */
54 char *er; /* expected revision; NULL, no test */
55 char *ev; /* expected version; NULL, no test */
56 char *ea; /* expected architecture; NULL, no
60 # if defined(HASKERNIDCK)
66 * Read the system information via uname(2).
69 (void) fprintf(stderr, "%s: uname error: %s\n",
73 if (er && strcmp(er, u.release)) {
74 (void) fprintf(stderr,
75 "%s: WARNING: compiled for %s release %s; this is %s.\n",
76 Pn, d, er, u.release);
78 if (ev && strcmp(ev, u.version)) {
79 (void) fprintf(stderr,
80 "%s: WARNING: compiled for %s version %s; this is %s.\n",
81 Pn, d, ev, u.version);
83 if (ea && strcmp(ea, u.machine)) {
84 (void) fprintf(stderr,
85 "%s: WARNING: compiled for %s architecture %s; this is %s.\n",
86 Pn, d, ea, u.machine);
88 # endif /* defined(HASKERNIDCK) */
91 #else /* !defined(USE_LIB_CKKV) */
92 char ckkv_d1[] = "d"; char *ckkv_d2 = ckkv_d1;
93 #endif /* defined(USE_LIB_CKKV) */