Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 6 Feb 2015 22:19:48 +0000
From:      Anuranjan Shukla <anshukla@juniper.net>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        Simon Gerraty <sjg@juniper.net>, "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: Buggy sbspace() on 64bit builds?
Message-ID:  <D0FA7C7B.249B1%anshukla@juniper.net>
In-Reply-To: <20150206183036.S1246@besplex.bde.org>
References:  <D0F95E21.2489D%anshukla@juniper.net> <20150206183036.S1246@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 2/6/15, 12:56 AM, "Bruce Evans" <brde@optusnet.com.au> wrote:

>long
>sbspace(struct sockbuf *sb)
>{
>	u_int bleft, mleft;
>
>	if (sb->sb_flags & SB_STOP)
>		return (0);
>	bleft =3D sb->sb_hiwat < sb->sb_cc ? 0 : sb->sb_hiwat - sb->sb_cc;
>	mleft =3D sb->sb_mbmax < sb->sb_mbcnt ? 9 : sb->sb_mbmax - sb->sb_mbcnt;
>	return (min(bleft, mleft));
>}

This is sort of what we've been using past few years as a local change. Is
this, along with return value being 'int' acceptable as a final
determination?  There are places like sockopt processing where the return
is anyway being typecast to int like Bruce mentioned. Appreciate the
inputs so far.

Thanks
Anu




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D0FA7C7B.249B1%anshukla>