mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:37:46 +00:00
LibC: First pass of compat work / stubs while trying to build OpenSSL.
This commit is contained in:
parent
08228f34b9
commit
4aef87a9a4
5 changed files with 57 additions and 6 deletions
1
LibC/memory.h
Normal file
1
LibC/memory.h
Normal file
|
@ -0,0 +1 @@
|
||||||
|
#include <string.h>
|
|
@ -16,4 +16,13 @@ struct hostent {
|
||||||
|
|
||||||
struct hostent *gethostbyname(const char*);
|
struct hostent *gethostbyname(const char*);
|
||||||
|
|
||||||
|
struct servent {
|
||||||
|
char* s_name;
|
||||||
|
char** s_aliases;
|
||||||
|
int s_port;
|
||||||
|
char* s_proto;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct servent* getservbyname(const char* name, const char* protocol);
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
|
|
||||||
|
struct rusage {
|
||||||
|
struct timeval ru_utime;
|
||||||
|
struct timeval ru_stime;
|
||||||
|
long ru_maxrss;
|
||||||
|
long ru_ixrss;
|
||||||
|
long ru_idrss;
|
||||||
|
long ru_isrss;
|
||||||
|
long ru_minflt;
|
||||||
|
long ru_majflt;
|
||||||
|
long ru_nswap;
|
||||||
|
long ru_inblock;
|
||||||
|
long ru_oublock;
|
||||||
|
long ru_msgsnd;
|
||||||
|
long ru_msgrcv;
|
||||||
|
long ru_nsignals;
|
||||||
|
long ru_nvcsw;
|
||||||
|
long ru_nivcsw;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define RUSAGE_SELF 1
|
||||||
|
#define RUSAGE_CHILDREN 2
|
||||||
|
|
||||||
|
int getrusage(int who, struct rusage *usage);
|
||||||
|
|
||||||
|
__END_DECLS
|
|
@ -3,6 +3,7 @@
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <sys/un.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
|
@ -33,12 +34,6 @@ struct sockaddr {
|
||||||
char sa_data[14];
|
char sa_data[14];
|
||||||
};
|
};
|
||||||
|
|
||||||
#define UNIX_PATH_MAX 108
|
|
||||||
struct sockaddr_un {
|
|
||||||
uint16_t sun_family;
|
|
||||||
char sun_path[UNIX_PATH_MAX];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct in_addr {
|
struct in_addr {
|
||||||
uint32_t s_addr;
|
uint32_t s_addr;
|
||||||
};
|
};
|
||||||
|
@ -56,6 +51,7 @@ struct sockaddr_in {
|
||||||
#define SO_RCVTIMEO 1
|
#define SO_RCVTIMEO 1
|
||||||
#define SO_SNDTIMEO 2
|
#define SO_SNDTIMEO 2
|
||||||
#define SO_KEEPALIVE 3
|
#define SO_KEEPALIVE 3
|
||||||
|
#define SO_ERROR 4
|
||||||
|
|
||||||
int socket(int domain, int type, int protocol);
|
int socket(int domain, int type, int protocol);
|
||||||
int bind(int sockfd, const struct sockaddr* addr, socklen_t);
|
int bind(int sockfd, const struct sockaddr* addr, socklen_t);
|
||||||
|
|
13
LibC/sys/un.h
Normal file
13
LibC/sys/un.h
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
|
|
||||||
|
#define UNIX_PATH_MAX 108
|
||||||
|
struct sockaddr_un {
|
||||||
|
uint16_t sun_family;
|
||||||
|
char sun_path[UNIX_PATH_MAX];
|
||||||
|
};
|
||||||
|
|
||||||
|
__END_DECLS
|
Loading…
Add table
Add a link
Reference in a new issue