delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/04/06/10:52:38

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_MK,TW_PR,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
Message-ID: <4BBB4EE4.9080508@gmail.com>
Date: Tue, 06 Apr 2010 16:10:28 +0100
From: Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: CygWin-1.7.3-1 fails to provide pipe.
References: <4B30AD0BED19E842AAE88DC3973649312411601388 AT mail3 DOT walsh DOT edu> <20100406141508 DOT GD16409 AT ednor DOT casa DOT cgf DOT cx>
In-Reply-To: <20100406141508.GD16409@ednor.casa.cgf.cx>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--------------050104060607080302010205
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

On 06/04/2010 15:15, Christopher Faylor wrote:
> On Tue, Apr 06, 2010 at 07:55:19AM -0400, George Barrick wrote:
>> What I am suggesting is that the new cygwin.dll has difficulties
>> implementing the kind of pipe that octave uses to send its graphing
>> commands to gnuplot.  The specific details of the pipe that serves as
>> an example of this can be seen in the __gnuplot_get_var__.m script
>> inside the GNU Octave package.
> 
> Sorry but unless someone can narrow this down to a test case which
> does not requier installing gnuplot I don't intend on investigating
> this.

  Here ya go.  I took a look at the octave module, and narrowed it down to the
equivalent C testcase attached, which appears to reproduce the same failure
mode for me:

> $ ./tfifo.exe
> Got name /tmp/t1150.0
> mkfifo returns 0 (errno 2)
> Open for read returns file 0x0 (errno is 13)
> 
> $ ls -lart /tmp/t1150.0
> prw------- 1 DKAdmin None 0 2010-04-06 16:05 /tmp/t1150.0
> 
> $

  errno 13 = EACCES = permission denied.  Haven't run through into the DLL to
look at why it's failing yet, and am about to go AFK for a while.
Possibly-relevant information after the failure:

> $ getfacl /tmp/t1150.0
> # file: /tmp/t1150.0
> # owner: DKAdmin
> # group: None
> user::rw-
> group::rw-
> other:rw-
> mask:rwx
> 
> 
> $ cacls `cygpath -w /tmp/t1150.0`
> F:\cygwin-1.7\tmp\t1150.0.lnk UBIK\DKAdmin:F
>                               BUILTIN\Administrators:F
>                               NT AUTHORITY\SYSTEM:F
> 
> 
> $


    cheers,
      DaveK


--------------050104060607080302010205
Content-Type: text/plain;
 name="tfifo.c"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="tfifo.c"


#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <sys/stat.h>

/* C code to perform the same operations as this chunk of
   octave code from the __gnuplot_get_var__.m module:

  if (use_mkfifo)
    gpin_name = tmpnam ();

    ## Mode: 6*8*8 ==  0600
    [err, msg] = mkfifo (gpin_name, 6*8*8);

    if (err != 0)
      error ("__gnuplot_get_var__: Can not make fifo (%s)", msg);
    endif
  endif

  gp_var_name = strtrim (gp_var_name);
  n = min (strfind (gp_var_name, " "), strfind (gp_var_name, ",")) - 1;
  if (isempty (n))
    n = numel (gp_var_name);
  endif

  unwind_protect

    ## Notes: Variables may be undefined if user closes gnuplot by "q"
    ## or Alt-F4. Further, this abrupt close also requires the leading
    ## "\n" on the next line.
    if (use_mkfifo)
      fprintf (ostream, "\nset print \"%s\";\n", gpin_name);
      fflush (ostream);
      [gpin, err] = fopen (gpin_name, "r");
      if (err != 0)
        ## Try a second time, and then give an error.
        [gpin, err] = fopen (gpin_name, "r");
      endif
      if (err != 0)
        error ("__gnuplot_get_var__: Can not open fifo.");
      endif

*/


int main (int argc, const char **argv)
{
  const char *gpin_name;
  int rv;
  FILE *f;

  gpin_name = tmpnam (0);
  printf ("Got name %s\n", gpin_name);

  rv = mkfifo (gpin_name, 0600);
  printf ("mkfifo returns %d (errno %d)\n", rv, errno);

  f = fopen (gpin_name, "r");
  printf ("Open for read returns file %p (errno is %d)\n", f, errno);

  if (f)
    fclose (f);

  return 0;
}


--------------050104060607080302010205
Content-Type: text/plain; charset=us-ascii

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
--------------050104060607080302010205--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019