Gettimeofday in Amazon FreeRTOS 202012.00

I am using AWS FreeRTOS with Espressif ESP32. I recently started moving my code from ESP3.4 back to ESP 3.3.2, based on the OTA demo.
In my original code I was using the gettimeofday() function along with other time functions - I found the instructions in the esp-idf API documentation: System Time - ESP32 - — ESP-IDF Programming Guide latest documentation
That page does not exist in the 3.3.2 documents, but I can find esp-idf/components/newlib/include/sys/time.h in the source tree that includes the gettimeofday call. So I think the functionality is buried somewhere in the esp-idf. If so, I’d like to know how to access it from within an esp32 component.

I’ve also been using the rtc_time_get() function, which I am also having trouble finding. But I think that can be replaced with esp_timer_get_time().

Ian

I have solved my problem. In vendors/espressif/boards/esp32/components/freertos/CmakeLists.txt, add or change the COMPONENT_REQUIRES to include newlib.
In my case, this is at line 26
set(COMPONENT_REQUIRES otherrequiredcomponents) to
set(COMPONENT_REQUIRES otherrequiredcomponents newlib)

various combinations of #include <time.h> and #include <sys/time.h> are required, depending on the particular functions required

Ian

Thank you for taking time and reporting your solution.