mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
Compare commits
4
Commits
c1bc473410
...
67d06cf1ed
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67d06cf1ed | ||
|
|
ae99c82c76 | ||
|
|
4b0fb442dc | ||
|
|
50bc1b8ce7 |
No files matched your search
+15
-26
@@ -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
@@ -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
|
||||
|
||||
@@ -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.
|
||||
Reference in new issue
Block a user