Example #1
0
struct mntent *
getmntent (FILE *stream)
{
  static struct mntent m;
  static int once;

  do {
    if (__pthread_once != NULL)
      __pthread_once (&once, allocate);
    else if (once == 0) {
      allocate ();
      once = !(0);
    }
  } while (0);


  if (getmntent_buffer == NULL)
    /* If no core is available we don't have a chance to run the
       program successfully and so returning NULL is an acceptable
       result.  */
    return NULL;

  return __getmntent_r (stream, &m, getmntent_buffer, BUFFER_SIZE);
}
Example #2
0
int pthread_once(pthread_once_t *once_control, void (*init_routine)(void)) {
	if(once_control->__once == 0) {
		return __pthread_once(once_control, init_routine);
	}
	return EOK;
}