Browse Source

4.3BSD says that bcopy and bzero are defined in strings.h, not string.h

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
1a0ca661c2
2 changed files with 11 additions and 1 deletions
  1. 0
    1
      src/include/string.h
  2. 11
    0
      src/include/strings.h

+ 0
- 1
src/include/string.h View File

59
 char * strtok(char * s,const char * ct);
59
 char * strtok(char * s,const char * ct);
60
 char * strsep(char **s, const char *ct);
60
 char * strsep(char **s, const char *ct);
61
 void * memset(void * s,int c,size_t count);
61
 void * memset(void * s,int c,size_t count);
62
-char * bcopy(const char * src, char * dest, int count);
63
 void * memmove(void * dest,const void *src,size_t count);
62
 void * memmove(void * dest,const void *src,size_t count);
64
 int __attribute__ (( pure )) memcmp(const void * cs,const void * ct,
63
 int __attribute__ (( pure )) memcmp(const void * cs,const void * ct,
65
 				    size_t count);
64
 				    size_t count);

+ 11
- 0
src/include/strings.h View File

2
 #define _STRINGS_H
2
 #define _STRINGS_H
3
 
3
 
4
 #include <limits.h>
4
 #include <limits.h>
5
+#include <string.h>
5
 
6
 
6
 static inline __attribute__ (( always_inline )) int
7
 static inline __attribute__ (( always_inline )) int
7
 __constant_flsl ( unsigned long x ) {
8
 __constant_flsl ( unsigned long x ) {
53
 
54
 
54
 extern int strcasecmp ( const char *s1, const char *s2 );
55
 extern int strcasecmp ( const char *s1, const char *s2 );
55
 
56
 
57
+static inline __attribute__ (( always_inline )) void
58
+bcopy ( const void *src, void *dest, size_t n ) {
59
+	memmove ( dest, src, n );
60
+}
61
+
62
+static inline __attribute__ (( always_inline )) void
63
+bzero ( void *s, size_t n ) {
64
+	memset ( s, 0, n );
65
+}
66
+
56
 #endif /* _STRINGS_H */
67
 #endif /* _STRINGS_H */

Loading…
Cancel
Save