CUBRID Engine  latest
porting.h File Reference
#include "config.h"
Include dependency graph for porting.h:

Go to the source code of this file.

Macros

#define __attribute__(X)
 
#define IMPORT_VAR   extern
 
#define EXPORT_VAR
 
#define L_cuserid   9
 
#define ONE_K   1024
 
#define ONE_M   1048576
 
#define ONE_G   1073741824
 
#define ONE_T   1099511627776LL
 
#define ONE_P   1125899906842624LL
 
#define ONE_SEC   1000
 
#define ONE_MIN   60000
 
#define ONE_HOUR   3600000
 
#define CTIME_MAX   64
 
#define LLONG_MAX   9223372036854775807LL
 
#define LLONG_MIN   (-LLONG_MAX - 1LL)
 
#define ULLONG_MAX   18446744073709551615ULL
 
#define MEM_SIZE_IS_VALID(size)
 
#define snprintf_dots_truncate(dest, max_len, ...)
 
#define strncpy_size(buf, str, size)   strncpy (buf, str, size); buf[(size) - 1] = '\0'
 
#define strncpy_bufsize(buf, str)   strncpy_size (buf, str, sizeof (buf))
 
#define PATH_SEPARATOR   '/'
 
#define PATH_CURRENT   '.'
 
#define IS_PATH_SEPARATOR(c)   ((c) == PATH_SEPARATOR)
 
#define IS_ABS_PATH(p)   IS_PATH_SEPARATOR((p)[0])
 
#define LONGJMP   _longjmp
 
#define SETJMP   _setjmp
 
#define CUB_MAXHOSTNAMELEN   256 /* 255 + 1(for NULL terminator) */
 
#define GETHOSTNAME(p, l)   css_gethostname(p, l)
 
#define FINITE(x)   finite(x)
 
#define difftime64(time1, time2)   difftime(time1, time2)
 
#define err(fd, ...)   do { fprintf(stderr, __VA_ARGS__); exit(1); } while (0)
 
#define errx(fd, ...)   do { fprintf(stderr, __VA_ARGS__); exit(1); } while (0)
 
#define SUPPRESS_STRLEN_WARNING
 
#define CAST_STRLEN   (int)
 
#define CAST_BUFLEN   (int)
 
#define OFF_T_MAX   LLONG_MAX
 
#define INVALID_SOCKET   (-1)
 
#define IS_INVALID_SOCKET(socket)   ((socket) < 0)
 
#define os_send_kill()   os_send_signal(SIGKILL)
 
#define THREAD_RET_T   void*
 
#define THREAD_CALLING_CONVENTION
 
#define COPYMEM(type, dst, src)
 
#define string_to_double(str, end_ptr)   strtod((str), (end_ptr))
 
#define PORTABLE_FUNC_NAME   "(unknown)"
 
#define UNUSED(x)   x
 
#define UNUSED_FUNCTION(x)   x
 
#define STATIC_CAST(dest_type, expr)   ((dest_type) (expr))
 
#define CONST_CAST(dest_type, expr)   ((dest_type) (expr))
 
#define DYNAMIC_CAST(dest_type, expr)   ((dest_type) (expr))
 
#define REINTERPRET_CAST(dest_type, expr)   ((dest_type) (expr))
 
#define REFPTR(T, name)   T *& name
 

Typedefs

typedef int SOCKET
 
typedef void(* SIGNAL_HANDLER_FUNCTION) (int sig_no)
 

Functions

char * strdup (const char *str)
 
int vasprintf (char **ptr, const char *format, va_list ap)
 
int asprintf (char **ptr, const char *format,...)
 
int cub_dirname_r (const char *path, char *pathbuf, size_t buflen)
 
char * dirname (const char *path)
 
int basename_r (const char *path, char *pathbuf, size_t buflen)
 
char * basename (const char *path)
 
char * stristr (const char *s, const char *find)
 
char * getuserid (char *string, int size)
 
int os_rename_file (const char *src_path, const char *dest_path)
 
SIGNAL_HANDLER_FUNCTION os_set_signal_handler (const int sig_no, SIGNAL_HANDLER_FUNCTION sig_handler)
 
void os_send_signal (const int sig_no)
 
INT64 timeval_diff_in_msec (const struct timeval *end_time, const struct timeval *start_time)
 
int timeval_add_msec (struct timeval *added_time, const struct timeval *start_time, int msec)
 
int timeval_to_timespec (struct timespec *to, const struct timeval *from)
 
FILE * port_open_memstream (char **ptr, size_t *sizeloc)
 
void port_close_memstream (FILE *fp, char **ptr, size_t *sizeloc)
 
char * trim (char *str)
 
int parse_bigint (INT64 *ret_p, const char *str_p, int base)
 
int str_to_int32 (int *ret_p, char **end_p, const char *str_p, int base)
 
int str_to_uint32 (unsigned int *ret_p, char **end_p, const char *str_p, int base)
 
int str_to_int64 (INT64 *ret_p, char **end_p, const char *str_p, int base)
 
int str_to_uint64 (UINT64 *ret_p, char **end_p, const char *str_p, int base)
 
int str_to_double (double *ret_p, char **end_p, const char *str_p)
 
int str_to_float (float *ret_p, char **end_p, const char *str_p)
 
size_t strlcpy (char *, const char *, size_t)
 
int msleep (const long msec)
 
int parse_int (int *ret_p, const char *str_p, int base)
 

Macro Definition Documentation

#define __attribute__ (   X)

Definition at line 36 of file porting.h.

#define CAST_BUFLEN   (int)

Definition at line 471 of file porting.h.

Referenced by btree_find_oid_from_leaf(), btree_find_oid_from_ovfl(), btree_find_unique(), btree_fix_root_for_delete(), btree_key_insert_new_key(), btree_pack_root_header(), btree_read_record_without_decompression(), btree_record_append_object(), btree_record_get_last_object(), btree_record_get_num_oids(), btree_record_replace_object(), BTREE_RV_GET_DATA_LENGTH(), btree_rv_keyval_dump(), btree_rv_read_keybuf_nocopy(), btree_rv_read_keybuf_two_objects(), btree_rv_read_keyval_info_nocopy(), btree_rv_record_modify_internal(), btree_rv_save_keyval_for_undo(), btree_rv_save_keyval_for_undo_two_objects(), btree_seq_find_oid_from_ovfl(), btree_write_record(), db_check_or_create_null_term_string(), db_find_string_in_in_set(), db_get_like_optimization_bounds(), db_string_to_datetimetz_ex(), db_string_to_timestamptz_ex(), db_to_date(), db_to_datetime(), db_to_time(), db_to_timestamp(), ehash_adjust_local_depth(), ehash_apply_each(), ehash_dump_bucket(), fileio_finish_backup(), fileio_write_backup(), fmt_fractional_value(), get_class_mops_from_file(), heap_attrinfo_transform_to_disk_internal(), heap_midxkey_key_generate(), heap_midxkey_key_get(), heap_update_adjust_recdes_header(), lang_back_strmatch_utf8_uca_w_level(), lang_fastcmp_ko(), lang_get_uca_back_weight_l13(), lang_mht2str_utf8(), lang_mht2str_utf8_exp(), lang_split_key_binary(), lang_split_key_byte(), lang_split_key_euckr(), lang_split_key_iso(), lang_split_key_utf8(), lang_split_key_w_exp(), lang_str_utf8_trail_zero_weights(), lang_str_utf8_trail_zero_weights_w_exp(), lang_strmatch_binary(), lang_strmatch_byte(), lang_strmatch_ko(), lang_strmatch_utf8(), lang_strmatch_utf8_uca_w_level(), lang_strmatch_utf8_w_contr(), locale_alphabet_data_to_buf(), locator_mflush(), locator_mflush_force(), locator_pack_copy_area_descriptor(), locator_pack_lockhint(), locator_pack_lockset(), locator_repl_add_error_to_copyarea(), locator_repl_mflush(), locator_send_copy_area(), locator_unpack_lockhint(), locator_unpack_lockset(), log_rv_record_modify_internal(), logpb_append_crumbs(), logpb_append_data(), logtb_update_global_unique_stats_by_delta(), mr_index_lengthmem_midxkey(), or_class_get_partition_info(), or_get_value(), or_mvcc_add_header(), or_put_set(), overflow_get_nbytes(), overflow_insert(), parse_datetime(), parse_explicit_mtime_compact(), parse_for_timestamp(), parse_time_string(), parse_timestamp_compact(), parse_tzd(), parser_allocate_string_buffer(), parser_create_string_block(), pr_midxkey_add_elements(), pr_midxkey_get_element_internal(), pr_midxkey_get_element_offset(), prior_lsa_append_data(), prior_lsa_gen_undoredo_record_from_crumbs(), pt_make_dotted_identifier_internal(), qfile_free_list_cache_entry(), qfile_make_sort_key(), qmgr_end_query(), qmgr_execute_query(), qmgr_prepare_and_execute_query(), qstr_eval_like(), qstr_position(), qstr_replace(), scan_dbvals_to_midxkey(), sort_run_find(), tf_class_to_disk(), tp_atof(), tran_server_commit(), tz_get_timezone_offset(), tz_str_timezone_decode(), tz_str_to_region(), vacuum_consume_buffer_log_blocks(), vacuum_heap_record_insid_and_prev_version(), xlogtb_get_pack_tran_table(), xts_save_regu_variable(), and xts_save_xasl_node().

#define difftime64 (   time1,
  time2 
)    difftime(time1, time2)

Definition at line 394 of file porting.h.

Referenced by logpb_fetch_from_archive(), and logpb_find_oldest_available_page_id().

#define DYNAMIC_CAST (   dest_type,
  expr 
)    ((dest_type) (expr))

Definition at line 1070 of file porting.h.

#define err (   fd,
  ... 
)    do { fprintf(stderr, __VA_ARGS__); exit(1); } while (0)

Definition at line 431 of file porting.h.

Referenced by add_element(), allocate_disk_structures(), base64_partition_into_chunk(), basename(), boot_make_session_server_key(), boot_reset_mk_after_restart_from_backup(), broker_config_read(), btree_coerce_key(), btree_get_prefix_separator(), btree_rv_keyval_undo_insert(), btree_rv_keyval_undo_insert_mvcc_delid(), btree_rv_keyval_undo_insert_unique(), btree_rv_keyval_undo_online_index_tran_insert(), cas_init_ssl(), catalog_update(), catcls_expand_or_value_by_subset(), cubload::sa_class_installer::check_class(), check_class_domain(), check_commit(), check_merge_trigger(), check_object_domain(), check_trigger(), classobj_drop_foreign_key_ref(), classobj_find_cons_index2_col_type_list(), classobj_put_foreign_key_ref(), col_expand(), col_expand_blocks(), col_new(), compare_size_and_buffer(), compile_trigger_activity(), construct_instance(), convert_db_value_to_string(), csect_wait_on_promoter_queue(), csect_wait_on_writer_queue(), csession_drop_session_variables(), csession_get_variable(), csession_set_session_variables(), csql_display_session_err(), csql_results(), css_check_ha_server_state_for_client(), css_gethostname(), css_hostname_to_ip(), css_init_conn_list(), css_initialize_conn(), css_tcp_client_open_with_retry(), css_windows_shutdown(), css_windows_startup(), cvacuum(), db_acos_dbval(), db_asin_dbval(), db_atan2_dbval(), db_atan_dbval(), db_compile_statement_local(), db_convert_sec_to_time(), db_cos_dbval(), db_cot_dbval(), db_date_parse_date(), db_date_parse_timestamp(), db_degrees_dbval(), db_execute_and_keep_statement(), db_execute_and_keep_statement_local(), db_execute_statement(), db_execute_statement_local(), db_find_or_create_session(), db_find_string_in_in_set(), db_json_get_json_from_str(), db_log_generic_dbval(), db_object_describe(), db_object_fetch(), db_radians_dbval(), db_sin_dbval(), db_string_extract_dbval(), db_string_from_base64(), db_string_to_timestamp_ex(), db_string_to_timestamptz_ex(), db_tan_dbval(), db_timestamp_decode_w_reg(), db_timestamp_decode_w_tz_id(), db_timestamp_encode_w_reg(), db_timestampltz_to_string(), db_timestamptz_to_string(), db_value_coerce(), dbval_to_net_buf(), cubload::sa_object_loader::destroy(), do_check_merge_trigger(), do_check_update_trigger(), do_execute_delete(), do_execute_insert(), do_execute_merge(), do_execute_select(), do_execute_session_statement(), do_execute_statement(), do_execute_update(), do_get_prepared_statement_info(), do_merge(), do_prepare_delete(), do_prepare_merge(), do_prepare_select(), do_prepare_statement(), do_prepare_update(), do_process_prepare_statement(), do_recompile_and_execute_prepared_statement(), do_set_user_host_variables(), drop_foreign_key_ref_internal(), drop_stored_procedure(), dump_console_conversion(), emit_stored_procedure(), emit_stored_procedure_args(), export_serial(), find_instance(), cubload::sa_object_loader::finish_line(), fn_get_query_info(), get_column_default_as_string(), get_select_list_to_update(), heap_get_class_oid(), histo_print(), histo_print_global_stats(), idmap_grow(), class_description::init(), insert_instance(), insert_meth_instance(), cubload::error_handler::is_last_error_filtered(), jsp_add_stored_procedure(), jsp_add_stored_procedure_argument(), jsp_alter_stored_procedure(), jsp_create_stored_procedure(), jsp_do_call_stored_procedure(), jsp_drop_stored_procedure(), jsp_get_return_type(), jsp_readn(), ldr_act_add_argument(), ldr_act_add_attr(), ldr_act_add_class_all_attrs(), ldr_act_attr(), ldr_act_check_missing_non_null_attrs(), ldr_act_class_attr(), ldr_act_elem(), ldr_act_init_context(), ldr_act_meth(), ldr_act_set_constructor(), ldr_add_mop_tempoid_map(), ldr_assign_all_perm_oids(), ldr_assign_class_id(), ldr_bstr_db_varbit(), ldr_bstr_elem(), ldr_check_date_time_conversion(), ldr_class_attr_db_generic(), ldr_class_oid_db_object(), ldr_class_oid_elem(), ldr_collection_db_collection(), ldr_collection_elem(), ldr_date_db_date(), ldr_date_elem(), ldr_datetime_db_datetime(), ldr_datetime_elem(), ldr_datetimeltz_db_datetimeltz(), ldr_datetimeltz_elem(), ldr_datetimetz_db_datetimetz(), ldr_datetimetz_elem(), ldr_double_elem(), ldr_elo_ext_db_elo(), ldr_elo_ext_elem(), ldr_finish_context(), ldr_float_elem(), ldr_generic(), ldr_init_loader(), ldr_int_db_bigint(), ldr_int_db_generic(), ldr_int_db_int(), ldr_int_db_short(), ldr_int_elem(), ldr_json_db_json(), ldr_mismatch(), ldr_monetary_db_monetary(), ldr_monetary_elem(), ldr_mop_tempoid_maps_init(), ldr_nstr_db_varnchar(), ldr_null_db_generic(), ldr_numeric_db_generic(), ldr_numeric_elem(), ldr_oid_db_object(), ldr_oid_elem(), ldr_real_db_double(), ldr_real_db_float(), ldr_real_db_generic(), ldr_refresh_attrs(), ldr_reset_context(), ldr_start(), ldr_str_db_char(), ldr_str_db_varchar(), ldr_time_db_time(), ldr_time_elem(), ldr_timestamp_db_timestamp(), ldr_timestamp_elem(), ldr_timestampltz_db_timestampltz(), ldr_timestampltz_elem(), ldr_timestamptz_db_timestamptz(), ldr_timestamptz_elem(), ldr_update_statistics(), ldr_xstr_db_varbit(), ldr_xstr_elem(), locator_get_object(), locator_lock_and_get_object_with_evaluation(), log_get_mvcc_snapshot(), logpb_debug_check_log_page(), main(), make_node_info(), MCReadCat(), mq_get_expression(), mq_translate_helper(), net_histo_print(), net_histo_print_global_stats(), net_histo_stop(), net_set_alloc_err_if_not_set(), or_install_btids_filter_pred(), pgbuf_remove_thrd_holder(), pgbuf_unlatch_thrd_holder(), prm_get_next_param_value(), pt_attr_check_default_cs_coll(), pt_check_enum_data_type(), pt_coerce_value_internal(), pt_copy_upddel_hints_to_select(), pt_eval_expr_type(), pt_evaluate_db_value_expr(), pt_for_update_prepare_query(), pt_for_update_prepare_query_internal(), pt_get_enumeration_from_data_type(), pt_report_to_ersys(), pt_report_to_ersys_with_statement(), pt_set_limit_optimization_flags(), pt_split_pred_regu_list(), pt_wrap_select_list_with_cast_op(), pwrite_with_injected_fault(), qdata_add_bigint_to_dbval(), qdata_add_bigint_to_timestamptz(), qdata_add_int_to_dbval(), qdata_add_int_to_timestamptz(), qdata_add_short_to_dbval(), qdata_add_short_to_timestamptz(), qdata_finalize_analytic_func(), qdata_get_class_of_function(), qdata_subtract_bigint_to_dbval(), qdata_subtract_datetime_to_dbval(), qdata_subtract_datetimetz_to_dbval(), qdata_subtract_int_to_dbval(), qdata_subtract_short_to_dbval(), qdata_subtract_time_to_dbval(), qdata_subtract_timestampltz_to_dbval(), qdata_subtract_timestamptz_to_dbval(), qexec_execute_selupd_list(), qexec_schema_get_type_desc(), rmutex_finalize(), sboot_get_locales_info(), sboot_get_timezone_checksum(), sbtree_load_index(), scan_init_indx_coverage(), scan_init_multi_range_optimization(), select_set_domain(), session_check_timeout(), session_create_prepared_statement(), session_define_variable(), session_get_prepared_statement(), session_remove_expired_sessions(), slogin_user(), slogtb_get_mvcc_snapshot(), sm_get_class_with_statistics(), sm_get_statistics_force(), smt_check_foreign_key(), ssession_create_prepared_statement(), ssession_delete_prepared_statement(), ssession_drop_session_variables(), ssession_end_session(), ssession_get_last_insert_id(), ssession_get_prepared_statement(), ssession_get_row_count(), ssession_get_session_variable(), ssession_reset_cur_insert_id(), ssession_set_row_count(), ssession_set_session_variables(), stde_get_data_keys(), stde_get_mk_file_path(), stmt_exec_batch_query_internal(), svacuum(), sysprm_make_default_values(), sysprm_validate_change_parameters(), tde_add_mk(), tde_change_mk(), tde_cipher_initialize(), tde_copy_keys_file(), tde_create_keys_file(), tde_decrypt_data_page(), tde_decrypt_internal(), tde_encrypt_data_page(), tde_encrypt_internal(), tde_find_first_mk(), tde_generate_keyinfo(), tde_initialize(), tde_load_dks(), tde_load_mk(), tp_value_cast_internal(), tp_value_coerce_strict(), tran_flush_to_commit(), trigger_to_object(), update_default_instances_stats(), ux_get_last_insert_id(), ux_get_row_count(), valcnv_convert_set_to_string(), values_list_to_values_array(), wsa_initialize(), xsession_get_last_insert_id(), xsession_reset_cur_insert_id(), xsession_set_cur_insert_id(), xstats_get_statistics_from_server(), xtde_change_mk_without_flock(), and xtde_get_mk_info().

#define errx (   fd,
  ... 
)    do { fprintf(stderr, __VA_ARGS__); exit(1); } while (0)

Definition at line 432 of file porting.h.

Referenced by MCReadCat(), xmalloc(), xrealloc(), and xstrdup().

#define EXPORT_VAR

Definition at line 51 of file porting.h.

#define FINITE (   x)    finite(x)

Definition at line 388 of file porting.h.

Referenced by round_double().

#define IMPORT_VAR   extern

Definition at line 50 of file porting.h.

#define INVALID_SOCKET   (-1)

Definition at line 483 of file porting.h.

Referenced by broker_find_available_proxy(), broker_get_readable_proxy_conn(), broker_set_proxy_fds(), connect_srv(), css_accept(), css_accept_new_request(), css_accept_old_request(), css_close_connection_to_master(), css_close_server_connection_socket(), css_init(), css_master_accept(), css_master_thread(), css_open_new_socket_from_master(), css_process_close_packet(), css_process_heartbeat_request(), css_reestablish_connection_to_master(), css_send_io_vector_with_socket(), css_server_accept(), css_shutdown_conn(), css_sockaddr(), css_tcp_client_open_with_retry(), css_tcp_client_open_with_timeout(), css_tcp_master_datagram(), dispatch_thr_f(), hb_cleanup_conn_and_start_process(), hb_cluster_cleanup(), hb_cluster_initialize(), hb_cluster_send_heartbeat_internal(), hb_hostname_n_port_to_sockaddr(), hb_is_deactivation_ready(), hb_resource_shutdown_all_ha_procs(), javasp_ping_server(), javasp_status_server(), javasp_stop_server(), jsp_close_connection(), jsp_connect_server(), jsp_execute_stored_procedure(), jsp_init(), jsp_send_destroy_request_all(), main(), net_connect_client(), net_connect_proxy(), net_init_env(), net_read_int_keep_con_auto(), proxy_cas_alloc_anything(), proxy_cas_io_find_by_fd(), proxy_cas_io_free(), proxy_cas_io_free_by_ctx(), proxy_cas_io_initialize(), proxy_cas_io_new(), proxy_client_io_free(), proxy_client_io_initialize(), proxy_convert_error_code(), proxy_io_close_all_fd(), proxy_io_initialize(), proxy_io_register_to_broker(), proxy_listener_thr_f(), proxy_process_cas_conn_error(), proxy_process_cas_read_error(), proxy_process_cas_write_error(), proxy_process_client_read_error(), proxy_process_client_write_error(), proxy_socket_io_add(), proxy_socket_io_clear(), proxy_socket_io_delete(), proxy_socket_io_destroy(), shard_cas_main(), and shard_dispatch_thr_f().

#define IS_INVALID_SOCKET (   socket)    ((socket) < 0)

Definition at line 484 of file porting.h.

Referenced by cas_main(), cas_ssl_read(), cas_ssl_write(), connect_srv(), css_accept(), css_block_all_active_conn(), css_check_master_socket_exception(), css_check_master_socket_input(), css_close_conn(), css_close_connection_to_master(), css_close_server_connection_socket(), css_common_connect(), css_does_master_exist(), css_enroll_exception_sockets(), css_enroll_read_sockets(), css_is_shutdown_timeout_expired(), css_master_accept(), css_master_select_error(), css_master_thread(), css_open_server_connection_socket(), css_process_all_count_info(), css_process_all_list_info(), css_process_close_packet(), css_process_new_client(), css_process_server_count_info(), css_process_server_list_info(), css_process_server_state(), css_process_shutdown(), css_process_stop_shutdown(), css_receive_heartbeat_data(), css_receive_heartbeat_request(), css_register_new_server(), css_register_new_server2(), css_send_command_to_server(), css_send_error(), css_send_heartbeat_data(), css_send_heartbeat_request(), css_send_io_vector_with_socket(), css_send_message_to_server(), css_send_request_with_socket(), css_send_to_existing_server(), css_setup_server_loop(), css_shutdown_conn(), css_shutdown_socket(), css_tcp_client_open(), css_tcp_client_open_with_retry(), css_tcp_listen_server_datagram(), css_tcp_master_datagram(), css_tcp_master_open(), css_tcp_setup_server_datagram(), dispatch_thr_f(), hb_deregister_from_master(), hb_process_master_request(), hb_register_to_master(), init_env(), jsp_close_connection(), jsp_connect_server(), jsp_execute_stored_procedure(), jsp_send_destroy_request_all(), net_connect_client(), net_connect_proxy(), net_init_env(), net_server_request(), proxy_io_accept(), proxy_io_cas_lsnr(), proxy_io_process(), proxy_io_register_to_broker(), proxy_shard_io_destroy(), proxy_socket_io_destroy(), read_buffer(), receiver_thr_f(), shard_cas_main(), write_buffer(), and write_to_client_with_timeout().

#define IS_PATH_SEPARATOR (   c)    ((c) == PATH_SEPARATOR)

Definition at line 351 of file porting.h.

#define LLONG_MAX   9223372036854775807LL

Definition at line 75 of file porting.h.

Referenced by str_to_int64().

#define LLONG_MIN   (-LLONG_MAX - 1LL)

Definition at line 78 of file porting.h.

Referenced by str_to_int64().

#define LONGJMP   _longjmp

Definition at line 368 of file porting.h.

#define MEM_SIZE_IS_VALID (   size)
Value:
(((long long unsigned) (size) <= ULONG_MAX) \
|| (sizeof (long long unsigned) <= sizeof (size_t)))

Definition at line 85 of file porting.h.

Referenced by pgbuf_initialize_bcb_table().

#define OFF_T_MAX   LLONG_MAX

Definition at line 475 of file porting.h.

Referenced by fileio_flush_backup().

#define ONE_G   1073741824

Definition at line 64 of file porting.h.

Referenced by util_size_to_byte().

#define ONE_HOUR   3600000

Definition at line 70 of file porting.h.

Referenced by ut_time_string_to_sec(), and util_time_to_msec().

#define ONE_M   1048576
#define ONE_MIN   60000

Definition at line 69 of file porting.h.

Referenced by ut_time_string_to_sec(), and util_time_to_msec().

#define ONE_P   1125899906842624LL

Definition at line 66 of file porting.h.

Referenced by util_size_to_byte().

#define ONE_SEC   1000
#define ONE_T   1099511627776LL

Definition at line 65 of file porting.h.

Referenced by util_size_to_byte().

#define os_send_kill ( )    os_send_signal(SIGKILL)

Definition at line 500 of file porting.h.

#define PATH_CURRENT   '.'

Definition at line 349 of file porting.h.

Referenced by basename_r(), cub_dirname_r(), and er_init().

#define PORTABLE_FUNC_NAME   "(unknown)"

Definition at line 1025 of file porting.h.

#define REFPTR (   T,
  name 
)    T *& name

Definition at line 1089 of file porting.h.

Referenced by db_private_realloc_external(), and pgbuf_assign_direct_victim().

#define SETJMP   _setjmp

Definition at line 369 of file porting.h.

#define string_to_double (   str,
  end_ptr 
)    strtod((str), (end_ptr))

Definition at line 972 of file porting.h.

Referenced by tp_atof().

#define strncpy_size (   buf,
  str,
  size 
)    strncpy (buf, str, size); buf[(size) - 1] = '\0'

Definition at line 326 of file porting.h.

Referenced by boot_restart_server(), and xboot_initialize_server().

#define SUPPRESS_STRLEN_WARNING

Definition at line 462 of file porting.h.

#define ULLONG_MAX   18446744073709551615ULL

Definition at line 81 of file porting.h.

Referenced by str_to_uint64(), and sysprm_get_param_range().

#define UNUSED (   x)    x

Definition at line 1031 of file porting.h.

#define UNUSED_FUNCTION (   x)    x

Definition at line 1037 of file porting.h.

Typedef Documentation

typedef void(* SIGNAL_HANDLER_FUNCTION) (int sig_no)

Definition at line 502 of file porting.h.

typedef int SOCKET

Definition at line 482 of file porting.h.

Function Documentation

int asprintf ( char **  ptr,
const char *  format,
  ... 
)
int basename_r ( const char *  path,
char *  pathbuf,
size_t  buflen 
)

Definition at line 1082 of file porting.c.

References PATH_CURRENT, PATH_SEPARATOR, and strlen.

Referenced by basename(), boot_get_host_name(), boot_set_server_session_key(), broker_config_read(), and clientids::set_program_name().

Here is the caller graph for this function:

int cub_dirname_r ( const char *  path,
char *  pathbuf,
size_t  buflen 
)

Definition at line 989 of file porting.c.

References PATH_CURRENT, PATH_SEPARATOR, and strlen.

Referenced by dirname(), er_file_backup(), er_file_open(), event_file_open(), fileio_lock_la_dbname(), ha_mkdir(), javasp_open_info_dir(), xboot_copy(), and xboot_initialize_server().

Here is the caller graph for this function:

char* getuserid ( char *  string,
int  size 
)

Definition at line 1271 of file porting.c.

References NULL.

Referenced by boot_initialize_client(), boot_restart_client(), css_sprintf_conn_infoids(), fileio_check_lockby_file(), fileio_lock(), fileio_lock_la_log_path(), and tran_unilaterally_abort().

Here is the caller graph for this function:

int msleep ( const long  msec)

Definition at line 2657 of file porting.c.

References assert, and error().

Referenced by db_sleep().

Here is the caller graph for this function:

int os_rename_file ( const char *  src_path,
const char *  dest_path 
)

Definition at line 1294 of file porting.c.

Referenced by es_posix_final(), fileio_rename(), fileio_unformat_and_rename(), logpb_archive_active_log(), and logpb_restore().

Here is the caller graph for this function:

void os_send_signal ( const int  sig_no)

Definition at line 1378 of file porting.c.

References assert, bool, COND_BROADCAST, cubregex::count(), FALSE, mutex, NULL, p, pthread_mutex_destroy, pthread_mutex_init, strlen, THREAD_CALLING_CONVENTION, THREAD_RET_T, and TRUE.

Referenced by signal_stop().

Here is the caller graph for this function:

int parse_bigint ( INT64 *  ret_p,
const char *  str_p,
int  base 
)

Definition at line 2318 of file porting.c.

References assert, error(), and str_to_int64().

Referenced by ldr_int_db_bigint(), ldr_int_elem(), sp_make_int_sp_value_from_string(), cubload::to_db_bigint(), cubload::to_int_generic(), and util_put_option_value().

Here is the caller graph for this function:

void port_close_memstream ( FILE *  fp,
char **  ptr,
size_t *  sizeloc 
)

Definition at line 2220 of file porting.c.

References NULL.

Referenced by do_send_plan_trace_to_session(), lock_detect_local_deadlock(), pt_plan_query(), qexec_clear_regu_variable_list(), qo_top_plan_print_text(), and session_get_trace_stats().

Here is the caller graph for this function:

FILE* port_open_memstream ( char **  ptr,
size_t *  sizeloc 
)
int str_to_double ( double *  ret_p,
char **  end_p,
const char *  str_p 
)

Definition at line 2479 of file porting.c.

References assert, and NULL.

int str_to_float ( float *  ret_p,
char **  end_p,
const char *  str_p 
)

Definition at line 2509 of file porting.c.

References assert, and NULL.

int str_to_int64 ( INT64 *  ret_p,
char **  end_p,
const char *  str_p,
int  base 
)

Definition at line 2419 of file porting.c.

References assert, LLONG_MAX, LLONG_MIN, and NULL.

Referenced by ldr_elo_ext_elem(), parse_bigint(), and cubload::to_db_elo_ext().

Here is the caller graph for this function:

int str_to_uint32 ( unsigned int *  ret_p,
char **  end_p,
const char *  str_p,
int  base 
)

Definition at line 2382 of file porting.c.

References assert, and NULL.

Referenced by load_console_conv_data(), load_unicode_data(), and string_to_int_array().

Here is the caller graph for this function:

int str_to_uint64 ( UINT64 *  ret_p,
char **  end_p,
const char *  str_p,
int  base 
)

Definition at line 2449 of file porting.c.

References assert, NULL, and ULLONG_MAX.

Referenced by sysprm_generate_new_value().

Here is the caller graph for this function:

char* strdup ( const char *  str)

Definition at line 901 of file porting.c.

References assert, strlen, and vasprintf().

Referenced by access_log_open(), add_fk_info_result(), alloc_dynamic(), applylogdb(), area_create(), au_user_name_dup(), boot_restart_server(), build_attr_change_map(), build_query_graph_function_index(), cfg_new_db(), cfg_update_db(), chksum_get_prev_checksum_results(), classobj_btid_from_property_value(), classobj_check_index_exist(), classobj_make_foreign_key_ref(), conf_file_has_been_loaded(), create_child_process(), csql(), csql_help_info(), csql_set_column_width_info(), css_init(), cub_catopen(), db_query_plan_dump_file(), db_set_preferred_hosts(), disk_get_remarks(), dl_validate_file_entry(), do_alter_index_rebuild(), do_promote_partition_by_name(), do_reclaim_class_addresses(), do_remove_partition_pre(), dumplocale(), er_dump_call_stack_to_string(), er_file_open(), event_file_open(), fh_create(), fileio_get_volume_label(), genlocale(), get_args(), hb_resource_job_proc_start(), heap_cache_class_info(), heap_get_class_info_from_record(), heap_get_class_name_alloc_if_diff(), heap_get_indexinfo_of_btid(), if(), ini_table_set(), init_default_conn_info(), init_tester_info(), installdb(), JSON_VALIDATOR::JSON_VALIDATOR(), jsp_check_stored_procedure_name(), jsp_start_server(), la_add_repl_filter(), load_console_conv_data(), load_properties(), locale_check_and_set_shared_data(), locale_compile_locale(), locator_initialize(), log_open(), log_prepare(), log_recovery_resetlog(), log_top(), main(), make_node_info(), method_initialize_vacomm_buffer(), msgcat_open(), object_to_trigger(), or_get_constraint_comment(), or_get_current_representation(), or_install_btids_class(), or_install_btids_filter_pred(), or_install_btids_foreign_key(), or_install_btids_foreign_key_ref(), or_install_btids_function_info(), pp_add_whenever_to_scope(), pp_new_cursor(), pp_new_stmt(), pp_new_structdef(), pp_new_symbol(), prm_file_has_been_loaded(), prm_set_force(), process_bind(), pt_fillin_type_size(), pt_get_attr_name(), pt_get_node_title(), pt_node_to_function_index(), qexec_execute_build_indexes(), qmgr_set_query_error(), query_info_add(), query_info_add_ne(), read_conf(), save_constraint_info_from_pt_node(), session_add_variable(), sm_save_constraint_info(), sp_create_parser(), sql_info_add(), sql_info_write(), start_include_collation(), start_one_alphabet(), start_one_collation(), stmt_exec_batch_query_internal(), stmt_exec_prepared_batch_internal(), stmt_make_error_info(), stmt_reset_session_and_parse(), sysprm_generate_new_value(), sysprm_set_sysprm_value_from_parameter(), sysprm_set_value(), sysprm_unpack_sysprm_value(), tr_create_trigger(), tr_drop_trigger(), tr_process_name(), tr_rename_trigger(), tr_set_comment(), tzc_compile_data(), tzc_compile_ds_rules(), tzc_index_raw_subdata(), uc_change_config(), update_locksets_for_multiple_rename(), util_make_ha_conf(), util_put_option_value(), util_split_string(), util_str_to_time_since_epoch(), xlocator_reserve_class_name(), xlogtb_get_pack_tran_table(), and xstrdup().

char* stristr ( const char *  s,
const char *  find 
)

Definition at line 1242 of file porting.c.

References NULL, and strlen.

Referenced by pt_get_hint().

Here is the caller graph for this function:

size_t strlcpy ( char *  ,
const char *  ,
size_t   
)

Definition at line 2584 of file porting.c.

References assert.

Referenced by boot_restart_server(), cub_catopen(), envvar_expand(), es_posix_init(), xtx_add_lob_locator(), and xtx_change_state_of_locator().

Here is the caller graph for this function:

int timeval_add_msec ( struct timeval *  added_time,
const struct timeval *  start_time,
int  msec 
)

Definition at line 2152 of file porting.c.

Referenced by dwb_wait_for_block_completion(), dwb_wait_for_strucure_modification(), logpb_flush_pages(), and pgbuf_flush_chkpt_seq_list().

Here is the caller graph for this function:

INT64 timeval_diff_in_msec ( const struct timeval *  end_time,
const struct timeval *  start_time 
)

Definition at line 2133 of file porting.c.

Referenced by pgbuf_flush_seq_list().

Here is the caller graph for this function:

int timeval_to_timespec ( struct timespec *  to,
const struct timeval *  from 
)

Definition at line 2173 of file porting.c.

References assert.

Referenced by dwb_wait_for_block_completion(), dwb_wait_for_strucure_modification(), and logpb_flush_pages().

Here is the caller graph for this function:

int vasprintf ( char **  ptr,
const char *  format,
va_list  ap 
)

Definition at line 936 of file porting.c.

References cubregex::count(), and NULL.

Referenced by asprintf(), pt_frob_error(), pt_frob_warning(), and strdup().

Here is the caller graph for this function: