Re: RE: pipe() syscall on ia64 (tiger) doesn't set errno to EMFILE

Jacky Malcles <[email protected]> Mon, 28 Apr 2003 10:48:41 +0200
Newsgroups gmane.linux.redhat.ia64.general
Message-ID <[email protected]>
thanks to you David and Tony,

 your answers are helpfull, 
BTW I load a version with 
Gnu make               3.79.1
util-linux             2.11u
mount                  2.11u
modutils               2.4.19
e2fsprogs              1.28
PPP                    2.4.1
isdn4k-utils           3.2p1
Linux C Library        so.6.1
Dynamic linker (ldd)   2.2.5
Linux C++ Library      5.0.0
Procps                 2.0.7
Net-tools              1.60
Kbd                    1.06
Sh-utils               2.0

and have errno sets appropriatly,
many thanks , bye
Jacky


[email protected] wrote:
> 
> Send ia64-list mailing list submissions to
>         [email protected]
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://listman.redhat.com/mailman/listinfo/ia64-list
> or, via email, send a message with subject or body 'help' to
>         [email protected]
> 
> You can reach the person managing the list at
>         [email protected]
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of ia64-list digest..."
> 
>   ------------------------------------------------------------------------
> Today's Topics:
> 
>    1. RE: pipe() syscall on ia64 (tiger) doesn't set errno to EMFILE (Luck, Tony)
>    2. RE: pipe() syscall on ia64 (tiger) doesn't set errno to EMFILE (David Mosberger)
>    3. RE: pipe() syscall on ia64 (tiger) doesn't set errno to EMFILE (digiovanni, lucio)
> 
>   ------------------------------------------------------------------------
> 
> Subject: RE: pipe() syscall on ia64 (tiger) doesn't set errno to EMFILE
> Date: Thu, 24 Apr 2003 09:12:45 -0700
> From: "Luck, Tony" <[email protected]>
> Reply-To: [email protected]
> To: <[email protected]>
> 
> Running strace, here are the last few lines:
> 
> pipe([993, 994])                        = 995
> pipe([995, 996])                        = 997
> pipe(0x6000000000000e78)                = -1 EMFILE (Too many open files)
> SYS_1212(0x1, 0x60000fffffffb310, 0x200000000001a420, 0xc00000000000020a, 0x2000000000041808, 0x2000000000001f6e, 0, 0x13) = 0
> mmap(NULL, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x20000000002b4000
> write(1, "errno set to EMFILE  0\n\n", 24errno set to EMFILE  0
> 
> Looks like strace saw "EMFILE" coming back from the system call, so its probably
> someplace in the libc code where that is either getting lost, or overwritten.
> My test was run on AS2.1 ... ldd says the library versions are
>         libc.so.6.1 => /lib/libc.so.6.1 (0x2000000000044000)
>         /lib/ld-linux-ia64.so.2 => /lib/ld-linux-ia64.so.2 (0x2000000000000000)
> 
> -Tony
> 
>   ------------------------------------------------------------------------
> 
> Subject: RE: pipe() syscall on ia64 (tiger) doesn't set errno to EMFILE
> Date: Thu, 24 Apr 2003 09:21:59 -0700
> From: David Mosberger <[email protected]>
> Reply-To: [email protected]
> To: [email protected]
> References: <[email protected]>
> 
> >>>>> On Thu, 24 Apr 2003 09:12:45 -0700, "Luck, Tony" <[email protected]> said:
> 
>   Tony> Looks like strace saw "EMFILE" coming back from the system
>   Tony> call, so its probably someplace in the libc code where that
>   Tony> is either getting lost, or overwritten.  My test was run on
>   Tony> AS2.1 ... ldd says the library versions are libc.so.6.1 =>
>   Tony> /lib/libc.so.6.1 (0x2000000000044000) /lib/ld-linux-ia64.so.2
>   Tony> => /lib/ld-linux-ia64.so.2 (0x2000000000000000)
> 
> The test-program works fine with libc-2.3.1.  It fails with
> libc-2.2.5.  Looks like a bug-fix for pipe() wasn't back-ported.
> 
>         --david
> 
>   ------------------------------------------------------------------------
> 
> Subject: RE: pipe() syscall on ia64 (tiger) doesn't set errno to EMFILE
> Date: Thu, 24 Apr 2003 13:32:52 -0400
> From: "digiovanni, lucio" <[email protected]>
> Reply-To: [email protected]
> To: "'[email protected]'" <[email protected]>
> 
> Do you mean npipes instead of pipes as the index?
> 
>     pipe_ret = pipe(npipes);
> 
> Instead of
>     pipe_ret = pipe(pipes);
> 
> -Lu
> 
> -----Original Message-----
> From: Jacky Malcles [mailto:[email protected]]
> Sent: Thursday, April 24, 2003 3:48 AM
> To: [email protected]
> Subject: pipe() syscall on ia64 (tiger) doesn't set errno to EMFILE
> 
> Can someone please tell me what is wrong with this:
> 
> /* expecting errno set to EMFILE but it isn't */
> 
> #include <unistd.h>
> #include <stdio.h>
> #include <fcntl.h>
> #include <errno.h>
> 
> int pipe_ret, pipes[2];
> 
> int main(int ac, char **av)
> {
>         int npipes;                     /* number of pipes opened */
> 
>                 for (npipes = 0; ; npipes++) {
>                         /*errno=-EMFILE;*/
>                         pipe_ret = pipe(pipes);
>                         /*printf(" errno = %d \n",errno);*/
> 
>                         if (pipe_ret < 0) {
>                                 printf("errno set to EMFILE  %d
> \n",errno);
>                                 printf(" npipes = %d \n",npipes);
>                                 break;
>                                 }
>                 }
> 
>         return 0;
> }
> 
> running it i get:
> [root@cza pipe]# pipe12
> errno set to EMFILE  0
>  npipes = 510
> [root@cza pipe]#
> 
> I think i should get, something like:
> errno set to EMFILE  24
>  npipes = 510
> 
> I currently have:
> Red Hat Linux release 7.2 (Enigma)
> 
> Gnu C                  2.96
> Gnu make               3.79.1
> binutils               2.11.90.0.8
> util-linux             2.11f
> mount                  2.11g
> modutils               2.4.10
> e2fsprogs              1.23
> reiserfsprogs          3.x.0j
> Linux C Library        2.2.4
> Dynamic linker (ldd)   2.2.4
> Procps                 2.0.11
> Net-tools              1.60
> Console-tools          0.3.3
> Sh-utils               2.0.11
> 
> /proc/cpuinfo
> processor  : 0
> vendor     : GenuineIntel
> arch       : IA-64
> family     : Itanium 2
> ...etc..
> 
> Linux version 2.5.64
> 
> thank you for your help,
> 
>  Jacky Malcles                  Email : [email protected]
>  Tel : 04.76.29.73.14
> 
>   ------------------------------------------------------------------------
> _______________________________________________
> ia64-list mailing list
> [email protected]
> https://listman.redhat.com/mailman/listinfo/ia64-list

-- 
 Jacky Malcles    	     B1-173   Email : [email protected]
 Bull SA, 1 rue de Provence, B.P 208, 38432 Echirolles CEDEX, FRANCE
 Tel : 04.76.29.78.98