Commit Graph

18820 Commits

Author SHA1 Message Date
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
kamil
7332bc9351 Document td_thr_info(3) from libpthread_dbg(3)
td_thr_info - get information on a thread

Currently a subset of td_thread_info_t is documented. This version
describes thread_addr and thread_state.

Sponsored by <The NetBSD Foundation>
2016-11-21 22:19:03 +00:00
kamil
ba06ccfe95 Add initial documentation (man-pages) for libpthread_dbg
Document libpthread_dbg and basic function calls: td_open() and td_close()

Sponsored by <The NetBSD Foundation>
2016-11-21 20:43:25 +00:00
kamil
2bd33bc337 Kill SA thread states (TD_STATE_*) in pthread_dbg and add TD_STATE_DEAD
Scheduler Activation types were removed in NetBSD 5.0. Old type set is not
matching the new world POSIX threads library.

Only TD_STATE_RUNNING, TD_STATE_ZOMBIE are still applicable - keep it.

Keep TD_STATE_UNKNOWN as generic unrecognized type.

Add new TD_STATE_DEAD one. The TD_STATE_DEAD type is represented by number
6 in the POSIX threads library, but for the sake of compatibility with
older software using pthread_dbg - renumber it to 7, as six was reserved
for TD_STATE_SUSPENDED.

Old removed state types are marked as reserved and unused.

Sponsored by <The NetBSD Foundation>
2016-11-21 03:02:34 +00:00
kamil
c35485043b Always set trailing '\0' in td_thr_getname() to compose valid ASCIIZ string
This fixes threads5 in tests/lib/libpthread_dbg

Sponsored by <The NetBSD Foundation>
2016-11-20 21:49:24 +00:00
pho
82c0423db2 fuse_main(3): Support general fuse options via fuse_parse_cmdline(3)
* Prototypes for fuse_new(3), fuse_mount(3), and fuse_unmount(3) now
  matches to the original fuse interface.

* Add fuse_daemonize(3): needs to have a different prototype,
  otherwise we can't use puffs_daemon(3).

* Remove fuse_setup(3) and fuse_teardown(3). These obsolete functions
  has already been removed from the original interface.

* fuse_main(3) now supports the following command-line options
  compatible with the original fuse:

  -h, --help      print help message
  -V, --version   print library version (currently does nothing)
  -d, -o debug    enable debug output (PUFFS_FLAG_OPDUMP), implies -f
  -f              foreground mode
  -s              single threaded mode (always enabled for now)
  -o fsname=NAME  explicitly set the name of the file system

* fuse_main(3) now daemonizes the process by default. This is for the
  compatibility with the original fuse.
2016-11-20 13:28:32 +00:00
pho
0e4f248f77 fuse_lowlevel.h: new file, currently only contains fuse_parse_cmdline(3) and struct fuse_cmdline_opts 2016-11-20 13:26:28 +00:00
wiz
14feb52a56 Whitespace. 2016-11-20 09:38:37 +00:00
dholland
b6a15c213c Add crossreference to fork(2) per note in PR 9627. 2016-11-20 07:05:20 +00:00
kamil
df6b325f24 Fix pt_magic read in td_map_pth2thr()
The pt_magic field is not the first one in the pthread_t structure.

Sponsored by <The NetBSD Foundation>
2016-11-20 03:53:47 +00:00
kamil
57fc5895ae Catch up with correct pt_magic reads in td_thr_{getname,suspend,resume}
The pt_magic field is not the first one in the pthread_t structure.

Sponsored by <The NetBSD Foundation>
2016-11-20 03:11:32 +00:00
kamil
1d6ebe4f76 Fix pt_magic (part of pthread_t) read in td_thr_info()
The pt_magic field is not the first one in the pthread_t structure.
After this fix, this code is confirmed to work and function td_thr_info()
is functional.

Sponsored by <The NetBSD Foundation>
2016-11-20 02:27:56 +00:00
pho
12a2d5638d Change the way how puffs_fuse_node_create() behaves.
In puffs "create" and "open" are two separate operations with
atomicity achieved by locking the parent vnode. In fuse, on the other
hand, "create" is actually a create-and-open-atomically and the open
flags (O_RDWR, O_APPEND, ...) are passed via fi.flags. So the only way
to emulate the fuse semantics is to open the file with dummy flags and
then immediately close it.

You might think that we could simply use fuse->op.mknod all the time
but no, that's not possible because most file systems nowadays expect
op.mknod to be called only for non-regular files and many don't even
support it.
2016-11-17 14:20:25 +00:00
pho
fd86259521 Major rework of fuse_opt_parse(3) so that it supports all the functionality of the original function 2016-11-16 16:11:42 +00:00
pho
5ae81a5b54 fuse_opt_match(3): Support every form of templates, not just the simple strcmp case
Also it should return 1 for successful matches, not the way around.
2016-11-15 00:34:19 +00:00
pho
8a68fd4cd6 Add missing macros 2016-11-14 17:48:57 +00:00
pho
111da591d5 Implement missing fuse_opt_add_opt(3) and fuse_opt_add_opt_escaped(3) 2016-11-14 17:19:29 +00:00
wiz
f662fdae7e Whitespace. 2016-11-14 10:40:59 +00:00
christos
c231d3fa1b Explain rmtp setting. 2016-11-11 16:07:05 +00:00
christos
50d1e6ecfe Document WNOZOMBIE 2016-11-10 17:08:31 +00:00
riastradh
263e13aeed Use the keywords underflow' and overflow' in ERANGE summary. 2016-11-07 21:52:36 +00:00
riastradh
95f4e015a9 Fix phrasing about out-of-band' and sentinel value'.
Either an out-of-band channel, or an in-band sentinel value, could
indicate an error, but an out-of-band sentinel value is a silly
proposition.

Noted by uwe@.
2016-11-07 21:51:42 +00:00
christos
f09a36d8a1 Change the way the built-in history works; some programs enter history
with the trailing newline, others don't so don't make any assumptions
about it when printing. Also print the correct event number (generated),
separate the event number from the event with a tab, and visually encode
the string (don't encode tabs and spaces though).
2016-11-07 15:30:18 +00:00
kre
edb49bae9b Actually, this problem won't be reported upstream, their code is
just ...

	ptrdiff_t nitems_max = PTRDIFF_MAX - WORK_AROUND_QTBUG_53071;
	ptrdiff_t amax = nitems_max < SIZE_MAX ? nitems_max : SIZE_MAX;

which is just fine if you think about it a little,   Unfortunately,
in our zealous effort to never leave a ggc warning unused, and to
treat all of the warnings as fatal errors, that code falls foul of the
"you must not compare an unsigned value with a signed value" warning.

nitems_max is a (signed) largish positive integer (obviously, by
inspection).  If it is less than SIZE_MAX then amax is just nitems_max.
In the unlikely case that size_t has less bits than ptrdiff_t so
SIZE_MAX is smaller, amax is limited to SIZE_MAX (which in that case
is known to fit in the ptrdiff_t and to remain positive).

To pacify gcc (and the way the build system uses it), casts are
required.   Unfortunately the cast that was installed here was to
convert SIZE_MAX to a ptrdiff_t.  Unfortunately when ptrdiff_t has
the same number of bits (or less) as size_t (ie: the common case)
but is signed, (ptrdiff_t)SIZE_MAX is just a fancy way of writing -1.

Rearrange the casting in a way that keeps the original intent
of the code for us (it is actyaly now incorrect if size_t has less
bits than a ptrdiff_t) and keeps gcc happy, all at the same time.

What a mess.
2016-11-05 23:09:37 +00:00
kre
752944af9d Revert a couple of lines of code from tzcode2016i to their state in 2016h
SIZE_MAX is the max value of a size_t (and is unsigned) so when converted
to a ptrdiff_t  (int) becomes -1.   That's not what the code was attempting
to achieve.

This will be reported upstream to the tzcode maintainers, and we'll see
what variation appears in tzcode2016j ...

Until then, the older code always worked for us, so it will do for now.

This should fix the broken i386 build.
2016-11-05 22:21:48 +00:00
riastradh
2d9978a06e Update strtoul(3) example to reflect clarifications in strtol(3). 2016-11-05 20:57:31 +00:00
christos
375cff8702 lint knows about _Generic 2016-11-05 01:08:58 +00:00
riastradh
02eab895ae Bump date for previous. 2016-11-04 20:19:58 +00:00
riastradh
59495a850c Tidy up the second example too. 2016-11-04 20:18:23 +00:00
riastradh
105424da40 Simplify error condition case.
Add assertions to reflect its implications.
2016-11-04 20:16:18 +00:00
riastradh
e465e7c45b Distinguish invalid syntax from trailing garbage cases. Clarify. 2016-11-04 20:14:31 +00:00
riastradh
3a33a135da Distinguish altogether invalid syntax from trailing garbage. 2016-11-04 20:06:09 +00:00
riastradh
95993320dc EXIT_FAILURE police 2016-11-04 20:04:04 +00:00
christos
aafaa3c48f tzcode2016i 2016-11-04 19:41:53 +00:00
riastradh
fd26083f95 Fix infinity detection with isinf(d), not d == HUGE_VAL.
Negative infinity counts as overflow too.

Simplify.
2016-11-04 19:18:53 +00:00
riastradh
e7962ffd1d Add example for strtod.
This illustrates all the cases you might be interested in and asserts
theorems in those cases.
2016-11-04 19:10:04 +00:00
riastradh
7f81880412 Fix description of ERANGE cases again.
Do use the technical terms `overflow' and `underflow', because strtod
sets ERANGE precisely to indicate either of these two conditions, and
they are the right keywords that one might be looking for.

Note that strtod may set ERANGE even if it returns noninfinity and
nonzero -- specifically, if the result is subnormal.  This part was
wrong before I `fixed' it and remained wrong after I `fixed' it
earlier this year.
2016-11-04 18:46:15 +00:00
pgoyette
bf821edee1 Typo - "a requests" --> "a request" 2016-11-02 03:21:38 +00:00
wiz
f899b3dcea Bump date for previous. 2016-11-01 15:30:47 +00:00
kamil
0144090d24 Document PT_SET_EVENT_MASK, PT_GET_EVENT_MASK and PT_GET_PROCESS_STATE
These descriptions are imported from OpenBSD.

Approved by <christos>

Sponsored by <The NetBSD Foundation>
2016-11-01 13:51:13 +00:00
christos
6e03f6000c Don't spin if we already own the mutex, otherwise we will get stuck spinning
forever, fixes timemutex{1,2} tests.
2016-10-31 23:53:12 +00:00
kamil
3b2abf0b2a Add CHECK_NOT_THREADED() in __libc_mutexattr_settype_stub()
This makes this function consistent with __libc_mutex_catchall_stub()
and others in the same group.

Approved by <christos>.
2016-10-31 18:10:11 +00:00
abhinav
0551ffcf66 Fix file name auto completion in one specific case.
For example if you do
$mkdir -p /tmp/dir1/dir2

Then:
$ls /tmp/di <TAB> auto completes to
$ls /tmp/dir1/

Hitting <TAB> again auto completes to
$ls /tmp/dir1/dir2

Whereas it should auto complete to
$ls /tmp/dir1/dir2/


Essentially, in cases like above where you have to hit <TAB> twice to get
to the match and there is only one match (because only one file/sub-directory) then
auto complete doesn't work correctly. It doesn't append a trailing slash (in case
of directory) or a space (in case of a file) to the match name.

I have tested file name completion in sh(1) and symbol completion in gdb after
this change.
2016-10-31 17:46:32 +00:00
pgoyette
c16bd04c08 Fix markup .Dv --> .Dq
(Thanks, wiz!)
2016-10-31 07:37:10 +00:00
pgoyette
34a71bb24b Typo 2016-10-31 01:31:25 +00:00
kamil
06b9d77598 POSIX harder the pthread_mutex_timedlock(3) prototype
Add missing __restrict keyword to the first pointer parameter.

It was already used for the second argument, should not be a functional
change and generated code should be the same.

This new form is now aligned with POSIX.
2016-10-30 23:26:33 +00:00
christos
931e76f255 export rl_done 2016-10-28 18:32:35 +00:00
christos
1a4590725b pass the stream to the getc function 2016-10-28 18:32:26 +00:00
christos
6c345d9579 PR/51578: Henning Petersen: Fix leak on error. 2016-10-26 15:39:30 +00:00
christos
4384a68ce2 KNF, no real change (except malloc(x * y) -> calloc(x, y)) 2016-10-26 15:36:17 +00:00
christos
59538e7ea4 It is expensive to open and close files for every printf, keep it around. 2016-10-23 21:20:56 +00:00
christos
5b486ace20 PR/51572: calling funopen on each printw call is a tad excessive, but this
is not a reason for funopen to leak. Always call the close function since we
are indirecting through our cookie and we need to free it.
2016-10-23 21:01:52 +00:00
christos
8a48cf6610 remove bogus malloc casts 2016-10-22 21:55:06 +00:00
skrll
11da075cc5 Add multiple inclusion protection and __{BEGIN,END}_DECLS as a native gdb
build uses c++ to build nbsd-thread.c
2016-10-22 18:04:40 +00:00
christos
af580f3ad2 welcome to 2016h 2016-10-20 17:41:34 +00:00
maya
57f1116306 Revert previous. it shouldn't have an effect.
$$ should make it sufficiently unique.
2016-10-19 09:51:38 +00:00
christos
95c12ccdf1 make the env stuff visible. 2016-10-19 01:30:35 +00:00
wiz
90f5b47a4a Sort sections. new sentence, new line. Whitespace. 2016-10-18 22:26:13 +00:00
christos
476dcf2b00 make this compile again, and simplify. 2016-10-18 17:56:31 +00:00
manu
edb96218ee Make FUSE socket buffer tunable
When dealing with high I/O throughput, we could run out of buffer
space if the filesystem was not consuming requests fast enough.
Here we slightly raise the buffer size, and we make it tunable
through the PERFUSE_BUFSIZE environment variable so that we can
cope with higher requirement later.

While there, document PERFUSE_OPTIONS environment variable.
2016-10-18 15:06:17 +00:00
maya
ae394a6300 use mktemp instead of $RANDOM for tmpdir
..$RANDOM won't work with our /bin/sh.

unsure if this script is used, but it is wrong.
might help the spurious build failures that occasionally
show up on autobuilds.
2016-10-17 18:24:42 +00:00
wiz
d42d91aeec Add missing word. 2016-10-16 05:28:33 +00:00
kamil
cc5d581159 Add NetBSD CVS Id on top of the wcsnlen.c file 2016-10-15 14:30:36 +00:00
kamil
6245abaafa Import wcsnlen(3) to libc
The wcsnlen(3) function conforms to POSIX.1-2008 and is an addition to the
ISO C standard.

size_t wcsnlen(const wchar_t *s, size_t maxlen);

The wcsnlen(3) function computes the number of wide-characters in a wide-
-string to which s points, not including NULL terminating wide-character
code and checking no more than maxlen wide-characters. This function never
examines wide-characters beyond a wide-string of maxlen size.


This function is a safer version of wcslen(3):

size_t wcslen(const wchar_t *s);


Update STANDARDS section of wmemchr(3) describing wide-character functions.
2016-10-15 14:21:59 +00:00
macallan
f61977ef47 build libc_fp only on mips64* 2016-10-14 17:29:29 +00:00
christos
6c1a8a7017 add strchrnul 2016-10-12 20:01:12 +00:00
macallan
8baff5f4bf build and install libc_fp on mips
use with LD_PRELOAD=/lib/libc_fp.so for FPU use via softfloat
2016-10-11 17:02:28 +00:00
macallan
8575febebd move shlib_version into the main directory 2016-10-11 16:55:22 +00:00
macallan
8de18d0a37 set MKSOFTFLOAT=no so we don't get another -msoft-float slapped on COPTS
now this actually builds
thanks to mrg for pointing me in the right direction
2016-10-10 18:49:30 +00:00
macallan
f21b7d7f2c fix tpyo 2016-10-09 17:18:32 +00:00
joerg
04b0597d11 Fix syntax for currently not compiled in code. From Henning Petersen in
PR lib/51538.
2016-10-09 11:48:24 +00:00
kre
3a37e001c7 Patch 0001 from upstream to tzcode2016g to restore full functionality
of zic -l
2016-10-07 19:47:16 +00:00
christos
9551d334d2 merge tzcode2016g 2016-10-07 15:29:42 +00:00
christos
1acb507c2d Sync with compat and remove dup implementations of ldexp and modf, switching
mips and m68k to the compat copies.
2016-10-07 11:10:43 +00:00
christos
c7db9c14b4 return 0 on unsupported bases. 2016-10-04 12:48:15 +00:00
wiz
33e9a4f901 Fix xref. 2016-10-04 10:46:40 +00:00
kamil
7f4b5eb156 Add timespec_get(3) in <time.h> and enable unconditionally struct timespec
These changes conforms to the C11 standard
References:
 - 7.27.1/3 Components of time (struct timespec)
 - 7.27.2.5 The timespec_get function

According to ISO/IEC 9899:201x (draft) <time.h> defines the timespec
structure and declares the timespec_get(3) function with TIME_UTC
definition.

According to a C++17 standard draft <ctime> offers the same interface in
the std:: namespace.

The timespec_get function modifies the timespec object pointed by ts
to hold the current calendar time in the given base. The standard notes
only the TIME_UTC base with implementation defined value, set it to 1
as zero is reserved for error handling. Once operation was successful this
function returns passed base, otherwise exits with zero.

The timespec struct was already part of the POSIX standard in <time.h>.

Enable this interface unconditionally in the header to allow to use it
in a code prior C11 and C++17 as an extension.

Review notes from <christos>
2016-10-04 09:41:40 +00:00
christos
beaa4a9608 bump warns 2016-10-03 17:06:58 +00:00
dholland
8536f06c47 Be more careful about preserving errno. Might conceivably be related
to PR 51432.
2016-09-30 06:22:21 +00:00
dholland
48faaeec69 Be consistent about returning -1 on error. Don't return random errnos
instead.
2016-09-30 06:16:47 +00:00
wiz
d6414e373d Remove duplicate Pp. 2016-09-27 11:11:43 +00:00
mrg
62ee7dc27b introduce a better pci_drvname() and PCI_IOC_DRVNAME as pciio_drvnameonbus()
and PCI_IOC_DRVNAMEONBUS.  the new ones also take a (autoconf) PCI bus
number, which allows lookups for any device on any pci bus node.  use this
in pcictl which current reports the wrong values sometimes.

up next: use these in libpciaccess.
2016-09-24 23:12:54 +00:00
christos
aae80e6be7 remove mpool_getf 2016-09-24 21:31:25 +00:00
christos
f3f19d16f2 bump for the flags version of db routines 2016-09-24 20:12:07 +00:00
christos
86147b1c32 Merge the recursive tree traversal changes from the mit kerberos tree. This
Also make the tracefile customizable. Unfortunately we can't merge any of
the hash changes because they have a different on-disk format. That does not
matter really because we've fixed most of the problems...
2016-09-24 20:11:12 +00:00
christos
d42d73761d When writing out pages in the "other endian" format, make a copy instead of
trashing the in-memory one.
2016-09-24 20:08:29 +00:00
christos
a49c1d21d7 move the description of CLOCK_REALTIME in the list. 2016-09-24 01:05:51 +00:00
pgoyette
9a9ece3b27 Since the argument buf is earlier described as a buffer, replace all
references to "the array" with "the buffer" for consistency.

Bump date.
2016-09-22 23:18:10 +00:00
christos
122a9a6480 deal with namespace issues and missing atanhf for vax. 2016-09-21 14:11:40 +00:00
roy
72d40e7cf4 Bump libc version for ifaddrs. 2016-09-21 10:54:36 +00:00
roy
45b7bd08f6 Add ifa_addrflags to ifaddrs. 2016-09-21 10:53:24 +00:00