An earlier version of the OpenAFS code used an unusual preprocessor
macro for the function osi_Msg and osi_VMsg. This causes problems
on newer Linux kernels. The macro was replaced with a function
leveraging vprintf, etc. These functions are not available in the
AIX kernel, where our only option is printf. However, AIX does
provide these functions in libc. This change ensures we only use
printf when building the AIX kernel module.
Change-Id: Ib46c4712516846a489cc66fda0833907612b3316
Reviewed-on: https://gerrit.openafs.org/15118
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
int type, char *data, int bytes, int istack);
extern struct rx_packet *rxi_SplitJumboPacket(struct rx_packet *p);
+#if !defined(AFS_AIX_ENV) || (defined(AFS_AIX_ENV) && (!defined(KERNEL) || defined(UKERNEL)))
/* rx_kcommon.c / rx_user.c */
extern void osi_Msg(const char *fmt, ...) AFS_ATTRIBUTE_FORMAT(__printf__, 1, 2);
+#endif
# endif /* RXK_LISTENER_ENV */
#endif /* !UKERNEL */
+#if !defined(AFS_AIX_ENV) || (defined(AFS_AIX_ENV) && (!defined(KERNEL) || defined(UKERNEL)))
void
osi_Msg(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
-#if defined(AFS_LINUX_ENV)
+# if defined(AFS_LINUX_ENV)
vprintk(fmt, ap);
-#else
+# else
vprintf(fmt, ap);
-#endif
+# endif
va_end(ap);
}
+#endif
#if !defined(AFS_LINUX_ENV)
void
(void)((exp) || (osi_AssertFailK( #exp , __FILE__, __LINE__), 0))
#endif
+#if (defined(AFS_AIX_ENV) && defined(KERNEL))
+# define osi_Msg printf
+#endif
+
#define osi_YieldIfPossible()
#define osi_WakeupAndYieldIfPossible(x) rx_Wakeup(x)