Remove the RCSID macro
[openafs.git] / src / afs / afs_warn.c
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /*
11  * afs_warn.c - afs_warn
12  *
13  * Implements: afs_warn, afs_warnuser
14  */
15 #include <afsconfig.h>
16 #include "afs/param.h"
17
18
19 #include "afs/stds.h"
20 #include "afs/sysincludes.h"    /* Standard vendor system headers */
21
22 #if !defined(UKERNEL)
23 #if !defined(AFS_LINUX20_ENV)
24 #include <net/if.h>
25 #endif
26 #include <netinet/in.h>
27
28 #ifdef AFS_SGI62_ENV
29 #include "h/hashing.h"
30 #endif
31 #if !defined(AFS_HPUX110_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_DARWIN60_ENV)
32 #include <netinet/in_var.h>
33 #endif /* ! AFS_HPUX110_ENV */
34 #endif /* !defined(UKERNEL) */
35
36 #include "afsincludes.h"        /* Afs-based standard headers */
37 #include "afs/afs_stats.h"      /* afs statistics */
38
39 #if     defined(AFS_SUN56_ENV)
40 #include <inet/led.h>
41 #include <inet/common.h>
42 #if     defined(AFS_SUN58_ENV)
43 #include <netinet/ip6.h>
44 #endif
45 #include <inet/ip.h>
46 #endif
47
48 #if     defined(AFS_AIX_ENV)
49 #include <sys/fp_io.h>
50 #endif
51
52
53
54 /* * * * * * *
55  * this code badly needs to be cleaned up...  too many ugly ifdefs.
56  * XXX
57  */
58 #if 0
59 void
60 afs_warn(char *a, long b, long c, long d, long e, long f, long g, long h,
61          long i, long j)
62 #else
63 void
64 afs_warn(a, b, c, d, e, f, g, h, i, j)
65      char *a;
66 #if defined( AFS_USE_VOID_PTR)
67      void *b, *c, *d, *e, *f, *g, *h, *i, *j;
68 #else
69      long b, c, d, e, f, g, h, i, j;
70 #endif
71 #endif
72 {
73     AFS_STATCNT(afs_warn);
74
75     if (afs_showflags & GAGCONSOLE) {
76 #if defined(AFS_AIX_ENV)
77         struct file *fd;
78
79         /* cf. console_printf() in oncplus/kernext/nfs/serv/shared.c */
80         if (fp_open
81             ("/dev/console", O_WRONLY | O_NOCTTY | O_NDELAY, 0666, 0, FP_SYS,
82              &fd) == 0) {
83             char buf[1024];
84             ssize_t len;
85             ssize_t count;
86
87             sprintf(buf, a, b, c, d, e, f, g, h, i, j);
88             len = strlen(buf);
89             fp_write(fd, buf, len, 0, UIO_SYSSPACE, &count);
90             fp_close(fd);
91         }
92 #else
93         printf(a, b, c, d, e, f, g, h, i, j);
94 #endif
95     }
96 }
97
98 #if 0
99 void
100 afs_warnuser(char *a, long b, long c, long d, long e, long f, long g, long h,
101              long i, long j)
102 #else
103 void
104 afs_warnuser(a, b, c, d, e, f, g, h, i, j)
105      char *a;
106      long b, c, d, e, f, g, h, i, j;
107 #endif
108 {
109     AFS_STATCNT(afs_warnuser);
110     if (afs_showflags & GAGUSER) {
111 #ifdef AFS_GLOBAL_SUNLOCK
112         int haveGlock = ISAFS_GLOCK();
113         if (haveGlock)
114             AFS_GUNLOCK();
115 #endif /* AFS_GLOBAL_SUNLOCK */
116
117         uprintf(a, b, c, d, e, f, g, h, i, j);
118
119 #ifdef AFS_GLOBAL_SUNLOCK
120         if (haveGlock)
121             AFS_GLOCK();
122 #endif /* AFS_GLOBAL_SUNLOCK */
123     }
124 }