size_t len = 0;
get_origin (void){  char linkval[PATH_MAX];  char *result;  if (readlink ("/proc/self/exe", linkval, PATH_MAX) != -1      && linkval[0] != '[')    {      /* We can use this value.  */      char *last_slash = strrchr (linkval, '/');      result = (char *) malloc (last_slash - linkval + 1);      if (result == NULL)	result = (char *) -1;      else	*((char *) __mempcpy (result, linkval, last_slash - linkval)) = '\0';    }  else    {      size_t len = 0;      result = (char *) -1;      /* We use te environment variable LD_ORIGIN_PATH.  If it is set make	 a copy and strip out trailing slashes.  */      if (_dl_origin_path != NULL)	{	  size_t len = strlen (_dl_origin_path);	  result = malloc (len + 1);	  if (result == NULL)	    result = (char *) -1;	  else	    {	      char *cp = __mempcpy (result, _dl_origin_path, len);	      while (cp > result && cp[-1] == '/')		--cp;	      *cp = '\0';	    }	}    }  return result;}