Commit Graph

16951 Commits

Author SHA1 Message Date
Enji Cooper
6157e90c35 Change WARNS to 2 across the board with all the libc testcases
This effectively "reverts" r290846

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-15 05:21:58 +00:00
Enji Cooper
dd3d75ba5f Fix -Wmissing-braces warnings by adding braces around all the
testcase inputs

MFC after: 1 week
X-MFC with: r290572
Sponsored by: EMC / Isilon Storage Division
2015-11-15 05:13:33 +00:00
Enji Cooper
397f4a0de5 Fix -Wunused warnings
MFC after: 1 week
X-MFC with: r290572
Sponsored by: EMC / Isilon Storage Division
2015-11-15 05:02:41 +00:00
Enji Cooper
e426f1f48f Bump WARNS to 2
MFC after: 1 week
X-MFC with: r290532
Sponsored by: EMC / Isilon Storage Division
2015-11-15 04:51:14 +00:00
Enji Cooper
c384ef563e Remove unused variables; sort by alignment where needed
MFC after: 1 week
X-MFC with: r290532
Sponsored by: EMC / Isilon Storage Division
2015-11-15 04:50:54 +00:00
Enji Cooper
a244e42201 Polish up iswctype_test
- Split up the testcases into C locale and ja_JP.eucJP testcases.
- Avoid a segfault in the event that setlocale fails, similar to r290843
- Replace `sizeof(x) / sizeof(*x)` pattern with `nitems(x)`

MFC after: 1 week
X-MFC with: r290532
Sponsored by: EMC / Isilon Storage Division
2015-11-15 04:50:08 +00:00
Enji Cooper
cc4ac19cb0 Polish up the tests a bit more after projects/collation was merged to head
Provide more meaningful diagnostic messages if LC_CTYPE can't be set properly
instead of segfaulting, because setlocale returns NULL and strcmp(NULL, b) will
always segfault

Split up the testcases so one failing (in this case en_US.ISO8859-15) won't
cause the rest of the testcases to be skipped

Remove some unused variables

MFC after: 1 week
X-MFC with: r290532
Sponsored by: EMC / Isilon Storage Division
2015-11-15 04:33:14 +00:00
Enji Cooper
252f1a84f7 Fix the Indian numbering system (hi_IN.ISCII-DEV) tests
Submitted by: ache
X-MFC with: r290494 (if that ever happens)
Sponsored by: EMC / Isilon Storage Division
2015-11-15 03:56:09 +00:00
Craig Rodrigues
677640a2fa Fix bootstrapping of libopenbsd on build hosts where KERN_PROC_NFDS
it not defined.
2015-11-14 23:43:59 +00:00
Craig Rodrigues
649e1da360 Add imsg to libopenbsd.
This will help with importing OpenBSD programs such as ypldap
into the base system.
2015-11-14 23:13:15 +00:00
Craig Rodrigues
1bbc47cb35 Implemtn getdtablecount() to count open file descriptors for current process.
Use underlying sysctl implemented by mjg in r290473.

PR:                    194985
Reviewed by:           bapt, mjg
Differential Revision: https://reviews.freebsd.org/D4084
2015-11-14 23:07:38 +00:00
Andrey A. Chernov
0856628198 1) Remove my overcomplicated error fallback and just return error
immediatelly as old code does, now for append modes too.
Real use case for such fallback is impossible (unless specially crafted).

2) Remove now unneded include I forgot to remove in prev. commits.

MFC after:      1 week
2015-11-12 22:24:39 +00:00
Enji Cooper
79346959a2 Add missing licensing boilerplate to test-fnmatch.c
Carry over licensing author info from fnmatch_test.c (jilles@)

MFC after: 1 week
X-MFC with: r290572
Sponsored by: EMC / Isilon Storage Division
2015-11-10 11:28:02 +00:00
Baptiste Daroussin
87101cb572 return "US-ASCII" instead of "POSIX" for "C" and "POSIX" locales
as it used to be in previous version of the locales. Returning
"POSIX" has too many fallouts.
2015-11-10 08:11:27 +00:00
Baptiste Daroussin
403105944d nl_langinfo: Simplify case ladder
The NONE:US-ASCII case isn't necessary.  The "NONE:" case will handle
US-ASCII, so let's remove the redundant handling.

Submitted by:	marino
Obtained from:	DragonflyBSD
2015-11-09 22:29:47 +00:00
Baptiste Daroussin
22b87a3555 Readd ascii.c forgotten in r290618 2015-11-09 22:11:37 +00:00
Baptiste Daroussin
473aa0b7ee locales: Enforce US-ASCII encoding (limited to 7-bit)
The US-ASCII format was getting treated identically to POSIX.  It is
supposed to throw an ILSEQ errno if a value of 0x80 or greater is
encountered, so let's bring back the "ASCII" handling.

While here, change nl_codeset to return US-ASCII only when the encoding
really is "US-ASCII".  Before "C" and "POSIX" encoding returned this
string, so now they return "POSIX".

Discussed with:	ache
Submitted by:	marino
Obtained from:	DragonflyBSD
2015-11-09 22:06:22 +00:00
Enji Cooper
fdb319ca66 Bump .Dd 2015-11-09 10:41:27 +00:00
Enji Cooper
6922f80018 Document powl(3)
PR: 191751
Sponsored by: EMC / Isilon Storage Division
2015-11-09 10:40:16 +00:00
Enji Cooper
fbf5b9f8a2 Integrate tools/regression/lib/libc/gen into the FreeBSD test suite
as lib/libc/tests/gen

The code in test-fnmatch that was used for generating:

- bin/sh/tests/builtins/case2.0
- bin/sh/tests/builtins/case3.0

has been left undisturbed. The target `make sh-tests` has been moved over
from tools/regression/lib/libc/gen/Makefile to
lib/libc/tests/gen/Makefile and made into a PHONY target

case2.0 and case3.0 test input generation isn't being done automatically.
This needs additional discussion.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-09 06:24:11 +00:00
Enji Cooper
233193f1e6 Fix some TAP -> ATF conversion errors
- Remove a leftover printf from when this was a TAP based testcase
- Catch mmap failures properly

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2015-11-09 06:16:38 +00:00
Enji Cooper
24732d675d Integrate tools/regression/lib/libc/net into the FreeBSD test suite
as lib/libc/tests/net

Also, fix eui64_aton_test:test_str(..). The test was comparing the result
of eui64_aton to a pointer of the expected result.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-08 23:06:40 +00:00
Enji Cooper
659f1d64bd Delete leftover printfs from when these were TAP tests
MFC after: 1 week
X-MFC with: r290532
Sponsored by: EMC / Isilon Storage Division
2015-11-08 21:57:35 +00:00
Enji Cooper
4c05e4ea85 Convert print_positional_test over to ATF
Somehow missed in r290537

X-MFC with: r290537
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-08 21:38:46 +00:00
Andrey A. Chernov
881e47bbb2 Reorganize code to elimitate one _sseek() call for append modes.
MFC after:      1 week
2015-11-08 18:00:44 +00:00
Enji Cooper
3e86c1081d printfloat_test and scanfloat_test need symbols from msun; these are automatically
provided on amd64, but not i386. Add libm to DPADD/LDADD to unbreak the i386
tinderbox

Pointyhat to: ngie
MFC after: 1 week
X-MFC with: r290538
Sponsored by: EMC / Isilon Storage Division
2015-11-08 08:27:51 +00:00
Enji Cooper
347267dcf8 Integrate tools/regression/lib/libc/string into the FreeBSD test suite
as lib/libc/tests/string

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-08 07:53:31 +00:00
Enji Cooper
98682851f2 Integrate tools/regression/lib/libc/stdlib into the FreeBSD test suite
as lib/libc/tests/stdlib

- Make the code a bit more style(9) compliant
- Convert a sizeof(x)/sizeof(x[0]) to nitems

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-08 07:03:17 +00:00
Enji Cooper
1ee0219205 Integrate tools/regression/lib/libc/stdio into the FreeBSD test suite
as lib/libc/tests/stdio

- Fix some whitespace
- Convert the testcases to ATF
- Convert "/dev/null" to _PATH_DEVNULL

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-08 06:37:50 +00:00
Enji Cooper
9da7d79f25 Integrate tools/regression/lib/libc/locale into the FreeBSD test suite
as lib/libc/tests/locale

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2015-11-08 02:06:17 +00:00
Baptiste Daroussin
3e4f384ed2 Merge from head r290483 2015-11-07 11:02:33 +00:00
Steven Hartland
72c33534b2 Correct posix_openpt reference in pty(3)
MFC after:	1 week
Sponsored by:	Multiplay
2015-11-06 12:02:24 +00:00
Brooks Davis
ff849914ef Revert r290298. Per discussion on tech-userlevel@netbsd.org this change
was incorrect.
2015-11-05 17:00:38 +00:00
Craig Rodrigues
cda9474ab7 Fix spelling error.
Reported by: junovitch
2015-11-05 01:54:38 +00:00
Craig Rodrigues
9e8e179172 Add README, similar to the one from libnetbsd. 2015-11-05 01:29:48 +00:00
Craig Rodrigues
70623c80d4 Import imsg from OpenBSD's libutil.
imsg provides functions for communication between processes
using sockets.  imsg is used by programs in OpenBSD such as ypldap.
2015-11-04 23:52:19 +00:00
Craig Rodrigues
a36eca08bb Rename libohash to libopenbsd.
libopenbsd is an internal library which
to bring in compatibility stuff from OpenBSD.
This will allow us to bring in more
OpenBSD utilities into the FreeBSD base system.

We similarly use libnetbsd for bringing in stuff from NetBSD.

Reviewed by: bapt
Differential Revision: https://reviews.freebsd.org/D4078
2015-11-04 07:20:55 +00:00
Hiroki Sato
c56e91b345 sdl->sdl_len in sockaddr_dl can be longer than
sizeof(struct sockaddr_dl).
2015-11-03 00:46:06 +00:00
Baptiste Daroussin
e58504783b Fix mbtowc not setting EILSEQ on an Incomplete multibyte sequence for eucJP encoding 2015-11-02 22:56:24 +00:00
Brooks Davis
942505ca1c The ops EL_SIGNAL, EL_EDITMODE, EL_UNBUFFERED, and EL_PREP_TERM all take
an int, not an int*.

Sponsored by:	DARPA, AFRL
Discovered with:	CHERI
Differential Revision:	https://reviews.freebsd.org/D4071
2015-11-02 22:21:02 +00:00
Devin Teske
9d9cc24662 Make figpar(3) types/macros [more] unique (s/fp_/figpar_/gi) 2015-11-02 20:03:59 +00:00
Enji Cooper
c5a5e42ca1 Add _test suffix to multiple tests in lib/libc to conform to the design noted
in the FreeBSD Test Suite wiki

MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2015-11-02 01:29:01 +00:00
Enji Cooper
7f9f802421 Remove unused variable (SRCDIR)
MFC after: 3 days
Sponsored by: EMC / Isilon Storage Division
2015-11-02 01:23:04 +00:00
Enji Cooper
c7f7fdd28b Remove unnecessary if (x) tests before calling free(x); free(3)
already employs this check

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2015-11-02 01:22:06 +00:00
Baptiste Daroussin
3c3feed41a Merge from head 2015-11-01 21:17:38 +00:00
Baptiste Daroussin
d8ed03efe5 locales: Fix eucJP sorting (broken upstream?)
Sorting eucJP text with "sort" resulted in an illegal sequence while
"gsort" worked.  This was traced back to mbrtowc handling which was
broken for eucJP (probably eucCN, eucKR, and eucTW as well).  This
small fix took hours to figure out.  The OR operation to build the
wide character requires an unsigned character to work correctly.  The
euc wcrtowc conversion is probably broken upstream in Illumos as well.

Triggered by: misc/freebsd-doc-ja in ports (encoded in eucJP)

Submitted by:	marino
Obtained from:	DragonflyBSD
2015-11-01 21:02:30 +00:00
Baptiste Daroussin
d79cdd21de libc: Fix (and improve) nl_langinfo (CODESET)
The output of "locale charmap" is identical to the result of
nl_langinfo (CODESET) for any given locale.  The logic for returning the
codeset was very simplistic.  It just returned portion of the locale name
after the period (e.g. en_FR.ISO8859-1 returned "ISO8859-1").

When softlinks were added to locales, this broke.  e.g.:
   en_US returned ""
   en_FR.UTF8 returned "UTF8"
   en_FR.UTF-8 returned "UTF-8"
   zh_Hant_HK.Big5HKSCS returned "Big5HKSCS"
   zh_Hant_TW.Big5 returned "Big5"
   es_ES@euro returned ""

In order to fix this properly, the named locale cannot be used to
determine the encoding.  This information was almost available in the
rune data.  Unfortunately, all the single byte encodings were listed
as "NONE" encoding.

So I adjusted localedef tool to provide more information about the
encoding.  For example, instead of "NONE", the LC_CTYPE used by
fr_FR.ISO8859-15 is now encoded as "NONE:ISO8859-15".  The locale
handlers now check if the first four characters of the encoding is
"NONE" and if so, treats it as a single-byte encoding.

The nl_langinfo handling of CODESET was adjusting accordingly.  Now the
following is returned:
   en_US returns "ISO8859-1"
   fr_FR.UTF8 returns "UTF-8"
   fr_FR.UTF-8 returns "UTF-8"
   zh_Hant_HK.Big5HKSCS returns "Big5"
   zh_Hant_TW.Big5 returns "Big5"
   es_ES@euro returns "ISO8859-15"

as before, "C" and "POSIX" locales return "US-ASCII".  This is a big
improvement.  The result of nl_langinfo can never be a zero-length
string and it will always exclusively one of the values of the
character maps of /usr/src/tools/tools/locale/etc/final-maps.

Submitted by:	marino
Obtained from:	DragonflyBSD
2015-11-01 12:00:55 +00:00
Andrey A. Chernov
190d73a757 Microoptimize. 2015-11-01 08:40:15 +00:00
Andrey A. Chernov
4fe4a788af Addition to prev. commit.
In some edge cases fp->_p can be changed in _sseek(), recalculate.

PR:     204156
MFC after:      1 week
2015-11-01 06:47:05 +00:00
Andrey A. Chernov
ec6cd152cb Don't seek to the end if write buffer is empty (in append modes).
PR:             204156
MFC after:      1 week
2015-11-01 06:15:14 +00:00