Commit Graph

10222 Commits

Author SHA1 Message Date
christos
69deaff196 CID 1338515: Make it clear that the pfd variable can't be NULL 2015-11-10 18:06:53 +00:00
christos
5d9565aab9 CID 1338513: Check listen(2) return 2015-11-10 18:01:16 +00:00
christos
2a964e6106 Add debugging for pollfd 2015-11-08 19:30:53 +00:00
christos
6821cf5fc4 Only do the compat cruft if we are compiling libc. 2015-11-08 02:46:53 +00:00
joerg
aae634b518 Soft-float support for rounding mode is currently not thread-safe, which
is not acceptable. Decision should be made on whether full fenv.h
support is desirable and then fix this appropiately.

Math functions (both libc and libm) should not touch errno, this creates
unnecessary problems for compilers.
2015-11-08 02:20:26 +00:00
christos
245e5bc63c initialize revents too. 2015-11-07 23:17:09 +00:00
christos
df8f5914dc PR/50408: Pedro Giffuni: Provide a way for rpc to use poll(2) instead of
select(2), and the linux svc_pollfd and svc_maxpollfd members. Our select(2)
implementation does not suffer from the FD_SETSIZE limitation so this is
not turned on by default.
2015-11-07 23:09:20 +00:00
christos
7c3ee3b303 spell reserved. 2015-11-07 20:24:00 +00:00
wiz
dec41c2e36 Use Dv for NULL. 2015-11-07 18:47:26 +00:00
wiz
c9e587d5a6 Sort SEE ALSO. 2015-11-07 18:46:37 +00:00
christos
f0421a30ec check for errors and recover instead of core-dumping. 2015-11-07 17:34:33 +00:00
christos
670a38d899 Put back NULL tests for allocation failures. 2015-11-07 16:58:24 +00:00
nros
b16a5c9dec Add the C11 function aligned_alloc to libc. 2015-11-07 16:21:42 +00:00
christos
addac9ec10 don't compile with SVC_LEGACY 2015-11-07 14:21:32 +00:00
christos
68e3906c09 simplify more. 2015-11-07 03:06:32 +00:00
christos
841c77b99c Introduce a binary compatible __fd_set_256 that is what the original fdset
size was for libc. Now we can bump it.
2015-11-07 00:42:04 +00:00
christos
01b6ad43e7 Cleanup and simplify.
undef svc_fdset and svc_maxfd to get to the real data for the compat code.
2015-11-06 23:11:09 +00:00
joerg
76218c7768 Don't use macros as types or variable names. 2015-11-06 23:05:09 +00:00
christos
2f904d5a7a - Provide multi-threaded fdset's for everyone not just rump if requested.
- Abstract fd_set access, and don't limit the fd_set size.
- Maintain binary compatibility by keeping the old global variables around.
2015-11-06 19:34:13 +00:00
christos
46615f7efe - Use -1 for the fake raw fd since we will be able to go beyond FD_SETSIZE.
- Poster boy for why it is bad to initialize in declarations :-)
2015-11-06 19:32:08 +00:00
pgoyette
82bcd0c81b Document the ms_flags field which is now exported in struct modstat 2015-11-04 04:31:53 +00:00
wiz
c1ef8df3ab Fix macro. Remove trailing whitespace. 2015-11-01 08:52:29 +00:00
christos
94aa2c7cfc mention what we are allowed to do. 2015-10-31 17:45:32 +00:00
ginsbach
3219a72f94 Don't attempt to set TM_ZONE (name) for 'J' as isdst isn't known. 2015-10-31 03:42:00 +00:00
christos
3c0ef4294c make %Z and %z understand the same strings. 2015-10-31 02:14:08 +00:00
ginsbach
b8b1230d48 - Add reference to RFC-3339
- Add J to military / nautical time zone description
2015-10-31 02:09:06 +00:00
ginsbach
fb679626c8 Add 'J' (Juliett) as military time zone name meaning the local time zone. 2015-10-30 21:36:25 +00:00
christos
eff9b12acf drop stray #endif 2015-10-30 18:20:16 +00:00
christos
5ba7c63c3a revert timezone() ifdef; it is wrong (pointed out by ginsbach) 2015-10-30 18:04:42 +00:00
ginsbach
862d86e79e ISO 8601 and RFC 3339 specify that an offset can be up to 23:59 and
not 12:00 east/west.  Just proves that one shouldn't use other
implementations as a canonical reference.  Thanks to all who pointed
this out.
2015-10-30 03:18:10 +00:00
christos
f4d28d09d8 Add tzgetgmtoff() prototype I forgot to commit. 2015-10-30 03:08:56 +00:00
ginsbach
a5eaa096be Reject timezone offsets more than 12 hours (east or west). 2015-10-30 01:49:36 +00:00
wiz
4bdb969ddc Whitespace. 2015-10-29 22:42:55 +00:00
christos
fb1c722214 another lint warning for compat. 2015-10-29 19:18:32 +00:00
christos
5eac10702e - use #defined constants (from gisbach)
- back to setting tm_zone to NULL when we don't know.
2015-10-29 19:18:19 +00:00
christos
d690aea660 new tzgetgmtoff 2015-10-29 17:55:09 +00:00
christos
4ba084a19e PR/50380: Balazs Scheidler: strptime() returns incorrect values in tm_gmtoff
- Always offset in seconds.
- Handle arbitrary timezones.
2015-10-29 17:54:49 +00:00
christos
37de2f9dd3 Add tzgetgmtoff(3) 2015-10-29 17:53:04 +00:00
christos
cefa99b2ad Document tzgetgmtoff(3) 2015-10-29 17:51:58 +00:00
christos
1aed602970 Add tzgetgmtoff, delint compat 2015-10-29 17:49:24 +00:00
christos
4dddbc1f8d put the state back after it is used. 2015-10-26 19:41:19 +00:00
christos
208f128939 PR/50367: Stefan Schaeckeler: Apply fix to obey RES_CHECKNAME to getnetbyaddr
and getnetbyname.
2015-10-26 19:28:53 +00:00
christos
a7b9f27a41 PR/50367: Stefan Schaeckeler: libc resolver library does not resolve host
names with underscores ("_"). According to resolv.conf(5) RES_NOCHECKNAME
is on by default; well, it is and gethostbyname(3) obeys it
(gethnamaddr.c:maybe_ok), but getaddrinfo(3) up till this commit not.
XXX: pullup-7, pullup-6
2015-10-26 14:48:04 +00:00
roy
4557363ec4 Use strerror(3) instead of strerror_r(3) and an arbitary buffer size which could be too small. 2015-10-26 11:44:30 +00:00
pooka
3a6246a644 Don't include daemon.c in RUMPRUN=yes mode.
The standard implementation uses fork(), needs an alternative
implementation for Rumprun.
2015-10-25 16:01:04 +00:00
christos
f9589d4feb Release 2015g - 2015-10-01 00:39:51 -0700
Changes affecting code

    localtime no longer mishandles America/Anchorage after 2037.
    (Thanks to Bradley White for reporting the bug.)

    The localtime module allows the variables 'timezone', 'daylight',
    and 'altzone' to be in common storage shared with other modules,
    and declares them in case the system <time.h> does not.
    (Problems reported by Kees Dekker.)

    On platforms with tm_zone, strftime.c now assumes it is not NULL.
    This simplifies the code and is consistent with zdump.c.
    (Problem reported by Christos Zoulas.)

  Changes affecting documentation

   The tzfile man page now documents that transition times denote the
   starts (not the ends) of the corresponding time periods.
   (Ambiguity reported by Bill Seymour.)
2015-10-09 17:21:45 +00:00
christos
a786eb43af PR/50295: Fix clock_nanosleep return value documentation. 2015-10-02 19:52:49 +00:00
christos
1ede8275d7 - fix various leaks on error
- don't use the wrong error variable in switch
- always set the error return code
- return consistent errors when the input data cannot be handled.
2015-09-22 16:16:02 +00:00
christos
525756d35c be more forgiving, and don't abort on unexpected errors. 2015-09-22 16:15:08 +00:00
christos
b350f7a434 Handle herrors properly so that postfix can return 4XX codes when appropriate.
Pointed out by Viktor Dukhovni.
2015-09-22 14:46:09 +00:00
christos
aa52694f67 use the unsigned char version of the input char in all cases "cap[uc]" to
avoid accessing cap[negative], found by Elliott Hughes
2015-09-12 19:08:47 +00:00
christos
ebe26a98ee namespace protect allocaddrinfo 2015-09-10 14:05:06 +00:00
christos
37cb794041 mke allocaddrinfo static. 2015-09-10 11:33:27 +00:00
ozaki-r
0cea365c35 Include several libc functions in rump.ping6
We need getaddrinfo, getifaddrs, if_indextoname and if_nametoindex
in addition to getnameinfo.
2015-09-09 10:06:05 +00:00
mrg
20f519c75f add a bunch of functions found in <stdio.h> that weren't listed here.
(this list may still be incomplete.)
2015-09-06 04:20:50 +00:00
pgoyette
04194d2b38 English grammar nit: there's only one function described in this man page 2015-09-06 03:10:50 +00:00
dholland
110c72e16b Improve the short description. 2015-09-06 01:37:35 +00:00
dholland
87aa30da64 SEE ALSO fmemopen(3) 2015-09-06 01:36:21 +00:00
dholland
eba062b188 Mention fmemopen(). 2015-09-06 01:35:34 +00:00
christos
33eb4d867d PR/50195: Henning Petersen: Incorrect check in getnameinfo_link. 2015-09-03 15:01:19 +00:00
jnemeth
14a099927b PR/49641 - Henning Petersen -- wordo 2015-09-03 04:05:38 +00:00
kamil
1c79b1c709 ANSIfy getopt(3) - this is the REPLACE_GETOPT version from getopt_long(3)
For the reference, this version still passes the current set of ATF tests
for the getopt(3) function.

This version is by default unused.
2015-09-01 19:39:57 +00:00
ozaki-r
3296ce621c Fix rump.ndp -I options by rump-ifying if_nametoindex(3)
From s-yamaguchi@IIJ
2015-09-01 09:54:34 +00:00
kamil
596fd5662e Constness correction for the getopt(3) function under REPLACE_GETOPT
Use the __UNCONST() macro, which is used in the other parts for the same
argument nargv, but under the !REPLACE_GETOPT namespace.
2015-09-01 01:28:17 +00:00
joerg
e78620fb9b Don't unconditionally pass MLIBDIR via CPPFLAGS. Drop now dead branch. 2015-08-28 11:45:02 +00:00
wiz
89df855eb5 Update for v1.10: use '(*)' instead of '#' as dagger replacement.
dholland finds the '#' unintuitive and hard to read.
2015-08-22 14:04:54 +00:00
kamil
3bff2c862b Minor alterations to reallocarr(3)
Add comment about division.
Mark error branches with __predict_false().
Reduce one branch with the OR trick.
2015-08-20 22:27:49 +00:00
joerg
b7742922d5 Fix portability. 2015-08-20 20:08:04 +00:00
pooka
71859f7093 In rumprun mode on ARM, don't build syscall or signal code into libc.
(like on x86)
2015-08-20 16:13:40 +00:00
wiz
b23bf62e84 Bump date for previous. 2015-08-20 11:05:06 +00:00
pgoyette
2c11157aee P1003_1B_SEMAPHORE is no longer optional 2015-08-20 10:42:09 +00:00
riz
f2164b60c8 Remove second 'const' declaration, to hopefully fix clang builds. 2015-08-18 16:54:27 +00:00
christos
d856f74aad merge 2015f 2015-08-13 11:21:18 +00:00
ginsbach
b6db50f38d Only apply am/pm adjustment to tm_hour when it has actually been parsed. 2015-07-29 20:32:54 +00:00
kamil
638c990b9a Compatibility fixes in reallocarr(3)
Make this work on !NetBSD platforms:
- replace __CTASSERT() with platform agnostic solution SQRT_SIZE_MAX
- include nbtool_config.h for cross builds to get definition of __RCSID()
- restore errno in the last rare code path for platforms affecting errno(2)
  in memcpy(2)

While there: rename parameter name 'num' to 'number' to be in sync with
the calloc(3) parameter naming.

Reported by scole_mail at the current-users ml.
2015-07-28 17:13:34 +00:00
wiz
d54956fea0 Spacing; Fn -> Xr for jemalloc. 2015-07-26 22:32:03 +00:00
martin
def993fa14 Defer using pthread keys until we are threaded.
From Christos, fixes PR port-arm/50087 by allowing malloc calls prior
to libpthread initialization.
2015-07-26 17:21:55 +00:00
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
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
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
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
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
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
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
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
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
898c51cf79 use isgraph_l suggested by joerg@ 2015-05-26 21:42:46 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
christos
e7c1b9e475 CID/1267868: Resource leak "cur" 2015-02-02 22:07:05 +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
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
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
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
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
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
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
christos
0f10d12f2f whitelist O_CLOEXEC flag, should fix lastlogin issue. 2014-12-22 17:01:42 +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
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
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
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
riastradh
eed04e6bf8 Ruminate on security model choices and API design in arc4random(3). 2014-11-17 07:11:00 +00:00
riastradh
ac8077340f Note relation of arc4random(3) to rand(3)/random(3). 2014-11-17 06:37:23 +00:00
wiz
746186406b Grammar. 2014-11-16 20:37:35 +00:00
riastradh
0e26ad0818 Rewrite arc4random(3) with ChaCha20-based PRNG and per-thread state.
Explain the security model in the man page.

No more RC4!

XXX pullup to netbsd-6, netbsd-5
2014-11-16 20:33:04 +00:00
christos
5988775b41 Don't try to extend the offset range on 32 bit machines by treating negative
offsets as positive. It is just confusing.
2014-11-16 20:32:52 +00:00
wiz
57a81568cf bump year 2014-11-14 22:46:34 +00:00
riastradh
995f5ce060 Commit to returning 1, not any nonzero value. 2014-11-14 16:43:57 +00:00
christos
b95700c1f3 localtime did not set tm->tm_zone properly making pkgsrc emacs core-dump.
Thanks to Masanori Kanaoka.
2014-11-11 18:46:54 +00:00
njoly
9425d53a52 Do not hardcode values for ENAMETOOLONG, use symblic constants. 2014-11-11 08:10:02 +00:00
christos
ff104b2e4b PR/48475: YAMAGUCHI Takanori: EDNS option broken with unbound. struct
querybuf in net/gethnamaddr.c defines MAXPACKET to 64K. This in turn
gets passed down until it reached res_nopt(..., answer, anslen), where
the size of the buffer must fit in 16 bits. Unfortunately we end up
being one more than the max so we end up sending a 0 as the size and
unbound does not like that. Instead we clip now to 64K - 1, and everyone
is happy.
XXX: Pullup to 7.
2014-11-11 03:29:24 +00:00
njoly
294822e1e1 Use more markups in AUTHORS section. 2014-11-02 11:28:03 +00:00
christos
a5a71196c8 PR/49317: Henning Petersen: Fix prototypes inman page. 2014-10-26 14:19:28 +00:00
christos
0a409b4552 remove stray endif 2014-10-23 21:19:53 +00:00
christos
67431d7357 merge 2014i 2014-10-23 18:45:58 +00:00
njoly
0df29bec99 Do not use hard-coded values with ENAMETOOLONG, use symbolic constants
instead.
2014-10-19 16:47:51 +00:00
justin
7cbb46f7c6 Add negative offset checks to fseeko
These were not strictly needed before, as lseek would error on negative
arguments, but having added open_memstream we have a virtual file pointer
that assumes that it gets sane values, so we get an assertion triggered
on a negative value. Best to check in one place rather than at all the
relevant points.
2014-10-19 11:17:43 +00:00
snj
f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
christos
5b3acd55fe - don't leak errno in mktime()
- when we load a new timezone, don't change anything unless the load succeeded.
2014-10-16 17:53:32 +00:00
christos
355ccc569e PR/49284: Andreas Gustafsson: sysinst segfaults when configuring network
manually. When tzload() fails called from zoneinit(), when trying to set the
local timezone for the first time in tzsetlcl(), we end up with a lclptr
that contains garbage, so settzname() core-dumps.

Thanks Andreas for the analysis!
2014-10-15 15:13:45 +00:00
christos
0230240a4a improve error checking (setting errno) 2014-10-14 20:35:40 +00:00
wiz
7ed90a21cf Fix whitespace in Xr. Remove sbuf(3) Xr, we do not have that. 2014-10-13 22:41:59 +00:00