Regarding select() on PPC

Sadashiiv, Halesh halesh.sadashiv at
Fri Sep 19 21:50:31 EST 2008

Hi all,

Please find the below testcase.

#include <stdio.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <stdlib.h>

int main()

 int fd;
 fd_set rfds;
 struct timeval tv;
 int ret_val;

 if ((fd = open("test_file", O_RDWR|O_CREAT, 0664)) < 0)
    printf("Open failed\n");

  FD_SET(fd, &rfds);

  /* Wait up to five seconds. */
  tv.tv_sec = 1;
  tv.tv_usec = 0;

  if ( (ret_val = select(-1, &rfds, NULL, NULL, &tv)) < 0)
    if ( ret_val == EINVAL)
      printf("Not OK, Got errno %d\n", errno);

For negetive value of n (first argument to select) select fails with
EINVAL error,

But for the same when I tested for PowerPC it was giving EFAULT, 
Its on 2.6.16 kernel.

Please let me know, If this is fixed or it's a issue in PPC.
For other archs its working fine.


This email is confidential and intended only for the use of the individual or entity named above and may contain information that is privileged. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this email is strictly prohibited. If you have received this email in error, please notify us immediately by return email or telephone and destroy the original message. - This mail is sent via Sony Asia Pacific Mail Gateway.

More information about the Linuxppc-embedded mailing list