LibC: Move bzero() and bcopy() per Dr. POSIX

This commit is contained in:
Andreas Kling 2021-01-09 19:54:51 +01:00
parent 9766f61f7b
commit b4918bbe2f
6 changed files with 15 additions and 12 deletions

View file

@ -45,6 +45,7 @@
#include <serenity.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/select.h>

View file

@ -38,16 +38,6 @@
extern "C" {
void bzero(void* dest, size_t n)
{
memset(dest, 0, n);
}
void bcopy(const void* src, void* dest, size_t n)
{
memmove(dest, src, n);
}
size_t strspn(const char* s, const char* accept)
{
const char* p = s;

View file

@ -43,8 +43,6 @@ void* memmove(void*, const void*, size_t);
void* memchr(const void*, int c, size_t);
const void* memmem(const void* haystack, size_t, const void* needle, size_t);
void bzero(void*, size_t);
void bcopy(const void*, void*, size_t);
void* memset(void*, int, size_t);
__attribute__((malloc)) char* strdup(const char*);

View file

@ -26,10 +26,21 @@
#include <assert.h>
#include <ctype.h>
#include <string.h>
#include <strings.h>
extern "C" {
void bzero(void* dest, size_t n)
{
memset(dest, 0, n);
}
void bcopy(const void* src, void* dest, size_t n)
{
memmove(dest, src, n);
}
static char foldcase(char ch)
{
if (isalpha(ch))

View file

@ -33,5 +33,7 @@ __BEGIN_DECLS
int strcasecmp(const char*, const char*);
int strncasecmp(const char*, const char*, size_t);
void bzero(void*, size_t);
void bcopy(const void*, void*, size_t);
__END_DECLS

View file

@ -30,6 +30,7 @@
#include <AudioServer/ClientConnection.h>
#include <AudioServer/Mixer.h>
#include <pthread.h>
#include <strings.h>
namespace AudioServer {