@@ -217,6 +217,8 @@ static int local_connection_cache_use_sbuf_envvar = 0;
217217
218218static int connection_cache_entries = 0 ;
219219
220+ int cdb2_use_ftruncate = 0 ;
221+ static int cdb2_use_ftruncate_set_from_env = 0 ;
220222static int cdb2_use_env_vars = 1 ;
221223static int cdb2_install_set_from_env = 0 ;
222224static int cdb2_uninstall_set_from_env = 0 ;
@@ -1438,6 +1440,8 @@ static void read_comdb2db_environment_cfg(cdb2_hndl_tp *hndl, const char *comdb2
14381440 if (!have_read_env ) {
14391441 // Do these once.
14401442 process_env_var_str_on_off ("COMDB2_FEATURE_IAM_IDENTITY" , & iam_identity , & cdb2_iam_identity_set_from_env );
1443+ process_env_var_str_on_off ("COMDB2_FEATURE_USE_FTRUNCATE" , & cdb2_use_ftruncate ,
1444+ & cdb2_use_ftruncate_set_from_env );
14411445 process_env_var_str ("COMDB2_CONFIG_ROOM" , (char * )& cdb2_machine_room , sizeof (cdb2_machine_room ),
14421446 & cdb2_machine_room_set_from_env );
14431447 process_env_var_int ("COMDB2_CONFIG_PORTMUXPORT" , & CDB2_PORTMUXPORT , & cdb2_portmuxport_set_from_env );
@@ -1567,6 +1571,10 @@ static void read_comdb2db_cfg(cdb2_hndl_tp *hndl, SBUF2 *s, const char *comdb2db
15671571 tok = strtok_r (NULL , " =:," , & last );
15681572 if (tok )
15691573 iam_identity = value_on_off (tok , & err , 0 );
1574+ } else if (!cdb2_use_ftruncate_set_from_env && (strcasecmp ("use_ftruncate" , tok ) == 0 )) {
1575+ tok = strtok_r (NULL , " =:," , & last );
1576+ if (tok )
1577+ cdb2_use_ftruncate = value_on_off (tok , & err , 0 );
15701578 } else if ((strcasecmp ("use_env_vars" , tok ) == 0 ) && !hndl ) {
15711579 tok = strtok_r (NULL , " =:," , & last );
15721580 if (tok )
0 commit comments