gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] pipe


From: Dave Denholm
Subject: Re: [gnugo-devel] pipe
Date: Tue, 13 Jan 2004 21:37:43 +0000
User-agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.2 (usg-unix-v)

address@hidden (Wolfgang Manner) writes:

> who knows about pipes ?
>
> according to what i read
>    pipe(PIPEDES)
>
> should give
>
>    If successful, two file descriptors are stored in PIPEDES;
>    bytes written on PIPEDES[1] can be read from PIPEDES[0].
>    Returns 0 if successful, -1 if not.  */
>

Sounds about right - definitely works for me on solaris

NAME
     pipe - create an interprocess channel

SYNOPSIS
     #include <unistd.h>

     int pipe(int fildes[2]);

DESCRIPTION
     The pipe() function creates an I/O mechanism called  a  pipe
     and  returns  two file descriptors, fildes[0] and fildes[1].


In fact on solaris, you get a bidirectional pipe. Traditionally,
you can only write to one of the fd's and read from the other.


>  but when i do it i get
>
> PIPEDES[0] = 4
> PIPEDES[1]   some address
>
> and it returns 3
>
> do i have a old version ? i have noticed that i can include
> unistd.h
> or not, it doesnt make any difference
>

Getting 3 and 4 as the two fd's would seem reasonable - perhaps
there's a prototype problem ?

eg

$ truss -f sh -c 'echo x | cat'
...
24110:  pipe()                                          = 3 [4]
...


dd
-- 
Dave Denholm              <address@hidden>       http://www.esmertec.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]