bug-m4
[Top][All Lists]
Advanced

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

Re: mingw lseek bug


From: Brian Dessent
Subject: Re: mingw lseek bug
Date: Wed, 23 May 2007 22:52:04 -0700

Eric Blake wrote:

> However, I'm not sure on mingw how to detect whether an fd is open on a
> regular file vs. a pipe.  Any ideas?

Check out ser-mingw.c from gdb, they have a fair amount of MinGW pipe/fd
handling code there, e.g.

static int
fd_is_pipe (int fd)
{
  if (PeekNamedPipe ((HANDLE) _get_osfhandle (fd), NULL, 0, NULL, NULL,
NULL))
    return 1;
  else
    return 0;
}

Brian




reply via email to

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