Commit Graph

19110 Commits

Author SHA1 Message Date
kamil bc0c5fd82b Update the EV_SET() description with newer implementation.
EV_SET(2) is a macro again, that wraps an inline function which is still
new in NetBSD 8.0.

Sponsored by <The NetBSD Foundation>
2017-06-06 17:01:59 +00:00
abhinav c45058c218 Fix typo: s/interrput/interrupt/ 2017-06-03 19:41:14 +00:00
christos 79e2355ab8 Adjust to prototype. 2017-05-31 17:56:00 +00:00
kamil 5f91e65caa Document transition of EV_SET() from a macro to a static inline function
Sponsored by <The NetBSD Foundation>
2017-05-31 01:03:01 +00:00
bouyer 6e4cb2b9ab merge the bouyer-socketcan branch to HEAD.
CAN stands for Controller Area Network, a broadcast network used
in automation and automotive fields. For example, the NMEA2000 standard
developped for marine devices uses a CAN network as the link layer.

This is an implementation of the linux socketcan API:
https://www.kernel.org/doc/Documentation/networking/can.txt
you can also see can(4).

This adds a new socket family (AF_CAN) and protocol (PF_CAN),
as well as the canconfig(8) utility, used to set timing parameter of
CAN hardware. Also inclued is a driver for the CAN controller
found in the allwinner A20 SoC (I tested it with an Olimex lime2 board,
connected with PIC18-based CAN devices).

There is also the canloop(4) pseudo-device, which allows to use
the socketcan API without CAN hardware.

At this time the CANFD part of the linux socketcan API is not implemented.
Error frames are not implemented either. But I could get the cansend and
canreceive utilities from the canutils package to build and run with minimal
changes. tcpudmp(8) can also be used to record frames, which can be
decoded with etherreal.
2017-05-27 21:02:54 +00:00
joerg 5bdaea99ff Use MACHINE_ARCH for the sparc check. 2017-05-26 22:56:50 +00:00
joerg 0ad2a3f96d Add __clear_cache implementatin for SPARC/SPARC64. 2017-05-24 21:45:40 +00:00
christos c74ab69c28 Add DragonFly. 2017-05-22 19:16:25 +00:00
riastradh ef315f7931 Remove MKCRYPTO option.
Originally, MKCRYPTO was introduced because the United States
classified cryptography as a munition and restricted its export.  The
export controls were substantially relaxed fifteen years ago, and are
essentially irrelevant for software with published source code.

In the intervening time, nobody bothered to remove the option after
its motivation -- the US export restriction -- was eliminated.  I'm
not aware of any other operating system that has a similar option; I
expect it is mainly out of apathy for churn that we still have it.
Today, cryptography is an essential part of modern computing -- you
can't use the internet responsibly without cryptography.

The position of the TNF board of directors is that TNF makes no
representation that MKCRYPTO=no satisfies any country's cryptography
regulations.

My personal position is that the availability of cryptography is a
basic human right; that any local laws restricting it to a privileged
few are fundamentally immoral; and that it is wrong for developers to
spend effort crippling cryptography to work around such laws.

As proposed on tech-crypto, tech-security, and tech-userlevel to no
objections:

https://mail-index.netbsd.org/tech-crypto/2017/05/06/msg000719.html
https://mail-index.netbsd.org/tech-security/2017/05/06/msg000928.html
https://mail-index.netbsd.org/tech-userlevel/2017/05/06/msg010547.html

P.S.  Reviewing all the uses of MKCRYPTO in src revealed a lot of
*bad* crypto that was conditional on it, e.g. DES in telnet...  That
should probably be removed too, but on the grounds that it is bad,
not on the grounds that it is (nominally) crypto.
2017-05-21 15:28:36 +00:00
christos 3ccc6b27b8 remove accidental __strong_alias additions, noticed by coypu. 2017-05-19 19:55:16 +00:00
christos 0a20cdb1cf use strerror_r_ss() 2017-05-19 19:51:10 +00:00
christos 1997642fee The BSD qsort() performs tail recursion elimination on the second
side of the array being partitioned to save on stack space.  Greater
savings can be gained by choosing recursion for the smaller side
of the partition and eliminating recursion for the larger side.
This also results in a small but measurable performance gain.
(From OpenBSD)
2017-05-19 19:48:19 +00:00
abhinav b34e0a62c9 Fix typo in the man page reference 2017-05-18 16:41:12 +00:00
roy 2e0a9a1da6 Improve the scope of some variables. 2017-05-16 12:03:41 +00:00
roy 8e374e1b75 Remove ticcmp and extend _ti_checkname so it can be used instead. 2017-05-16 11:16:37 +00:00
roy fc79bac804 Fix prior for multiple terminfo aliases. 2017-05-16 10:29:06 +00:00
roy 2b9f5c3f2c Instead of poking in the binary blob to work out if this is our terminal,
assume it is and load it.
Once loaded then check it's really for us.
This allows us to work out if the indexed alias entry is correct we
this was not checked previously.
2017-05-16 10:25:40 +00:00
roy 2678fcfdf5 Don't bother allocating space for the database name, just print
directly to the static buffer storage.
2017-05-16 09:19:48 +00:00
roy 3edb4adc61 Move pathbuf into the function where it's actually used. 2017-05-16 08:52:14 +00:00
christos eeb345227e Don't make assert use stdio; saves >100K on an empty static binary. 2017-05-15 16:09:09 +00:00
wiz 0456c39519 Formatting and punctuation improvements. 2017-05-14 12:35:46 +00:00
wiz 63d3c713fa file system police. 2017-05-14 12:30:37 +00:00
wiz cf1b0d459d Use Nx. 2017-05-14 12:29:10 +00:00
maya 5b9767ae88 Belatedly bump minor.
lots of changes since -7 (libm.so.0.11), including:
new functions: llroundl, lroundl, erfl, erfcl
partial switch to freebsd catrig
2017-05-13 13:17:11 +00:00
maya 6c9a28baeb Drop superfluous ; in __warn_references 2017-05-13 02:58:03 +00:00
christos a613f690f9 make it the same as rump.h 2017-05-11 18:44:50 +00:00
christos 60b22e867e Don't depend on stars in order to define things. 2017-05-11 17:47:22 +00:00
martin 3397b20a60 Evil hack to fix the build: provide PRIxREGISTER here.
Sevan, please check and fix correctly ;-)
2017-05-11 10:21:55 +00:00
sevan 6b31f116cc With the removal of HAVE_REGISTER_T from rumpuser_port.h, _KERNTYPES does not
need to be defined. This allows register_t to be typedef'd to RUMP_REGISTER_T
without conflict, as highlighted in PR kern/52206.
2017-05-11 04:33:14 +00:00
sevan 64fda0b19a Update NetBSD values obtained from running configure as instructed in comment.
This paves the way to resolve rump build process using buildrump.sh, where the definition of
HAVE_REGISTER_T caused conflicting definitions of register_t.
2017-05-11 04:27:27 +00:00
kre 7cbdd94285 Turns out that the previous fix is incorrect, we were not doing ++hit
to change the boolean hit from false to true, but to change it from 1 to 2
which in a sense should have been obvious from the context:
	if (hit)
		/* more tests */
			++hit;
The real problem was that hit was (in the imported tzcode) incorrectly
changed from int to bool in a previous update.

Not that it matters, this code is never actually executed - it was there
to deal with the mythical double leapseconds, which simply never exist
(hit counted the number of leapseconds in an adjustment) and it will all
be gone in the next tzcode update.

For now, just turn hit back into an int, which should satisfy gcc 8,
I hope.
2017-05-10 10:34:30 +00:00
sevan 979875ac74 Revert previous change so builds can resume.
_KERNTYPES needs to be defined for NetBSD builds to succeed.
_KERNTYPES must not be defined for buildrum.sh builds to succeed.
2017-05-10 08:48:46 +00:00
mbalmer 0f3108288c Guard against double freeing of objects (explicit by the Lua program, then
later by the garbage collector).
This fixes PR bin/52218.
2017-05-10 07:36:01 +00:00
sevan 9204518573 Do not define _KERNTYPES as this breaks build with buildrump.sh due to
conflicting types for register_t.
Closes PR kern/52206
Steered in the right direction by christos.
2017-05-10 01:11:51 +00:00
christos 518a4ef5c5 Only add a write filter for sockets. It is not supported for vnodes, or
for 1/2 closed fifos (which we both have now).
2017-05-09 21:15:30 +00:00
kre 486691905e Add the new signalname/signalnext/signalnumber interface to libc.
This as discussed on current-users in the thread
entitled:
  Proposal: new libc/libutil functions to map SIGXXXX <-> "XXXX"
that can be found (starting at):
  http://mail-index.netbsd.org/current-users/2017/04/28/msg031600.html

These functions provide the mechanism to enable applications
to divorce themselves from internal details of the signal
implementation.

Libc minor bumped, prototypes in <signal.h>, sets lists updated (and sorted).

One and all: feel free to improve the sources & man page (etc), but
please do not change the function signatures without discussion.
2017-05-09 11:14:16 +00:00
abhinav d531aa96de Add missing word. 2017-05-09 06:41:56 +00:00
maya 9c26aa2ea4 Avoid shift of negative signed integer. this is UB. NFC.
from gcc8, ok riastradh
2017-05-09 02:56:44 +00:00
maya 6db625eb59 ++bool to bool=true to appease GCC 8. NFC
ok riastradh
2017-05-09 02:30:49 +00:00
maya 468489bfea Correct misleading indentation. NFC
This isn't a functional difference because huge + x > one is
always true for a small x, and is probably a magical incantation
to raise inexact if x != 0

Found by GCC 8.0
2017-05-09 02:04:38 +00:00
christos 048b91431b use the symbolic M_ALL and trim with M_MASK 2017-05-08 14:42:16 +00:00
martin 0dcaa3783b Complete the namespace dance 2017-05-08 09:25:03 +00:00
martin 9bce32444d Add missing namespace.h include 2017-05-08 08:21:56 +00:00
christos 922c79a2e7 Add the imprecise catrigl functions back. 2017-05-07 22:01:54 +00:00
christos ea6fb1417c mention why we don't support this (yet) 2017-05-07 21:59:06 +00:00
martin dc8051aeb0 Limit some rintl usage to #ifdef __HAVE_LONG_DOUBLE.
XXX should probably declare some aliases in the #else case
2017-05-07 11:29:21 +00:00
joerg 4f77b889d0 Extend the mmap(2) interface to allow requesting protections for later
use with mprotect(2), but without enabling them immediately.

Extend the mremap(2) interface to allow duplicating mappings, i.e.
create a second range of virtual addresses references the same physical
pages. Duplicated mappings can have different effective protections.

Adjust PAX mprotect logic to disallow effective protections of W&X, but
allow one mapping W and another X protections. This obsoletes using
temporary files for purposes like JIT.

Adjust PAX logic for mmap(2) and mprotect(2) to fail if W&X is requested
and not silently drop the X protection.

Improve test cases to ensure correct operation of the changed
interfaces.
2017-05-06 21:34:51 +00:00
christos 6b9cab4173 Bump version 2017-05-06 19:52:25 +00:00
christos 464b32545a Replace our rounding functions with the ones from FreeBSD 2017-05-06 18:03:24 +00:00
christos f7c6682327 add missing namespace.h 2017-05-06 18:02:52 +00:00
roy 34c6060f1f Clean up some more warnings. 2017-05-04 09:46:30 +00:00
roy 04f58b4824 Clean up some compile warnings. 2017-05-04 09:42:23 +00:00
christos 1700326566 - limit size of buffers to RPC_MAXDATASIZE
- don't leak memory
- be more picky about bad parameters
https://raw.githubusercontent.com/guidovranken/rpcbomb/master/libtirpc_patch.txt

XXX: pullup-7
2017-05-03 21:39:27 +00:00
roy db8a6fb0b3 Fix some compile warnings. 2017-05-01 19:09:22 +00:00
roy ac826cc7fc Whitespace police. 2017-05-01 18:39:02 +00:00
christos b8fc685b9a Switch from a recursive pattern matching algorithm to handle '*'
to a backtracking one. Avoids DoS attacks with patterns "a*a*a*a*a*...b"
matching against "aaaaaaaaaaaa..." https://research.swtch.com/glob
2017-04-26 14:56:54 +00:00
abhinav 06ea77a20c Clean up the NAME section.
The entries in the NAME section of these man pages have man pages of their
own, so it doesn't make sense to have their names here, instead they
should be just described in the body (similar to what we do in math(3) man page).

This also helps whatis(1) and apropos(1), as otherwise you would see multiple
results with the same name in the output, while there is actually only one page
with that name.

Good example is:

$ apropos -n 2 -M realloc
realloc (3)       general memory allocation operations
realloc (3)       general purpose memory allocation functions

The first line is there because memory(3) man page had realloc in its
NAME section. This commit will fix this issue.

ok wiz@
2017-04-26 07:40:09 +00:00
riastradh 6fa7b15833 Change VOP_REMOVE and VOP_RMDIR to preserve lock/ref on dvp.
No change to vp -- the plan is to replace the node by the
componentname in the vop parameters, and let all directory vops do
lookups internally.

Proposed on tech-kern with no objections:
https://mail-index.netbsd.org/tech-kern/2017/04/17/msg021825.html
2017-04-26 03:02:47 +00:00
christos 1e4359e82a merge tzcode2017b. 2017-04-25 13:19:44 +00:00
christos 882d7a48e8 fix typo (Leonardo Taccari) 2017-04-23 13:23:02 +00:00
wiz 014a98250c Sort errors. 2017-04-23 11:38:53 +00:00
abhinav bf7f329587 Fix sentences at couple of places
s/a file/the file/
	s/a -1 is returned/-1 is returned/
2017-04-23 06:46:04 +00:00
christos 6f84e2e257 Add VIS_DQ (for OpenBSD compat) 2017-04-23 01:58:48 +00:00
christos 5ec33a074f Mention that the signal stack of the newly created lwp is reset to disabled. 2017-04-21 15:04:10 +00:00
abhinav 3a89c5769a When doing filename autocompletion, append a trailing slash at the end of directory
names. We already do this when there is only one completion option but
in case of of multiple completion options, it wasn't being done.

ok christos@
2017-04-21 05:38:03 +00:00
roy 5b2b9b53e2 Whitespace, fit in 80 and extra braces for readability.
No functional change.
2017-04-20 08:34:23 +00:00
christos 6ad75611ab F_DUPFD* needs an argument (minfd) found by jmcneill 2017-04-19 22:21:07 +00:00
maya b24bc65591 always initialize iovcnt
from clang static analyzer
2017-04-18 12:34:07 +00:00
maya 0e5a550a5b avoid calloc(1,0).
from clang static analyzer

ok christos
2017-04-18 11:35:34 +00:00
christos 50dd7b358e Fix out of bounds read for very large numbers (pointed out by Brooks Davis)
https://svnweb.freebsd.org/changeset/base/316766
2017-04-13 17:45:56 +00:00
abhinav bf08a0975f Use more markup for `struct timespec`
Use Xr to refer to timespec(3)
Add timespec(3) to SEE ALSO
2017-04-11 17:59:23 +00:00
riastradh 87fb32292e Make VOP_INACTIVE preserve vnode lock on return.
Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2017/04/01/msg021751.html

Ride 7.99.68, a bumpy bus of incremental vfs improvements!
2017-04-11 14:24:59 +00:00
abhinav 3b14f403c3 s/Sets/Set: Use style consistent with the other sentences in that list.
Add .Pp before next sentence.
2017-04-11 11:06:39 +00:00
abhinav c626d04131 Add missing argument for H_SET.
ok christos@
2017-04-10 15:02:40 +00:00
kamil 049bc8e25e Fix typo in previous (ptrace(2)) 2017-04-08 00:58:35 +00:00
kamil d50fceb568 Document new calls and be more clear about PT_SYSCALL* in ptrace(2)
Document PT_SETSTEP and PT_CLEARSTEP in ptrace(2).

Try to explain more details of PT_SYSCALL and PT_SYSCALLEMU.

The description of PT_*STEP has been obtained from FreeBSD.

Sponsored by <The NetBSD Foundation>
2017-04-08 00:56:38 +00:00
pgoyette 158c71ad1f Fix typos and some grammar 2017-04-07 07:21:58 +00:00
kamil 2667b4dcaa Correction in ptrace(2) about operations that emit signals
PT_STEP and PT_DETACH cannot emit signals
PT_CONTINUE and PT_SYSCALL can emit signals

Pointed out by <chs>
2017-04-07 00:56:14 +00:00
abhinav 8e077e469b Fix sentence. 2017-04-02 14:27:11 +00:00
abhinav 9f9499a40c Add man page links for:
EV_SET to kqueue(2)
   getmntoptstr, getmntoptnum, freemntopts to getmntopts(3)

Reviewed by wiz@
2017-04-01 14:31:05 +00:00
abhinav 8e39d64647 Add EV_SET() to the NAME section
Use Xr instead of Fn to refer other man pages
Add some more entries to SEE ALSO

Reviewed by wiz@
2017-04-01 14:20:45 +00:00
abhinav ad5244b4e8 Use Sy to highlight the table header. 2017-03-30 20:00:21 +00:00
abhinav 1bf28fdbff Add missing functions 2017-03-30 19:56:36 +00:00
abhinav 33d7e92834 Add getmntoptstr, getmntoptnum, and freemntopts to the NAME section
Fix couple of sentences

getmntoptstr, getmntoptnum, and freemntopts need to be linked to the getmntopts(3)
man page as well. Will do in a later commit after doing a relase build test.
2017-03-30 19:41:41 +00:00
abhinav cd4acf025e Add getdiskcookedname to the NAME section
Fix couple of typos.
2017-03-30 19:23:06 +00:00
abhinav 21edcefd45 Remov comma from the last Nm entry
Use Xr instead of Fn to refer rmdir(2)
Fix couple of sentences
2017-03-30 18:54:26 +00:00
maya 38f9590df4 Remove outdated CAVEATS.
Not sure everything is standards compliant, but I've been told non-default
values are supported and pshared exists.
2017-03-28 17:42:52 +00:00
nat e5d1b604d5 ABI of libossaudio did not change, so there was no need to bump the version
number.

Pointed out by mrg@
2017-03-24 11:46:52 +00:00
chs c853a494e6 expose the BSD/linux fenv extensions in libm on ia64 too. 2017-03-23 18:27:29 +00:00
chs de7c5b7203 sun2 just has to be different, of course.
it doesn't use the libc softfloat and thus doesn't set MKSOFTFLOAT=yes.
enable the fenv functions here explicitly for now.
2017-03-23 18:26:03 +00:00
nat dab5456581 Calculate GETISPACE/GETOSPACE properly.
Bump version.

Addresses PR kern/51999.
2017-03-23 15:50:48 +00:00
wiz 54c511cc9d Remove trailing whitespace. 2017-03-23 12:31:57 +00:00
roy 5128a2ed79 POSIX says that use_env(3) must precede setupterm(3).
The former lives in curses.h, but the latter lives in term.h.

This is solved by moving the function to libterminfo.
Because the environment can affect the terminal capabilities for
lines and columns, it follows that the tty size should affect it to.
So move that code to libterminfo and adjust in libcurses.
2017-03-23 00:55:39 +00:00
roy d5c74a0225 Allow terminfo users to update flag and numeric capabilities as they do
strings.
2017-03-23 00:39:06 +00:00
roy c8a6d4546d Revert botched commit. 2017-03-23 00:36:37 +00:00
roy 8bf4334f27 term.h 2017-03-23 00:23:29 +00:00
roy a3b8817f64 Revert prior .... some ncurses application expect to be able to update
the terminal capabilities.
2017-03-23 00:17:57 +00:00
chs 7e30e94394 provide a common softfloat fenv implemenation and use it for softfloat builds.
restore ABI compatibility with previous releases for ieeefp.h on sh3.
add namespace.h protection for all the fenv interfaces.
use MKSOFTFLOAT on sh3 instead of assuming softfloat.
standardize on comparing MKSOFTFLOAT with "no".
remove the arm-specific softfloat fenv code (which also had several bugs).
fix logic errors in the arm hardfloat feraiseexcept() and feupdateenv().
2017-03-22 23:11:07 +00:00
kre 4b48a30a7a Unbreak build, init variable (not a false alarm for this one.) 2017-03-22 19:36:04 +00:00
kre de1e0dfd01 parsedate.y: meaningless KNF of a comment (no code changes)
parsedate.3:  add an item in BUGS noting the weirdness of "next"

The real purpose of this commit is to supply the following message
which should be used for the immediately previous commit, replacing
its commit message (the two are similar, but definitely not the
same).   With thanks to gdt@ for pointing out one of the (many) errors
in the previous message (and noting others I had already seen).

    ----

Make parsedate handle "12 noon" and "12 midnight" (including when the
time given is "12:00" or "12:00:00") - but only for exactly 12 o'clock.
"12:00:01" is am or pm, not noon or midnight.

"12 am" remains as an alias for "12 midnight", and "12 pm" for noon,
though both are strictly (pedanticly) invalid (and meaningless.)

Note that "12 midnight" (or "12 am") means 00:00:00 (ie: midnight at
the start of the day, not at the end.)
2017-03-22 18:17:42 +00:00
roy 1b119018c7 openlog(3): add LOG_PTRIM and LOG_NLOG log options.
syslog(3) is the one stop method of logging system events and diagnostics.
When debugging a daemon in the foreground on a terminal, each line is
prefixed with tag[pid]: which is very repetative and can take up valuable
screen estate.
LOG_PTRIM solves this by removing this prefix from stderr output.

There is also the case where the debugging could involve a dry-run and
syslog(3) calls would pollute the system log with incorrect data.
LOG_NLOG solves this by not writing the the system log, but allowing
LOG_PERROR to operate as before.

Initially discussed here:
https://mail-index.netbsd.org/tech-userlevel/2016/10/06/msg010330.html
2017-03-22 17:52:36 +00:00
kre e9cfba3947 Make parsedate handle "12 noon" and "12 midnight" (including when
the time is "12:00" or "12:00:00) - but only for exactly 12 o'clock.
"12:00:01" is am or pm, not noon or midnight.

"12 am" remains as an alias for "12 midnight", and "12 pm" for midnight,
though both are strictly invalid (and meaningless.)

Note that "12 pm" means 00:00:00 (ie: midnight at the start of the
day, not at the end.)
2017-03-22 01:49:36 +00:00
kre b717517d3c Fix PR lib/52101 -- 12:30 am is 00:30:00 and 12:30 pm is 12:30:00 2017-03-22 00:59:06 +00:00
christos 010ddb1dfc Make this compile again (gcc does not like strcmp(maybe-NULL, maybe-NULL);
simplify the life of the {compiler,human eyes}.
2017-03-20 20:44:06 +00:00
christos f85b99dc0a Make this compile again: use ce instead of clr_eol which gcc thinks might
be NULL.
2017-03-20 20:42:39 +00:00
christos 12423e3e50 comment out unused code. 2017-03-20 18:19:34 +00:00
roy 0f7015d835 Ensure there is a terminal to return capabilities from. 2017-03-20 14:46:28 +00:00
roy 3cd3ec3cb0 Put back filter(3) I mistakenly removed in r1.29 2017-03-20 10:20:16 +00:00
chs ed8841c51d lrint() and lrintf() are supposed to use the current rounding mode,
so use vcvtr rather than vcvt.
2017-03-16 16:32:12 +00:00
dholland 9fc21b6efb more trash to take out at bump time 2017-03-15 23:23:15 +00:00
wiz 65bf0053ed Update zlib version in pkgconfig file. 2017-03-12 20:38:30 +00:00
christos 20e5bd1924 merge 2017a 2017-03-11 18:23:14 +00:00
chs 6626e5c201 fix the mapping table. this sh3 version was originally copied from arm,
but FP_RP and FP_RM have opposite values on sh3 vs. arm.
2017-03-11 01:25:04 +00:00
maya 4644559ea4 Remove entirely redundant free right after declaration.
This block existed because the original code used bindname as a global.
2017-03-10 18:02:32 +00:00
maya 88f58dd75f Drop redundant null checks.
this doesn't increase diff to upstream, the whole block differs already.
2017-03-10 17:47:20 +00:00
maya 7ab45b5b71 Remove redundant null check before free. it is safe to free(NULL)
While here, clear up odd whitespace issue. NFC
2017-03-09 11:39:41 +00:00
maxv f8e693e577 Deprecate the pmc functions in libi386. The parameters will be updated,
and we are not interested in maintaining this anyway. Now i386's pmc
interface is opaque, which is good.
2017-03-08 16:09:27 +00:00
maxv a2375778e5 Remove i386 from libpmc; it has its own interface (sysarch), and we won't
maintain compatibility.

Verily, I cannot build a distribution now, so I'm committing this rather
blindly. This being said, it looks correct enough.
2017-03-08 15:53:00 +00:00
maya 0e7316adf4 Remove redundant null check before free()
It is guaranteed to be fine also by C99
2017-03-07 11:15:08 +00:00
pgoyette 5169db68cb Improve grammar. Pointed out by Timo Buhrmester on netbsd-docs list. 2017-03-06 09:24:09 +00:00
christos 3bea32ca4f one extra char for NUL. 2017-03-05 19:23:58 +00:00
njoly 9be71c742b Fix man page ERRORS section for (clock,pthread}_getcpuclockid to match
reality.
2017-03-05 18:42:51 +00:00
christos bd242e1e3e Grow the buffer for event search if there was not enough space.
From Gerry Swislow
2017-03-05 17:30:38 +00:00
njoly 5e0724b3f9 Fix {clock,pthread}_getcpuclockid to return an error number on
failure, to match OpenGroup specifications.
2017-03-04 11:16:33 +00:00
chs 55470246b3 fix asm operands: "ctc1" uses the register as an input, not an output. 2017-02-27 06:55:26 +00:00
chs ae1038858d have fpsetmask() change the FE0/FE1 MSR bits to precise mode if any
FP exceptions are enabled.  fix the kernel emulation of mfmsr and mtmsr
to use the correct opcodes for these instructions.  ignore PSL_FE
(the FP enable bit) in the MSR that a user program tries to set,
since it will naturally be set for FP-using processes but
we can't let the user process manage that bit.
2017-02-27 06:54:00 +00:00
chs a3f976c753 the MI lrint() code assumes that rounding is done in at most double precision
but m68k (68881) uses extended precision by default, so put the FPU in
double-precision mode temporarily here.
2017-02-27 06:49:02 +00:00
joerg 6fbd2a0be4 Switch from __ABICALLS__ to __mips_abicalls like upstream GCC does in
the generic MIPS target logic.
2017-02-25 21:16:50 +00:00
christos 3fed35c1f4 add link for accept4. 2017-02-23 15:17:17 +00:00
wiz 5de13b617d Formatting fix. 2017-02-23 08:11:09 +00:00
kamil 7250944257 Document PT_GETDBREGS and PT_SETDBRGS in ptrace(2)
Not this interface in MD part.
Explain design choices.

Sponsored by <The NetBSD Foundation>
2017-02-23 05:48:14 +00:00
scole e3edf3b621 Add fenv for ia64, imported from FreeBSD, compile tested only. 2017-02-23 02:05:30 +00:00
kamil f9b2093d06 Introduce new ptrace(2) API to allow/prevent exection of LWP
Introduce new API for debuggers to allow/prevent execution of the specified
thread.

New ptrace(2) operations:

     PT_RESUME     Allow execution of a specified thread, change its state
                   from suspended to continued.  The addr argument is unused.
                   The data argument specifies the LWP ID.

                   This call is equivalent to _lwp_continue(2) called by a
                   traced process.  This call does not change the general
                   process state from stopped to continued.

     PT_SUSPEND    Prevent execution of a specified thread, change its state
                   from continued to suspended.  The addr argument is unused.
                   The data argument specifies the requested LWP ID.

                   This call is equivalent to _lwp_suspend(2) called by a
                   traced process.  This call does not change the general
                   process state from continued to stopped.

This interface is modeled after FreeBSD, however with NetBSD specific arguments
passed to ptrace(2) -- FreeBSD passes only thread id, NetBSD passes process and
thread id.

Extend PT_LWPINFO operation in ptrace(2) to report suspended threads. In the
ptrace_lwpinfo structure in pl_event next to PL_EVENT_NONE and PL_EVENT_SIGNAL
add new value PL_EVENT_SUSPENDED.

Add new errno(2) value EDEADLK that might be returned by ptrace(2). It prevents
dead-locking in a scenario of resuming a process or thread that is prevented
from execution. This fixes bug that old API was vulnerable to this scenario.

Kernel bump delayed till introduction of PT_GETDBREGS/PT_SETDBREGS soon.

Add new ATF tests:
 - resume1
   Verify that a thread can be suspended by a debugger and later
   resumed by the debugger

 - suspend1
   Verify that a thread can be suspended by a debugger and later
   resumed by a tracee

 - suspend2
   Verify that the while the only thread within a process is
   suspended, the whole process cannot be unstopped

Sponsored by <The NetBSD Foundation>
2017-02-22 23:43:43 +00:00
abhinav c56d982263 Add reference to flockfile(3) in SEE ALSO section. 2017-02-22 15:08:55 +00:00
abhinav 4acd25c1d4 Fix a sentence.
Add write(2) in SEE ALSO.
2017-02-22 14:58:33 +00:00
maya bee20f7c3c GC deprecated logic. GCC 4.8 is not in tree any more. 2017-02-22 02:58:31 +00:00
abhinav 44c9d98bb0 Use Fn for function name. 2017-02-21 19:53:20 +00:00
abhinav 74752680de Insert comma between two Nm entries.
Replace Nm with Fn to refer a function.
2017-02-21 18:47:40 +00:00
abhinav 68d0ebc2d9 Fix spelling of "parenthesis". 2017-02-21 18:22:15 +00:00
abhinav 52cc192a32 Use .Fn to refer functions instead of .Nm. 2017-02-21 18:01:38 +00:00
abhinav 9c8d63417a Fix spelling of "includes". 2017-02-21 17:56:21 +00:00
rin 36be1ec540 Fix -O0 build; <machine/bwx.h> should be included after ".arch ev56" pseudo-op. 2017-02-20 15:23:43 +00:00
roy d837f94776 Note that typeahead(3) is no longer set to infd by default. 2017-02-17 11:23:21 +00:00
roy 0d7cbb25e8 Disable typeahead being set to infd by default as this seems to cause
refresh issues in nvi.
2017-02-17 11:18:38 +00:00
ozaki-r 44d072be9e Support paccept for nc 2017-02-16 08:08:01 +00:00
christos 379a1dffb1 fix off-by-one, found by asan. 2017-02-12 22:37:49 +00:00
maya 85f888414a overlapping strcpy is UB. use memmove
from asan+ubsan
2017-02-12 17:19:00 +00:00
kamil 61aff29627 Introduce new interface in ptrace(2) - PT_GET_SIGMASK and PT_SET_SIGMASK
Add new interface to add ability to get/set signal mask of a tracee.
It has been inspired by Linux PTRACE_GETSIGMASK and PTRACE_SETSIGMASK, but
adapted for NetBSD API.

This interface is used for checkpointing software to set/restore context
of a process including signal mask like criu or just to track this property
in reverse-execution software like Record and Replay Framework (rr).


Add new ATF tests for this interface
====================================
getsigmask1:
    Verify that plain PT_SET_SIGMASK can be called

getsigmask2:
    Verify that PT_SET_SIGMASK reports correct mask from tracee

setsigmask1:
    Verify that plain PT_SET_SIGMASK can be called with empty mask

setsigmask2:
    Verify that sigmask is preserved between PT_GET_SIGMASK and
    PT_SET_SIGMASK

setsigmask3:
    Verify that sigmask is preserved between PT_GET_SIGMASK, process
    resumed and PT_SET_SIGMASK

setsigmask4:
    Verify that new sigmask is visible in tracee


Kernel ABI bump delayed as there are more interfaces to come in ptrace(2).

Sponsored by <The NetBSD Foundation>
2017-02-12 06:09:52 +00:00
roy 0a316e40f7 Warn about unprintable characters in capability strings. 2017-02-11 15:13:17 +00:00
roy 0fb82a6eaf Following a newline, strip leading whitespace from capability strings. 2017-02-11 14:57:15 +00:00
maya 39d6057df2 speed limit is 80 (missed this one) 2017-02-10 08:52:04 +00:00
maya 6ac4e27787 strncpy->strlcpy. use sizeof instead of numbers. 2017-02-10 08:50:27 +00:00
blymn 871cddc640 Remove checks for cursor being in scrolling region, ncurses doesn't
do checking, rather just scrolls the scrolling region so we shall
follow suit.  SUSv2 says what is happens when scrl is called with the
cursor outside the scrolling is undefined so we should match ncurses.
This fixes PR#51819 without forcing tin to use terminfo directly.
2017-02-10 06:25:28 +00:00
maya fa47e9d850 ifdef out some dead code. improves code readability.
all later users of y first assign another value.

using ifdefs to make potential future code syncs easier, as is done
elsewhere.

suggested by coverity, CID 1300929, 1300930.
2017-02-09 22:11:09 +00:00
maya d5de09b1da Appease static analyzers by making all code paths which assign
values into p,q sane. Get rid of redundant assignment. Indent
for legibility. NFC.

This doesn't create a functional difference, as all callers
test number >= 0x40000000 anyway.

To see this, note the following:
- consistently, hx is the high bits of x, lx is the low bits,
  x is the float.
- & 0x7fffffff zeroes the sign bit, as does fabs.

A case where it isn't easy to see that there's no functional
change is y1, which does:

ix = hx & 0x7fffffff (zero signbit of high bits of x)
y = fabs(x) (this has a zeroed signbit but otherwise same as x)
ix >= 0x40000000
  pone(y); qone(y)

qone(x) (also pone) do:
  ix = hx & 0x7fffffff

ix in qone and in the calling function are the same number,
and the comparison applies for both, and ix < 0x40000000 isn't
possible.

(Also, no explosions seem to happen when I feed it random numbers)
2017-02-09 21:23:11 +00:00
maya d2158a65ab minor bump libc for accept4 2017-02-08 20:26:26 +00:00
maya 248eba16c5 oops, do not write the same file twice -- accidentally ran patch twice 2017-02-08 18:03:57 +00:00
maya e89d2a589b Document accept4 in accept(2) 2017-02-08 18:01:24 +00:00
christos ea89c7259a empty to nothing 2017-02-08 18:00:37 +00:00
maya 708af0751d Add accept4, a tiny wrapper around paccept.
accept4 is a syscall in Linux, FreeBSD and OpenBSD. It is used in
LLVM, zeromq, and probably others. paccept is a superset of it.

adding it to libc ensures it is used by programs and prevents the
need to define the same wrapper in every program.
2017-02-08 17:58:41 +00:00
maya fefc5fa8d9 Make paccept a weak symbol in preparation for using it in another function 2017-02-08 17:30:27 +00:00
christos 9aa43b8677 __empty is defined in <sys/cdefs.h> 2017-02-08 16:13:40 +00:00
riastradh adfa6ca875 Omit duplicate text. 2017-02-08 13:31:36 +00:00
kamil 0892a29a1a libpthread_dbg(3) deletion from the base distribution
libpthread_dbg(3) is a remnant library from the M:N thread model
(pre-NetBSD-5.0) API to introspect threads within a process and for use
of debuggers.

Currently in the 1:1 model it's not used in GDB neither in LLDB and it's
not either planned to be used. It's current function to read pthread_t
structures is realizable within a regular debugger capable to
instrospect objects within a tracee (GDB, LLDB...).

Remaining users of this API can still use this library from
pkgsrc/devel/libpthread_dbg.

Sponsored by <The NetBSD Foundation>
2017-02-08 03:44:40 +00:00
christos 4251f87df7 PR/51958: Ngie Cooper: ESRCH error description in hcreate(3) contains typo
for action
2017-02-07 22:25:25 +00:00
kamil 5acf460d25 Mark exect(3) obsolete and bind it to plain execve(2) on all platforms
The original exect(2) from BSD4.2 was enabling bit for tracing
(single-step mode) and calling execve(2). The purpose of it was to generate
a signal for a tracer once the application will change its image to a new
program.

This approach no longer works as:
 - exect(2) traces (single-steps) libc and it requires hundreds or
   thousands steps before entering a new image
 - it's vax and x86 specific code
 - this functionality has been moved to the kernel - once a process is
   traced it will generate SIGTRAP with si_code TRAP_EXEC and route it to
   its debugger
 - the side effects and unportability make this interface unusable
 - there are no known users of this interface
 - it apparently never worked better since day0 of NetBSD ("day0 bug")

Users are requested to move to other execve(2) variants. Calling current
execve(2) as it is the most similar behavior to this one from BSD4.2.

Discussed several times on mailing lists and in PR/51700.

Add warning to exect(3) telling about marking this function obsolete.

This function is prepared to be removed in next libc major bump.

Sponsored by <The NetBSD Foundation>
2017-02-07 19:29:39 +00:00
kamil c58abbea19 Document in libc's shlib_version request for exect(3) removal
This functionality has been moved long time to the kernel. Kernel exec()
emits SIGTRAP under a debugger (unless PT_SYSCALL traced).
2017-02-07 15:33:25 +00:00
abhinav 6b1f1a07e7 Add posix_madvise(2) in the NAME section. 2017-02-03 21:10:22 +00:00
abhinav 0d379b321a Insert comma between two Nm entries.
Remove Pp before Bd
2017-02-03 21:03:05 +00:00
abhinav b566e9d11b Remove comma after the last Nm entry. 2017-02-03 08:14:58 +00:00
njoly cada2c18c7 Fix a typo : pthread_mutexaddr_init -> pthread_mutexattr_init. 2017-02-02 10:48:22 +00:00
abhinav 60763e809a Add comma between two Nm entries in the NAME section. 2017-02-01 16:06:19 +00:00
abhinav d2174aa7ea Add modff and modfl in the NAME section. 2017-02-01 15:57:47 +00:00
abhinav 11aef024b5 Fix a sentence.
Correct function name in the DESCRIPTION section.
2017-02-01 15:49:02 +00:00
abhinav 5f9e091f8e Also, fix spelling of described. 2017-02-01 14:51:29 +00:00
abhinav 6cef231ea2 Fix sentence. 2017-02-01 14:46:51 +00:00
abhinav b59ab9a645 Remove comma after last Nm entry. 2017-02-01 14:42:28 +00:00
abhinav 53327cbb3e Remove comma after the last Nm entry. 2017-02-01 14:37:20 +00:00
sevan cc576e1d8e Update supporting files for components which rely on autoconf to allow systems
introducing since release of software to be recognised. This should hopefully
allow the builds to progress a littles further on systems such as the POWER8
which features a little endian 64-bit PowerPC CPU identified as ppc64le.
2017-02-01 09:26:39 +00:00
roy 8dcd50a6a0 Move ESCDELAY to curses.c so all globals are close to each other.
Remove _reentrant and use ESCDELAY and TABSIZE as we're not really
reentrant.
2017-01-31 09:17:53 +00:00
roy 3c94ec04f2 Just return ERR instead of asserting if someone calls the slk routines
to affect the ripped off window before the window is actually ripped off.
2017-01-30 17:15:52 +00:00
roy 7487819a0b Check _cursesi_term is set in a few places and sprinkle some static. 2017-01-30 16:50:44 +00:00
roy 64b2ce979c If either set_escdelay(3) or set_tabsize(3) are called, set _reentrant
to ensure we use the saved value for the sceen.

This effectively makes ESCDELAY and TABSIZE read-only when either
of these functions are called.
2017-01-30 14:55:58 +00:00
abhinav c8b491e821 Fix a typo. 2017-01-29 16:52:38 +00:00
snj e6059b4b0a new lookup order will be in 7.1 before 8.0 2017-01-29 05:13:55 +00:00
wiz bb66c0074f Spelling fixes. 2017-01-27 12:52:39 +00:00
kamil 231f136ce0 Make the PIOD_READ_AUXV operation more clear
Describe how to set piod_offs.

Sponsored by <The NetBSD Foundation>
2017-01-25 17:12:56 +00:00
roy 2ebbf64e54 Document baudrate(3). 2017-01-25 12:42:05 +00:00
roy 1899e6576b And more functions .... 2017-01-25 12:21:18 +00:00
roy 9ab26a1db5 Note the substantial work by others on the curses library. 2017-01-25 12:05:26 +00:00
roy cb39f3d94a Document recently added functions in curses.3 2017-01-25 12:00:57 +00:00
roy de49f4c9e2 Reference curses_slk(3). 2017-01-25 11:44:55 +00:00
roy a2ac1ce48c Implement POSIX Curses Soft Label Key functions. 2017-01-24 17:27:30 +00:00
roy 9d818e01f4 Note an issue with our cursor movement in 1 line size window. 2017-01-24 16:45:41 +00:00
maya c7ed247615 add a wishlist for a major bump. isinff and compatibility cabs. 2017-01-20 22:10:38 +00:00
kamil c2ffce666f Fix one markup issue and add initial HISTORY section
Import HISTORY notes from FreeBSD.

Sponsored by <The NetBSD Foundation>
2017-01-15 22:18:11 +00:00
christos 1ecca95a27 fix *syslog_ss* 2017-01-15 16:41:39 +00:00
christos 213f09a410 don't include machine/param.h <sys/param.h> already does WTF? 2017-01-14 22:19:29 +00:00
christos 9d493e3dc8 remove useless include; asm.h is not useful for c files. our current assumption
is that stuff in cdefs.h is duplicated in asm.h.
2017-01-14 15:50:24 +00:00
wiz 13cf5641ee Wording, macro use. 2017-01-14 14:33:18 +00:00
kamil c2476a0996 Document PTRACE_LWP_CREATE and PTRACE_LWP_EXIT in ptrace(2)
Sponsored by <The NetBSD Foundation>
2017-01-14 07:17:38 +00:00
kamil 4e100202af Document PTRACE_VFORK and PTRACE_VFORK_DONE in ptrace(2)
PTRACE_VFORK - report vfork(2)-like operations and trace child
PTRACE_VFORK_DONE - report unblocking the parent after vfork(2)-like call

Note that PTRACE_VFORK is currently unimplemented and returns ENOTSUP.

Sponsored by <The NetBSD Foundation>
2017-01-14 00:02:40 +00:00
christos 4afb65f9d5 fix compilation 2017-01-13 18:18:20 +00:00
christos 025af9a44f allow overriding snprintf/vsnprintf 2017-01-13 14:41:27 +00:00
christos 794a9d5044 use getpagesize(3). 2017-01-13 04:18:54 +00:00
maya 68f994d51e replace old style function declaration 2017-01-12 19:02:22 +00:00
christos 585a07d820 Don't go redefining system constants, without checking if the system provides
them.
2017-01-12 18:23:04 +00:00
christos e9f6168b19 undo SSP damage from -Wsystem-headers 2017-01-12 18:16:52 +00:00
roy 5952c1b776 Use the screen argument, not _cursesi_screen. 2017-01-12 16:23:46 +00:00
roy ca57f21848 Correct terminfo variable pkey_norm to plab_norm. 2017-01-12 13:53:11 +00:00
christos 8212adb6e3 Avoid sysconf: __sysconf -> sysctlgetmibinfo -> strtoimax -> locale, etc. 2017-01-12 02:00:42 +00:00
christos 9cc0be316b A little more restructuring so that we don't need mutex stuff in syslog_ss. 2017-01-12 01:58:39 +00:00
christos 227c2c0795 make this smaller. 2017-01-12 01:02:09 +00:00
christos b722e4222b put back strerror_ss, it will be used shortly. 2017-01-12 00:43:55 +00:00
riastradh 0add037f37 Clarify the explanation of the compat_time.c definition of time. 2017-01-12 00:38:25 +00:00
christos 820e172c78 Split syslog.c to:
- syslog_ss.c *_ss api functions (don't use stdio, time)
- syslog.c: *syslog* non _ss api functions (use stdio, time)
- xsyslog.c> common guts.

The motivation for this is not to drag in stdio/locale/floating point/time
for every binary, since syslog_ss() is used in __stack_check_fail() for SSP.
2017-01-12 00:38:01 +00:00
christos 2a1a34d545 Add strerror_ss_r to be used by syslog_ss 2017-01-12 00:35:38 +00:00
roy 53035e70de Fix some off by one issues with arraycount ..thanks coypu. 2017-01-11 20:53:52 +00:00
roy c77e1d014f Move the ripoffline logic out of screen.c and into ripoffline.c.
Store ripped off lines in the SCREEN structure so we can repaint then
when the terminal is resized.
Fix mvwin(3) so it can move windows in the ripped off area.
2017-01-11 20:43:03 +00:00
roy 295b0bfab7 Remove setup already done in newterm and even set_term. 2017-01-11 17:15:27 +00:00
roy 518bfd5577 Kill stray refs to __virtscr and _cursesi_screen missed in prior commit. 2017-01-11 10:06:32 +00:00
roy 019139adbd ripoffline requires wnoutrefresh to work before _cursesi_screen has been
set.
2017-01-11 09:54:54 +00:00
kamil 2e2dd171b3 Correct man-page category of posix_spawn: is (3) not (2) 2017-01-11 07:32:36 +00:00
kamil 5ed9a833b2 Document SIGTRAP with si_code TRAP_CHLD in ptrace(2)
Document the current behavior of TRAP_CHILD in NetBSD.
Add more notes on PTRACE_FORK events.

Sponsored by <The NetBSD Foundation>
2017-01-11 07:31:14 +00:00
roy 98102593fe Use the window's screen's terminal. 2017-01-10 23:49:20 +00:00
roy cc74ade3a6 Fix resizing terms. 2017-01-10 23:28:45 +00:00
roy e56dac4e35 Use the terminal of the SCREEN of the WINDOW rather than cur_term
for window attribute functions.
2017-01-10 21:56:50 +00:00
christos 4ad16b3e7c PR/51814: Ngie Cooper: add <stdio.h> since sys_nerr is declared there on
FreeBSD.
2017-01-10 20:25:48 +00:00
christos 4476579893 KNF, simplify expressions for readability. 2017-01-10 17:51:01 +00:00
christos 46629f8e5f pacify lint. 2017-01-10 17:50:24 +00:00
christos 6ddfa6c010 simplify cast. 2017-01-10 17:46:47 +00:00
christos 01b3cff52b add missing cast. 2017-01-10 17:46:26 +00:00
christos 56572bf5f5 cast for size_t 2017-01-10 17:45:58 +00:00
christos 14501124c4 use correct type for poll 2017-01-10 17:45:27 +00:00
christos 3707fb92bc include <sys/stat.h> 2017-01-10 17:45:12 +00:00
christos d472a9154a add constcond 2017-01-10 17:44:51 +00:00
christos f8af623337 add linted comment 2017-01-10 17:44:28 +00:00
christos 93438ac9dd Need <sys/stat.h> 2017-01-10 17:00:58 +00:00
christos ef5b9db358 need <sys/stat.h> 2017-01-10 16:51:30 +00:00
roy 545dbcc586 When doupdate is called, check for typeahead input after N lines changed
instead of aborting really early.

This allows some screen update when holding the page down key for example.
2017-01-10 10:33:49 +00:00
roy 25445577c0 Implement POSIX curses function ripoffline(3). 2017-01-10 10:13:24 +00:00
roy 5714904ce2 Test for __ISPASTEOL when moving the cursor and it hasn't moved.
Unset __ISPASTEOL when moving the cursor during refresh.
2017-01-10 09:32:01 +00:00
abhinav fe8fae7920 Add missing word. 2017-01-10 06:28:46 +00:00
christos 93f630910e Adapt to new zlib 2017-01-10 01:28:03 +00:00
blymn b3963fa60a Checks for bottom right corner were reversed. 2017-01-09 21:17:29 +00:00
christos 1ec9eafabc Make sure we take into account history_base when computing negative history
offsets. (Gerry Swinslow)
2017-01-09 03:09:05 +00:00
christos 4937de3b47 Make sure that argv is NULL terminated since functions like tty_stty rely
on it to be so (Gerry Swinslow)
2017-01-09 02:54:18 +00:00
wiz 65fa8d4547 Use more markup, sort ENVIRONMENT. 2017-01-08 13:49:21 +00:00
wiz 6811b22279 Whitespace fix, bump date for previous. 2017-01-08 13:49:05 +00:00
kamil 69c3a1c44c Add more notes explaining how debuggers work on NetBSD
Explain:
 - execve(2) handling and behavior, SIGTRAP & TRAP_EXEC
 - reference PaX MPROTECT restrictions for debuggers
 - software breakpoints handling and behavior, SIGTRAP & TRAP_BKPT
 - single step behavior, SIGTRAP & TRAP_TRACE
 - list predefined MI symbols for help debuggers in port specific headers
 - explain that PT_TRACE_ME does not send a SIGSTOP signal

Sponsored by <The NetBSD Foundation>
2017-01-07 05:51:14 +00:00
kamil 6a0def7293 Document PT_SET_SIGINFO and PT_GET_SIGINFO in ptrace(2)
PT_SET_SIGINFO - fake signal information emitted to tracee
PT_GET_SIGINFO - read signal information routed to tracee

Sponsored by <The NetBSD Foundation>
2017-01-07 03:41:25 +00:00
kamil 6615db4a39 Fix swapped text between PT_GET_PROCESS_STATE and PT_GET_EVENT_MASK
Sponsored by <The NetBSD Foundation>
2017-01-07 01:32:35 +00:00
kamil 929c1cc1fe ptrace(2): Document addr and data argument usage for PT_GET_PROCESS_STATE
The PT_GET_PROCESS_STATE call in ptrace(2) has the following usage of addr
and data:

    A pointer to this structure is passed in addr.  The data
    argument should be set to sizeof(struct ptrace_event).

Sponsored by <The NetBSD Foundation>
2017-01-07 01:29:18 +00:00
roy 84fe414e1f KNF 2017-01-06 14:25:41 +00:00
roy 9180469668 KNF 2017-01-06 14:06:00 +00:00
roy 50a63ac8d2 KNF.
Normalise coding style.
White space police.
Sprinkle some extra braces to make the flow more clear.

No functional changes.
2017-01-06 13:53:18 +00:00
roy 846cb8f380 u_int -> unsigned int, u_int32_t -> uint32_t. 2017-01-06 09:14:07 +00:00
roy 506f84ec9a Implement ncurses is_pad(3).
Correct documentation about is_keypad(3).
2017-01-05 23:15:43 +00:00
roy 433b66d936 Whitespace 2017-01-05 21:42:04 +00:00
roy 4550c5287c Implement is_term_resized and resize_term(3) ncurses extensions.
resizeterm(3) is now a wrapper for resize_term(3).
2017-01-05 21:25:17 +00:00
roy 47cc2fc353 Add the set_escdelay(3) and set_tabsize(3) ncurses extensions. 2017-01-05 20:31:37 +00:00
wiz e4ec469a39 Fix typo. 2017-01-05 12:35:41 +00:00
wiz 3134e606a6 Whitespace. 2017-01-05 09:46:32 +00:00
wiz 6e0a1cbf88 Use Ev for environment variables. 2017-01-05 09:46:08 +00:00
roy ffbd31d04d White space police 2017-01-04 03:51:29 +00:00
roy c293b9d8ca Allow C++ to link with all curses parts. 2017-01-04 02:05:23 +00:00
roy 5a86062c02 Add missing man pages for wsyncup.3 and wcursyncup.3 2017-01-03 13:21:40 +00:00
roy 8cf8e1d614 Support 256 colour terms.
From: rofl0r <retnyg@gmx.net>
2017-01-03 12:42:06 +00:00
roy 330e363652 Now that we have the initialize_color capability,
init_color can be made to work.

From: rofl0r <retnyg@gmx.net>
2017-01-03 12:39:44 +00:00
christos 29343d16d1 set to NULL after releasing to avoid double free. 2017-01-03 00:59:31 +00:00
roy c247fb6646 Bump libcurses to 7.1 for prior additions. 2017-01-02 12:38:16 +00:00
roy 1369811d4e Implement POSIX Curses functions immedok(3) and syncok(3). 2017-01-02 10:28:34 +00:00
roy 4da08ba387 Whitespace 2017-01-02 08:44:12 +00:00
maya 038de09f8a compare to zero, instead of using signbit, and be more specific in comment.
-0.0 > 0 is also false. no functional change.

while this is mostly a change to be consistent in style (the rest of the
comparisons aren't done with signbit), it is also a micro-optimization.

with our default compile flags, calls to copysign are libm calls (and a
whole function call!!). this generates more efficient code.
2017-01-01 19:32:14 +00:00
abhinav db324dcb86 Fix sentences at a couple of places.
Reorganize the RETURN VALUES section a bit to improve readability.
Add xrefs to clearerr(3) and ungetc(3) in SEE ALSO.
Bump date.

ok wiz@
2017-01-01 12:39:33 +00:00
roy 6de5f0d137 Implement ncurses extension has_key. 2017-01-01 03:06:06 +00:00
maya c0f2822a3c similar to csqrt, spare ourselves a fabsf call. we already check sign
later on, use this to our advantage.

No functional change.
2016-12-31 22:54:56 +00:00
roy a663bc11be Implement POSIX Curses typeahead function. 2016-12-31 22:47:01 +00:00
maya 43e54dd9fc csqrt has a branch cut on the negative real axis, and this requires
delicacy in order to maintain continuity around it.

we have an initial case to deal with a fairly common case: getting
a real number. Avoid dealing with the branch cut in this case by
checking if the real part is negative.

later, -0.0 < 0 is not met, so instead, test for a negative number
using signbit, so negative zero is also treated as a negative number.

Fixes last part of PR lib/51427: libm issues triggered by py-numpy

ok riastradh
2016-12-31 20:01:15 +00:00
roy 77943ff6ed Implement POSIX curses use_env function. 2016-12-31 17:46:35 +00:00
maya 03a73f9282 Spare ourselves a fabs call. We already check the sign later.
w = r + y*I is the same as w = r because this is the y == 0 case.

no functional change.
2016-12-31 15:33:03 +00:00
roy 2ab1e31d80 Implement ncurses extensions is_leaveok and is_keypad.
The former allows the ncurses (and pdcurses) macros getsyx and setsyx
to be implemented, which is needed by a surprising number of applications.

The latter is needed for Python curses support so it doesn't have to dive
into ncurses window structure.
2016-12-31 13:50:16 +00:00
roy 1c3d328353 Add the POSIX filter() function to libcurses. 2016-12-30 22:38:38 +00:00
wiz 1e92e63851 Fix some prototypes. 2016-12-29 23:50:59 +00:00
kamil 383dde7b6a Reference siginfo(2) for a SIGCHLD signal
siginfo(2) describes appropriate signal specific information for SIGCHLD.

Sponsored by <The NetBSD Foundation>
2016-12-29 22:17:51 +00:00
wiz 42d8f555f6 Update prototypes to match current RPC code.
Bump date.
2016-12-29 22:07:12 +00:00
wiz 29b4283f3f Fix asctime_r prototype. 2016-12-29 21:03:51 +00:00
wiz b52b1cd113 Mention stdarg.h for va_list. 2016-12-29 20:29:30 +00:00
christos 5d7e998696 Make this portable to other OSs 2016-12-29 18:30:55 +00:00
wiz 146c3bb911 Fix typos. 2016-12-27 21:25:12 +00:00
rmind cbc7bab49c KNF 2016-12-27 20:32:58 +00:00
christos 52d8bce52a Add a function to iterate over endpoints 2016-12-27 20:14:07 +00:00
rmind 5e66d73d01 Update libnpf(3) man page. 2016-12-27 17:58:56 +00:00
christos f75d79eb69 Sync NPF with the version on github: backport standalone NPF changes,
which allow us to create and run separate NPF instances. Minor fixes.
(from rmind@)
2016-12-26 23:05:05 +00:00
abhinav c95a15e71b Add missing full stop. 2016-12-26 10:16:43 +00:00
abhinav b2f786d04e As per the IEEE 1003.1-2008 standard, the range of values for the %S
format specifier is [0,60].
2016-12-25 06:37:50 +00:00
maya 177f6a3a05 don't use systm.h header, it's not available to userland.
as a side effect, this fixes the evbarm64 build, which was failing due
to a declaration of psize_t physmem in systm.h, while psize_t is
kernel-only.

ok riastradh
2016-12-24 15:23:06 +00:00
abhinav a4dca42e82 As per C99 the range of values for the %S format specifier is [0,60]
rather than [0,61]. The standard has removed mention of double leap seconds.
The standard has give the following rationale in the time.h man page:

"The range [0,60] seconds allows for positive or negative leap seconds.
The formal definition of UTC does not permit double leap seconds, so all
mention of double leap seconds has been removed, and the range shortened
from the former [0,61] seconds seen in previous versions of POSIX."
2016-12-24 05:33:51 +00:00
abhinav 93864c5433 Complete a sentence
and replace full stop with a comma at one place as the sentence wasn't finished
2016-12-23 06:01:41 +00:00
abhinav 6672db53ac Remove trailing comma at the end of the last .Nm entry in the NAME section 2016-12-22 17:39:28 +00:00
abhinav d52ecd3afc Grammar fixes at few places
Also, don't use .D1 inside .Bd (mandoc -Tlint was complaining)
Remove whitespace at the end of a sentence
2016-12-22 17:27:02 +00:00
christos 116a2064fe PR/50228: Christian Groessler: fix bzero(ptr, 0) on ppc. Check for 0 length
before jumping to cb_memset like memset does.
2016-12-19 14:30:23 +00:00
abhinav af4d0016d3 Use markup for errno
Also remove a .Pp before .Bl while there
2016-12-19 07:48:35 +00:00
abhinav fc41d23c04 Be consistent in using process' (vs process's). 2016-12-19 07:17:45 +00:00
abhinav 490a78e58c Fix sentence. 2016-12-19 06:45:29 +00:00
christos b91b113b53 flesh out _Unwind_Exception, rust needs it. 2016-12-19 01:24:40 +00:00
christos cb01aa8e82 clarify res_nclose and res_ndestroy. 2016-12-18 17:34:36 +00:00
wiz 31a419311f Fix typo. 2016-12-17 10:25:49 +00:00
abhinav adaa892a13 Fix typo 2016-12-17 06:17:16 +00:00
mrg f1582e88f7 scandir/alphasort take "const struct dirent **" not "const void *" in
modern unix.  since we claim to be 'IEEE Std 1003.1-2008', make it so.
2016-12-16 04:45:04 +00:00
kamil 1779f12820 ptrace(2): Document PT_GETVECREGS and PT_SETVECREGS (ppc ports specific)
Sponsored by <The NetBSD Foundation>
2016-12-15 15:03:17 +00:00
kamil 3c3d6699d5 ptrace(2): Document PT_GETXMMREGS and PT_SETXMMREGS (i386 port specific)
Sponsored by <The NetBSD Foundation>
2016-12-15 14:49:46 +00:00
kamil 091cebb2c4 ptrace(2): Remove dead text, some of it commented in this file for years
For example PT_READ_U/PT_WRITE_U has been removed by <mycroft> in 19950126.

Sponsored by <The NetBSD Foundation>
2016-12-15 13:06:08 +00:00
christos 2b4d6aa5a1 fix placement of lint comment 2016-12-12 04:20:31 +00:00
blymn 4114d2610d Improve debug information. 2016-12-11 21:25:22 +00:00
christos 3d8a0ad9b3 PR/51706: Amir Plivatsky: Fix memory leak 2016-12-11 15:47:06 +00:00
scole 5e40039f22 Add exect stub so "build.sh distribution" will compile 2016-12-10 21:19:15 +00:00
christos 5467719bc0 use array notation 2016-12-10 21:04:12 +00:00
kamil 4067ec816b Remove outdated note in the PT_DUMPCORE call of the ptrace(2) man-page
Currently the PT_DUMPCORE call requires process to be stopped, therefore it
no longer need to warn about stoped tracee to generate consistent data.

Sponsored by <The NetBSD Foundation>
2016-12-10 20:02:07 +00:00
christos 431fde0e65 update for v18 conn list; more error checks 2016-12-10 19:07:22 +00:00
rin 7edfde5134 Fix typo; ".Lx" should be ".Nx" 2016-12-10 14:13:29 +00:00
kre c0121372b2 Remove what was probably a left over remnant of a debugging printf
which was incompletely deleted.   Hopefully fix the build.
2016-12-10 08:48:11 +00:00
christos 3d5a430c2b add npf_nat_lookup() 2016-12-10 05:37:55 +00:00
christos 5398e0956f more stuff needs -mfpu=vfp 2016-12-08 18:42:01 +00:00
pgoyette 02a1db30fb Fix comment: s/ACCD/ADDC/ 2016-12-07 10:03:29 +00:00
kre 7a3aec16f6 Actually guarantee that the returned buffer from link_ntoa() is always
NUL terminated, even when called by malicious/broken applications.
2016-12-07 09:52:34 +00:00
pgoyette d6b064e942 More tweaking... 2016-12-07 03:48:05 +00:00
pgoyette dfa0a7c726 Update BUGS section to note the possibility of a truncated return value. 2016-12-07 03:22:14 +00:00
christos 2067ca0866 make it always return a NUL terminated string instead of NULL when the address
is truncated for compatibility with others.
2016-12-07 03:16:45 +00:00
christos 7143892b68 Add the terminating NUL as a regular character addition. 2016-12-07 02:48:54 +00:00
dholland f118bedc12 Leave room for the null terminator. Spotted by DuClare on freenode. 2016-12-07 02:36:41 +00:00
christos 8f4552233c Fix buffer copy without checking the size of input:
https://www.kb.cert.org/vuls/id/548487
2016-12-06 18:41:02 +00:00
christos d10d9a2322 fix test lib/librumphijack/t_sh/runscript
(handle F_DUPFD_CLOEXEC that the shell is now using)
2016-12-02 20:53:36 +00:00
christos b293c8a9d7 Add unwind action type and constants 2016-12-02 19:25:19 +00:00
christos 6d100a1021 PR/51673: Carsten Kunze: curses: standend() does not turn off A_BOLD;
according the X/Open it needs to turn off all attributes.
2016-11-29 17:33:48 +00:00
christos 56b8322bcc If we are inserting spaces to account for a tab, move the x position of the
cursor, otherwise this is a no-op (Carsten Kunze)
2016-11-28 18:25:26 +00:00
dholland aa08bfea54 More of previous. 2016-11-26 21:17:06 +00:00
dholland a714102aaa fix comment about initialization-time calls; ok joerg 2016-11-26 20:38:20 +00:00
christos ee97ae6abf off-by-one in memcpy. Found by ASAN (Carsten Kunze)
XXX: pullup 7.
2016-11-24 17:09:55 +00:00
christos 50c795e166 don't coredump if we call endwin when initscr fails. 2016-11-24 14:49:08 +00:00
wiz fe65e38bd3 Bump date for previous. 2016-11-24 12:19:28 +00:00
wiz 9e3f1ccd88 Various fixes. 2016-11-24 12:18:02 +00:00
kamil eedb67d83d Remove duplicated PT_DUMPCORE description in machine-specific calls section
This function is part of the general ptrace(2) interface.

Sponsored by <The NetBSD Foundation>
2016-11-24 00:12:52 +00:00
scole 53744582f1 For ski, break into debugger instead of exiting 2016-11-22 22:50:32 +00:00
kamil f54728af92 Obsolete thread_type in td_thread_info_st in <pthread_dbg.h>
The thread_type is irrelevant as all local POSIX threads are in user-space.

Keep the thread_type member in td_thread_info_st to preserve ABI
compatibility.

Later the remnants from M:N will be refactored in one go with library ABI
version bump.

Sponsored by <The NetBSD Foundation>
2016-11-22 04:51:06 +00:00
kamil 4c8a06b7ee Simplify (pthread_t)pt_magic read in td_map_pth2thr(3)
No functional change. All ATF tests for pthread_dbg(3) still pass.

Sponsored by <The NetBSD Foundation>
2016-11-22 04:17:05 +00:00
kamil 7b8609d5c0 Document td_map_pth2thr(3) from libpthread_dbg(3)
td_map_pth2thr - convert the pthread_t to a thread handle

Sponsored by <The NetBSD Foundation>
2016-11-22 03:52:01 +00:00
kamil 2d6a6aff1c Document td_thr_getname(3) from libpthread_dbg(3)
td_thr_getname - get the user-assigned name of a thread

Sponsored by <The NetBSD Foundation>
2016-11-22 01:49:36 +00:00
kamil 6c74bd40be Add reference in SEE ALSO to pthread_dbg(3)
Sponsored by <The NetBSD Foundation>
2016-11-22 00:32:09 +00:00
kamil 2e8fabe0b7 Document td_thr_iter(3) from libpthread_dbg(3)
td_thr_iter - iterate over the threads in the process

Sponsored by <The NetBSD Foundation>
2016-11-22 00:07:40 +00:00