Compare commits

...
4 Commits
Author SHA1 Message Date
Goran Mekić 67d06cf1ed sound examples: trigger dsp devices via syncgroup
Triggering is only needed if device is in mmap mode, and in mmap example
the device is triggered as part of syncgroup. For non-mmap mode,
triggering is not needed at all. Triggering mmap'ed device too early
would start the IPTR/OPTR counters and that would cause those pointers
to be out of sync, so let syncgroup do the triggering once the device is
fully configured and ready for capture and playback.

MFC after:	1 week
Reviewed by:	christos
Differential Revision:	https://reviews.freebsd.org/D60839

(cherry picked from commit d3aa926bff)
2026-10-26 18:04:57 +01:00
Wolfram Schneider ae99c82c76 locate.1: clarify bytes vs. characters
The database stores bytes, not characters. Remove the historical
note about 7-bit storage. Also document that -i ignores case only
for ASCII letters.

Reviewed by: ziaee
MFC after: 3 days

(cherry picked from commit a03b051f23)
2026-10-26 11:08:20 +00:00
Wolfram Schneider 4b0fb442dc find.1: rewrite the -s flag section for clarity
Restructure the description of -s flag:
1. what the option does
2. why it is useful (deterministic order, streaming output)
3. how its results can differ from `find | sort'

Reviewed by: ziaee
MFC after: 3 days

(cherry picked from commit ad0f866941)
2026-10-26 11:06:17 +00:00
Ryan Libby 50bc1b8ce7 find.1: fix rendering of find -s example
The period here is part of the literal string in the example.  Adding a
space caused the example to be quoted wrongly.  Instead, a trailing
zero-width space keeps the linter mandoc -T happy.

Reviewed by:	ziaee
Differential Revision:	https://reviews.freebsd.org/D59353

(cherry picked from commit 3581b6db62)
2026-10-26 11:05:56 +00:00
3 changed files with 58 additions and 45 deletions

No files matched your search

+15 -26
View File
@@ -98,10 +98,6 @@ oss_init(struct config *config)
if (ioctl(config->fd, SNDCTL_DSP_GETCAPS, &config->audio_info.caps) < 0)
err(1, "Unable to get capabilities");
/* Check if device supports triggering */
if (!(config->audio_info.caps & PCM_CAP_TRIGGER))
errx(1, "Device doesn't support triggering!\n");
/* Handle memory mapped mode */
if (config->mmap) {
if (!(config->audio_info.caps & PCM_CAP_MMAP))
@@ -216,27 +212,24 @@ oss_init(struct config *config)
config->sample_count, config->audio_info.max_channels,
config->sample_size, config->sample_rate, config->format);
/* Set trigger direction and mmap protection */
switch (config->mode & O_ACCMODE) {
case O_RDONLY:
tmp = PCM_ENABLE_INPUT;
prot = PROT_READ;
break;
case O_WRONLY:
tmp = PCM_ENABLE_OUTPUT;
prot = PROT_WRITE;
break;
case O_RDWR:
tmp = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT;
prot = PROT_READ | PROT_WRITE;
break;
default:
errx(1, "Invalid mode %d", config->mode);
break;
}
/* Map or allocate the buffer */
if (config->mmap) {
/* Set mmap protection */
switch (config->mode & O_ACCMODE) {
case O_RDONLY:
prot = PROT_READ;
break;
case O_WRONLY:
prot = PROT_WRITE;
break;
case O_RDWR:
prot = PROT_READ | PROT_WRITE;
break;
default:
errx(1, "Invalid mode %d", config->mode);
break;
}
config->buf = mmap(NULL, config->buffer_info.bytes, prot, MAP_SHARED, config->fd, 0);
if (config->buf == MAP_FAILED)
err(1, "Memory map failed");
@@ -244,8 +237,4 @@ oss_init(struct config *config)
if ((config->buf = malloc(config->buffer_info.bytes)) == NULL)
err(1, "Allocating buffer failed");
}
/* Set the trigger */
if (ioctl(config->fd, SNDCTL_DSP_SETTRIGGER, &tmp) < 0)
err(1, "Failed to set trigger");
}
+31 -10
View File
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd February 14, 2026
.Dd October 20, 2026
.Dt FIND 1
.Os
.Sh NAME
@@ -149,23 +149,44 @@ and
Cause
.Nm
to traverse the file hierarchies in lexicographical order,
i.e., alphabetical order within each directory.
Note:
.Ql find -s
sorting entries within each directory.
.Pp
The output order is deterministic for a given locale and does not
depend on the type of
file system or on the order in which directory entries were created.
This is useful for comparing results between runs, reproducible
builds, and automated tests.
.Pp
Since entries are sorted per directory,
.Ql "find -s"
typically uses less memory and temporary disk space than
.Ql "find | sort" .
Unlike
.Ql "find | sort" ,
.Ql "find -s"
can produce output while the traversal is still in progress,
allowing a long-running pipeline such as
.Ql "find -s . -print0 | xargs -0 -n1 /slow/script"
to begin processing files immediately.
The predictable order also makes the progress easy to follow,
e.g., with
.Xr ps 1 .
.Pp
Note that
.Ql "find -s"
and
.Ql "find | sort"
may give different results.
.Pp
For example,
.Ql find -s
.Ql "find -s"
puts a directory
.Ql Ar foo
with all its contents before a directory
.Ql Ar foo .
.Ql Ar foo\&. ,
but
.Ql "find | sort"
puts the directory name
.Ql Ar foo .
.Ql Ar foo\&.
before any string like
.Ql Ar foo/bar
because
@@ -174,8 +195,8 @@ goes before
.Ql /
in ASCII.
In locales other than
.Ar C
results may vary more due to collation differences.
.Ar C ,
the two may differ further because of locale-dependent collation.
.It Fl x
Prevent
.Nm
+12 -9
View File
@@ -1,4 +1,4 @@
.\" Copyright (c) 1995 Wolfram Schneider <[email protected]>. Berlin.
.\" Copyright (c) 1995-2026 Wolfram Schneider <[email protected]>
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
@@ -26,7 +26,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd December 11, 2020
.Dd October 22, 2026
.Dt LOCATE 1
.Os
.Sh NAME
@@ -70,17 +70,16 @@ As a special case, a pattern containing no globbing characters
is matched as though it were
.Dq *foo* .
.Pp
Historically, locate only stored characters between 32 and 127.
The
current implementation stores any character except newline
The database can store any byte in a path name except newline
.Pq Sq \en
and
.Dv NUL
.Pq Sq \e0 .
The 8-bit character support does not waste extra space for
plain ASCII file names.
Characters less than 32 or greater than 127
are stored in 2 bytes.
Bytes with values from 32 to 127
.Pq printable ASCII characters and DEL
are stored in at most one byte;
all other bytes take two bytes.
For example, a two-byte UTF-8 character takes four bytes in the database.
.Pp
The following options are available:
.Bl -tag -width 10n
@@ -159,6 +158,7 @@ Note: you can only use
pattern for stdin.
.It Fl i
Ignore case distinctions in both the pattern and the database.
Only ASCII letters are folded.
.It Fl l Ar number
Limit output to
.Ar number
@@ -266,3 +266,6 @@ a locate database which was built on SunOS/sparc machine
The
.Nm
utility does not recognize multibyte characters.
The
.Fl i
option ignores case only for ASCII letters.