HEADS UP: IFF_NEEDSGIANT consumers to be disabled, removed

Ed Schouten ed at 80386.nl
Tue Feb 17 03:56:52 PST 2009


Hello Michael,

* Michael Butler <imb at protected-networks.net> wrote:
> I have NETGRAPH_BLUETOOTH et al defined in my kernel which automagically
> creates /dev/ubt0. With the appropriate entries in
> /etc/bluetooth/[hosts|hcsecd.conf], I simply do ..
> 
> imb at toshi:/home/imb> less bin/gps-connect.sh
> #!/bin/sh
> /usr/bin/rfcomm_sppd -b -a QstarzGPS -t /dev/ttyp9
> 
>  .. to bring it out to a device where roadnav or gspdrive can read it.
> 
> Should I be doing something else in this script now?

Well, this is not related to IFF_NEEDSGIANT and everything's fine, but
there is something else I don't like about this approach in general (the
way rfcomm_sppd works), namely that you `hardcode' a PTY name on the
command line. There is never a guarantee ttyp9 is available for use,
because another user can use it to log in with SSH, for example.

Can you try this patch?

	http://80386.nl/pub/rfcomm_sppd.diff

This changes the -t switch to take no argument and let the pseudo-
terminal be allocated with posix_openpt(). Unfortunately I don't know
how practical this is for rfcomm_sppd. So let me get this straight: when
you use rfcomm_sppd -t, the application itself will not give any output
and will close immediately (because it is run in the background).  Maybe
we could change it to just printf() the pseudo-terminal name, so you can
do something like this:

	TTYNAME="`rfcomm_sppd -b -a QstarzGPS -t`"
	# Use $TTYNAME here

Any opinions on the subject? (Other people as well?)

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20090217/50607a42/attachment.pgp


More information about the freebsd-current mailing list