1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-02 22:35:36 -08:00
Commit Graph

33 Commits

Author SHA1 Message Date
cheloha
d7259957e8 userspace: remove vestigial '?' cases from top-level getopt(3) loops
getopt(3) returns '?' when it encounters a flag not present in the in
the optstring or if a flag is missing its option argument.  We can
handle this case with the "default" failure case with no loss of
legibility.  Hence, remove all the redundant "case '?':" lines.

Prompted by dlg@.  With help from dlg@ and millert@.

Link: https://marc.info/?l=openbsd-tech&m=167011979726449&w=2

ok naddy@ millert@ dlg@
2022-12-04 23:50:45 +00:00
claudio
bbd193179e This no longer needs the inet pledge. sysconf(3) was modified to report
_POSIX_IPV6 without opening a socket using a method that is allowed by
the vminfo plegde.
OK sthen@ deraadt@
2022-07-20 14:23:13 +00:00
beck
bc5a8259a4 Change the error reporting pattern throughout the tree when unveil
fails to report the path that the failure occured on. Suggested by
deraadt@ after some tech discussion.

Work done and verified by Ashton Fagg <ashton@fagg.id.au>

ok deraadt@ semarie@ claudio@
2021-07-12 15:09:18 +00:00
mestre
39972dfb8a The code path were we pass `pathname' in the arguments is already limited
with pledge(2), but since we know exactly what it is then we can go further and
also unveil(2) it with read permissions.

OK millert@ deraadt@
2018-10-26 17:11:32 +00:00
schwarze
84d7e2a2af Delete some useless setlocale(3) calls in /usr/bin, no functional change.
Patches from Jan Stary <hans at stare dot cz>, tweaked by me and tb@.
While here, apply some simple style improvements:
Sort headers, static void __dead usage(), return from main(),
zap case '?', drop /* NOTREACHED */, drop break after usage(), ...
OK tb@ millert@
2016-10-28 07:22:59 +00:00
jca
73ef282f78 Pledge for getconf(1). ok deraadt@ benno@
kern_pledge.c necessary additions committed earlier by deraadt@
2015-11-17 17:29:27 +00:00
millert
2a63b04941 Add sysconf() extensions PHYS_PAGES, AVPHYS_PAGES, NPROCESSORS_CONF
and NPROCESSORS_ONLN.  OK guenther@
2015-03-22 01:14:34 +00:00
guenther
d4648cd609 Add support for _PC_TIMESTAMP_RESOLUTION for ffs/mfs, cd9600, ext2,
msdos, NFS, fifos and devices, plus support for querying it in
getconf(2) and the requisite pathconf(2) manpage blurb

ok tedu@
2013-03-28 03:29:44 +00:00
guenther
420a52b0b6 Remove a couple duplicates entries that snuck in.
Per POSIX, if confstr() returns zero without setting errno ("no
defined value") then print "undefined\n".
Don't include a pointless number in the error messasge if confstr() fails.
Above pointed out by Andres Perera (andres.p (at) zoho.com)

Orgranize the CONFSTR code like the SYSCONF and PATHCONF cases.
Don't test for confstr() returning (size_t)-1, as that's not special.
Delete lint comments and unnecessary casts.
2013-03-07 08:54:53 +00:00
jmc
e2f8c590af sort options, and avoid line wrap, in usage(); ok guenther 2013-03-02 07:18:17 +00:00
jmc
2d77330e4d missing newline; 2013-03-02 07:08:22 +00:00
guenther
59d1056efa Bring getconf(1) substantially up to spec with POSIX 1003.1-2008,
adding 155 new names as well as support for the -v option.

Also, add support for non-standard -L and -l options for listing
the known names.  (Contrast with the Solaris/Linux -a option, whose
output is inconsistent and can't be reliably parsed.)

ports build tested by espie@
2013-03-02 05:33:41 +00:00
jmc
f1c64ac4de add an EXIT STATUS section for /usr/bin; 2010-09-03 11:09:28 +00:00
deraadt
043fbe51c1 rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms
2009-10-27 23:59:19 +00:00
jmc
99332e389a bump the posix reference in STANDARDS to IEEE Std 1003.1-2008, with a few
updates to follow;
2009-02-08 17:15:08 +00:00
sobrado
49378797c9 replace hardcoded exit values with .Ex macros;
ok jmc@
2009-01-04 11:19:55 +00:00
chl
8194b5ee61 fix format string
ok otto@
2008-11-08 01:29:10 +00:00
jmc
9490d37cb6 convert to new .Dd format; 2007-05-31 19:19:00 +00:00
jmc
7c5a075bb3 - use a consistent text for STANDARDS
- note which options are extensions to POSIX
2007-05-30 04:41:33 +00:00
otto
4598616492 check confstr() return value. Due to the braindead return value
specified by POSIX we have to clear errno before; also check for -1 to
remain compatible. ok millert@
2006-12-04 15:05:19 +00:00
david
70ef01f6b6 add missing includes
ok deraadt@ tedu@
2003-07-10 00:03:01 +00:00
deraadt
1837a5ca50 mostly ansi cleanup; pval ok 2003-06-10 22:20:44 +00:00
pjanzen
dbc9b48103 From NetBSD:
Fix an ancient typo which made "_POSIX_PATH_MAX" actually return
"_POSIX_PIPE_BUF".
2003-05-21 00:56:50 +00:00
millert
c72b5b24e1 Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically. 2002-02-16 21:27:05 +00:00
deraadt
c3e1e82e9b first pass at a -Wall cleanup 2001-07-12 05:16:53 +00:00
aaron
16363961dc Sync usage() with man page; mpech@prosoft.org.lv 2001-03-01 21:15:41 +00:00
aaron
453cecf014 Various cleanup. 2000-03-07 21:11:07 +00:00
aaron
2e0eb34f9e - remove trailing white space
- remove arguments from .Os macros
- remove arguments from .Nm macros, where appropriate
- some more Dq/Sq/Ql insanity
- still lots to do in the usr.bin tree... :/
1999-06-05 01:21:16 +00:00
aaron
aea1524a59 usr.bin/ man page fixes, f-m. 1998-09-26 19:54:41 +00:00
deraadt
e189ddde44 $OpenBSD$ 1997-09-21 11:34:32 +00:00
deraadt
1258a77d10 rcsid 1996-06-26 05:31:08 +00:00
deraadt
3b665a4519 call errx instead of err 1996-05-04 09:15:04 +00:00
deraadt
df930be708 initial import of NetBSD tree 1995-10-18 08:37:01 +00:00