Name

sched_yield - yield the processor

Library

libc.lib

Synopsis

  #include <sched.h>
  int sched_yield (void);

Return values

The sched_yield function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error.

Detailed description

The sched_yield system call forces the running process to relinquish the processor until it again becomes the head of its process list. It takes no arguments.

Examples

#include <stdio.h>
#include <sched.h>
int main()
{
 int i = sched_yield(void);
 printf("Expected: 0, sched_yield returned: %d"), i);
}

         

Output

Expected: 0, sched_yield returned: 0

         

Errors

[EINTR]
  A signal was delivered to the process and its action was to invoke a signal-catching function.


Feedback

For additional information or queries on this page send feedback

© 2008-2009 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user.

Top