mirror of
https://github.com/espressif/esp-protocols.git
synced 2025-12-06 00:59:29 +01:00
feat(sockutls): Add initial support for socket helpers
This commit is contained in:
17
components/sock_utils/src/gai_strerror.c
Normal file
17
components/sock_utils/src/gai_strerror.c
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "gai_strerror.h"
|
||||
|
||||
_Thread_local char gai_strerror_string[32];
|
||||
|
||||
const char *gai_strerror(int ecode)
|
||||
{
|
||||
if (snprintf(gai_strerror_string, sizeof(gai_strerror_string), "EAI error:%d", ecode) < 0) {
|
||||
return "gai_strerror() failed";
|
||||
}
|
||||
return gai_strerror_string;
|
||||
}
|
||||
Reference in New Issue
Block a user