Commit Graph

7863 Commits

Author SHA1 Message Date
mrg
798e718222 fix a very old resolver bug:
when looping over the current list of sockets we're connected to,
use getpeername() not getsockname() to find out who the remote
end is.  avoid spurious close()s and (rare) failure.

apparently known as ISC bug #18625, and fixed in libbind 6.0
2009-01-27 05:13:23 +00:00
drochner
92b9f070f2 remove stale getdevmajor() declarations, fixes lint(1) warning
reported by Bernd Ernesti
2009-01-26 15:05:56 +00:00
njoly
122f627e90 Make msgsnd(2)/msgrcv(2) fail with EINVAL for messages larger than
SSIZE_MAX. Adjust man pages accordingly.

ok by christos.
2009-01-26 13:08:48 +00:00
skrll
14c5fc5d63 Sprinkle the "memory" clobber register so the fpsr manipulation actually
happens.

Fixes the ieeefp/except regresion test.
2009-01-25 16:44:41 +00:00
tls
8d33a6da32 Cause getaddrinfo() without socktype specification to work correctly for
numeric addresses.  The documentation appears to say this works, and some
other systems support it -- more importantly, why should it _not_ work?  If
it does not, getaddrinfo() cannot be used as a general-purpose textual to
binary address conversion utility function; yet it is the only such function
we have in the system, since inet_pton() requires a priori knowledge of the
address family.

This change also causes getaddrinfo() with NULL hint (expressly documented
as working) to work properly for numeric addresses.
2009-01-23 00:48:57 +00:00
drochner
ad965be01b cleanup after devmajor_t:
-since getdevmajor(3) is now binary compatible again with <=5.0
 there is no need to rename, I've just left a __getdevmajor50 symbol
 temporarily for those who track -current
-update manpage
2009-01-20 20:08:12 +00:00
drochner
d767912be3 Change major()/minor() to return 32-bit types again, called
devmajor_t/devminor_t, as proposed on tech-kern.
This avoids 64-bit arithmetics and 64-bit printf formats in parts
of the kernel where it is not really useful, and helps clarity.
2009-01-20 18:20:47 +00:00
tnozaki
db74109901 PR lib/40411, nuke wctrans_init(). lazy initialization is not good idea.
statically initialized _DefaultRuneLocale.rl_wctrans field.
so we can re-const-ify _DefaultRuneLocale.

pkgsrc/shells/standalone-tcsh should be rebuild,
because it's staticaly linked binary.
2009-01-18 22:03:19 +00:00
christos
503c6c0a79 try a different approach since allocating a new RuneLocale is complicated.
Don't make DefaultRuneLocale const, so that we can write to it, and undo
previous changes.
2009-01-18 19:53:11 +00:00
drochner
fb535ac77e Make mktime(3) work with 64-bit time_t.
The problem is that the tm_year field of "struct tm" is just an "int"
(per POSIX), and thus time_t values >  2^31*60*60*24*365 cannot
be converted. This made mktime(3) fail even if no such large time values
were passed in by user code because the algorithm does a binary search
over the time_t range which fails if a probe value cannot be converted.
To fix this, limit the time_t range to be scanned to 55 bits (which
is a bit on the safe side, but still good until y570855533).
This is more a stopgap fix, the overflow should be checked for
at other places as well (eg localtime(3)), and there are some more
limitations in timezone parsing code.
2009-01-18 10:57:15 +00:00
christos
15d0878308 use a separate variable to copy the locale. 2009-01-17 17:56:01 +00:00
christos
361e31839f make this compile [now that I am on a machine that can compile :-)] 2009-01-16 21:18:37 +00:00
christos
826ddf7ef5 PR/40411: Hisashi T Fujinaka: standalone-tcsh dumps core when tab completing
The new rune code abuses __UNCONST to lazily initialize _RuneLocale. If
that happens to be the _DefaultRuneLocale which is const, the program will
core-dump because it will attempt to write to read-only memory. Catch this
and clone a copy of the locale and return it. The reason we don't see
everything core-dumping is because our shared library code probably loads
the text segment COW so it works (Is there an mprotect missing somewhere?).
But on statically linked binaries this is not the case and we die.

XXX[1]: Vet the code so that we are sure that there is no more of that
        happening trying to get rid of much of the __UNCONST'ing.
XXX[2]: This needs to be fixed for 5.0 and all related fixes.
XXX[3]: There is one place in the code where _DefaultRuneLocale is treated
	specially, does the patch break things?
2009-01-16 21:12:11 +00:00
drochner
21a81eb749 update struct timeval 2009-01-16 10:52:07 +00:00
christos
584a4c6af9 don't use glue for semctl, the number of underscores makes this an intractable
problem :-) Use regular wrappers like we do with sigtimedwait.
2009-01-16 00:02:57 +00:00
christos
74070c3c8c fix the semctl glue build that worked before by chance by side effects of
building the the assembly stub as a normal stub. Just build it as a glue
stub.
2009-01-15 01:35:45 +00:00
christos
209f6eb5bd add another directory the cvs did not merge. 2009-01-11 03:56:22 +00:00
christos
f943330f91 merge another directory that cvs missed. 2009-01-11 03:46:25 +00:00
christos
404fbe5fb9 cvs does not -j new directories, do it manually. 2009-01-11 03:41:28 +00:00
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
lukem
4a94e73441 Change the second argument of getlogin_r() from int to size_t, per POSIX. 2009-01-06 11:16:46 +00:00
wiz
bdd95bc725 Add missing newline. 2009-01-06 00:13:02 +00:00
pooka
5369f33800 Return of the Flag: There is no PROT_EXECUTE. 2009-01-05 22:11:48 +00:00
tnozaki
38eee9115b add more item for major bump:
_ctype_ table in ctype.h and gen/ctype_.c has insufficient bitwidth.
2009-01-05 07:50:23 +00:00
tnozaki
2af58f1cce 1. reworking PR lib/40317:
libnbcompat already contains empty fparseln.lo
so previous fix doesn't work correctly.
i've just added broken fparseln check to configure script.

2. reworking cross build breakage under FreeBSD/MacOS X.
FreeBSD/MacOS X still have public /usr/include/runetype.h
derived from 4.4BSD-Lite.  so i renamed out private header from
src/lib/libc/locale/runetype.h to src/lib/libc/locale/runetype_local.h
to solve this problems.

3. fix build breakage when CITRUS=no was set.
2009-01-05 06:11:43 +00:00
dogcow
c67ae0d68b define __UNCONST for OSes that don't have it when building tools/mklocale 2009-01-05 03:14:30 +00:00
dogcow
441204832d move nbtool_config.h include to top. 2009-01-05 03:10:02 +00:00
wiz
a711e8e9e4 Fix HTML output. 2009-01-04 09:42:43 +00:00
dholland
6557571403 Rework the text to make it clearer; it was really pretty confusing before.
Add an example; note some bugs/shortcomings. Bump date.
2009-01-04 07:54:15 +00:00
dholland
8f5f9030b6 SEE ALSO getmode(3)/setmode(3).
Suggested in passing by Joerg a long time ago on tech-pkg, seems like
a good idea.
Bump date.
2009-01-04 07:21:01 +00:00
lukem
a2c38ed82e Ensure fts_close() doesn't spuriously close fd 0,
by testing FTS_SYMFOLLOW in fts_flags instead of fts_options.
Fix provided by Ben Harris in PR 40319
2009-01-03 06:12:14 +00:00
tnozaki
52ed7b035f Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES} db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).

[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
  new locale-db implementation using citrus_db backend,
  see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
  internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].

[tools]
- mklocale(1): add new option ``-t'' that generates new style
  LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().

[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
    en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
    zh_CN.eucCN -> zh_CN.GB18030
    and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
  for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
  i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<

old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
2009-01-02 00:20:18 +00:00
ad
12c911ef99 Add more items for major bump. 2008-12-28 10:59:20 +00:00
christos
a41cd06ba5 PR/9359: Chris Demetriou: Document fread/fwrite mixing behavior. 2008-12-19 20:20:48 +00:00
christos
20ffd1f752 fix return values for snprintf and vsnprintf. 2008-12-16 23:09:19 +00:00
christos
47b2a9219c document svc_getrpccaller 2008-12-12 23:22:26 +00:00
wiz
5d7029bf64 Sort sections, sort SEE ALSO, remove trailing whitespace. 2008-12-11 09:07:46 +00:00
yamt
ad61a2c71e move a description of return values into the RETURN VALUES section. 2008-12-11 04:30:57 +00:00
christos
c900253da8 Martin says:
I had added a getaddrinfo()/getnameinfo() lookup to obtain an FQDN even
if gethostname() would return only the local part of the hostname.
I did not really consider that many systems do not have FQDNs and more
importantly that the calls introduce a high latency (timeout) when DNS
is not available.

On the other hand I do not (or no longer) think that using a non-FQDN is
such a big problem here. Those users/admins that do collect logs from
different hosts and want an FQDN should notice the problem quickly
enough and can easily fix it by correctly setting their hostname.
2008-12-10 15:20:04 +00:00
wiz
edd8540874 New sentence, new line. Bump date for fdopendir. 2008-12-05 13:26:41 +00:00
ad
117c67b2f2 Add fdopendir(), from Solaris/Linux. 2008-12-05 13:08:53 +00:00
christos
c450dd749d correct EBADF bogus comment. 2008-12-02 19:20:06 +00:00
jnemeth
b9c73aff7d PR/40060 - Bug Hunting -- grammar fix 2008-11-29 06:00:45 +00:00
wiz
0481201a86 Sort errors. 2008-11-28 22:33:02 +00:00
pooka
5ade66e9b9 make the synopsis slightly less overpromising:
"attempt to recover a deleted file" => "remove whiteout"
2008-11-28 09:48:58 +00:00
martin
10b0d64e49 Remove __LIBC12_SOURCE__ 2008-11-24 16:10:27 +00:00
matt
0ad7281825 Add new ptree (Patricia / RADIX tree) implementation to NetBSD. 2008-11-20 23:50:08 +00:00
christos
e1e5353bbe PR/39347: floating and long double conversions were ifdef'ed out because
we did not have wcstold and wcstof back then. But this was done incorrectly
because we did not move the argument vector. Enable them now.
2008-11-16 16:26:01 +00:00
ad
c6555ead19 Our qsort() is inappropriate for kernel use because it makes recursive
calls. Replace it with a kheapsort() function in kernel. Pointed out
by tron@.
2008-11-16 16:15:58 +00:00
ad
e5c4df967a Make qsort() available in libkern. 2008-11-16 15:01:26 +00:00
christos
9ebdd72925 Nobody tested this? Initialize wcio for wide char i/o.
NB: Pullup to 5.0.
2008-11-16 03:16:00 +00:00
reed
a4bfac4a14 Reference secmodel_securelevel(9) manual page. 2008-11-11 00:09:36 +00:00
christos
125a3d7f1f fix diagassert arg. 2008-11-06 19:59:42 +00:00
tsutsui
d13d5beaba Comment out nonexistent crash(8) xref. 2008-11-06 16:23:56 +00:00
nakayama
531d468612 Redo rev.1.13. We must refer to CURBRK via GOT in case of PIC. 2008-11-06 13:42:55 +00:00
christos
9f012c8aed don't forget to use neg. 2008-11-04 21:08:33 +00:00
christos
2844d6eadc we don't need * 2008-11-04 20:17:56 +00:00
christos
b4be570207 Our new syslogd seems to want to depend on %z which is a gnu extension.
- While here, add all the rest of gnu extensions: %g, %G, %u.
- Fix long standing bug where %Z would not work because "private.h" was
  not included. (Hi Brian!)
2008-11-04 18:37:28 +00:00
cube
26d23ca1c6 Invert the test for the return value of getaddrinfo(), because that's what
is actually meant there, to do nothing when the name doesn't resolve to an
address.
2008-11-03 23:21:19 +00:00
wiz
9a02e1d47d New sentence, new line. Mark up NULL with Dv. 2008-11-01 13:54:01 +00:00
christos
035a506da3 use the right variable in memcpy. 2008-11-01 00:54:47 +00:00
christos
8cda436bf2 fix compile error. 2008-10-31 17:49:48 +00:00
christos
e34e014482 make __findenv return the offset for the new entry to be inserted when
the string is not found, to avoid an additional scan of the environ array
in setenv.
2008-10-31 17:46:04 +00:00
christos
1c6aec2060 Import syslogd SoC project by Martin Schuette:
- new syslog protocol api syslogp(3) that supports structured data
	  and draft-rfc timestamps
	- reliable tcp connections with queueing
	- encrypted connections
2008-10-31 16:12:18 +00:00
rmind
9b24696c04 Add sched_getaffinity_np() and sched_setaffinity_np() wrappers, mainly
for compatibility purposes.
2008-10-31 00:29:19 +00:00
wiz
695738de0e Sort ERRORS, use more markup, bump date for previous.
Remove trailing whitespace.
2008-10-27 16:49:10 +00:00
erh
8886757e7e Document the fact that shmget can return EINVAL.
Refer the reader over to sysctl for information about changing shm limits.
2008-10-27 15:42:04 +00:00
mrg
2f0d0e12bf define and use LIBCDIR in terms of .CURDIR. fixes compat/lib/libc build. 2008-10-26 07:43:07 +00:00
mrg
5019a04ee2 use libcincludes.mk 2008-10-26 07:42:09 +00:00
mrg
7bee40559f put the code to find the libc include directories and define ARCHSUBDIR
and ARCHDIR in a common place.

this will be used by libc, libposix and librt.
2008-10-26 07:28:06 +00:00
mrg
15378e3afa remove an unncessary .PATH element that doesn't exist (and never did?) 2008-10-25 19:07:26 +00:00
wiz
4e1bb8f91c Fix pasto in previous. 2008-10-24 15:40:21 +00:00
christos
777e210a29 PR/39796: Robert Elz: Document that sigpending can return EFAULT since it calls
copyout.
2008-10-24 15:14:48 +00:00
dogcow
990e83b99d appease lint: warning: assignment in conditional context [159] 2008-10-22 02:17:29 +00:00
christos
b602f406f7 - vsyslog_r only closes if it opened
- maintain opened properly
- preserve the tag (from OpenBSD)
2008-10-21 21:00:31 +00:00
apb
debdeec730 The tools/compat versions of mkstemp() and mkdtemp() need to call the
internal function that's usually named "__gettemp".  However in a cross
build, "__gettemp" is in a namespace reserved for the host system, so we
can't use that.  Use "__nbcompat_gettemp" instead, following the example
of several other functions or macros in tools/compat.  Previously, this
was handled by using the name "gettemp", but that conflicts with the
local gettemp() function in dist/nawk.
2008-10-20 10:28:38 +00:00
wiz
e22cd6ffa8 Sort errors, use .Nx, avoid man markup, whitespace and punctuation nits. 2008-10-20 07:03:58 +00:00
christos
8a0817a3ac PR/39770: Robert Elz: mount(2) doc enhancements 2008-10-19 20:54:22 +00:00
wiz
06f6396fc6 Improve wording. Use Bd -literal for code sample. 2008-10-19 16:54:19 +00:00
rmind
53117b532b - Recommend poll(2) instead of select(2).
- Update example code a little bit.
2008-10-18 03:30:19 +00:00
christos
b30f2079e1 remove "limits" where it is not appropriate. 2008-10-09 14:40:11 +00:00
christos
910c3de51d this needs finite and scalbn 2008-09-28 18:54:30 +00:00
christos
519d922f3a having 2 separate implementations of frexp ldexp and modf (one here and
one in libm) that produce different results does not make any sense. Use
the one from libm to build instead.
2008-09-28 15:19:09 +00:00
lukem
2060495782 fix unused variable if !defined(FTS_ALLOC_ALIGNED) 2008-09-27 15:12:00 +00:00
tsutsui
61a62e59f7 unsigned int32_t -> uint32_t 2008-09-26 11:41:06 +00:00
christos
389390f57e pacify lint. 2008-09-24 16:58:53 +00:00
christos
0588e62651 fix newer gcc warning. 2008-09-24 16:24:30 +00:00
christos
194e105784 From Ilya Dogolazky ilya.dogolazky at teleca dot fi:
The new algorithm does not use any array initialisation.
Instead of that the only integer variable "index" is initialized.
It is not using any bitwise operations and shifts as well.

The well-known algorithm (an efficient representation for sparse sets) is
mentioned as exercise 2.12 in "The Design and Analysis of Computer Algorithms"
by Alfred Aho, John Hopcroft and Jeffrey Ullman. It is described here
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.30.7319
and here
http://research.swtch.com/2008/03/using-uninitialized-memory-for-fun-and.html
2008-09-24 14:36:02 +00:00
lukem
7fb0a8b2f3 Add fts_free() to complement fts_alloc(), and use instead of free().
Should avoid a memory leak on systems without ALIGNBYTES.
2008-09-20 00:14:12 +00:00
christos
6f1e299202 From Ilya Dogolazky: Fix return value doc. 2008-09-17 22:08:52 +00:00
drochner
dc7ba38823 fix the -0.0 case, fixes a gm4 test error reported by wiz
(normally, the libm implementation should be used)
2008-09-14 13:38:38 +00:00
wiz
7afae79e13 Bump date for previous. 2008-09-13 09:20:37 +00:00
rmind
0f80b1578d Arguments were swapped for cpuset_set(), cpuset_clr(), cpuset_isset()
functions, but man pages were not updated (hi Christos!).
2008-09-12 13:39:04 +00:00
christos
628eb1017e PR/39513: Stathis Kamperis: reboot(2) doesn't explicitly mention that combining
options is possible
Also remove RB_DFLTROOT.
2008-09-11 17:03:23 +00:00
christos
7ea3b31b66 PR/39519: Nozomu Ando: Fix incorrect change from bind9 that broke IPv4 mapped
addresses.
2008-09-11 15:40:43 +00:00
joerg
d3595ddff7 Consistently include "nbtool_config.h" when cross-compiling. 2008-09-11 12:58:00 +00:00
joerg
65f930bc37 Remove one remaining sccsid. 2008-09-11 12:33:55 +00:00
joerg
3ae583451f Prepare use of strtoull, strtoumax and strtoimax in tools/compat by
including nbtool_config.h.
2008-09-10 18:08:58 +00:00
joerg
52c4a82ef2 In preparation for providing a db fallback in libnbcompat, remove
sccsid and conditionals around __RCSID. lint understands __RCSID enough
to ignore it, undefining LIBC_SCCS is superseded by MKSTRIPIDENT.
No functional changes.
2008-09-10 17:52:35 +00:00
apb
a1dad6e718 Fix some errors in examples, noticed by Robert Elz:
* use \e in the source to get a backslash in the output.
* test whether the result from shquote[v]() is -1 before, not after,
  adding 1 to it.
2008-09-07 08:55:46 +00:00
lukem
4e3bc9a2d6 Expand the description of bsize, and correct the description of the default. 2008-09-05 06:25:04 +00:00
lukem
490ac90f8e Add strunvisx(3) as a link to unvis(3) 2008-09-05 04:52:34 +00:00
dholland
629defb951 Clarify that the historic V7 sticky file semantics no longer apply. 2008-09-05 03:28:15 +00:00
lukem
6fb06e2c97 In strsvisx(), don't attempt to read the "next" character past the end
of the provided length.
2008-09-04 09:41:44 +00:00
dholland
43987efbe4 Grammar police. 2008-08-29 05:48:40 +00:00
christos
5022bd798d Ignore whitespace in format string from Andy Shevchenko 2008-08-28 16:41:21 +00:00
joerg
dcb3546b5c Fix __log2 to not loop for 0x80000000 and higher. 2008-08-28 11:00:43 +00:00
christos
80a5932343 setup _POSIX2_C_BIND per SUSv3, from Andy Shevchenko 2008-08-27 08:56:49 +00:00
christos
40d362f8e0 malloc(3) and getenv(3) affect errno; make sure we save and restore it
Reported by Andy Shevchenko
2008-08-27 08:49:03 +00:00
christos
40d6ddde20 system(NULL) should return if the command interpreter is there or not.
Andy Shevchenko
2008-08-27 06:45:02 +00:00
joerg
40b37a3bf2 Convert db from UCB types to POSIX types. Prefer uint8_t for u_char as
it is mostly about the wire format.

Patched libc.so is bit-identical.

OK matt@
2008-08-26 21:18:38 +00:00
drochner
14744ddade fix range of strtouq(), from Henning Petersen per PR lib/39399 2008-08-26 12:21:24 +00:00
lukem
4638a08a72 Use Qq instead of Qc to quote a single word 2008-08-26 05:04:19 +00:00
joerg
8609f98c0c mpool.libtp seems to be an ancient copy of mpool.c, nuke it. 2008-08-25 21:24:07 +00:00
joerg
245e086321 Unify the implementation of strto{l,ul,ll,ull,imax,umax,q,uq} into one
version for signed and one version for unsigned data types.

Add a check for supported bases and set errno (userland) or panic
(kernel, libsa) otherwise.

Make strto{ll,ull,imax,umax} normal symbols and just keep the underscore
versions as strong alias.

Obtained from DragonFly, based on the wide char version from Citrus.
Reviewed by christos@
2008-08-20 12:42:26 +00:00
gmcgarry
77023558e8 Changee __attribute(__weak__) to __weak_reference(). Produces same object code
and matches lib/csu/common_elf/common.h.  Fixes linkage with PCC.
2008-08-17 10:51:19 +00:00
rtr
e5321bd81b revert previous 2008-08-17 10:50:50 +00:00
dholland
377b231974 Fix grammar. Noted by Taylor R Campbell in PR 39369. 2008-08-17 09:40:59 +00:00
rtr
1becd174de fix comment iff -> if 2008-08-17 09:26:45 +00:00
wiz
b9a5e63c26 Bump date for previous.
Sort ERRORS, and merge two entries for the same errno value.
2008-08-14 18:00:08 +00:00
matt
8165c33c80 Implement following constants and add support their to the UFS family of file
systems:
	_PC_2_SYMLINKS
	_PC_SYMLINK_MAX

From andy dot shevchenko at gmail dot com.
2008-08-14 16:19:25 +00:00
tnozaki
cd0f2012d3 SUSv3 says, if not printable wide-character exists, return -1. 2008-08-12 21:59:27 +00:00
tnozaki
73651b99df add _CTYPE_R(printable) bit for ALL_80_TO_FF_SW1 area.
now wcwidth(wc) looks whether wc is printable or not.
2008-08-12 21:25:31 +00:00
tnozaki
b5174f925f SUSv3 says, wcwidth(wc) returns:
1) wc is nul wide-character, return 0.
  2) wc is printable wide-character, return column width.
  3) else, return -1.
but our implementation, case 3) returns 0. it's wrong!
2008-08-12 20:51:25 +00:00
matt
c331e46238 Add support for missing _SC_* constants for sysconf().
From andy dot shevchenko at gmail dot com
2008-08-06 17:17:03 +00:00
matt
f0a4a8908c Add a missing dependency 2008-08-06 16:22:48 +00:00
lukem
c15f2bdde0 Revert previous addition of '-e sedcmd'. Still retain the usage improvements. 2008-08-05 02:08:13 +00:00
lukem
0cc7d83887 Redo previous in a much simpler way.
Inspired by and fixes PR 39285.
2008-08-05 02:06:53 +00:00
lukem
d3eb13d073 Add '-e sedcmd' to makelintstub, to translate filename to syscall name.
Improve usage, etc.

Invoke makelintstub with -e 's/^tmp_//' when building LintSysNormal.c

Fixes build problem that matt@ highlighted to me.
2008-08-05 01:54:47 +00:00
matt
cac8e44915 Add C99 functions imaxabs and imaxdiv. 2008-08-04 21:29:27 +00:00
matt
01b36ae8ad Use WEAK_ALIAS 2008-08-04 20:26:38 +00:00
matt
e796a34c9c Use WEAK_ALIAS.
Add imaxabs weak alias.
2008-08-04 20:21:26 +00:00
lukem
29e7a5c114 Prefix filenames of tomporarily generated .S files with "tmp_", so that the
".if exists(foo.S)" check doesn't get confused by ${.OBJDIR}/foo.S.
Fixes PR/39217
2008-08-04 00:53:51 +00:00
joerg
9acf218ba1 Before using the slightly more involved bitmap tables,
check that the charset for strspn/strcspn is non-trivial.
An empty charset is either a direct return or a strlen and
a single charset a simple loop.
2008-07-30 16:13:59 +00:00
lukem
a703e9a7ca Disable assembler warnings on mipseb and mipsel for mcount.c
Workaround for PR#39192
2008-07-29 14:20:12 +00:00
dsl
9edd12efca Change the gross #defines HVIS and SVIS into local functions. 2008-07-25 22:29:23 +00:00
christos
674681d3c0 fix gcc warnings from Alexander Shishkin 2008-07-25 14:05:25 +00:00
lukem
8897ce05a0 Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 12:05:43 +00:00
dholland
d3dda4ea44 Clarify one of the process-group-ID cases by saying "process group ID"
instead of just "group ID". This was sitting in my tree and I forget
the exact genesis - I think it came up in chat a couple months ago.
2008-07-13 15:16:26 +00:00
gmcgarry
99f83f7619 Nuke __strong_alias() to avoid definition loop. 2008-07-08 00:23:28 +00:00
rmind
7781a976a7 Avoid calling a syscall when argument to sbrk(2) is zero.
OK by <ad>.
2008-07-02 20:07:43 +00:00
rmind
2a94bd63c1 Move scheduling functions from librt to libc.
Fixes PR/38657.
2008-07-02 20:05:16 +00:00
matt
48717a981d Move rb.c from sys/lib/libkern to common so it can be in both libc and libkern. 2008-06-30 19:03:59 +00:00
ad
2a7116daf3 ttyname_r is another of the strange functions that returns its error code
instead of setting errno.
2008-06-25 11:47:29 +00:00
ad
3ae2f84118 Add _SC_TTY_NAME_MAX. 2008-06-25 11:46:11 +00:00
ad
5c6eb305b3 Fix MLINKS line 2008-06-25 11:19:28 +00:00
ad
c6f43a476e Crank libc minor for getlogin_r 2008-06-25 11:12:01 +00:00
ad
5f64faa3a9 Add getlogin_r. Manual page changes mostly lifted from FreeBSD. 2008-06-25 11:10:24 +00:00
ad
d29b52efe8 Return -1 for the unsupported realtime extensions. 2008-06-25 11:09:20 +00:00
ad
e7bd22925c A few more POSIX defs for threads. 2008-06-24 14:06:55 +00:00
ad
380c3da007 Split choose_arena() back out into inline and non-inline portions. 2008-06-23 10:46:25 +00:00
ad
7a21650601 Install manual pages for the atomic ops. 2008-06-23 10:22:40 +00:00
wiz
067a770e99 Note that strndup was recently (4.0) added. Bump date. 2008-06-22 11:02:07 +00:00
wiz
688c5830e1 Clarify a sentence. 2008-06-22 08:25:26 +00:00
christos
7ce5e09d1b - protect DEBUG again because we should be able to set it from the Makefile
- add a missing cast to pacify lint.
2008-06-21 23:37:53 +00:00
christos
3873655b27 updates from bind-9-5-0 2008-06-21 20:41:48 +00:00
christos
f498c90335 PR/38942: Pedro F. Giffuni: Mention that utimes now supports setting of
the birthtime. Text from FreeBSD.
2008-06-17 17:46:40 +00:00
he
842f96408c Correct the use of MLINKS for the cpuset_* manual page links.
The value for MLINKS is a list of pairs, where the original manpage
is listed first in each pair...
2008-06-17 00:10:54 +00:00
rmind
e6acd90e07 - Add affinity(3) manual page, which describes thread affinity,
pthread_setaffinity_np(3) and pthread_getaffinity_np(3) functions,
  provides simple code example.
- Add cpuset(3) manual page, which describes API of CPU-sets.

Thanks <wiz> for many improvements!
2008-06-16 14:25:49 +00:00
christos
2d6c1e93d9 Glue in cpuset.c 2008-06-15 20:36:52 +00:00
tnozaki
e1ee662664 remove unused include, locale.h. 2008-06-14 16:01:07 +00:00
christos
22c4053358 PR/38539: Ed Ravin: libc/gen/syslog.c always logs to console if LOG_CONS is set.
While here:
1. Don't loop forever, handle closing and opening the log after each send.
2. Release the lock later, after we've possibly printed to the console.
2008-06-12 20:43:14 +00:00
ginsbach
0f112a8437 The category LC_MESSAGES is already a directory possibly containing
gencat(1) generated message catalogs.  Make sure that it is handled
properly.  (I missed this previously.)

Add some additional sanity checks on the locale path as the value may
come from the envrionment.
2008-06-12 20:33:23 +00:00
yamt
4f6334de3c fix a typo 2008-06-06 05:51:46 +00:00
aymeric
b0288bde97 fix a "typo" which prevented %ls from working in printf() (NARROW case).
Among other things, nvi displays options correctly now.
2008-06-05 19:55:47 +00:00
ad
88261d4ead Check to see if MALLOC_OPTIONS is actually set in the environment before
doing issetugid().
2008-06-05 00:16:34 +00:00
ad
e54e98d8cc xprintf returns void. 2008-06-03 19:22:37 +00:00
enami
ed3ed8f740 Refer sigprocmask(2) instead of non existing sigmask(2). Also, xref
sigprocmask(2) and pthread_sigmask(3).
2008-05-31 16:15:07 +00:00
gdt
f7d5c4db3f Document the C99-required and already implemented hh modifier (pointer
is to a char, vs. h for short).  Bump date.
2008-05-30 17:29:54 +00:00
mrg
c2b95373bf remove clause #3 from my license where there are no other
copyright holders involved.
2008-05-29 14:51:25 +00:00
haad
a3b083b6a1 Remove unneeded #include <string.h>, found by Adam Hoka.
Ok'ed by martin@.
2008-05-26 13:17:48 +00:00
ad
27d03b16a5 Fedora Core 9 doesn't provide ARG_MAX, so use _POSIX_ARG_MAX if it's
not available.
2008-05-26 13:06:38 +00:00
wiz
e430b722ea New sentence, new line. 2008-05-25 20:13:47 +00:00
wiz
62954cc42a Sort sections. Sort ERRORS. Prepare for HTML output. 2008-05-25 20:13:14 +00:00
wiz
8b96d555e0 Remove trailing whitespace. Fix typo. Sort SEE ALSO. 2008-05-25 20:07:14 +00:00
wiz
885b937f63 Prepare for HTML output. Remove dot at end of SEE ALSO. 2008-05-25 20:06:53 +00:00
dholland
d617ea4585 Fix handling of legacy global variable timezone outputs. PR misc/22221. 2008-05-25 06:18:06 +00:00
christos
be2cd377db Coverity CID 5028: Fix memory leak. 2008-05-24 16:04:15 +00:00
christos
9842feccf0 Coverity CID 5029: Fix memory leak. 2008-05-24 15:59:59 +00:00
lukem
edf03256a8 Fix possible memory leak in error path.
Part of PR 38677.
2008-05-18 22:36:15 +00:00
ginsbach
bcd54758b8 Add support for additional locale categories: LC_MESSAGES, LC_MONETARY,
LC_NUMERIC.

The code used to load LC_TIME was refactored in to a more general routine.
This common routine is now used to load LC_TIME along with the newly added
categories.

Changes discussed with/reviewed by christos.
2008-05-17 03:49:54 +00:00
christos
8e11cb8cb8 undo the constification of the argument. Per opengroup. 2008-05-10 22:39:40 +00:00
martin
5d1469bd77 Backout previous: the license sweep touched these files in error, so
restore the old license.
2008-05-10 15:31:03 +00:00
christos
7f928c07fa add more errors from gleaning the source. 2008-05-09 15:52:50 +00:00
lukem
2713f76747 Convert getnetbyname(3) and getnetbyaddr(3) to the more "standard"
nsdispatch() backend method API.
2008-05-08 13:01:42 +00:00
lukem
d8aac84366 Fix a misuse of an automatic as a static that was exposed by the previous. 2008-05-08 12:26:55 +00:00
lukem
6e5e2748b3 Fix DNS getnetbyname(), which has been broken for at least 5.5 years
(if not longer).
2008-05-08 05:06:18 +00:00
njoly
24cbc2830b - Make semctl SETVAL/SETALL commands validate the semaphore value to
be set, which needs to be in the range [0,SEMVMX].
- Adjust the man page.
2008-05-06 20:25:09 +00:00
yamt
ad1e9536e6 document LWPCTL_FEATURE_PCTR. 2008-05-05 05:04:06 +00:00
tonnerre
34f7daa87e Fix a bug in the implementation of seekdir(). If the first entry in
a block has been unlinked, seekdir() may overshoot by one entry.
Thus, _readdir_unlinked() must not skip deleted entries when being
called from seekdir().
Christos agreed.
2008-05-04 18:53:26 +00:00
yamt
49716be5e2 a little more about fpos_t. 2008-05-03 07:06:30 +00:00
martin
a71552e354 Move to 2 clasue license 2008-05-02 18:38:32 +00:00
martin
f1a537e1d9 Fix nested comment and move to 2 clause license 2008-05-02 18:34:17 +00:00
martin
cd22f25e6f Move TNF licenses to 2 clause form 2008-05-02 18:11:04 +00:00
christos
640f4f7d25 mention thread local support. 2008-05-01 15:52:31 +00:00
christos
5614cf4051 Mention errno settings on failure. 2008-04-30 14:51:10 +00:00
martin
11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
scw
d05f8e9263 - Document RAS_START_ASM, RAS_END_ASM, RAS_START_ASM_HIDDEN, and
RAS_END_ASM_HIDDEN.
- Advise against implementing RASs in C.

See PR lib/38482 for details.

While here, remove clauses 3 and 4 from TNF license.
2008-04-29 21:06:28 +00:00
martin
3028e483e4 Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
christos
a8706a45b4 mention ldexp, frexp, modf. 2008-04-27 09:26:20 +00:00
dogcow
9fdae5aaa5 make this compile again. (hi, xtos!) 2008-04-25 23:51:41 +00:00
ginsbach
b876d7a7df Add %F the ISO 8601 date format which is equivalent to %Y-%m-%d. This
format character is supported for reasons of symmetry with strftime(3).
FreeBSD and GNU versions of strptime(3) both support %F.
2008-04-25 20:51:10 +00:00
christos
c9cdc30221 - always check malloc results
- don't leak fds on error
- don't cast malloc
- don't cast NULL
2008-04-25 17:44:44 +00:00
christos
eaacd42b0f I don't see why we need to strong alias those. Nothing else does it. 2008-04-25 16:43:00 +00:00
ginsbach
52de4d6274 Change date for previous change (addition of %Z). 2008-04-25 14:37:00 +00:00
ginsbach
43e9d46aab Add support for %Z ala FreeBSD and some other strptime(3) implementations.
Reviewed by christos.
2008-04-24 21:34:48 +00:00
plunky
043900c0cb constify dirname(3) and basename(3) 2008-04-23 07:53:26 +00:00
plunky
f983e71d70 constify uuid(3) 2008-04-23 07:52:32 +00:00
rmind
4000aba309 Add posix_madvise(2) and appropriate definitions in sys/mman.h header.
This interface is identical to madvise(2), however, is defined by POSIX.
Partially sync madvise(2) man page with FreeBSD.

Reviewed by <mrg>.
2008-04-22 10:42:16 +00:00
dogcow
690e5f1c0b add matching END(). found via -Wa,--fatal-warnings 2008-04-22 04:47:44 +00:00
plunky
7c3f385475 correct cut and paste error in uuid_dec_be(); le16dec -> be16dec 2008-04-19 18:21:38 +00:00
lukem
e11ffebb07 Document the callback API used by "standard" functions.
NOTE: some of these will be changing in the future to be more
consistent with the technique used in the group & passwd backends.
I'm just documenting the existing behaviour.

Be more consistent when using certain terms.
Rename some variables to reduce confusion.
2008-04-19 08:24:45 +00:00
lukem
e39aac16df Add a missing const. 2008-04-19 07:56:34 +00:00
garbled
6f4524c1a6 Fix a stupid typo in a comment. Pointed out by Juergen Hannken-Illjes. 2008-04-18 08:05:05 +00:00
garbled
1ad3697abd Back out the ppc assembler changes for memcpy/memmove/memcmp on evbppc.
It breaks the explora because the cpu (403) cannot deal with unaligned
accesses.  Reported by Juergen Hannken-Illjes.
2008-04-18 05:34:04 +00:00
apb
01a2b8e8ab Clarify the range of the result from toascii. 2008-04-17 16:41:00 +00:00
apb
576ccca3eb When given negative inputs, isascii returns false. Clarify that
it checks for the range 0 to 127, not "less than or equal to 0177".
2008-04-17 16:40:20 +00:00
apb
a754895afc Refer to the CAVEATS section of ctype(3) for more information. 2008-04-17 16:25:36 +00:00
apb
bafb5bb96d * Expand the CAVEATS section with a lot more detail on how to safely
use the ctype functions.
* Use toupper((int)(unsigned char)*s)) instead of just
  toupper((unsigned char)*s) in an example.
2008-04-17 16:24:40 +00:00
dholland
052fb4c32d Fix replicated typo 2008-04-13 02:04:31 +00:00
njoly
3c71964512 Fix _SC_MQ_OPEN_MAX/_SC_MQ_PRIO_MAX sysctlgetmibinfo calls.
The corresponding sysctl nodes are available under kern.mqueue tree.
2008-04-09 18:37:04 +00:00
lukem
a699245e9a The ns_mtab.mdata is passed to the ns_mtab.method as the cbdata argument. 2008-04-07 13:25:42 +00:00
lukem
7ce7cf535a Improve description of the arguments and return values of
various methods & callbacks.
Improve markup.
2008-04-07 13:20:44 +00:00
rtr
f2575a3983 whitespace fix 2008-04-05 08:01:54 +00:00
jmmv
53501bc8e0 Improvements and fixes from J. Vicente Carrasco sent by private mail. 2008-04-03 10:47:27 +00:00
drochner
b5e4e50433 remove stale declarations 2008-04-01 19:19:33 +00:00
chris
c82cfbf571 Use SYSTRAP macro, rather than inlining the swi instruction.
This makes sure the SWI will be in the NetBSD assigned range of swi
numbers.
2008-03-30 21:22:05 +00:00
dholland
5b571a159f Add a note clarifying that getprogname() results are not trustable in a
setugid environment. Prompted by PR 38327 discussion.
2008-03-29 16:51:40 +00:00
he
c2dbd6e374 Make this build again. 2008-03-28 00:56:54 +00:00
christos
23b2e3cd80 Fix another integer overflow issue discovered by Maksymilian Arciemowicz.
On top of this, limit the range of getnumber to 0x00ffffff to make sure
that adding two of them does not cause an integer overflow.
2008-03-27 21:50:30 +00:00
tnozaki
690d9c4d8a add comment about renaming of setlocale -> __setlocale_mb_len_max32. 2008-03-24 12:54:38 +00:00
yamt
7f068c6aa5 mention fpos_t 2008-03-23 15:33:26 +00:00
christos
ab6254493d Don't coredump on out of memory conditions. This solution leaks, but gdtoa
is too complicated to fix. Try printf %99999999999.9999999999f 2
2008-03-21 23:13:48 +00:00
tnozaki
7ed5b48246 add BOM to utf-16/32 stream in case that endian is not specified,
like other iconv implementation, GNU libiconv, glibc2 iconv, perl iconv.
2008-03-20 11:47:45 +00:00
he
0db6a6b023 When compiling for _STANDALONE, omit a bunch of headers which aren't really
needed and which trigger build problems.

(These two files should probably be unified and put under common/...)
2008-03-18 20:11:43 +00:00
christos
00f5c7fe8d Avoid integer overflow; reported by Maksymilian Arciemowicz. 2008-03-18 18:16:08 +00:00
wiz
636a4f58a9 Describe how to portable extend a file. From joerg. Bump date. 2008-03-16 11:33:40 +00:00
christos
749de7f2a4 Since _file is a short, check that the fd fits in it, otherwise bail with
EMFILE. We treat _file as an unsigned short to double our range, with a
special case for -1 (closed). Make a note of what we should do about stdio
if we ever bump libc. We could change _file in the future compatibly to an
int by putting it in the extension space but for now we don't bother.
2008-03-13 15:40:00 +00:00
rmind
1c7eae5598 Use size_t to avoid overflow when sorting large arrays. While here, ANSIfy.
Obtained from FreeBSD (das@).
2008-03-11 18:04:59 +00:00
he
71ca0c37fa As mrg@ informs me, delay slots are indented 1 and not 2 spaces. 2008-03-10 18:31:08 +00:00
he
bbed82985f Fix the problem that CURBRK can't be referenced directly via R_SPARC_GOT13
here anymore (apparently libc grew too big).  Use sethi and %hi/%lo instead.
2008-03-10 18:28:43 +00:00
wiz
388f16d85b Move previously added sentence to STANDARDS section, as suggested by yamt. 2008-03-10 12:25:55 +00:00
wiz
4111fbb94d Mention that extending files with truncate is a POSIX extension.
Requested by joerg.

Bump date.
2008-03-10 11:47:28 +00:00
lukem
da757a063f Style tweaks:
* test defined(HAVE_foo) not just HAVE_foo
* replace u_foo with unsigned foo
* the whitespace change whose name we dare not mention
2008-03-10 01:18:44 +00:00
yamt
b82fd04ee9 sysconf: cache the result of _SC_PAGESIZE. 2008-03-08 13:34:40 +00:00
ad
91224074af Redo the CPU-based arena selection slightly differently. With the latest
libpthread and kernel, this mysteriously works without a problem.
2008-03-08 13:17:13 +00:00
ad
1046045268 Keep one builtin slot so that pthread initialization doesn't need to use
malloc().
2008-03-07 17:56:39 +00:00
tnozaki
47d7f820fd bin/38047 fix bad prototype for function mbrlen
reported by cheusov AT tut DOT by, thanks!
2008-02-28 19:36:51 +00:00
christos
908cf676a4 mention RANDOM_MAX 2008-02-28 16:16:35 +00:00