Commit Graph

17966 Commits

Author SHA1 Message Date
kamil 13f3706081 Add history of allocators
Idea accepted by <christos>
No objctions from <riastradh>
2015-07-26 17:09:29 +00:00
christos c0c6a84ba3 From Timo Buhrmester: Fix wrong parameter description 2015-07-26 17:03:06 +00:00
kamil 4f643221a3 mandoc lint 2015-07-26 17:00:37 +00:00
kamil 382f8944d9 Bump shlib minor for new function: ereallocarr(3)
Noted by <mrg>
2015-07-26 15:15:31 +00:00
kamil dc83c1546e Add license header (the NetBSD 2-clause version) with (C) TNF 2015-07-26 02:29:44 +00:00
kamil ec6de4df8b reallocarray(3) cleanup
Add missing NetBSD CVS Id
Don't define twice _OPENBSD_SOURCE
2015-07-26 02:22:33 +00:00
kamil 2cf5f6af2b Add ereallocarr(3) to libutil
ereallocarr(3) wraps reallocarr(3) and embeds return status validation.

Older version reviewed by <riastradh> and <christos>
2015-07-26 02:20:30 +00:00
pooka 5ede295be8 Since the rump kernel does not know when the container it's running in
actually halts, print "halted" in the hypercall.
2015-07-24 14:11:11 +00:00
ginsbach 8b0d942b48 More KNF style changes -- consistent use of whitespace in #defines. 2015-07-22 13:33:59 +00:00
ginsbach 2cacd9205d KNF and additional comments 2015-07-20 14:37:11 +00:00
kamil f1354ae7ef Reorder memcpy(3) and save errno
This change is for safety as memcpy(3) might change it.

Approved by <riastradh>
2015-07-16 00:03:59 +00:00
christos 90b9d61d73 Allow changing the default buffering policy for a stdio stream during
construction by setting environment variables.
2015-07-15 19:08:43 +00:00
pooka 7db5875437 Don't include sigtramp or foocontext routines in rumprun mode. They won't
work (since a rump kernel does not provide NetBSD _lwp syscalls nor
signals), but they cause unwanted symbols to be pulled in when the
resulting libc is linked.

problem reported by Robert Gifford on rumpkernel-users
2015-07-15 14:27:49 +00:00
pooka db8ece9eea Remove "objects built from C sources" comments. Everyone can see
they're built from C sources because the source files end in .c (???)
2015-07-15 14:23:40 +00:00
ginsbach f7bfe448b0 Don't set state when parsing any timezone (%z) information. The '+' in
this case isn't the same as the FreeBSD '%+' str[fp]time() (GNU) extension.
2015-07-15 13:54:38 +00:00
ginsbach d2fb39874a Set S_WDAY state for %u (same as it is set for %w). 2015-07-14 18:07:17 +00:00
ginsbach ad43142fb9 Switch to using isleap() and isleap_sum() macros from <tzfile.h> to be
consistent with strftime.c and localtime.c.
2015-07-13 17:45:16 +00:00
christos 68ac8e89d0 remove local copy of tzfile.h 2015-07-11 16:41:08 +00:00
christos b999beb0fa - don't copy the man pages anymore. they have been converted to mdoc
format.
- don't delete extra files, but mention the 'import' process
2015-07-11 16:09:15 +00:00
wiz cd36512e99 Add missing Fc. 2015-07-11 15:51:33 +00:00
wiz 2aaae60f41 Add missing Fc which broke man page on the web. Remove superfluous Pp. 2015-07-11 15:50:56 +00:00
riastradh d06c586af2 Elaborate documentation of libc symbol rules.
- Say `provide' for what libc does to a symbol.
- Say `define' for what source code does to a symbol or macro.
- Quote code fragments rather than just talking about them.
- Qualify ELF symbols as such.
- List provided ELF symbols in tables rather than in prose.
2015-07-11 15:23:57 +00:00
riastradh 278ee21a56 Add section headings. Match order in table of contents. 2015-07-11 14:29:50 +00:00
kamil 3867e136be Clean-up resources (sys/sys/resource.h) usage
Add vmemoryuse to login_cap(3)
Document vmemoryuse in login.conf(5)
Document proc.pid.rlimit.vmemoryuse and proc.pid.rlimit.maxlwp in sysctl(7)
Document SBSIZE, AS, VMEM and NTHR in share/doc/psd/05.sysman/1.6.t

Reviewed by <riastradh>
Approved by <pgoyette>

Tested by Dominik Bialy

Closes PR xsrc/49912
2015-07-11 09:21:22 +00:00
nat 878ddfdf3d Return x for >= DBL_FRACBITS in lrint.c.
Return x for >= SNG_FRACBITS in lrintf.c

Addresses PR lib/49690

This commit was approved by christos@
2015-07-09 06:17:13 +00:00
ginsbach 700896bffd Add macros to clarify what (parse) state is needed to calculate 'missing'
tm fields.
2015-07-08 19:48:20 +00:00
ginsbach 6d93b92ef8 Rename flags to state since that is really what flags tracks (parse state). 2015-07-08 18:44:09 +00:00
martin 44f72a641f Simplify previous by just doing an open() on the directory and then using
the fstat* family to test for all relevant details.
Clean up buffer sizes and clarify a length check. Based on input from dholland.
2015-07-08 07:14:38 +00:00
matt 6fa466fc35 Possibly build libc_vfp if MACHINE_CPU is aarch64 too.
Use AFLAGS to pass -mfpu=vfp
2015-07-08 01:08:24 +00:00
matt cee94c5eb0 Add the fpset* routines for tests 2015-07-07 21:40:19 +00:00
matt 45908a5ffd Some test programs require these. 2015-07-05 22:07:09 +00:00
christos dacd5c569a PR/50009: David CARLIER: Enhance strptime to fill out more fields when it
can. From FreeBSD.
2015-07-03 13:06:54 +00:00
christos a42548a2aa document PIOD_READ_AUXV. 2015-07-02 03:50:21 +00:00
martin 17ea7bcab8 Allow /var/shm to be a symlink to a properly set up directory. 2015-06-30 11:46:47 +00:00
pooka a83d5ed5dd Rev 1.14 was nice except it didn't work with _INITIALIZER, which
sort of negates the whole point ... so revert everything while in
drawing board mode.
2015-06-26 11:25:22 +00:00
pooka 24bdf1ef99 Don't depend on __CPU_SIMPLE_LOCK_PAD to determine the type of
__cpu_simple_lock_t (because it doesn't).  Instead, use sizeof/alignof
with a struct { uchar[] }.

Fixes problem in previous commit, caught by Nick Hudson.
2015-06-26 10:05:17 +00:00
pooka 7cc7e65751 C++ (namely libc++) expects to be using PTHREAD_FOO_INITIALIZER as a
member initializer. This does not work for volatile types. Since C++
does not touch the guts of those types, redefine them as non-volatile.

Fixes libc++ compilation with g++ 5.1, as reported in PR lib/49989.
2015-06-26 01:33:08 +00:00
matt b63e1aaa52 Add DTRACE and CTF libraries 2015-06-23 16:33:21 +00:00
christos 25bda9e7c1 Fix hash iteration that deletes the current element under the cursor by
adjusting the position of the iterator appropriately.
XXX: pullup 7
2015-06-22 21:16:02 +00:00
christos 1be34afaf8 Delay moving to the next key until the next iteration. This avoids returning
invalid data to the user if the user deletes the current key, but it also
fails to iterate over some keys as will be shown by a unit test. From FreeBSD.
2015-06-22 18:50:06 +00:00
christos d72c59e26f don't define statics we don't need 2015-06-22 17:43:23 +00:00
matt 6e6800cb88 Add libraries created by MKZFS != "no" 2015-06-22 06:03:20 +00:00
matt 9477a260e4 Build external/gpl3/lib/libmudpath{,th} so that MKCOMPAT picks it up 2015-06-22 00:06:38 +00:00
christos fe1f008fec merge tzcode2015e:
Changes affecting code

    When displaying data, tzselect converts it to the current locale's
    encoding if the iconv command works.  (Problem reported by random832.)

    tzselect no longer mishandles Dominica, fixing a bug introduced
    in Release 2014f.  (Problem reported by Owen Leibman.)

    zic -l no longer fails when compiled with -DTZDEFAULT=\"/etc/localtime\".
    This fixes a bug introduced in Release 2014f.
    (Problem reported by Leonardo Chiquitto.)
2015-06-21 16:06:51 +00:00
dholland aeb39c6e9e PR 49988 Kamil Rytarowski: fix pasto 2015-06-20 04:18:00 +00:00
christos a73bc7adc9 Deal with limits properly.
Don't print strerror() 2ice.
XXX: pullup-7
2015-06-19 17:33:20 +00:00
christos 5521b51a7a fix error messages 2015-06-17 00:15:26 +00:00
christos 670c784563 Only create and install the tags file for the normal libc (not any of the
compat copies), because we don't want it to be overwritten by the compat
copies. This was detected by the evbarm mkimage complaining.
2015-06-15 14:24:01 +00:00
dholland e3df6c4c29 grammar patrol 2015-06-13 19:52:58 +00:00
dennis 1c1ffc929a Add entries for riscv and aarch64. This lets the former build
complete and gets the latter close to the end.
2015-06-13 17:28:42 +00:00
christos 8f54820655 back to the defines (fixing a typo -- extra 'g') 2015-06-08 15:04:20 +00:00
christos 981b1ee281 Another version using inline functions (just as a demo, I'll go back to
defines since they are shorter and inlines don't fix the problem).
2015-06-08 15:02:33 +00:00
joerg fb99f8156a mvgetnstr should have a length argument as the name implies. 2015-06-08 12:38:57 +00:00
matt 690eda7bb4 Avoid defining MLIBDIR. Use ${MLIBDIR:Unone} instead. 2015-06-08 04:08:30 +00:00
christos 1c03a0ccd5 Make the cpp protection macro name consistent with other headers.
Fix problems caused by the new macros introduced for gnu gettext compatibility.
XXX: Must be a better way...
2015-06-05 20:12:56 +00:00
manu 4c4ecb7844 Fix dot-lookup when readdir does not provide inodes
Some filesystems do not provide inode numbers through readdir (FUSE mounts
without -o use_ino). We therefore have to lookup each directory entry to
get the missing numbers.

dot and double-dot are exceptions, as we already know the values. Moreover,
the lookup code does not expect to get requests for dot and will abort
perfused(8) when it gets some. In order to fix that, we just check for
dot and double-dot special case and use the known values instead of sending
a lookup.
2015-06-03 14:07:05 +00:00
christos 14ccb7c1cc remove duplicate declaration 2015-06-02 15:36:45 +00:00
christos 0804279dff Adjust API to a more modern readline (Ryo Onodera) 2015-06-02 15:35:31 +00:00
christos 8c0cb8e7ec Thanks rump for not letting us use even mmap during initialization. 2015-05-30 14:42:26 +00:00
wiz dbea196857 Bump date for previous.
New sentence, new line.
2015-05-29 18:00:51 +00:00
christos cb27e6553e Fix previous: Can't use calloc/malloc before we complete initialization
of the thread library, because malloc uses pthread_foo_specific, and it will
end up initializing itself incorrectly.
2015-05-29 16:05:13 +00:00
christos a059aa6763 bump for p functions 2015-05-29 12:27:03 +00:00
christos 5297022a79 Patch from William Orr in tech-userlevel:
- Added most *p*gettext functions
- Added basic function to concat msgctxt and msgid
- Simplify free handling

Need to write tests.
2015-05-29 12:26:28 +00:00
manu 841339f07f Make PTHREAD_KEYS_MAX dynamically adjustable
NetBSD's PTHREAD_KEYS_MAX is set to 256, which is low compared to
other systems like Linux (1024) or MacOS X (512). As a result some
setups tested on Linux will exhibit problems on NetBSD because of
pthread_keys usage beyond the limit. This happens for instance on
Apache with various module loaded, and in this case no particular
developper can be blamed for going beyond the limit, since several
modules from different sources contribute to the problem.

This patch makes the limit conigurable through the PTHREAD_KEYS_MAX
environement variable. If undefined, the default remains unchanged
(256). In any case, the value cannot be lowered below POSIX-mandated
_POSIX_THREAD_KEYS_MAX (128).

While there:
- use EXIT_FAILURE instead of 1 when calling err(3) in libpthread.
- Reset _POSIX_THREAD_KEYS_MAX to POSIX mandated 128, instead of 256.
2015-05-29 07:37:31 +00:00
wiz 18ac899793 Fix quoting in macro.
Needed by dialog-1.2-20150513.
2015-05-28 06:28:37 +00:00
christos 898c51cf79 use isgraph_l suggested by joerg@ 2015-05-26 21:42:46 +00:00
christos 0b61093115 - fix types of rl_completion_entry_function and rl_add_defun
- call update pos before completion to refresh the screen
From Thomas Eriksson
2015-05-26 19:59:21 +00:00
christos 82b5c79b22 fix the tools build. 2015-05-23 14:21:11 +00:00
christos 7a9a29fb4a Grr need to deal with isgraph(3). Is there a better way? 2015-05-23 14:01:07 +00:00
christos 4245319fac use VIS_NOLOCALE 2015-05-23 11:48:13 +00:00
christos 24bc27d78e Add VIS_NOLOCALE to avoid ambiguous conversions. 2015-05-23 11:47:56 +00:00
mlelstv b4b5970a1f strvisx is used here to encode binary data, but the encoding
depends on locale settings and the result might not be accepted
or even misinterpreted by the strunvis decoder. As a workaround
encode manually as a string of octal numbers.

strvisx should learn how enforce such an encoding by itself.
2015-05-23 09:18:01 +00:00
christos 06f2d20635 use reallocarr (Ingo Schwarze) 2015-05-21 01:29:13 +00:00
matt 0828cd07d4 Rework ksym defines and includes. 2015-05-20 04:37:45 +00:00
matt d0c9fc59d2 Change the ksyms ioctls to more compat_netbsd32 friendly. Use _IOWR ioctls
to avoid extra copyouts.  With these changes, netstat and vmstat work on
mips64eb with the normal N32 userland and a N64 kernel.
2015-05-20 02:45:20 +00:00
christos 7310b6ff91 Fix the build for ancient (rhel5) systems that don't have O_CLOEXEC
XXX: pullup-7
2015-05-19 13:20:52 +00:00
matt 37a895a7a8 Support ELF64 on MIPS N32 even though it's ILP32.
XXX should we do this for other arches that support compat_netbsd32?
2015-05-19 06:09:15 +00:00
christos bdf16bca92 make el_gets() return the number of characters read in wide mode (not the
number of wide characters) From khorben@ by FreeBSD:
https://svnweb.freebsd.org/ports/head/devel/libedit/files/patch-src_eln.c?\
revision=382458&view=markup
XXX: Pullup-7
2015-05-18 15:07:04 +00:00
christos 5113710e5b add FreeBSD 2015-05-17 13:14:41 +00:00
joerg 5d88ea0bae Don't create a weak alias in the !RUMPACTION case. 2015-05-15 14:26:02 +00:00
ozaki-r 6011d36bd6 Fix rump.{netstat,route} shows host's interface names in link local addresses
Interface names of IPv6 link local addresses are resolved
by getnameinfo(3). So we need to rump-ify it as well as
if_indextoname and getifaddrs.
2015-05-15 06:58:59 +00:00
joerg 7d697e8913 copysignl is also needed for PowerPC's double-double format, so special
case that. Functional support was added earlier, but not enabled.
2015-05-14 19:26:12 +00:00
christos d2ed0c780a fix warnings on ubuntu 32 bit (Miki Rozloznik) 2015-05-14 10:44:15 +00:00
justin bcb8c68de1 Missing MAP_PRIVATE on mmap 2015-05-13 23:15:57 +00:00
joerg 5d6007be0f void * is bad for computation, so cast to const char * first. 2015-05-13 19:57:16 +00:00
christos 440c00cdaa libasan depends on libstdc++ so move it under the wait barrier. 2015-05-12 19:43:50 +00:00
dholland 116f085a39 Update HISTORY from OpenBSD: strerror from 4.3 Reno, perror from v4.
(this page was claiming both were from 4.4, which is clearly rubbish)
2015-05-09 19:01:53 +00:00
christos fd05aad26e add overlapping pointer checks 2015-05-09 15:42:21 +00:00
pgoyette 9fc9038db1 Provide additional info on why ENOEXEC gets returned. 2015-05-09 08:10:01 +00:00
wiz 593de75e05 Sort SEE ALSO. 2015-05-03 12:29:28 +00:00
wiz a4569887ef Sort ERRORS and SEE ALSO. 2015-05-03 12:27:32 +00:00
matt 44371503dd Make sure .init and .fini are word (4byte) aligned. 2015-05-01 21:35:56 +00:00
christos 35d355f3ea - new test for strtoi
- namespace protection for strto{i,u}
- separate manpages for strto{i,u} from the ones for strto{u,}l
From: Kamil Rytarowski
2015-05-01 14:17:56 +00:00
christos 0c69da7c8a welcome to tzcode 2015d (zic performance improvements and cleanups) 2015-04-28 17:00:24 +00:00
wiz 858361fa34 Remove trailing whitespace. 2015-04-22 13:59:54 +00:00
christos 9cf433da08 Mention EWOULDBLOCK too since a lot of the source code and documentation still
refers to it.
2015-04-21 21:22:07 +00:00
riastradh 46e71c7d57 Make VOP_LINK return directory still locked and referenced.
Ride 7.99.10 bump.
2015-04-20 22:59:19 +00:00
riastradh c89a5913e6 Release dir after create/mknod/mkdir/symlink as 6.99.29 required. 2015-04-20 21:48:47 +00:00
joerg 66e8846b8d Redo __aeabi_atexit by shuffling the arguments and dropping the code in
libstdc++.
2015-04-19 18:15:26 +00:00
joerg e88efb111c Add __aeabi_atexit alias for another case of NIH on ARM. 2015-04-18 21:44:31 +00:00
mrg 422d8988cb xz/lib depends upon pthread so move it to the 1st dependancy point.
libarchive/lib depends upon xz, so move to the 2nd.
2015-04-17 22:17:23 +00:00
martin 4c8eef7861 Dummy support for ia64 2015-04-17 13:16:01 +00:00
martin f89f6560d4 Dummy ia64 support 2015-04-17 13:14:19 +00:00
martin 2a5b63aa81 Add set/longjmp and friends (nearly verbatim from FreeBSD).
Add a dummy _lwp_makecontext() function (enough to make autoconfigury
happy and gcc mknative work)
2015-04-17 12:51:05 +00:00
mrg 2603e0673f remove various HAVE_GCC=45 fragments. 2015-04-15 19:13:46 +00:00
riastradh ee14e9e637 Define the expansion of the VFORK macro, not the symbol `VFORK'.
Fixes hijacking processes that vfork and exec.  Symptom was the child
would spin with read/EAGAIN <-> kevent/EBADF because the inheritance
mechanism relied on setting the holyfd to -1 on fork...which didn't
happen if we didn't hijack vfork.

ok pooka@
2015-04-11 12:54:41 +00:00
martin d8bc6bf52a Restrict the arm compiler optimization hack to gcc 4.5 2015-04-08 13:16:37 +00:00
ginsbach 08257a48e9 Add UTC as a synonym for GMT (%Z). [from FreeBSD] 2015-04-06 14:38:22 +00:00
uwe c9951c23e1 On swapcontext(3) preserve r12 too. Properly fixes PR port-sh3/49597. 2015-04-06 01:50:46 +00:00
wiz 1ce6069203 Sort errors. Bump date for previous. 2015-04-05 20:41:05 +00:00
rtr 2ed41a38ec Note that bind(2) can fail with EAFNOSUPPORT. The description of why is
taken from the connect(2) manpage.
2015-04-05 20:33:45 +00:00
pgoyette 03022ba794 Remove dangling cross-ref to localtime(3). There's another cross-ref in
the next sentence that actually makes sense.
2015-04-05 08:36:38 +00:00
christos f804baf730 Adapt to the new API. 2015-04-04 02:51:10 +00:00
ginsbach 236fefb93e Fix spelling; time zone is two words not one. 2015-04-03 15:52:50 +00:00
riastradh 3a68faac74 Strengthen prohibition against overlapping in strcpy(3). 2015-04-01 20:18:17 +00:00
christos 3fb66fec62 grammar. 2015-04-01 15:45:00 +00:00
christos 2a7851d30c Fix overlapping strcpy (Gerry Swislow) 2015-04-01 15:23:15 +00:00
christos a08f75f398 clarify what happens when strings overlap. 2015-04-01 15:20:58 +00:00
matt d67e7afb11 Use lla instead doing the pcrel relocs ourselves. 2015-03-31 11:59:41 +00:00
plunky da04c17630 fix typo: sdp_seq_seq->sdp_set_seq 2015-03-31 09:26:45 +00:00
matt b12144c585 We have _REG_SP so use it. 2015-03-31 01:36:27 +00:00
matt e740ee3013 Update to new RISCV ABI 2015-03-27 23:35:40 +00:00
matt 35c3446182 Adapt to new assembler. jump->tail[call] auipc/lo12 changes. 2015-03-27 23:23:14 +00:00
matt 4ec25a89b6 Adapt to the jmpbuf changes. 2015-03-27 23:22:20 +00:00
matt 8a3081d220 Switch to new ABI (return values now in a0/a1; v0/v1 are no more) 2015-03-27 06:44:28 +00:00
justin f617fade4f Fix prototypes to match definitions 2015-03-26 11:59:38 +00:00
justin 7b67337b9d Fix definitions to match headers 2015-03-26 11:31:57 +00:00
justin 59fd6f1da5 Return type of compat wait functions should be pid_t not int. 2015-03-26 11:17:08 +00:00
christos b52bce6ba8 set some readline compatibility default key settings.
https://bugzilla.redhat.com/attachment.cgi?id=1001895
2015-03-24 21:29:52 +00:00
christos 9a8795cdcd save and restore IGNORE_EXTCHARS like we do in the getc case. From:
https://bugzilla.redhat.com/attachment.cgi?id=1001894
2015-03-24 21:26:50 +00:00
christos aa771cb970 merge 2015b 2015-03-24 20:01:18 +00:00
apb 978d974482 Explain why there is no consttime_memcmp().
Inspired by a patch from Kamil Rytarowski.
2015-03-23 07:41:16 +00:00
riastradh f97ad6c03c Tweak wording. 2015-03-20 14:10:40 +00:00
riastradh 934b3616ba Elaborate on how our ad-hack symbol versioning works. Tweak style. 2015-03-20 13:26:51 +00:00
riastradh 26ef86fddb First draft of documentation for the libc symbol madness.
Currently describes only what we do, not why we do it.
2015-03-20 12:57:48 +00:00
joerg b9e2400677 Call libc's fpgetround. 2015-03-19 21:22:59 +00:00
riastradh cc8a3a240d Remove #ifdef MAP_INHERIT_ZERO.
This is essential for fork-safety, so don't merely #warn about it.
Attaining fork-safety without it requires restructuring things -- in
particular, there's no clear way to make it per-thread and fork-safe
without some global list of states to zero on fork.
2015-03-19 05:46:25 +00:00
wiz 0e3145a0d2 Use existing month for Dd. 2015-03-11 09:57:35 +00:00
christos f7b1663b18 Behave in an OpenBSD compatible way for 0. 2015-03-10 13:05:13 +00:00
christos 49345864e2 PR/49640: Kamil Rytarowski: Improve error printing 2015-03-10 13:00:58 +00:00
christos f41fc32af9 The OpenBSD strtonum() only accepts base 10 keywords. (Kamil Rytarowski) 2015-03-10 12:57:56 +00:00
pooka 367e4a103c Wrap utimensat() only if present on host
fixes buildrump.sh on NetBSD 6.1.5
2015-03-05 00:26:17 +00:00
pooka f24bc1c7bb check for utimensat 2015-03-05 00:25:39 +00:00
pooka 8ce52db1d0 Make ATCALL() behave for absolute paths too. 2015-03-04 23:42:26 +00:00
pooka 8651603956 Define a generic ATCALL() and use it to implement utimensat() 2015-03-04 23:31:49 +00:00
enami 02c2c060ff Also hijack futimens(2) so that t_sh test passes. 2015-03-03 01:24:39 +00:00
enami a4c990f5c2 Hijack utimensat(2) so that t_vfs test passes after cp(1)/mv(1) are
changed to use the system call.  Linux also has this system call, but
not tested this on linux.
2015-03-03 00:19:07 +00:00
christos 6998697823 say that we put the exit code in data. 2015-03-02 19:24:19 +00:00
christos f5804ec983 Document SIGBUS per ToG. 2015-02-27 16:18:00 +00:00
wiz c0c6cce56c Remove sentence about casting to int (also from example).
Bump date.

ok joerg@
2015-02-25 16:23:40 +00:00
christos 4d416d886b belated removal of the advertising clause. 2015-02-24 17:56:20 +00:00
christos 21ea10bd7a split the allocation functions, their mixed usage was too confusing. 2015-02-22 02:16:19 +00:00
christos aecf67a262 PR/49683: Amir Plivatsky: Off-by-one comparison in ct_decode_string() leading
to out of bounds referrence.
XXX: pullup-7
2015-02-22 00:46:58 +00:00
wiz f95cba75d4 Add EXAMPLES section, from Youri Mouton.
Bump date.
2015-02-19 23:08:21 +00:00
wiz a1da3f78ee Fix Xref. Split line, Ox doesn't take word arguments. 2015-02-18 08:46:43 +00:00
christos 71cf54e71e OpenBSD is like us. 2015-02-17 22:49:26 +00:00
christos 84a0efdf85 use reallocarr() 2015-02-17 20:44:42 +00:00
joerg 9b5f3d5723 Move reallocarray under _OPENBSD_SOURCE where it belongs. 2015-02-17 20:33:40 +00:00
joerg f6072d060e Use reallocarr and simplify. Document valid reallocation failures. 2015-02-17 20:30:44 +00:00
joerg c9baa5968d Introduce reallocarr(3) for easy (re)allocation of memory with overflow
checks. Compared to OpenBSD's reallocarray, makes it easier to avoid memory
leaks on allocation failures and it doesn't depend on malloc(0) != NULL
for correct error checking. Compared to plain realloc, it also avoids
the problem of intermediate integer overflows. The trade-off is the use
of void * to side step C type system with regard to generic pointer to
pointer.
2015-02-17 20:29:20 +00:00
wiz bcb2129dc2 filesystem -> file system 2015-02-16 10:48:56 +00:00
wiz 8ca9874e72 Sort sections. 2015-02-16 10:48:50 +00:00
wiz 0c9e1ca798 Bump date for previous.
filesystem -> file system
2015-02-16 10:48:34 +00:00
manu 8abab6b782 Add PUFFS_KFLAG_NOFLUSH_META to prevent sending metadata flush to FUSE
FUSE filesystems do not expect to get metadata updates for [amc]time
and size, they updates the value on their own after operations.

The PUFFS PUFFS_KFLAG_NOFLUSH_META option prevents regular metadata cache
flushes to the filesystem , and libperfuse uses it to match Linux FUSE
behavior.

While there, fix a bug in SETATTR: do not update kernel metadata cache
from SETATTR reply when the request is asynchronous, as we do not have
the reply yet.
2015-02-15 20:21:29 +00:00
justin a0e1fabf06 Minor fixes to types and includes 2015-02-15 00:54:32 +00:00
justin 36ca2dc69a Whitespace fixes, no functional change 2015-02-13 22:00:53 +00:00
justin eb70afec87 Fix some return value checks 2015-02-13 21:31:18 +00:00
riastradh b4ed92be5b Use Pq to avoid space before O_EXCL. 2015-02-11 15:19:05 +00:00
pooka 7578f98047 Include compat in rumprun libc
Not including non-renamed symbols in libc caused all kinds of configure
scripts to do the wrong thing when they just tested linkage without
including headers.  So, go for the "least moving parts" bandaid for now.
2015-02-09 22:44:34 +00:00
wiz 4b0035a070 Fix typo. Reported by rudolf on netbsd-docs. 2015-02-08 19:09:56 +00:00
wiz b482bd6fc9 It is 2015 already. 2015-02-08 14:10:28 +00:00
njoly 45cb14b62a The length argument is of an unsigned type (size_t) and cannot be
negative. Remove wrong statements in ERRORS section.
2015-02-08 11:27:43 +00:00
ginsbach ce098d3b4e PR/49642: change processor to host
Use the wording used by FreeBSD, IRIX, and MacOSX (as a sample) rather
suggested wording in PR from Henning Petersen.
2015-02-06 17:35:46 +00:00
wiz 1dc99cebf1 Remove trailing whitespace. 2015-02-06 08:37:39 +00:00
christos 0a0e590de3 Remove incorrect comment about size; mention that the malloc ambiguity is
part of the C standard.
2015-02-05 22:05:33 +00:00
christos 7347edd333 Revert addition to reallocarray to the malloc man page, but keep
the examples.  Add separate manual page to reallocarray explaining
what are the problems with it.
2015-02-05 20:02:28 +00:00
christos 20f708949a add a couple of casts. 2015-02-05 16:05:20 +00:00
christos a582ce5979 Add and use reallocarray() to prevent a multiplication overflow in allocation.
Reported by Guido Vranken, thanks!
2015-02-05 16:04:35 +00:00
christos 269fe79da6 cast to return type 2015-02-05 16:01:38 +00:00
christos 70c8a4b907 fix incorrect type 2015-02-05 16:00:39 +00:00
pooka 7ee5757301 If binding fails, print URL with which it failed. 2015-02-04 12:55:47 +00:00
christos e7c1b9e475 CID/1267868: Resource leak "cur" 2015-02-02 22:07:05 +00:00
lneto 730082507e lua: updated from 5.3 work3 to 5.3.0
* improved the overall kernel Lua patch; fixed coercion
* updated lua/syslog
* updated luapmf and luasystm Makefiles
2015-02-02 14:03:05 +00:00
rmind 3e73e7e64b libnpf: add npf_rule_getid() and npf_rule_getcode().
Missed in the previous commit.
2015-02-02 00:55:28 +00:00
christos 0bf39b3f13 PR/49617: Kirk Russell: Describe the posix_fallocate return values correctly. 2015-02-01 15:24:15 +00:00
christos 5415342756 PR/49617: Kirk Russell: posix_fallocate() should be returning an error on
failure, without setting errno, so make it PSEUDO_NOERROR, by adding a new
category GLUENOERR.
2015-01-31 23:10:56 +00:00
christos c51676e4e1 merge tzcode2015a:
tzalloc now scrubs time zone abbreviations compatibly with the way
that tzset always has, by replacing invalid bytes with '_' and by
shortening too-long abbreviations.
2015-01-31 18:55:17 +00:00
joerg 68179c3df2 Remove va_arg hack for Clang/PPC. 2015-01-29 20:44:38 +00:00
joerg d5e00695c3 Disable -Wcast-qual for clang for now. 2015-01-29 20:30:02 +00:00
manu 95be0d98d3 Fix double free in fts_read()/fts_close()
When fts_read() gets an error on fchdir(), it exited with sp->fts_cur
set to a freed structure. fts_close() would later attempt to free it
again, crashing the program.
2015-01-29 15:55:21 +00:00
wiz 99c1481cc2 Remove superfluous comma. 2015-01-27 10:11:20 +00:00
christos bdb45807c6 hook into blacklist 2015-01-25 15:47:19 +00:00
uwe 1a997bcd9f Adjust _UC_MACHINE_SP(oucp) to "drop" values we pushed to the stack.
t_swapcontext tests pass now with gcc 4.8.

From Yasushi Oshima in PR port-sh3/49597
2015-01-25 01:32:26 +00:00
christos 95130e3a90 s/basename/bname/ 2015-01-22 19:04:28 +00:00
christos 0afe4227b1 - not all asprintfs return -1 *and* set buf = NULL, check explicitly.
- don't shadow basename(3)
2015-01-22 16:19:08 +00:00
wiz c56adf4dde Whitespace fixes. Remove duplicate Pp. 2015-01-21 08:35:31 +00:00
riastradh d868888350 Use ChaCha20 here as advertised, not ChaCha8.
Oops.

Fortunately, there is no public cryptanalysis even of ChaCha8: the
best published attack is on ChaCha7 with time complexity 2^248.
2015-01-21 02:47:39 +00:00
christos 26ba80487b Fix non _REENTRANT build. 2015-01-20 18:31:24 +00:00
christos 9226f39def Factor out popen() code into separate functions and create popenve()
using the new functions, a safer version of popen() that does not
involve a shell. Correct manual page inaccuracies.
2015-01-20 17:28:00 +00:00
wiz 194f011f43 Fix date. Sort section. Sort errors. Sort SEE ALSO. Break too long
lines.
2015-01-19 11:47:41 +00:00
christos 57b77f77cd add estro{i,u} (Kamil Rytarowski) 2015-01-18 18:09:36 +00:00
christos 3d8157c11a cleanups from (Kamil Rytarowski) 2015-01-18 18:01:41 +00:00
christos 566fb07644 man page for strtonum.3 2015-01-18 17:59:36 +00:00
justin 1eb711493e Remove no longer required definitions 2015-01-17 23:49:40 +00:00
justin 7b800c0c00 Modern Android SDK does not need special cases 2015-01-17 19:34:50 +00:00
wiz 8a99473073 Remove trailing whitespace. 2015-01-16 23:46:37 +00:00
christos 435e4e69b0 bump libc for strtoi and strtou 2015-01-16 18:45:01 +00:00
christos 40195068d4 Add strtonum implemented as a wrapper of strtoi. 2015-01-16 18:41:33 +00:00
christos fbb651a269 strtoi and strtou additions 2015-01-16 18:37:21 +00:00
manu 575ae72270 Fix atime update
FUSE filesystems assume that SETATTR with atime is the result of utiimes()
being called. As a result, atime and mtime will be updated.  This happens
with MooseFS and glusterFS. atime is supposed to be updated by the
filesystem itself when it gets read operations.

We fix the problem in SETATTR operations by
1) do not create a mtime update when we have an atime update (and vice
   versa), just fill the fields to avoid the filesystem restting the
   missing field to Epoch, but do not pretend we want to update it.
2) If the change is limited to atime, iscard it, as updates should be
   done by READ operations
3) Kernel part of PUFFS has been fixed to make sure reads on empty file
   are sent to the filesystem:
   http://mail-index.netbsd.org/source-changes/2015/01/13/msg062364.html

Thanks to Tom Ivar Helbekkmo for reporting this issue.
2015-01-13 16:51:30 +00:00
martin f91d4e28bb Simplify, now that rounding mode defines match the hardware bits. 2015-01-13 11:16:06 +00:00
dennis 75a496875b Replace the branch to __cerror() in powerpc64 syscall stubs
with inline code which does what __cerror() was doing.  #ifdef
that code (i.e. all code) out of cerror.S; __cerror() is no more.
This seems to be necessary to fix the link of rescue/rescue, and
should have the pleasant side effect of making all other workarounds
done to keep the 'b __cerror' working unnecessary.
2015-01-12 02:48:20 +00:00
riastradh fe3ead6a42 Introduce membar_datadep_consumer.
Discussed briefly on tech-kern without objection:

https://mail-index.netbsd.org/tech-kern/2014/11/20/msg018054.html
https://mail-index.netbsd.org/tech-kern/2015/01/07/msg018326.html
2015-01-08 22:27:17 +00:00
wiz 17c647e734 Add more markup. 2015-01-04 21:38:58 +00:00
christos 848cec6390 Correct API for the gethostby{name,addr} 2015-01-04 16:06:29 +00:00
pooka bc3e3c852d check that sys/cdefs.h builds with -Werror (not the case on alpine linux
where it contains an unconditional #warning)
2015-01-03 13:16:41 +00:00
justin e42c569056 Just abort on currently unsupported functions. 2014-12-29 21:50:09 +00:00
martin f5c779f5d9 Fix exception status vs mask confusion, of course feenableexcept(),
fedisableexcept() and fegetexcept() all operate on the mask.
2014-12-29 19:11:13 +00:00
martin 06e406a946 Add missing return in __SOFTFP__ variant, pointed out by htodd. 2014-12-28 10:15:29 +00:00
martin b137db7576 Add our common non standard extensions and fix typo (FE_EXCEPT_ALL ->
FE_ALL_EXCEPT).
2014-12-27 17:54:24 +00:00
martin b19178f8f4 Fix consistent typo: it is FE_ALL_EXCEPT instead of FE_EXCEPT_ALL (this
went unnoticed as the undefined macro evaluated to 0 and the expression
was always used with ~)
2014-12-27 17:52:45 +00:00
martin dce8d6f504 fenv(3) support for hppa 2014-12-27 16:54:02 +00:00
wiz 724c4ed029 Bump date for previous. 2014-12-25 13:39:41 +00:00
wiz eb157f70b1 From Ingo Schwarze, based on changes from Kaspars Bankovskis:
* Document error handling of el_init(), el_set(), el_source(),
   and history_init().
 * Fix a typo an improve punctuation below H_SETUNIQUE.
 * The ellipsis already implies "optional", no need for [].
 * Sort options in editrc(5).
 * Prevent e.g. rom being misconstrued as the end of a sentence.
 * Drop a useless duplicate .Ar macro.
 * Put telltc in its proper place in the alphabetical order.
 * A few typos in vi editor command names.
 * Some missing vi editor command names.
 * Some missing author macros.
2014-12-25 13:39:05 +00:00
christos 0f10d12f2f whitelist O_CLOEXEC flag, should fix lastlogin issue. 2014-12-22 17:01:42 +00:00
manu 8ee430e576 Do not warn about relative path because of trailing slash
libpuffs calls realpath() to obtain an absolute path to use for mounting.
If the obtained path is different from the one given by the caller, a
warning is issued. This included the situation where the path passed by
the caller just have trailing slashes, a situation where we just want them
to be striped without a warning.
2014-12-22 08:16:21 +00:00
pooka aa91aeb3c8 include correct header for "last minute just-in-case defensive addition
that's too trivial to check"
2014-12-17 01:49:08 +00:00
pooka 082d249a16 Allow for arbitrary MI scheduler implementations.
A concrete result is enabling unpatched libpthread to run on the
rumprun stacks (e.g. Xen and bare metal) with a non-NetBSD scheduler.
Those schedulers hook into the existing _lwp_frobnitz() NetBSD syscall
interfaces (well, "syscall" interfaces in that scenario ;)

More specifically about the change itself:

1) instead of calling _lwp_makecontext() followed by _lwp_create()
   and passing the entry point in ucontext_t (MD) through the calls, roll
   the calls into pthread__makelwp() and allow alternate implementations
   for that MI interface.

2) allow compile-time overriding of __lwp_gettcb_fast() or
   __lwp_getprivate_fast, which are inline and leak MD scheduler/thread
   details into libpthread


Additionally, two small nits:

I)  define LIB=pthread before including mk.conf so that it's possible
    to test for LIB==pthread in mk.conf

II) make it possible to leave out pthread_cancelstub.c.  This is required
    by the current implementation of rumprun-posix (i.e. rumprun on
    POSIX hosts) due to symbol collisions.  It needs to be fixed properly
    some day, but for now allows an almost-correct libpthread to run.
    I am sure @justin will be happy to explain the details ;)


no change to NetBSD
tested: anita+atf
2014-12-16 20:05:54 +00:00
pooka 68efe5aa2a With glibc on ARM kthread_exit() aborts because pthread_exit() fails
to unwind the stack.  Add a temporary workaround where we simply don't
allow the thread to exit (a kernel thread exit is a relatively uncommon
event in a rump kernel anyway).
2014-12-16 17:00:17 +00:00
msaitoh 5a1f437d33 Add "int showclass" argument to pci_devinfo(). The API was changed 10 years
ago.
2014-12-16 13:38:36 +00:00
chs a60c43758e fix powerpc TLS problems by removing the hacks for PPC EABI.
the kernel no longer treats R2 specially and its use as
the TLS register is now handled entirely in userland.
2014-12-14 23:49:17 +00:00
justin 61b4fed96a Always use kqueue for BSDs in librumpclient
Tested now on the others
2014-12-13 17:18:55 +00:00
riastradh 212c8238ec Fix rcsid comment. 2014-12-11 21:54:13 +00:00
pooka dc3c2e9560 Add two more Makefile conditionals required for RUMPRUN=yes
* do not build _errno.c (different thread/tls handling)
 * do not build either phk- or jemalloc (different backing page allocation)

Somehow I missed these in the previous commit, but now libc built with
RUMPRUN=yes works also with rumprun-posix, so there's reasonably high
confidence that I didn't miss anything anymore.
2014-12-10 16:55:54 +00:00
pooka a17684a24c Add hooks for RUMPRUN build of libc
If "yes", does the following (default "no"):
  * prevents ASM syscalls from being built (librump provides syscalls)
  * does not include compat (useless when application is linked with libc)
  * does not build tags (no /var/db to install them to)
  * does not include tls

==> libc for rumprun can now be built against unmodified NetBSD sources
2014-12-10 00:37:30 +00:00
justin 7e80a07c88 Use kqueue in librumpclient for FreeBSD too 2014-12-08 01:10:07 +00:00
justin af1fbf0457 Avoid uninitialised variable warning when gcc is feeling lazy 2014-12-08 00:12:03 +00:00
enami 11fe7239df Changes done in rsh.c rev. 1.36 was incomplete. As chuq pointed
in private mail, it broke rcp(1).

To achieve the documented behavior and to fix long standing incorrect
rsh(1) behavior which I've tried to fix in rev. 1.36, rcmd(1) should have
two operation mode; whether it should relay signal information on
auxiliary channel or not, depending on the argument `fd2p' passed to rcmd(3).
So, make rcmd(1) behave differntly depending on the environment variable and
set it when necessary in rcmd(3) according to how auxiliary channel
is set up by rcmd(3).
2014-11-26 23:44:21 +00:00
christos fa438ee608 - Use O_DIRECTORY to open the file, so that we don't need to stat() after
that.
- Move the stat() call to fdopendir() and change it's error handling so that
  it does not hide errors.
- According to POSIX, fdopendir() transfers ownership of the fd only on
  success, so don't close it on failure. XXX: We still make it non-blocking
  on failure, but that's nitpicking.

XXX: pullup-7?
2014-11-26 16:48:43 +00:00
christos 94783bbf05 knf, no functional change. 2014-11-24 15:43:21 +00:00
christos 8a88bf6a6c Don't read past the end when the data is exactly the right size. Reported
by tedu @ openbsd in tech-userlevel. Thanks!
2014-11-24 15:41:18 +00:00
christos 625ac095d3 Fix ptrace %rcx corruption when pthread_errno() is used. Small example:
#include <sys/types.h>
    #include <stdio.h>
    #include <sys/ptrace.h>
    int main(void) { ptrace(18, getpid(), NULL, 0xabcd); }
The -lpthread cases pases 0 instead of 0xabcd
2014-11-24 15:33:18 +00:00
christos 6ced7fd882 welcome to 2014j 2014-11-18 01:58:59 +00:00
riastradh b1fb140d0e Tweak wording, define `output', remove misplaced scaremongering. 2014-11-17 18:41:29 +00:00
christos 5f285f6d25 PR/49399: Henning Petersen: Add man pages for erfl and erfcl 2014-11-17 16:53:23 +00:00
riastradh d8a3efd656 Fix Google Groups link. 2014-11-17 15:28:22 +00:00
wiz 7a50617bac Remove unnecessary Ns before punctuation. Fix a line. 2014-11-17 15:17:41 +00:00
riastradh e8e4197773 Cross-reference rnd(4). 2014-11-17 15:08:37 +00:00
riastradh 28464c9ad0 Markup for BUGS note about arc4random_uniform. 2014-11-17 15:06:59 +00:00
riastradh e8af01c56b Amplify comment about how quickly RC4 was known to be bad. 2014-11-17 15:05:12 +00:00