mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 04:25:32 +00:00
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:
15
components/linux/include/sys/random.h
Normal file
15
components/linux/include/sys/random.h
Normal 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__
|
Reference in New Issue
Block a user