create a ptrdiff_t offset between the start of an allocation region and
some interesting pointer, so it can be adjusted with this offset after
realloc() returns. for pdisk(), realloc() is a locally inlind malloc()
and free() pair.
for mail(1), this required a little bit more effort as the old pointer
was passed into another file for fix-ups there, and that code needed to
be adjusted for offset vs old pointer usage.
found by GCC 12.
When calculating the length of the args that can be
appended in a "find .... -exec something {} +"
usage, remember to allow for the arg pointers, which
form part of what is allowed in ARG_MAX.
From a fairly empty installation of HEAD on amd64
and with a "/tmp/args" command that simply prints
its arg count, and the length of the arg strings,
with this mod I see ..
netbsd# find / -exec /tmp/args {} +
Argc 5000 Arglen 107645
Argc 5000 Arglen 151324
Argc 5000 Arglen 187725
Argc 5000 Arglen 206591
Argc 5000 Arglen 172909
Argc 5000 Arglen 186264
Argc 5000 Arglen 167906
Argc 2881 Arglen 98260
The upper limit of 5000 args is in the code.
Using the biggest of those, 5000
args, plus 206591 bytes of strings
uses 246591 bytes total (this excludes
the command name, so add a few more).
That's fairly close to the ARG_MAX
of 262144.
On another system (with longer paths) I see:
(this is just a small part of the output, using a
different version of the dummy command, and a
slightly different invocation)
Args: 4546 Len 218030
Args: 4878 Len 217991
Args: 4813 Len 218028
Args: 4803 Len 218029
There, 4878*8 + 217991 == 257015 which is about
as close as we'd want to come to the arg limit.
XXX pullup -8
attributes against a user-specified timestamp (rather than the
attributes of a reference file).
Update the parse routines so they have access to the name of the
option being parsed. This enables accurate error reporting for
"aliases" of primaries.
Now that aliases work, introduce some aliases for consistency with
Gnu findutils.
earlier statement concerning n being prefaced by a plus or minus.
(These exceptions to the +/- rule noted by kre@)
While here, fix markup error. .Em for emphasis (stress) rather
than .Ar :)
- remove redundant mentioning of option names within their description;
- improve (and make consistent) punctuation;
- add missing empty line;
- remove superfluous white space;
- extend `-iname' primary description (copying text from `-name');
- general wording improvements;
- improve macro usage;
- remove double spaces from examples (it's readable well without);
- reference re_format(7) in `SEE ALSO' (as it's mentioned in the
text several times);
- bump date.
From Bug Hunting.
Closes PR 44973 (change is a somewhat more principled equivalent of
the patch suggested there) although I cannot replicate the reported
behavior unless I explicitly prepare errno with a nonzero value before
the fts_read loop.
per the standard. Per (brief) discussion on tech-userlevel.
There should really be a form where you can do the equivalent of
"-exec blah {} blah +", but I think we're going to need to call it
something other than -exec. As it is it's sort of surprising that the
standards people didn't add a different name -- note what happens if
you try to do something like "find ... -exec expr {} + 2 \;".