feat(linux): provide getrandom implementation for macOS

This makes getrandom(2) usable when compiling with IDF_TARGET=linux
on a macOS host.
This commit is contained in:
Ivan Grokhotkov
2023-12-15 13:50:48 +01:00
parent a596ca56a8
commit 7b8f69404f
3 changed files with 49 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include_next "sys/random.h"
#if __APPLE__
#include <stddef.h>
int getrandom(void *buf, size_t buflen, unsigned int flags);
#endif // __APPLE__