Revert "posix: net: move static inline gethostname() to lib definition"
This reverts commit e60070d91b
.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
a649b31cfc
commit
0a6e579987
2 changed files with 9 additions and 7 deletions
|
@ -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);
|
|||
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 */
|
||||
|
|
|
@ -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)
|
|||
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…
Add table
Add a link
Reference in a new issue