Commit Graph

8454 Commits

Author SHA1 Message Date
Enji Cooper
58c03e4e08 gethostby_test: fix multiple warning types
- Fix -Wmissing-declaration warning by staticizing run_tests.
- Fix -Wsign-compare warnings by casting size_t types to int
  for comparisons.

Reindent some of the code in sdump_hostent(..) to accomodate the
overall changes.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:34:57 +00:00
Enji Cooper
42f519347e getproto_test: fix -Wunused warnings
Mark unused parameters __unused in functions.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:15:57 +00:00
Enji Cooper
eaff481c05 getrpc_test: fix -Wunused warnings
- Mark unused function parameters unused.
- Remove an unused function prototype.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:15:05 +00:00
Enji Cooper
2b19d77418 getserv_test: mark unused parameters __unused to fix corresponding
warnings

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:12:52 +00:00
Enji Cooper
93ee3b7e9b getusershell_test: mark mdata parameter in compare_usershell __unused
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:12:02 +00:00
Enji Cooper
bd8f63f25c getaddrinfo_test: mark unused function parameters __unused to fix -Wunused
warnings

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:11:04 +00:00
Enji Cooper
c4519040b5 getproto_test: fix -Wmissing-prototypes and -Wsign-compare warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:05:19 +00:00
Enji Cooper
8b0fc406e5 getrpc_test: fix -Wmissing-prototypes and -Wsign-compare warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:04:32 +00:00
Enji Cooper
905de51259 getaddrinfo_test: fix -Wsign-compare warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:03:45 +00:00
Enji Cooper
93936a0653 getserv_test: fix -Wsign-compare and -Wmissing-prototypes warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 04:03:06 +00:00
Enji Cooper
bbccc5a736 getusershell_test: staticize run_tests(..) to fix warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 03:58:36 +00:00
Enji Cooper
4a9a8952c0 Fix -Wsign-compare warnings
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 03:47:58 +00:00
Enji Cooper
bd874c6a7f Staticize functions and remove unused variables to aid with bumping WARNS
MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 03:42:49 +00:00
Enji Cooper
ae8cdfddc3 Sort make variables to suit style.Makefile(5)
This is being done prior to functional changes.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 03:39:24 +00:00
Enji Cooper
3bdd6cf05d lib/libc/tests/nss: use calloc appropriately
The pattern used prior to this commit was `calloc(1, n * sizeof(type))`;
the pattern that should be used however is `calloc(n, sizeof(type))`.

MFC after:	3 days
Sponsored by:	Dell EMC Isilon
2017-05-28 02:55:04 +00:00
Pedro F. Giffuni
0523111725 fts_open: move bogus initialization further below, before it is used.
Move an unneeded initialization, introduced in r54770 to quiet down GCC,
to a place nearer to its first use. This has no practical effect, it just
keeps the garbage better sorted.

Hinted by:	OpenBSD (CVS rev. 1.56, without obfuscations)
2017-05-26 01:14:58 +00:00
Edward Tomasz Napierala
a9a393b390 Don't end up manpage titles with a full stop.
MFC after:	2 weeks
2017-05-24 21:02:53 +00:00
Glen Barber
4adb408018 Update the "first appeared in" version in several manual pages.
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
2017-05-24 17:50:34 +00:00
Allan Jude
f299c47b52 Allow cpuset_{get,set}affinity in capabilities mode
bhyve was recently sandboxed with capsicum, and needs to be able to
control the CPU sets of its vcpu threads

Reviewed by:	emaste, oshogbo, rwatson
MFC after:	2 weeks
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D10170
2017-05-24 00:58:30 +00:00
Enji Cooper
7828a9ccb7 directory(3): add trailing comma after e.g., missed in r318699
Submitted by:	bjk
MFC after:	2 weeks
MFC with:	r318699
Sponsored by:	Dell EMC Isilon
2017-05-23 17:34:10 +00:00
Eric van Gyzen
5a6d7b723f libthr: fix warnings from GCC when WARNS=6
Fix warnings about:
- redundant declarations
- a local variable shadowing a global function (dlinfo)
- an old-style function definition (with an empty parameter list)
- a variable that is possibly used uninitialized

"make tinderbox" passes this time, except for a few unrelated
kernel failures.

Reviewed by:	kib
MFC after:	3 days
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D10870
2017-05-23 16:12:50 +00:00
Konstantin Belousov
6992112349 Commit the 64-bit inode project.
Extend the ino_t, dev_t, nlink_t types to 64-bit ints.  Modify
struct dirent layout to add d_off, increase the size of d_fileno
to 64-bits, increase the size of d_namlen to 16-bits, and change
the required alignment.  Increase struct statfs f_mntfromname[] and
f_mntonname[] array length MNAMELEN to 1024.

ABI breakage is mitigated by providing compatibility using versioned
symbols, ingenious use of the existing padding in structures, and
by employing other tricks.  Unfortunately, not everything can be
fixed, especially outside the base system.  For instance, third-party
APIs which pass struct stat around are broken in backward and
forward incompatible ways.

Kinfo sysctl MIBs ABI is changed in backward-compatible way, but
there is no general mechanism to handle other sysctl MIBS which
return structures where the layout has changed. It was considered
that the breakage is either in the management interfaces, where we
usually allow ABI slip, or is not important.

Struct xvnode changed layout, no compat shims are provided.

For struct xtty, dev_t tty device member was reduced to uint32_t.
It was decided that keeping ABI compat in this case is more useful
than reporting 64-bit dev_t, for the sake of pstat.

Update note: strictly follow the instructions in UPDATING.  Build
and install the new kernel with COMPAT_FREEBSD11 option enabled,
then reboot, and only then install new world.

Credits: The 64-bit inode project, also known as ino64, started life
many years ago as a project by Gleb Kurtsou (gleb).  Kirk McKusick
(mckusick) then picked up and updated the patch, and acted as a
flag-waver.  Feedback, suggestions, and discussions were carried
by Ed Maste (emaste), John Baldwin (jhb), Jilles Tjoelker (jilles),
and Rick Macklem (rmacklem).  Kris Moore (kris) performed an initial
ports investigation followed by an exp-run by Antoine Brodin (antoine).
Essential and all-embracing testing was done by Peter Holm (pho).
The heavy lifting of coordinating all these efforts and bringing the
project to completion were done by Konstantin Belousov (kib).

Sponsored by:	The FreeBSD Foundation (emaste, kib)
Differential revision:	https://reviews.freebsd.org/D10439
2017-05-23 09:29:05 +00:00
Enji Cooper
9227de8c73 kill(2): add missing section for sysctl(9)
Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:46:10 +00:00
Enji Cooper
945cb7775f ptrace(2): clean up trailing whitespace
Reviewed by:	make manlint
MFC after:	2 weeks
2017-05-23 07:45:29 +00:00
Enji Cooper
7661c8b028 open(2): fix manlint warnings
- Sort SEE ALSO .Xr entries.
- Sort sections (HISTORY comes after STANDARDS).

Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:44:43 +00:00
Enji Cooper
c0f64185c6 rctl_add_rule(2): fix manlint warnings
- Fix commas (either missing or misused) after .Nm entries in SYNOPSIS

Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:32:57 +00:00
Enji Cooper
60f14b3186 cap_enter(2): fix manlint issues
- Sort SEE ALSO section appropriately.
- Correct section for sysctl(9).

Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:31:03 +00:00
Enji Cooper
bb09af5f58 _umtx_op(2): fix minor manlint issues
- Sort .Xr entries in SEE ALSO section.
- Sort SEE ALSO and STANDARDS sections properly, in terms of the
  entire document.

Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:26:45 +00:00
Enji Cooper
94f6747eb9 xdr(3): add missing comma after xdr_sizeof(3) in SYNOPSIS
This unbreaks the .Nm declaration

Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:17:52 +00:00
Enji Cooper
2a105685d2 fopencookie(3): declare function pointers in SYNOPSIS correctly
Add obligatory `*` in declarations.

Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:15:57 +00:00
Enji Cooper
40850c3b4f quick_exit(3): delete trailing whitespace in licensing tort
Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:14:46 +00:00
Enji Cooper
7372d8148c acl_to_text(3): start sentences on new lines
Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:12:31 +00:00
Enji Cooper
5f19e26b75 acl_create_entry(3): separate .Nm entries with commas in SYNOPSIS
Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:11:15 +00:00
Enji Cooper
f18519e1d5 sctp_send(3): start sentences on new lines
Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:10:20 +00:00
Enji Cooper
5e84ba7a43 localeconv(3): start sentences on new lines
Reported by:	make manlint
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:09:26 +00:00
Enji Cooper
39d657f5db fopen(3): make manlint fixes
- Break on new lines.
- Use .Dv with NULL.
- Rewrap lines as necessary/when possible.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:08:30 +00:00
Enji Cooper
b4b5c4a602 posix1e(3): reference using the section (3) when referencing libbsm with .Xr
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 07:05:34 +00:00
Enji Cooper
a18696433a __iconv_get_list: separate .Nm entries with commas
MFC after:	2 weeks
Reported by:	make manlint
Sponsored by:	Dell EMC Isilon
2017-05-23 07:02:01 +00:00
Enji Cooper
671ea87fba tcsendbreak(3): delete spurious blank line at the end of the man page
MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 06:58:08 +00:00
Enji Cooper
3d54bd2294 dirname(3): fix section ordering
IMPLEMENTATION NOTES come before RETURN VALUES

MFC after:	2 weeks
Reported by:	make manlint
Sponsored by:	Dell EMC Isilon
2017-05-23 06:56:57 +00:00
Enji Cooper
a966418a66 directory(3): delete trailing whitespace and rewrite E.g. as e.g.
Reported by:	make manlint
Sponsored by:	Dell EMC Isilon
2017-05-23 06:55:51 +00:00
Enji Cooper
41a9662896 basename(3): fix section ordering
IMPLEMENTATION NOTES come before RETURN VALUES

MFC after:	2 weeks
Reported by:	make manlint
Sponsored by:	Dell EMC Isilon
2017-05-23 06:53:31 +00:00
Enji Cooper
1384163706 err(3): use NULL, aka (void*)0 per POSIX instead of (FILE *)0
This is being done to aid humans and static analysis checkers.

MFC after:	2 weeks
Sponsored by:	Dell EMC Isilon
2017-05-23 06:14:02 +00:00
Eric van Gyzen
07f29d9f76 Remove old spinlock_debug code from libc
This no longer seems useful.  Remove it.

This was prompted by a "cast discards volatile qualifier" warning
in libthr when WARNS=6.

Reviewed by:	kib
MFC after:	3 days
Sponsored by:	Dell EMC
Differential Revision:	https://reviews.freebsd.org/D10832
2017-05-20 17:32:01 +00:00
Xin LI
ca1578f0c0 The current qsort(3) implementation ignores the sizes of partitions, and
always perform recursion on the left partition, then use a tail call to
handle the right partition.  In the worst case this could require O(N)
levels of recursions.

Reduce the possible recursion level to log2(N) by always recursing on the
smaller partition instead.

Obtained from:	PostgreSQL 9d6077abf9d6efd992a59f05ef5aba981ea32096
2017-05-19 04:59:12 +00:00
Xin LI
a3f893fc61 Use size_t.
Inspired by:	OpenBSD src/lib/libc/stdlib/qsort.c,v 1.11
2017-05-19 04:44:14 +00:00
Konstantin Belousov
fade31741d Add tests for some cases in r318298.
The first test triggers the out of bounds read of the 'left' array. It
only fails when realpath.c is compiled with '-fsanitize=address'.

The other test checks for ENOENT when running into an empty
symlink. This matches NetBSD's realpath(3) semantics. Previously,
empty symlinks were treated like ".".

Submitted by:	Jan Kokemц╪ller <jan.kokemueller@gmail.com>
PR:	219154
MFC after:	2 weeks
2017-05-18 13:49:53 +00:00
Stephen J. Kiernan
f55d7dd1c9 Add information to open(2) man page about the O_VERIFY flag.
Reviewed by:	bjk wblock
Approved by:	sjg (mentor)
Obtained from:	Juniper Networks, Inc.
2017-05-15 19:32:26 +00:00
Ed Maste
b47e69e69e getusershell: don't write past end of line buffer reading local shells
_local_initshells did not reset cp to the beginning of the line buffer
for every iteration that it called fgets(3), leading to writing past the
end of line with fairly long /etc/shells or excessively long line
lengths. Correct this by properly resetting cp.

PR:		192528
Submitted by:	Kyle Evans <kevans91@ksu.edu>
Reviewed by:	cem, jilles
Differential Revision:	https://reviews.freebsd.org/D10690
2017-05-15 17:57:09 +00:00
Konstantin Belousov
cf5cedd785 Style.
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2017-05-15 17:54:36 +00:00