TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: R.WIESER
from: TAUNO VOIPIO
date: 2017-12-28 19:34:00
subject: Re: For the I2C-1 `file`,

On 22.12.17 12:28, R.Wieser wrote:
> Hello All,
>
> When I open /dev/i2c-1 and want to send some data to a certain port on the
> target device I currently always need to first combine the two into a single
> buffer, and than call 'write' providing it that buffer.  Which feels a bit
> wastefull to me.
>
> My question therefore is:
> 1) Is there a way, for the above I2C "file", to do a multi-part write which
> gets accepted as a single one ?
> - and/or -
> 2) Is there a way to set the target port in another way - maybe in the same
> way the device address is currently set (using ioctl) ?
>
> My googeling did not turn up anything like it, which I why I'm asking here.


It seems that you're looking for gather write system call, it writes
from multiple buffers in a single system call. The call to look for
is writev(). Read its man page or google for it.

--

-TV

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.