LibC: Fix sockaddr_un implementation
This commit is contained in:
parent
41cad88d6e
commit
454bee3f02
|
@ -16,6 +16,12 @@ __BEGIN_DECLS
|
|||
#include <bits/types/sa_family_t.h>
|
||||
typedef long socklen_t;
|
||||
|
||||
#if !defined(FILENAME_MAX)
|
||||
#define FILENAME_MAX 256
|
||||
#elif FILENAME_MAX != 256
|
||||
#error "invalid FILENAME_MAX"
|
||||
#endif
|
||||
|
||||
struct sockaddr
|
||||
{
|
||||
sa_family_t sa_family; /* Address family. */
|
||||
|
@ -24,8 +30,8 @@ struct sockaddr
|
|||
|
||||
struct sockaddr_storage
|
||||
{
|
||||
// FIXME
|
||||
sa_family_t ss_family;
|
||||
char ss_storage[FILENAME_MAX];
|
||||
};
|
||||
|
||||
struct msghdr
|
||||
|
|
|
@ -11,8 +11,8 @@ __BEGIN_DECLS
|
|||
|
||||
struct sockaddr_un
|
||||
{
|
||||
sa_family_t sun_family; /* Address family. */
|
||||
char sun_path[]; /* Socket pathname. */
|
||||
sa_family_t sun_family; /* Address family. */
|
||||
char sun_path[FILENAME_MAX]; /* Socket pathname. */
|
||||
};
|
||||
|
||||
__END_DECLS
|
||||
|
|
|
@ -22,7 +22,7 @@ int listen(int socket, int backlog)
|
|||
return syscall(SYS_LISTEN, socket, backlog);
|
||||
}
|
||||
|
||||
ssize_t revc(int socket, void* __restrict buffer, size_t length, int flags)
|
||||
ssize_t recv(int socket, void* __restrict buffer, size_t length, int flags)
|
||||
{
|
||||
return recvfrom(socket, buffer, length, flags, nullptr, nullptr);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue