Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions arch/arm64/src/common/arm64_arch_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <nuttx/arch.h>
#include <arch/irq.h>
#include <arch/chip/chip.h>
#include <nuttx/kmalloc.h>
#include <nuttx/spinlock.h>
#include <nuttx/timers/arch_alarm.h>

Expand Down
12 changes: 9 additions & 3 deletions include/nuttx/lib/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,15 @@
****************************************************************************/

#include <nuttx/config.h>
#include <nuttx/fs/fs.h>
#include <nuttx/kmalloc.h>

#if !defined(CONFIG_BUILD_FLAT) && defined(__KERNEL__)
# include <nuttx/kmalloc.h>
#else
# include <stdlib.h>
#endif
#ifdef CONFIG_FILE_STREAM
# include <nuttx/fs/fs.h>
#endif
#include <stdbool.h>
#include <limits.h>
#include <alloca.h>

Expand Down
4 changes: 4 additions & 0 deletions include/nuttx/streams.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ struct lib_rawoutstream_s
int fd;
};

#ifndef CONFIG_DISABLE_MOUNTPOINT
struct lib_fileinstream_s
{
struct lib_instream_s common;
Expand All @@ -222,6 +223,7 @@ struct lib_fileoutstream_s
struct lib_outstream_s common;
struct file file;
};
#endif

struct lib_rawsistream_s
{
Expand Down Expand Up @@ -428,12 +430,14 @@ void lib_stdsostream(FAR struct lib_stdsostream_s *stream,
*
****************************************************************************/

#ifndef CONFIG_DISABLE_MOUNTPOINT
int lib_fileinstream_open(FAR struct lib_fileinstream_s *stream,
FAR const char *path, int oflag, mode_t mode);
void lib_fileinstream_close(FAR struct lib_fileinstream_s *stream);
int lib_fileoutstream_open(FAR struct lib_fileoutstream_s *stream,
FAR const char *path, int oflag, mode_t mode);
void lib_fileoutstream_close(FAR struct lib_fileoutstream_s *stream);
#endif

/****************************************************************************
* Name: lib_rawinstream, lib_rawoutstream, lib_rawsistream, and
Expand Down
23 changes: 18 additions & 5 deletions libs/libc/netdb/lib_getaddrinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@
#include <string.h>

#include <arpa/inet.h>
#include <nuttx/net/loopback.h>
#include <netpacket/rpmsg.h>
#include <netpacket/vm_sockets.h>
#ifdef CONFIG_NET_LOOPBACK
# include <nuttx/net/loopback.h>
#endif
#ifdef CONFIG_NET_RPMSG
# include <netpacket/rpmsg.h>
#endif
#ifdef CONFIG_NET_VSOCK
# include <netpacket/vm_sockets.h>
#endif
#include <netdb.h>
#include <sys/un.h>

Expand All @@ -51,8 +57,12 @@ struct ai_s
struct sockaddr_un sun;
struct sockaddr_in sin;
struct sockaddr_in6 sin6;
#ifdef CONFIG_NET_RPMSG
struct sockaddr_rpmsg srp;
#endif
#ifdef CONFIG_NET_VSOCK
struct sockaddr_vm svm;
#endif
} sa;
};

Expand All @@ -65,12 +75,13 @@ FAR static struct ai_s *alloc_ai(int family, int socktype, int protocol,
{
FAR struct ai_s *ai;

ai = lib_zalloc(sizeof(struct ai_s));
ai = lib_malloc(sizeof(struct ai_s));
if (ai == NULL)
{
return ai;
}

memset(ai, 0, sizeof(*ai));
ai->ai.ai_addr = (FAR struct sockaddr *)&ai->sa;
ai->ai.ai_family = family;
ai->ai.ai_socktype = socktype;
Expand Down Expand Up @@ -187,12 +198,13 @@ int getaddrinfo(FAR const char *hostname, FAR const char *servname,
{
/* Force network byte order */

port = HTONS(port);
port = htons(port);
}
else if ((flags & AI_NUMERICSERV) != 0)
{
return EAI_NONAME;
}
#if defined(CONFIG_NET_IPv4) || defined(CONFIG_NET_IPv6)
else if (getservbyname_r(servname, NULL, &ent, NULL, 0, &sp) == OK)
{
/* The s_port field of struct servent is required to
Expand All @@ -201,6 +213,7 @@ int getaddrinfo(FAR const char *hostname, FAR const char *servname,

port = sp->s_port;
}
#endif
else
{
return EAI_SERVICE;
Expand Down
4 changes: 3 additions & 1 deletion libs/libc/netdb/lib_gethostentbynamer.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
#include <arpa/inet.h>

#include <nuttx/net/dns.h>
#include <nuttx/net/loopback.h>
#ifdef CONFIG_NET_LOOPBACK
# include <nuttx/net/loopback.h>
#endif

#include "netdb/lib_dns.h"
#include "netdb/lib_netdb.h"
Expand Down
1 change: 1 addition & 0 deletions libs/libc/netdb/lib_netdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <netdb.h>
#include <stdio.h>
#include <stdbool.h>

#ifdef CONFIG_LIBC_NETDB

Expand Down
Loading