public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [Linux-ia64] pipe() not setting errno.
@ 2002-04-04 11:48 Anders Herbjørnsen
  2002-04-04 13:36 ` Andreas Schwab
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Anders Herbjørnsen @ 2002-04-04 11:48 UTC (permalink / raw)
  To: linux-ia64

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Linux-ia64] pipe() not setting errno.
  2002-04-04 11:48 [Linux-ia64] pipe() not setting errno Anders Herbjørnsen
@ 2002-04-04 13:36 ` Andreas Schwab
  2002-04-05 14:02 ` Anders Herbjørnsen
  2002-04-05 16:44 ` Ulrich Drepper
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Schwab @ 2002-04-04 13:36 UTC (permalink / raw)
  To: linux-ia64

Anders Herbjørnsen <anders.herbjornsen@start.no> writes:

|> 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.

It's a bug in glibc, this should fix it:

2002-04-04  Andreas Schwab  <schwab@suse.de>

	* sysdeps/unix/sysv/linux/ia64/pipe.S: Don't overwrite r8 on
	error.

--- sysdeps/unix/sysv/linux/ia64/pipe.S.~1.2.~	2001-07-16 10:45:29.000000000 +0200
+++ sysdeps/unix/sysv/linux/ia64/pipe.S	2002-04-04 14:35:31.000000000 +0200
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by David Mosberger <davidm@hpl.hp.com>
 
@@ -28,7 +28,7 @@
        cmp.ne p6,p0=-1,r10
        ;;
 (p6)   st4 [r2]=r8,4
-       mov ret0=0
+(p6)   mov ret0=0
        ;;
 (p6)   st4 [r2]=r9
 (p6)   ret

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Linux-ia64] pipe() not setting errno.
  2002-04-04 11:48 [Linux-ia64] pipe() not setting errno Anders Herbjørnsen
  2002-04-04 13:36 ` Andreas Schwab
@ 2002-04-05 14:02 ` Anders Herbjørnsen
  2002-04-05 16:44 ` Ulrich Drepper
  2 siblings, 0 replies; 4+ messages in thread
From: Anders Herbjørnsen @ 2002-04-05 14:02 UTC (permalink / raw)
  To: linux-ia64

Reply to the message of Thursday April 4, 2002 15:36 +0100
-----------------------------------------------------------------
Andreas Schwab <schwab@suse.de internet> writes:

|> 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.

>It's a bug in glibc, this should fix it:

Thanks, the patch worked like charm!

Anders


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Linux-ia64] pipe() not setting errno.
  2002-04-04 11:48 [Linux-ia64] pipe() not setting errno Anders Herbjørnsen
  2002-04-04 13:36 ` Andreas Schwab
  2002-04-05 14:02 ` Anders Herbjørnsen
@ 2002-04-05 16:44 ` Ulrich Drepper
  2 siblings, 0 replies; 4+ messages in thread
From: Ulrich Drepper @ 2002-04-05 16:44 UTC (permalink / raw)
  To: linux-ia64

[-- Attachment #1: Type: text/plain, Size: 448 bytes --]

On Thu, 2002-04-04 at 05:36, Andreas Schwab wrote:

> 2002-04-04  Andreas Schwab  <schwab@suse.de>
> 
> 	* sysdeps/unix/sysv/linux/ia64/pipe.S: Don't overwrite r8 on
> 	error.

I've applied the patch now.  Thanks,

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-04-05 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-04 11:48 [Linux-ia64] pipe() not setting errno Anders Herbjørnsen
2002-04-04 13:36 ` Andreas Schwab
2002-04-05 14:02 ` Anders Herbjørnsen
2002-04-05 16:44 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox