{ freelist = runp->next_run; runp->running = allocated; }
runlist = runp->next_run;
handle_fildes_io (void *arg){  pthread_t self = pthread_self ();  struct sched_param param;  struct requestlist *runp = (struct requestlist *) arg;  aiocb_union *aiocbp = runp->aiocbp;  int policy;  int fildes = runp->aiocbp->aiocb.aio_fildes;  pthread_getschedparam (self, &policy, &param);  do    {      /* Change the priority to the requested value (if necessary).  */      if (aiocbp->aiocb.__abs_prio != param.sched_priority	  || aiocbp->aiocb.__policy != policy)	{	  param.sched_priority = aiocbp->aiocb.__abs_prio;	  policy = aiocbp->aiocb.__policy;	  pthread_setschedparam (self, policy, &param);	}      /* Process request pointed to by RUNP.  We must not be disturbed	 by signals.  */      if ((aiocbp->aiocb.aio_lio_opcode & 127) == LIO_READ)	{	  if (aiocbp->aiocb.aio_lio_opcode & 128)	    aiocbp->aiocb.__return_value =	      TEMP_FAILURE_RETRY (__pread64 (fildes,					     (void *) aiocbp->aiocb64.aio_buf,					     aiocbp->aiocb64.aio_nbytes,					     aiocbp->aiocb64.aio_offset));	  else	    aiocbp->aiocb.__return_value =	      TEMP_FAILURE_RETRY (pread (fildes,					 (void *) aiocbp->aiocb.aio_buf,					 aiocbp->aiocb.aio_nbytes,					 aiocbp->aiocb.aio_offset));	}      else if ((aiocbp->aiocb.aio_lio_opcode & 127) == LIO_WRITE)	{	  if (aiocbp->aiocb.aio_lio_opcode & 128)	    aiocbp->aiocb.__return_value =	      TEMP_FAILURE_RETRY (__pwrite64 (fildes,					      (const void *) aiocbp->aiocb64.aio_buf,					      aiocbp->aiocb64.aio_nbytes,					      aiocbp->aiocb64.aio_offset));	  else	    aiocbp->aiocb.__return_value =	      TEMP_FAILURE_RETRY (pwrite (fildes,					  (const void *) aiocbp->aiocb.aio_buf,					  aiocbp->aiocb.aio_nbytes,					  aiocbp->aiocb.aio_offset));	}      else if (aiocbp->aiocb.aio_lio_opcode == LIO_DSYNC)	aiocbp->aiocb.__return_value = TEMP_FAILURE_RETRY (fdatasync (fildes));      else if (aiocbp->aiocb.aio_lio_opcode == LIO_SYNC)	aiocbp->aiocb.__return_value = TEMP_FAILURE_RETRY (fsync (fildes));      else	{	  /* This is an invalid opcode.  */	  aiocbp->aiocb.__return_value = -1;	  __set_errno (EINVAL);	}      /* Get the mutex.  */      pthread_mutex_lock (&__aio_requests_mutex);      if (aiocbp->aiocb.__return_value == -1)	aiocbp->aiocb.__error_code = errno;      else	aiocbp->aiocb.__error_code = 0;      /* Send the signal to notify about finished processing of the	 request.  */      __aio_notify (runp);      /* Now dequeue the current request.  */      if (runp->next_prio == NULL)	{	  /* No outstanding request for this descriptor.  Process the	     runlist if necessary.  */	  if (runp->next_fd != NULL)	    runp->next_fd->last_fd = runp->last_fd;	  if (runp->last_fd != NULL)	    runp->last_fd->next_fd = runp->next_fd;	}      else	{	  runp->next_prio->last_fd = runp->last_fd;	  runp->next_prio->next_fd = runp->next_fd;	  runp->next_prio->running = yes;	  if (runp->next_fd != NULL)	    runp->next_fd->last_fd = runp->next_prio;	  if (runp->last_fd != NULL)	    runp->last_fd->next_fd = runp->next_prio;	}      /* Free the old element.  */      __aio_free_request (runp);      runp = freelist;      if (runp != NULL)	{	  /* We must not run requests which are not marked `running'.  */	  if (runp->running == yes)	    {	      freelist = runp->next_run;	      runp->running = allocated;	    }	  else	    {	      struct requestlist *old;	      do		{		  old = runp;		  runp = runp->next_run;		}	      while (runp != NULL && runp->running != yes);	      if (runp != NULL)		old->next_run = runp->next_run;	    }	}      /* If no request to work on we will stop the thread.  */      if (runp == NULL)	--nthreads;      /* Release the mutex.  */      pthread_mutex_unlock (&__aio_requests_mutex);    }  while (runp != NULL);  pthread_exit (NULL);}