if (result != 0) return result;
__get_clockfreq (void){  /* We read the information from the /proc filesystem.  It contains at     least one line like	cpu MHz         : 497.840237     We search for this line and convert the number in an integer.  */  unsigned long long int result = 0ull;  int fd;  fd = open ("/proc/cpuinfo", O_RDONLY);  if (__builtin_expect (fd != -1, 1))    {      /* XXX AFAIK the /proc filesystem can generate "files" only up         to a size of 4096 bytes.  */      char buf[4096];      ssize_t n;      n = read (fd, buf, sizeof buf);      if (__builtin_expect (n, 1) > 0)	{	  char *mhz = memmem (buf, n, "cpu MHz", 7);	  if (__builtin_expect (mhz != NULL, 1))	    {	      char *endp = buf + n;	      /* Search for the beginning of the string.  */	      while (mhz < endp && (*mhz < '0' || *mhz > '9') && *mhz != '\n')		++mhz;	      while (mhz < endp && *mhz != '\n')		{		  if (*mhz >= '0' && *mhz <= '9')		    {		      result *= 10;		      result += *mhz - '0';		    }		  ++mhz;		}	    }	}      close (fd);    }  return result;}