All pastes #106739 Raw Edit

Unnamed

public c v1 · immutable
#106739 ·published 2006-07-30 15:06 UTC
rendered paste body
extern int _dlerror_run (void (*operate) (void *), void *args);extern void _dl_signal_error (int errcode,const char *objname,const char *errstring);intdlnam(void *handle, char *filename, int len){  struct link_map *map = handle;  void doit (void *a)  {    if (handle == NULL)      _dl_signal_error (0, NULL, "Null dll handle is invalid");    else    {      if ( (strlen(map->l_name) + 1) <= len )        strcpy(filename, map->l_name);      else        _dl_signal_error (0, NULL, "Not enough memory to return the dll name");    }  }  return _dlerror_run (doit,(void *)NULL) ? -1 : strlen(map->l_name);}