Browse Source

Revert "posix: net: move static inline gethostname() to lib definition"

This reverts commit e60070d91b.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
pull/72102/merge
Anas Nashif 1 month ago
parent
commit
0a6e579987
  1. 10
      include/zephyr/posix/unistd.h
  2. 6
      lib/posix/options/net.c

10
include/zephyr/posix/unistd.h

@ -11,6 +11,11 @@ @@ -11,6 +11,11 @@
#ifdef CONFIG_POSIX_API
#include <zephyr/fs/fs.h>
#endif
#ifdef CONFIG_NETWORKING
/* For zsock_gethostname() */
#include <zephyr/net/socket.h>
#include <zephyr/net/hostname.h>
#endif
#include <zephyr/posix/sys/confstr.h>
#include <zephyr/posix/sys/stat.h>
#include <zephyr/posix/sys/sysconf.h>
@ -44,7 +49,10 @@ int rmdir(const char *path); @@ -44,7 +49,10 @@ int rmdir(const char *path);
FUNC_NORETURN void _exit(int status);
#ifdef CONFIG_NETWORKING
int gethostname(char *buf, size_t len);
static inline int gethostname(char *buf, size_t len)
{
return zsock_gethostname(buf, len);
}
#endif /* CONFIG_NETWORKING */
#endif /* CONFIG_POSIX_API */

6
lib/posix/options/net.c

@ -10,7 +10,6 @@ @@ -10,7 +10,6 @@
#include <stdlib.h>
#include <zephyr/net/net_if.h>
#include <zephyr/net/socket.h>
#include <zephyr/posix/arpa/inet.h>
#include <zephyr/posix/netinet/in.h>
#include <zephyr/posix/net/if.h>
@ -217,11 +216,6 @@ struct hostent *gethostent(void) @@ -217,11 +216,6 @@ struct hostent *gethostent(void)
return NULL;
}
int gethostname(char *buf, size_t len)
{
return zsock_gethostname(buf, len);
}
int getnameinfo(const struct sockaddr *addr, socklen_t addrlen, char *host, socklen_t hostlen,
char *serv, socklen_t servlen, int flags)
{

Loading…
Cancel
Save