Tor  0.4.7.0-alpha-dev
Functions
approx_time.h File Reference

Header for approx_time.c. More...

#include <time.h>

Go to the source code of this file.

Functions

time_t approx_time (void)
 
void update_approx_time (time_t now)
 

Detailed Description

Header for approx_time.c.

Definition in file approx_time.h.

Function Documentation

◆ approx_time()

time_t approx_time ( void  )

Return a cached estimate of the current time from when update_approx_time() was last called. This is a hack to avoid calling time(NULL) on critical paths: please do not even think of calling it anywhere else.

Definition at line 32 of file approx_time.c.

Referenced by build_service_desc_plaintext(), circpad_cell_event_nonpadding_received(), circpad_cell_event_padding_received(), circuit_build_times_needs_circuits_now(), circuit_build_times_network_is_live(), circuit_set_n_circid_chan(), circuit_set_p_circid_chan(), connection_ap_handle_onion(), connection_ap_handshake_attach_chosen_circuit(), connection_buf_read_from_socket(), connection_edge_flushed_some(), connection_edge_process_inbuf(), connection_handle_read_impl(), dirauth_get_voting_schedule(), dnsserv_launch_request(), entry_guard_consider_retry(), entry_guard_state_should_expire(), entry_guards_note_guard_failure(), entry_guards_note_guard_success(), entry_guards_note_internet_connectivity(), get_guard_state_for_bridge_desc_fetch(), handle_response_fetch_consensus(), have_been_under_memory_pressure(), hs_get_responsible_hsdirs(), hs_get_time_period_num(), log_master_signing_key_cert_expiration(), lookup_v3_desc_as_client(), mark_circuit_unusable_for_new_conns(), microdesc_note_outdated_dirserver(), networkstatus_set_current_consensus(), overload_happened_recently(), reasonably_live_consensus_is_missing(), router_descriptor_is_older_than(), routerlist_descriptors_added(), should_collect_v3_stats(), sr_get_current(), and sr_get_previous().

◆ update_approx_time()

void update_approx_time ( time_t  now)

Update the cached estimate of the current time. This function SHOULD be called once per second, and MUST be called before the first call to get_approx_time.

Definition at line 41 of file approx_time.c.

Referenced by subsys_wallclock_initialize().