Commit Graph

19760 Commits

Author SHA1 Message Date
uwe
86bd1b8280 getlogin_r: use strcpy(). We check namelen before copying the result.
gcc 8 -Wstringop-overflow is uhappy when the specified bounds depend
on the length of the source and is not smart enough to see the check
we do.  Besides we don't want the padding effect of strncpy() here.
2019-10-05 19:19:51 +00:00
uwe
fdee483c8f __dberr: tweak signature to make gcc8 -Wbad-function-cast happy about
casts in __dbpanic.  Admittedly this is a bit too "cute".
2019-10-05 18:07:58 +00:00
jhigh
c7ab523edc adding full scheme comparison to libcrypt:crypt and pwhash tests 2019-10-05 18:06:16 +00:00
uwe
da97884ede __dbpanic: use the official DB typedef name in the casts. They were
copied from the declaration point where it's not yet available.
2019-10-05 18:01:52 +00:00
christos
c8863f455b deduplicate the conversion function from statvfs -> statfs12 2019-10-04 01:28:02 +00:00
christos
573d865676 Ignore strncpy(foo, bar, sizeof(foo)) for the wtmp fields where we don't
want NUL termination. We can't use pragma's because the old gcc complains
about the new warnings it does not understand.
2019-10-04 00:03:56 +00:00
tnn
00bf802c59 annotate __dead 2019-10-03 20:29:19 +00:00
christos
5c84fc8d45 provide a default error function instead of trying to cast exit(3). 2019-10-03 18:12:44 +00:00
christos
d97b323d0b Cast function pointers that take different arguments through void * 2019-10-03 18:02:05 +00:00
christos
d3574aa770 - user (an alias to the login buffer should be NUL terminated so use strlcpy
- double the size of the resulting buffer so that it can fit a copy of the
  same sized buffer + more.
2019-10-03 17:56:17 +00:00
christos
ae8d4ecfdb Use strlcpy to NUL terminate the name string here. The kernel already
uses strlcpy() to set values in this field. We leave the kernel's strncmp()
alone to maintain compatibility.
2019-10-03 17:10:16 +00:00
christos
194e441521 use strlcpy here; the destination string is passed to strtok_r, and if it
is not NUL terminated, bad things can happen.
2019-10-03 17:08:26 +00:00
christos
01d1183f90 Since ch gets reassigned, it is not certain that it will be & or | again,
so return an illegal token if it is not instead of telling the compiler
that this is impossible.
2019-10-03 16:37:45 +00:00
christos
b490ea0c99 provide sizes so that we don't truncate accidentally. 2019-10-03 16:35:57 +00:00
rmind
04cb50ac51 libnpf/npfctl: support dynamic NAT rulesets using a name prefix. 2019-09-30 00:37:11 +00:00
mrg
21303c93e9 convert HAVE_GCC == 7 to HAVE_GCC >= 7. 2019-09-29 23:44:58 +00:00
wiz
9d3e825cb4 Sort errors. Remove trailing whitespace. 2019-09-27 07:20:07 +00:00
christos
75a357d94d document errors returned by F_GETPATH 2019-09-26 17:13:52 +00:00
christos
ed9ca5deea teach hijack about the new vfs syscalls 2019-09-25 20:19:59 +00:00
christos
accd2f2682 lint is not smart enough to figure out that ilog2() is constant. 2019-09-23 18:17:03 +00:00
christos
38a0431bfa Restore binary compatibility by using the statvfs90 structure internally. 2019-09-23 12:00:57 +00:00
christos
02cdd248ec Add a new member to struct vfsstat and grow the unused members
The new member is caled f_mntfromlabel and it is the dkw_wname
of the corresponding wedge. This is now used by df -W to display
the mountpoint name as NAME=
2019-09-22 22:59:37 +00:00
brad
2e0a32871b Add USE_SHLIBDIR=yes to a number of Makefiles for the libraries used
by /sbin/{zfs,zpool,mount_zfs}.  The general effect is to move them
from /usr/lib to /lib.  Compatibility links are installed in /usr/lib
and nothing that is installed, say in /usr/pkg, appears to break.

With this, it is possible to have a /var and /usr mount using ZFS
legacy mounting early on in the boot process.

Run tested on amd64 and i386 and compile tested on evbarm.
2019-09-22 18:45:19 +00:00
wiz
911f6cb213 Sort errors; remove two more duplicates. 2019-09-18 04:57:53 +00:00
christos
26260efb9b merge the two E2BIG entries (wiz) 2019-09-16 11:03:08 +00:00
wiz
5a2de753fb Sort errors. 2019-09-16 04:59:32 +00:00
wiz
4799815d98 Add missing word, add comma in enumeration. 2019-09-16 04:54:23 +00:00
wiz
6cc77413c5 Add missing word, fix typo, remove trailing whitespace. 2019-09-16 04:49:46 +00:00
kamil
889b81b138 Remove _INCOMPLETE_XOPEN_C063, no longer needed 2019-09-16 01:25:16 +00:00
kamil
d3dd6160fd Stop passing -D_INCOMPLETE_XOPEN_C063 (obsolete define) 2019-09-16 00:00:56 +00:00
christos
a5a5a01f84 Fix type and remove cast (Yuichiro NAITO/FreeBSD). 2019-09-15 21:09:11 +00:00
christos
6f91a43aa9 Document O_EXEC, and add some extra explanation for O_CREAT from FreeBSD. 2019-09-15 20:53:24 +00:00
christos
20f72bdb4e documentation for fexecve(2) 2019-09-15 16:55:00 +00:00
christos
0a76d2ed5a Add F_GETPATH, presented to tech-kern. 2019-09-15 16:25:57 +00:00
wiz
5ac2498fa8 Fix markup, and remove two superfluous Pp. 2019-09-15 07:01:13 +00:00
christos
9aeb91c2c4 fix wrong names and add markup 2019-09-15 01:03:23 +00:00
mlelstv
d87f421944 Need register defines that were moved to armreg.h 2019-09-12 10:18:50 +00:00
kamil
36ec32beff Switch back _Noreturn to __dead in C11 threads
There is an ongoing discussion to unify unreturn attribute between C and
C++, making a compatible version, shared between languages. Instead of
picking C11-only approach here, switch back to __dead that wraps the
compiler extension for the same purpose.

This change makes this header more compatible with C++ and pre-C11.

Reference:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2410.pdf
2019-09-10 22:34:19 +00:00
wiz
5f4f33c6a5 Remove superfluous Pp. 2019-09-09 07:46:49 +00:00
sevan
fb87f380ab mprotect first appeared in SunOS 4.0
Page 25 of SunOS 4.0 Change Notes
http://chiclassiccomp.org/docs/content/computing/Sun/software/800-1731-10_SunOS4.0ChangeNotes9May88.pdf
2019-09-08 22:35:44 +00:00
sevan
7e18ab6233 Extend history 2019-09-08 17:47:33 +00:00
sevan
a4cf051b9a Sort flags 2019-09-08 17:24:49 +00:00
sevan
4fef48b525 Document MAP_ANONYMOUS 2019-09-08 17:17:55 +00:00
uwe
6ba5b90bdf Use the right values for .Bl -width
Typeset "fuse" literal (default value for type) as a literal.
2019-09-08 11:34:56 +00:00
abhinav
c3d00a7d30 PR lib/54510: Fix file completion inside quotes which broke in rev 1.53
While there also fix handling character appending in the file completions when
inside quotes. For example when inside a quote, if the completion is a directory then
append a '/' but don't close the quote. On the other hand when inside a quote if the
completion is a file name and it is the only match then we can close the quote.
2019-09-08 05:50:58 +00:00
wiz
2583d20169 Add missing word. More markup. 2019-09-07 19:32:11 +00:00
wiz
d46d61dd74 Punctuation nit. 2019-09-07 19:30:39 +00:00
sevan
16210d39ba New sentence, new line 2019-09-07 13:17:43 +00:00
sevan
1cd8c1fa55 Document the destiny for these functions. 2019-09-07 12:40:17 +00:00
sevan
9e150b2d97 Document sbrk() history and adjust brk()'s.
via Ingo Schwarze <schwarze@OpenBSD>
2019-09-07 11:59:42 +00:00
sevan
d149c91d7e Document history 2019-09-07 11:53:27 +00:00
christos
8d1f0ec42c Since we advance cp after the bounds check, we need to test for bounds
again before using it. Discovered via fuzzing, reported by enh at google, via:
    https://android-review.googlesource.com/c/platform/bionic/+/1093130
2019-09-04 12:14:09 +00:00
roy
cc96515f67 curses: believe in unicorns
Hopefully this ends the bikeshed.
If you don't believe in unicorns, please #if 0 it out to preserve
the humour.
2019-09-03 13:43:34 +00:00
roy
b02c2cea81 curses: Add __NetBSD_Curses_Version__
Similar to __NetBSD_Version__ from sys/param.h but has no
correlation to it or the ELF symver libcurses is built as.

If we say that v1 was everything prior to this, it makes sense to
start this from v2.
2019-09-03 10:36:17 +00:00
roy
c977d4cfab curses(3): add curses_version()
Returns NetBSD-Curses %s
Where %s is the NetBSD version taken from sys/param.h

Discussed on tech-net@, only for ncurses compat.
2019-09-02 09:08:29 +00:00
sevan
d284e45ce6 Start documenting history
https://www.bell-labs.com/usr/dmr/www/man31.pdf
2019-09-02 00:51:48 +00:00
sevan
5856ef0738 putc & putw were in v1
https://www.bell-labs.com/usr/dmr/www/man31.pdf
putchar was in v4
https://minie.tuhs.org/cgi-bin/utree.pl?file=V4/man/man3/putchr.3
2019-09-02 00:48:16 +00:00
sevan
e7c2f0e667 log appeared in v1
https://www.bell-labs.com/usr/dmr/www/man31.pdf
2019-09-02 00:37:47 +00:00
sevan
045ae074b5 Start documenting history
https://www.bell-labs.com/usr/dmr/www/man31.pdf
2019-09-02 00:30:58 +00:00
sevan
a8ce1a4d96 exp was present in v1
https://www.bell-labs.com/usr/dmr/www/man31.pdf
2019-09-02 00:25:47 +00:00
sevan
d051e0b21d start documenting history 2019-09-02 00:24:01 +00:00
sevan
211298066f write was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-02 00:13:09 +00:00
sevan
35c5311442 wait was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-02 00:12:11 +00:00
sevan
b26b6614cd unlink was presen in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-02 00:09:14 +00:00
sevan
4bdf4627ad setuid was in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-02 00:05:38 +00:00
sevan
9e15184fb2 seek was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-02 00:01:42 +00:00
sevan
65ee4583a2 read was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-02 00:00:25 +00:00
sevan
ff3425a0e5 Open was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-01 23:57:14 +00:00
sevan
b561dbbbe6 mount & umount were present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-01 23:53:45 +00:00
sevan
fbcb2c65d6 stty & gtty were around since v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf
https://www.bell-labs.com/usr/dmr/www/man22.pdf
2019-09-01 23:42:19 +00:00
sevan
5ae2aa4a54 Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:52:32 +00:00
sevan
da65270b52 getuid was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:46:58 +00:00
sevan
89c2482298 stat() was present in v1
https://www.bell-labs.com/usr/dmr/www/man22.pdf
document history of fstat()
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:45:48 +00:00
sevan
2d5e133f80 fork was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:40:07 +00:00
sevan
7356612ea6 Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:37:21 +00:00
wiz
fb6187f957 Remove superfluous Pp. 2019-09-01 19:36:09 +00:00
sevan
f769ad4c22 Document history of exec()
Move statement on execlpe() & execvpe() to HISTORY section.
2019-09-01 19:33:45 +00:00
sevan
04473fb0e1 create was present in v1
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:28:31 +00:00
sevan
60ffbc104f Document history
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:20:45 +00:00
sevan
ceb77431eb Document history of chown(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:16:43 +00:00
sevan
d9e8d47bcc Document history of chmod(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:13:57 +00:00
sevan
1644fb6375 Document history of chdir(2)
https://www.bell-labs.com/usr/dmr/www/man21.pdf
2019-09-01 19:11:41 +00:00
uwe
9018abb765 Refer to "w+" as "mode" as that's what fopen(3) calls it. 2019-09-01 01:23:14 +00:00
kamil
1a5f018b01 Enhance the support of LLVM sanitizers
Define _REENTRANT for MKSANITIZER build. This is needed for at least stdio
code. This caused new build issued with duplicated symbols in few places
and rump kernel code picking different code paths borrowed from libc.
Handle all this in one go.

Add bsd.sanitizer.mk to share common code used by programs and libraries.

Switch from realall to beforeinstall target in .syms files. This is more
reliable in MKSANITIZER.
2019-08-27 22:48:53 +00:00
martin
0c393ecfe5 Include libnv directly into this library 2019-08-27 14:54:17 +00:00
riastradh
ab94299db0 Fix feraiseexcept.
- Don't touch the trap flags (though on all ARMv8 I know they have no
  effect anyway).

- Don't clear any existing raised exception flags; just add to them.

XXX atf test
XXX pullup-9
2019-08-25 18:59:52 +00:00
riastradh
f527f35001 Fix fesetenv and feupdateenv.
- fesetenv is supposed to set the stored rounding mode (and stored trap
  settings, but they have no effect on any ARMv8 I know).

- feupdateenv is supposed to re-raise the exceptions that were raised
  in the environment when it was called.

XXX atf test
XXX pullup-9
2019-08-25 18:31:30 +00:00
rmind
0dd7abe473 libnpf fix: link the library itself to libnv; libnpf users should not be
expected to assume this dependency.
2019-08-24 13:20:52 +00:00
mrg
1db21b1df3 fix MKCXX=no:
- don't build GDB
- don't build sanitizers
- don't build GCC commands
- fix some set lists
2019-08-23 08:17:26 +00:00
brad
c59f01cb01 Teach getdiskrawname and getdiskcookedname about zvols.
Reviewed by Christos
2019-08-22 20:23:43 +00:00
rmind
0e1944da36 npfkern/libnpf: Add support for the table replace/swap operation.
Contributed by Timshel Knoll-Miller.
2019-08-21 21:45:47 +00:00
christos
a909d35bd1 Increment offset when adding an element to history to keep it aligned with
the last element entered (Sandy Li Changqing)
2019-08-21 11:11:48 +00:00
manu
bf00e86bc9 Rollback directory filehandle screening for FUSE lock operations
libfuse has a different usage of filehandles for files and directories.
A directory filehandle is valid only for directory operations such
as OPENDIR, READDIR, RELEASEDIR, FSYNCDIR. Change of src/lib/libperfuse/ops.c
1.85-1.86 made sure filehandles of directories were only sent for that
operations.

However, the status of lock operations GETLK, SETLK, SETLKW was overlooked.
The only FUSE filesystem I found using locks is GlusterFS, and it needs
directory filehandles to be provided on lock operations, otherwise locking
crashes the filesystem. Hence this change brings back filehandles for
lock operations on directories.
2019-08-10 07:08:11 +00:00
wiz
dbba53aad8 Remove leading zero in date. 2019-08-07 19:13:49 +00:00
riastradh
772f880c3d Mark the libc fegetround weak reference unused.
Not all .c files that include gdtoaimp.h use it, which makes clang
unhappy.
2019-08-07 15:37:46 +00:00
roy
72913d43ba read(2): Document ENOBUFS 2019-08-07 01:09:49 +00:00
uwe
a4a4fa9898 Minor markup tweaks. 2019-08-04 01:22:49 +00:00
riastradh
9a9a41227b Sprinkle some more const in. 2019-08-01 02:27:43 +00:00
riastradh
15feeb4916 Honour the floating-point rounding mode in floating-point formatting.
C99, Sec. 7.19.6.1 `The fprintf function', paragraph 13, p. 281:

   (Recommended practice)

   For e, E, f, F, g, and G conversions, if the number of significant
   decimal digits is at most DECIMAL_DIG, then the result should be
   correctly rounded.  If the number of significant decimal digits is
   more than DECIMAL_DIG but the source value is exactly
   representable with DECIMAL_DIG digits, then the result should be
   an exact representation with trailing zeros.  Otherwise, the
   source value is bounded by two adjacent decimal strings L < U,
   both having DECIMAL_DIG significant idgits; the value of the
   resultant decimal string D should satisfy L <= D <= U, _with the
   extra stipulation that the error should have a correct sign for
   the current rounding direction_.  [emphasis added]

The gdtoa code base already supports respecting the floating-point
rounding mode, as long as we compile it with Honor_FLT_ROUNDS
defined.  However, for this to work, fegetround must be available in
libc, which it is not currently -- the fenv logic is in libm.

Fortunately, we don't have to move all of fenv from libm to libc --
programs that do not link against libm don't have fesetround, so the
rounding mode is always the default (barring asm shenanigans that
bypass the API -- tough).  So use a weak reference to fegetround; by
default, assume FE_TONEAREST if it is not defined.
2019-08-01 02:06:31 +00:00
pgoyette
44f0185e19 Fix a couple of typos 2019-07-31 23:53:25 +00:00