| 834 | return g_sys_unsetenv_func( n ); |
| 835 | } |
| 836 | char *getenv( const char *n ) |
| 837 | { |
| 838 | HOOK_SYS_FUNC( getenv ) |
| 839 | if( co_is_enable_sys_hook() && g_co_sysenv.data ) |
| 840 | { |
| 841 | stCoRoutine_t *self = co_self(); |
| 842 | |
| 843 | stCoSysEnv_t name = { (char*)n,0 }; |
| 844 | |
| 845 | if( !self->pvEnv ) |
| 846 | { |
| 847 | self->pvEnv = dup_co_sysenv_arr( &g_co_sysenv ); |
| 848 | } |
| 849 | stCoSysEnvArr_t *arr = (stCoSysEnvArr_t*)(self->pvEnv); |
| 850 | |
| 851 | stCoSysEnv_t *e = (stCoSysEnv_t*)bsearch( &name,arr->data,arr->cnt,sizeof(name),co_sysenv_comp ); |
| 852 | |
| 853 | if( e ) |
| 854 | { |
| 855 | return e->value; |
| 856 | } |
| 857 | |
| 858 | } |
| 859 | return g_sys_getenv_func( n ); |
| 860 | |
| 861 | } |
| 862 | struct hostent* co_gethostbyname(const char *name); |
| 863 | |
| 864 | struct hostent *gethostbyname(const char *name) |
no test coverage detected