gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] cfmakeraw part 2


From: Gary E. Miller
Subject: Re: [gpsd-dev] cfmakeraw part 2
Date: Wed, 19 Jun 2019 18:22:51 -0700

Yo Greg!

Oh, my.  Someone still uses Slowlaris?

Can you first see waht this says:
        fgrep -r cfmakeraw /usr/include

Every other OS seems to have cfmakeraw() in there somewhere...

If cfmakeraw() is not there your patch looks good.

On Wed, 19 Jun 2019 20:35:01 -0400
Greg Troxel <address@hidden> wrote:

> An explanation of the cfmakeraw issue is at:
> 
>   https://perkin.org.uk/posts/solaris-portability-cfmakeraw.html
> 
> The short story is that cfmakeraw is a nonportable extension, but
> apparently the same everywhere it exists, which I think includes
> linux, *bsd, mac.
> 
> Perhaps gpsd.h should add __sun to the cfmakeraw decl, making the
> implementation in serial.c visible, and not patch gpspipe.c.  I am
> inclined to just do this and let the solaris people deal on the slight
> chance that's wrong.
> 
> Is that ok?
> 
> $NetBSD: patch-gpspipe.c,v 1.2 2019/05/01 20:22:02 gdt Exp $
> 
> cfmakeraw compatability for SunOS.
> 
> --- gpspipe.c.orig    2018-09-22 23:24:39.000000000 +0000
> +++ gpspipe.c
> @@ -97,7 +97,15 @@ static void open_serial(char *device)
>      memset(&newtio, 0, sizeof(newtio));
>  
>      /* make it raw */
> +#if defined(__sun)
> +    newtio.c_iflag &=
> ~(IMAXBEL|IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
> +    newtio.c_oflag &= ~OPOST;
> +    newtio.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN);
> +    newtio.c_cflag &= ~(CSIZE|PARENB);
> +    newtio.c_cflag |= CS8;
> +#else
>      (void)cfmakeraw(&newtio);
> +#endif
>      /* set speed */
>      (void)cfsetospeed(&newtio, BAUDRATE);
>  
> 
> 
> 




RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin

Attachment: pgpqU994etglW.pgp
Description: OpenPGP digital signature


reply via email to

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