[Linux-ia64] pipe() not setting errno.

From: Anders Herbjørnsen <anders.herbjornsen_at_start.no>
Date: 2002-04-04 21:48:50
Hello,

When running out of file descriptors pipe() does return -1 but
errno is not set. This is working ok on IA32 systems, but fails
on IA64. I've tested this with kernels 2.4.9 and 2.4.18.

Below is a small sample program to illustrate the problem:

########################################################
#include <stdio.h>
#include <errno.h>
#include <unistd.h>

int main (int argc, char **argv){
  int i;
  for (i = 0; i < 3000; i++) {
    int fd[2];
    if (-1 == pipe(fd))
      break;
    printf ("%d ", i);
  } /* for */
  printf ("\npipe number %d error: errno=%d\n", i, errno);
  return errno;
}
#############################################################

Sample run:

$ ulimit -n 12
$ ./tpipe
0 1 2 3
pipe number 4 error: errno=0

Regards
Anders Herbjørnsen
Received on Thu Apr 04 03:49:04 2002

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:07 EST