[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] Move terminal port procedures into chicken
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] [PATCH] Move terminal port procedures into chicken.port |
Date: |
Mon, 12 Feb 2018 18:52:47 +0100 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Mon, Feb 12, 2018 at 09:34:48AM +1300, Evan Hanson wrote:
> Hi Peter,
>
> > +#define C_C_fileno(p) C_fix(fileno(C_port_file(p)))
> > +
> > +#if !defined(__ANDROID__) && defined(TIOCGWINSZ)
> > +static int get_tty_size(int p, int *rows, int *cols)
> > +{
> > + struct winsize tty_size;
> > + int r;
> > +
> > + memset(&tty_size, 0, sizeof tty_size);
> > +
> > + r = ioctl(p, TIOCGWINSZ, &tty_size);
>
> Don't we still need to include termios.h somewhere, for TIOCGWINSZ?
Good catch!
> I think we should return ENOSYS here, too, rather than having
> `terminal-size' return zeros. The function is effectively not
> implemented on Windows, so let's indicate that with an exception.
It actually already returns -1, but I've added the ENOSYS errno set
to ensure we show a proper error.
Updated patch attached.
Cheers,
Peter
0001-Move-terminal-port-procedures-from-posix-to-chicken..patch
Description: Text Data
signature.asc
Description: PGP signature