Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Oct 2020 22:56:34 +0800
From:      Ka Ho Ng <khng@freebsdfoundation.org>
To:        freebsd-arch@freebsd.org
Subject:   Re: Draft IOCTL commands on sndstat
Message-ID:  <CAAiyo%2B9Dv0XisY7-6G7pNE-uje=TyTMkg%2Byek8k46LJML53FBA@mail.gmail.com>
In-Reply-To: <CAAiyo%2B9Na2iJdE_M-FHbBozzX5WY95EinfdWHXgSZZw3fvzOpw@mail.gmail.com>
References:  <CAAiyo%2B9Na2iJdE_M-FHbBozzX5WY95EinfdWHXgSZZw3fvzOpw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Meanwhile, I was thinking if things sound better that we create
another label called `nameunit` to hold
something like pcm0, and prepend /dev/ to existing `devnode` string.
By doing so, callers only need to
directly use the `devnode` string to open the node without the hassle
of snprintf/asprintf.

Here is a piece of code to enumerate audio devices without error
checking with `nameunit` label added:
https://gist.github.com/khng300/b9b3ccc86c24691273dc36c85066e2dd

Ka Ho

On Thu, Oct 22, 2020 at 1:55 AM Ka Ho Ng <khng@freebsdfoundation.org> wrote:
>
> Hi all,
>
> I have proposed a set of IOCTLs on sndstat. The IOCTLs are nvlist-based,
> and the goal of these IOCTLs aims at eliminating text parsing as a
> generic user space API.
> Here is the link to the differential:
> https://reviews.freebsd.org/D26884. A piece of sample code
> is also provided to demonstrate the usage of the IOCTLs.
>
> Regards,
> Ka Ho



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAiyo%2B9Dv0XisY7-6G7pNE-uje=TyTMkg%2Byek8k46LJML53FBA>