From: Roland Dreier <roland@topspin.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] Export all functions in lib/string.c
Date: Fri, 23 Jul 2004 13:32:10 -0700 [thread overview]
Message-ID: <52llhatqgl.fsf@topspin.com> (raw)
Quite a few functions in lib/string.c are not exported. I ran into
this trying to use strnchr() in a module.
This patch
- exports every function defined in lib/string.c
- adds some missing __HAVE_ARCH_xxx defines for i386
- gets rid of the exports of functions from lib/string.c in arch/s390
(BTW, why is s390 exporting things NOVERS?)
Thanks,
Roland
Signed-off-by: Roland Dreier <roland@topspin.com>
Index: linux-2.6.8-rc2/arch/s390/lib/string.c
===================================================================
--- linux-2.6.8-rc2.orig/arch/s390/lib/string.c
+++ linux-2.6.8-rc2/arch/s390/lib/string.c
@@ -394,12 +394,3 @@
return s;
}
EXPORT_SYMBOL_NOVERS(memset);
-
-/*
- * missing exports for string functions defined in lib/string.c
- */
-EXPORT_SYMBOL_NOVERS(memmove);
-EXPORT_SYMBOL_NOVERS(strchr);
-EXPORT_SYMBOL_NOVERS(strnchr);
-EXPORT_SYMBOL_NOVERS(strncmp);
-EXPORT_SYMBOL_NOVERS(strpbrk);
Index: linux-2.6.8-rc2/include/asm-i386/string.h
===================================================================
--- linux-2.6.8-rc2.orig/include/asm-i386/string.h
+++ linux-2.6.8-rc2/include/asm-i386/string.h
@@ -27,6 +27,7 @@
*/
#if !defined(IN_STRING_C)
+#define __HAVE_ARCH_STRCPY
static inline char * strcpy(char * dest,const char *src)
{
int d0, d1, d2;
@@ -40,6 +41,7 @@
return dest;
}
+#define __HAVE_ARCH_STRNCPY
static inline char * strncpy(char * dest,const char *src,size_t count)
{
int d0, d1, d2, d3;
@@ -58,6 +60,7 @@
return dest;
}
+#define __HAVE_ARCH_STRCAT
static inline char * strcat(char * dest,const char * src)
{
int d0, d1, d2, d3;
@@ -74,6 +77,7 @@
return dest;
}
+#define __HAVE_ARCH_STRNCAT
static inline char * strncat(char * dest,const char * src,size_t count)
{
int d0, d1, d2, d3;
@@ -96,6 +100,7 @@
return dest;
}
+#define __HAVE_ARCH_STRCMP
static inline int strcmp(const char * cs,const char * ct)
{
int d0, d1;
@@ -116,6 +121,7 @@
return __res;
}
+#define __HAVE_ARCH_STRNCMP
static inline int strncmp(const char * cs,const char * ct,size_t count)
{
register int __res;
@@ -138,6 +144,7 @@
return __res;
}
+#define __HAVE_ARCH_STRCHR
static inline char * strchr(const char * s, int c)
{
int d0;
@@ -156,6 +163,7 @@
return __res;
}
+#define __HAVE_ARCH_STRRCHR
static inline char * strrchr(const char * s, int c)
{
int d0, d1;
Index: linux-2.6.8-rc2/lib/string.c
===================================================================
--- linux-2.6.8-rc2.orig/lib/string.c
+++ linux-2.6.8-rc2/lib/string.c
@@ -75,6 +75,7 @@
/* nothing */;
return tmp;
}
+EXPORT_SYMBOL(strcpy);
#endif
#ifndef __HAVE_ARCH_STRNCPY
@@ -98,6 +99,7 @@
}
return dest;
}
+EXPORT_SYMBOL(strncpy);
#endif
#ifndef __HAVE_ARCH_STRLCPY
@@ -143,6 +145,7 @@
return tmp;
}
+EXPORT_SYMBOL(strcat);
#endif
#ifndef __HAVE_ARCH_STRNCAT
@@ -172,6 +175,7 @@
return tmp;
}
+EXPORT_SYMBOL(strncat);
#endif
#ifndef __HAVE_ARCH_STRLCAT
@@ -218,6 +222,7 @@
return __res;
}
+EXPORT_SYMBOL(strcmp);
#endif
#ifndef __HAVE_ARCH_STRNCMP
@@ -239,6 +244,7 @@
return __res;
}
+EXPORT_SYMBOL(strncmp);
#endif
#ifndef __HAVE_ARCH_STRCHR
@@ -254,6 +260,7 @@
return NULL;
return (char *) s;
}
+EXPORT_SYMBOL(strchr);
#endif
#ifndef __HAVE_ARCH_STRRCHR
@@ -271,6 +278,7 @@
} while (--p >= s);
return NULL;
}
+EXPORT_SYMBOL(strrchr);
#endif
#ifndef __HAVE_ARCH_STRNCHR
@@ -287,6 +295,7 @@
return (char *) s;
return NULL;
}
+EXPORT_SYMBOL(strnchr);
#endif
#ifndef __HAVE_ARCH_STRLEN
@@ -302,6 +311,7 @@
/* nothing */;
return sc - s;
}
+EXPORT_SYMBOL(strlen);
#endif
#ifndef __HAVE_ARCH_STRNLEN
@@ -318,6 +328,7 @@
/* nothing */;
return sc - s;
}
+EXPORT_SYMBOL(strnlen);
#endif
#ifndef __HAVE_ARCH_STRSPN
@@ -371,6 +382,7 @@
return count;
}
+EXPORT_SYMBOL(strcspn);
#ifndef __HAVE_ARCH_STRPBRK
/**
@@ -390,6 +402,7 @@
}
return NULL;
}
+EXPORT_SYMBOL(strpbrk);
#endif
#ifndef __HAVE_ARCH_STRSEP
@@ -440,6 +453,7 @@
return s;
}
+EXPORT_SYMBOL(memset);
#endif
#ifndef __HAVE_ARCH_BCOPY
@@ -463,6 +477,7 @@
while (count--)
*dest++ = *src++;
}
+EXPORT_SYMBOL(bcopy);
#endif
#ifndef __HAVE_ARCH_MEMCPY
@@ -484,6 +499,7 @@
return dest;
}
+EXPORT_SYMBOL(memcpy);
#endif
#ifndef __HAVE_ARCH_MEMMOVE
@@ -514,6 +530,7 @@
return dest;
}
+EXPORT_SYMBOL(memmove);
#endif
#ifndef __HAVE_ARCH_MEMCMP
@@ -533,6 +550,7 @@
break;
return res;
}
+EXPORT_SYMBOL(memcmp);
#endif
#ifndef __HAVE_ARCH_MEMSCAN
@@ -557,6 +575,7 @@
}
return (void *) p;
}
+EXPORT_SYMBOL(memscan);
#endif
#ifndef __HAVE_ARCH_STRSTR
@@ -581,6 +600,7 @@
}
return NULL;
}
+EXPORT_SYMBOL(strstr);
#endif
#ifndef __HAVE_ARCH_MEMCHR
@@ -603,5 +623,5 @@
}
return NULL;
}
-
+EXPORT_SYMBOL(memchr);
#endif
reply other threads:[~2004-07-23 20:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52llhatqgl.fsf@topspin.com \
--to=roland@topspin.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.