bash problems ? (was Re: cygwin fork())
Fri Sep 1 17:50:00 GMT 2006
I'm just changing the subject so that Eric will, with luck, notice
and comment on what's going on here.
On Fri, Sep 01, 2006 at 10:47:13AM -0700, email@example.com wrote:
>On Fri, Sep 01, 2006 at 01:24:57PM -0400, Christopher Faylor wrote:
>> >In regards to setting the fd to textmode as a way of stripping CRs.
>> >Only problem is that it's making 213,110 syscalls for a 213k libtool
>> >script. That cannot be an efficient way to remove CRs from input.
>> Opening a file with O_TEXT should not, AFAIK, cause a bunch of one-byte
>> A simple test case (tm) seems to confirm that.
>You're right. I also verified this.
>I found the real culprit, which I had also ifdef'd out because it looked
>bogus and crufty:
>/* Return 1 if a seek on FD will succeed. */
># define fd_is_seekable(fd) (lseek ((fd), 0L, SEEK_CUR) >= 0)
># define fd_is_seekable(fd) 0
>#endif /* __CYGWIN__ */
>/* Take FD, a file descriptor, and create and return a buffered stream
> corresponding to it. If something is wrong and the file descriptor
> is invalid, return a NULL stream. */
> int fd;
> char *buffer;
> size_t size;
> struct stat sb;
> if (fstat (fd, &sb) < 0)
> close (fd);
> return ((BUFFERED_STREAM *)NULL);
> size = (fd_is_seekable (fd)) ? min (sb.st_size, MAX_INPUT_BUFFER_SIZE) : 1;
> if (size == 0)
> size = 1;
> buffer = (char *)xmalloc (size);
> return (make_buffered_stream (fd, buffer, size));
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
More information about the Cygwin