Commit Graph

2858 Commits

Author SHA1 Message Date
Jilles Tjoelker
7a3000699c sh: Add tests for 'local -' (save shell options). 2013-06-15 22:22:03 +00:00
Eitan Adler
1cbff2a999 Remove CVS from the base system.
Discussed with:	many
Reviewed by:	peter, zi
Approved by:	core
2013-06-15 20:29:07 +00:00
Adrian Chadd
67a6ee573d Link the AR9300 EEPROM dump tool into the build. 2013-06-14 08:12:54 +00:00
Adrian Chadd
4c8f505c3f Begin fleshing out an AR9300 EEPROM dump helper utility. 2013-06-14 08:12:40 +00:00
Adrian Chadd
4cfeefe1c7 Add missing formatting strings.
Thanks to: clang
2013-06-14 08:11:45 +00:00
Ed Maste
e60c420fa3 Use portable string comparison
We support == in /bin/sh now, but it ought to be avoided, and my use of
it was accidental.
2013-06-13 13:05:08 +00:00
Ed Maste
f506e293ab Handle options that override other options
This is a workaround for WITH_LDNS_UTILS forcing BIND_UTILS off.  It can
be reverted when we no longer have these conflicting options, or made more
general if we grow more cases like this.
2013-06-10 13:55:03 +00:00
David Schultz
7a62fe0f3e Fix some bugs in the complex trig tests so that they test both double
and float precision properly.
2013-06-10 06:03:03 +00:00
Glen Barber
01bb862861 Add freebsd-update.conf(5) to OptionalObsoleteFiles.inc
PR:		179437
Approved by:	kib (mentor)
MFC after:	1 week
2013-06-09 06:13:51 +00:00
Ed Schouten
17b945433d Add testing utility for behavior of atomic ops.
This small utility performs a sequence of atomic operations with random
parameters on an atomic variable. For every type, we also create 16
variables, to ensure that we test the correctness at different
alignments.
2013-06-08 22:44:49 +00:00
Ed Maste
42f8c5b580 Add a new knob WITH_DEBUG_FILES to control the building of standalone
debug files for userland programs and libraries.  The "-g" debug flag
is automatically applied when WITH_DEBUG_FILES is set.

The debug files are now named ${prog}.debug and ${shlib}.debug for
consistency with other systems and documentation.  In addition they are
installed under /usr/lib/debug, to simplify the process of installing
them if needed after a crash.  Users of bsd.{prog,lib}.mk outside of the
base system place the standalone debug files in a .debug subdirectory.
GDB automatically searches both of these directories for standalone
debug files.

Thanks to everyone who contributed changes, review, and testing during
development.
2013-06-07 21:40:02 +00:00
Ed Maste
371df6c6ad Switch to 2-clause license and standard text
Approved by:	bms@
2013-06-06 21:09:27 +00:00
Jilles Tjoelker
79b1d31887 sh: Return status 127 for unknown jobs in wait builtin.
This is required by POSIX, at least for pids that are not known child
processes.

Other problems with job specifications still cause wait to abort with
exit status 2.

PR:		176916
2013-06-05 19:40:52 +00:00
Jilles Tjoelker
a4099656c3 sh: Allow multiple operands in wait builtin.
This is only part of the PR; the behaviour for unknown/invalid pids/jobs
remains unchanged (aborts the builtin with status 2).

PR:		176916
Submitted by:	Vadim Goncharov
2013-06-05 19:08:22 +00:00
Luigi Rizzo
b303f675df new features (mostly for testing netmap capabilities)
+ pkt-gen -f rx now remains active even when traffic stops
  Previous behaviour (exit after 1 second of silence) can be
  restored with the -W option

+ the -X option does a hexdump of the content of a packet (both tx and rx).
  This can be useful to check what goes in and out.

+ the -I option instructs the sender to use indirect buffers
  (not really useful other than to test the kernel module in the
  VALE switch)
2013-06-05 17:37:59 +00:00
Adrian Chadd
2cdc5a48f6 Add RX STBC statistics. 2013-06-04 23:52:57 +00:00
David E. O'Brien
f9d4b3926a Match the options of the kernel. 2013-06-04 06:38:01 +00:00
Ed Schouten
49111f0092 Add libiconv based versions of *c16*() and *c32*().
I initially thought wchar_t was locale independent, but this seems to be
only the case on Linux. This means that we cannot depend on the *wc*()
routines to implement *c16*() and *c32*(). Instead, use the Citrus
libiconv that is part of libc.

I'll see if there is anything I can do to make the existing functions
somewhat useful in case the system is built without libiconv in the
nearby future. If not, I'll simply remove the broken implementations.

Reviewed by:	jilles, gabor
2013-06-03 17:17:56 +00:00
David Schultz
8ffb5b838e Add more tests for log functions. A few are commented out because the
long double versions don't pass yet.  (They are rather nit-picky cases,
so there's ongoing discussion with Bruce about whether it is worth the
performance cost.)
2013-06-03 09:15:15 +00:00
David Schultz
45de1d006d Factor out some common code from the libm tests. This is a bit messy
because different tests have different ideas about what it means to be
"close enough" to the right answer, depending on the properties of the
function being tested.  In the process, I fixed some warnings and
added a few more 'volatile' hacks, which are sufficient to make all
the tests pass at -O2 with clang.
2013-06-02 04:30:03 +00:00
Mark Johnston
1e86bf67f5 This test is working now, so remove it from NOTWORK. 2013-06-02 01:07:38 +00:00
Jilles Tjoelker
f19825af72 test: Remove -ntXY and -otXY primaries.
This reverts commit r247274.

As maintainer of sh, I disapprove of this feature addition.

It is too specific and can be done without easily using find(1) or stat(1).
I will add some hints to the test(1) man page shortly.

In general, FreeBSD sh is not the place to invent new shell language
features. This is how it has been maintained and adding features randomly
does not work with that.

The new syntax (e.g. [ FILE1 -ntca FILE2 ]) looks cryptic to me.
2013-05-31 22:54:20 +00:00
Jilles Tjoelker
0fbff2deb9 sh: Add test cases for break outside a loop.
In most shells (including our sh), break outside a loop does nothing with
status 0, or at least does not abort. Therefore, scripts sometimes (buggily)
depend on this.
2013-05-31 14:45:25 +00:00
David E. O'Brien
85325f8942 Different approach to making all compilers happy. 2013-05-31 04:27:41 +00:00
David E. O'Brien
7b45e382d0 Allow building with clang (which is being really stupid here...). 2013-05-31 04:19:13 +00:00
Luigi Rizzo
f18be5766f Bring in a number of new features, mostly implemented by Michio Honda:
- the VALE switch now support up to 254 destinations per switch,
  unicast or broadcast (multicast goes to all ports).

- we can attach hw interfaces and the host stack to a VALE switch,
  which means we will be able to use it more or less as a native bridge
  (minor tweaks still necessary).
  A 'vale-ctl' program is supplied in tools/tools/netmap
  to attach/detach ports the switch, and list current configuration.

- the lookup function in the VALE switch can be reassigned to
  something else, similar to the pf hooks. This will enable
  attaching the firewall, or other processing functions (e.g. in-kernel
  openvswitch) directly on the netmap port.

The internal API used by device drivers does not change.

Userspace applications should be recompiled because we
bump NETMAP_API as we now use some fields in the struct nmreq
that were previously ignored -- otherwise, data structures
are the same.

Manpages will be committed separately.
2013-05-30 14:07:14 +00:00
Luigi Rizzo
1cb4c501ae add support for rate-limiting in the sender (-R ...)
Obtained from:	Giuseppe Lettieri
2013-05-30 11:10:42 +00:00
Luigi Rizzo
0dea02f39e add a compile-time option to copy packets instead of doing
the buffer swapping.
2013-05-30 11:09:41 +00:00
Luigi Rizzo
00c2805055 remove use of deprecated ioctl() 2013-05-30 11:08:16 +00:00
David Schultz
6bba248bee Fix some harmless bugs in a test. 2013-05-30 04:47:03 +00:00
David Schultz
659a67c641 Basic tests for complex inverse trig and hyperbolic functions. 2013-05-30 04:46:36 +00:00
Joel Dahl
1d1f5c6b8e mdoc: silence a few mandoc lint warnings. 2013-05-28 09:33:46 +00:00
Tijl Coosemans
9bea689e8b Fix cexp regression tests that have an infinite real part. The signs of the
result depend on the cosine and sine of the imaginary part.
Small values are used in the new tests such that cosine and sine are well
defined.

Reviewed by:	das
2013-05-28 08:50:50 +00:00
David Schultz
7dbbb6dde3 Fix some regressions caused by the switch from gcc to clang. The fixes
are workarounds for various symptoms of the problem described in clang
bugs 3929, 8100, 8241, 10409, and 12958.

The regression tests did their job: they failed, someone brought it
up on the mailing lists, and then the issue got ignored for 6 months.
Oops. There may still be some regressions for functions we don't have
test coverage for yet.
2013-05-27 08:50:10 +00:00
Ed Schouten
5f4cd89cce Add missing #includes, to keep Clang silent. 2013-05-25 18:04:24 +00:00
Adrian Chadd
d2e0ac3c78 Implement beacon event debugging in athalq. 2013-05-22 01:03:41 +00:00
Ed Schouten
50c77c6e8b Add <uchar.h>.
The <uchar.h> header, part of C11, adds a small number of utility
functions for 16/32-bit "universal" characters, which may or may not be
UTF-16/32. As our wchar_t is already ISO 10646, simply add light-weight
wrappers around wcrtomb() and mbrtowc().

While there, also add (non-yet-standard) _l functions, similar to the
ones we already have for the other locale-dependent functions.

Reviewed by:	theraven
2013-05-21 19:59:37 +00:00
Xin LI
b8a8e6e450 BMAKE is now being built by default. 2013-05-21 00:41:49 +00:00
Brooks Davis
6893d87392 Cleanups and markup improvements suggested by trociny and joel. 2013-05-20 20:32:58 +00:00
Jilles Tjoelker
e9dec7758d popen(): Add 'e' mode character to set close-on-exec on the new fd.
If 'e' is used, the kernel must support the recently added pipe2() system
call.

The use of pipe2() with O_CLOEXEC also fixes race conditions between
concurrent popen() calls from different threads, even if the close-on-exec
flag on the fd of the returned FILE is later cleared (because popen() closes
all file descriptors from earlier popen() calls in the child process).
Therefore, this approach should be used in all cases when pipe2() can be
assumed present.

The old version of popen() rejects "re" and "we" but treats "r+e" like "r+".
2013-05-20 17:31:18 +00:00
Jilles Tjoelker
86b75745ad Add a test program for popen(). 2013-05-20 13:05:51 +00:00
Joel Dahl
7a019d4487 Minor mdoc improvements. 2013-05-16 20:55:20 +00:00
Brooks Davis
561e967f2f Add a sample script to create filesystem images from an installed tree
created by installworld+distribution with the -DNO_ROOT option.
2013-05-16 14:38:12 +00:00
Brooks Davis
a09aff8343 Add support for an external cross compiler. The cross compiler is
specified by passing the XCC, XCXX, and XCPP variables (corresponding to
CC, CXX, and CPP) to buildworld/buildkernel.  The compiler must be clang
or be configured to target the appropriate architecture.

To speed build times, if XCC is an absolute path or
WITHOUT_CROSS_COMPILER is defined then no cross compiler will be built
during the cross-tools stage.

Limited documentation of this feature can currently be found at:

https://wiki.freebsd.org/ExternalToolchain

This functionality should be considered experimental and is subject to
change without notice.

Sponsored by:	DARPA, AFRL
Discussed with:	imp, sjg
2013-05-15 14:30:03 +00:00
Brooks Davis
a5b2b29fe1 Add a new option WITHOUT_FORMAT_EXTENSIONS to disable flags related to
checking our kernel printf extensions.  This is useful to allow
compilers without these extensions to build kernels.

Sponsored by:	DARPA, AFRL
2013-05-15 13:04:10 +00:00
Hiren Panchasara
05864d89d1 As python3 does not have raw_input(), convert it to input() when we
are using python3.

PR:	177214
Reviewed by:	gnn
Approved by:	sbruno (mentor)
2013-05-13 19:53:19 +00:00
Peter Wemm
dda759d344 Tidy up some CVS workarounds. 2013-05-12 01:53:47 +00:00
Eitan Adler
2b3b363780 Unconditionally install 210.backup-aliases as many MTAs other than
sendmail support the use of /etc/aliases.

PR:		conf/176098
Submitted by:	ak
MFC after:	2 weeks
2013-05-11 23:55:43 +00:00
Jilles Tjoelker
60bf56fd82 Add simple testcases for fcntl(F_DUP2FD_CLOEXEC). 2013-05-11 22:13:24 +00:00
Jilles Tjoelker
7a1a8a4243 Add simple testcases for fcntl(F_DUPFD_CLOEXEC). 2013-05-11 16:31:41 +00:00
Jilles Tjoelker
316ed7ca36 Add missing argument to fcntl(F_DUPFD) in regression test. 2013-05-11 15:45:44 +00:00
Adrian Chadd
14a75019c2 Add the AR9300 descriptor decoding code. 2013-05-05 09:38:25 +00:00
Adrian Chadd
443db1d0c5 This is a simple script to output the delta between each TX and TXSTATUS.
Useful for debugging TDMA.
2013-05-05 09:38:02 +00:00
Stefan Farfeleder
cd5810229d Add a few xargs tests related to -0, -n and quoting. 2013-05-04 16:41:14 +00:00
Jilles Tjoelker
14303aa889 sh: Remove racy test case for read builtin.
This test case sometimes fails because of an EINTR-related race condition.
Fixing this race condition likely requires an extra system call per byte,
which would make the read builtin even slower than it already is, or very
complicated trickery. Therefore, remove the test case for now.
2013-05-03 20:39:53 +00:00
Jilles Tjoelker
c4539460e3 sh: Improve error handling in read builtin:
* If read -t times out, return status as if interrupted by SIGALRM
  (formerly 1).
* If a trapped signal interrupts read, return status 128+sig (formerly 1).
* If [EINTR] occurs but there is no trap, retry the read (for example
  because of a SIGWINCH in interactive mode).
* If a read error occurs, write an error message and return status 2.

As before, a variable assignment error returns 2 and discards the remaining
data read.
2013-05-03 15:28:31 +00:00
Luigi Rizzo
eb41b16f81 sync with my local copy (this file may go away, eventually) 2013-04-30 13:13:32 +00:00
Nick Hibma
fcb107b9a6 Replace a silly command sequence with a proper if-then-else.
Generate images sparsely. This saves space and time, especially when
generating images inside a VM (PR 173482).
Add a 'true' statement to last_orders to prevent some version of sh from
tripping over an empty function.
2013-04-28 22:12:40 +00:00
Nick Hibma
2b235be6d3 Doing a cpio from /var/empty if dir was not specified or non-existent
copies its mode to the destination. This is not desirable.
Rephrase this code to be more sensible.

PR:		173483
MFC after:	1 week
2013-04-28 21:44:44 +00:00
Eitan Adler
b4634967f0 When the world is built WITHOUT_OPENSSH also don't
install ssh-copy-id.

PR:		misc/177590
Submitted by:	Oleg Ginzburg <olevole@olevole.ru>
Reviewed by:	imp
2013-04-28 17:58:11 +00:00
Eitan Adler
ec8025b5e2 Add a comma to satisfy Igor. 2013-04-27 04:09:09 +00:00
Eitan Adler
850163e4ed Remove IDEA from OptionalObsoleteFiles.inc
Also add an UPDATING entry (requsted by gjb)
2013-04-27 00:03:07 +00:00
Eitan Adler
4e3b8d2037 Remove the WITH_IDEA option and build it unconditionally.
The European version of the patent expired in 2011.
The US version of the patent expired in 2012 or prior.

Reviewed by:	des
No objection from:	cperciva, ehaupt
2013-04-26 23:24:41 +00:00
Pawel Jakub Dawidek
849c495c94 Style cleanups. 2013-04-17 21:08:18 +00:00
Gabor Kovesdan
84a17a97ce - Correct mispellings of word and
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
2013-04-17 11:48:46 +00:00
Gabor Kovesdan
ab3f6b347e - Correct mispellings of the word occurrence
Submitted by:	Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
2013-04-17 11:40:10 +00:00
Sergey Kandaurov
5911f5a7fa Fix build.
- pass a format string to printf
- catch up with constifying uz_name

MFC after:	3 days
2013-04-12 21:29:37 +00:00
Dimitry Andric
139f7f9bf5 Upgrade our copy of llvm/clang to trunk r178860, in preparation of the
upcoming 3.3 release (branching and freezing expected in a few weeks).

Preliminary release notes can be found at the usual location:
<http://llvm.org/docs/ReleaseNotes.html>

An MFC is planned once the actual 3.3 release is finished.
2013-04-12 17:57:40 +00:00
Jilles Tjoelker
6e0f89a4b4 sh: Don't modify exit status when break/continue/return passes !.
This matches what would happen if  ! P  were to be replaced with
if P; then false; else true; fi.

Example:
  f() { ! return 0; }; f
2013-04-12 15:19:35 +00:00
Navdeep Parhar
e22981b241 Set and display the IP fragment bit correctly when dealing with
the filter mode.

MFC after:	3 days.
2013-04-11 16:50:58 +00:00
Dimitry Andric
809500fc2c Vendor import of clang trunk r178860:
http://llvm.org/svn/llvm-project/cfe/trunk@178860
2013-04-08 18:45:10 +00:00
Dimitry Andric
4a16efa3e4 Vendor import of llvm trunk r178860:
http://llvm.org/svn/llvm-project/llvm/trunk@178860
2013-04-08 18:41:23 +00:00
Jilles Tjoelker
87887877ec sh: Add a variation on builtins/eval4.0 where the cmdsubst returns 0. 2013-04-06 22:30:46 +00:00
Jilles Tjoelker
70d41b5846 wordexp(): Remove wrong IFS usage.
Words in shell script are separated by spaces or tabs independent of the
value of IFS. The value of IFS is only relevant for the result of
substitutions. Therefore, there should be a space between 'wordexp' and the
words to be expanded, not an IFS character.

Paranoia might dictate that the shell ignore IFS from the environment (even
though our sh currently uses it), so do not depend on it in the new test
case.
2013-04-01 20:50:07 +00:00
Navdeep Parhar
d14b0ac129 cxgbe(4): Add support for Chelsio's Terminator 5 (aka T5) ASIC. This
includes support for the NIC and TOE features of the 40G, 10G, and
1G/100M cards based on the T5.

The ASIC is mostly backward compatible with the Terminator 4 so cxgbe(4)
has been updated instead of writing a brand new driver.  T5 cards will
show up as cxl (short for cxlgb) ports attached to the t5nex bus driver.

Sponsored by:	Chelsio
2013-03-30 02:26:20 +00:00
Rene Ladan
a8a703a228 Properly spell "Class Based Queueing"
PR:		www/177412
Submitted by:	Oliver Loch <grimeton@gmx.net>
Approved by:	cognet
2013-03-27 15:10:40 +00:00
Gleb Kurtsou
a1897c0cf6 Add shlib-compat under tools.
shlib-compat is ABI compatibility checker for shared libraries with
symbol versioning.
2013-03-25 00:31:14 +00:00
Adrian Chadd
8e787d67be More indentation fixes. 2013-03-23 23:27:16 +00:00
Adrian Chadd
d90b001e03 Expose the beacon miss counter. 2013-03-23 23:20:38 +00:00
Adrian Chadd
d18e646cbe Add AR9300 descriptor decoding. 2013-03-23 01:25:11 +00:00
Pawel Jakub Dawidek
ff96467412 Update regression tests after adding chflagsat(2).
Sponsored by:	The FreeBSD Foundation
2013-03-21 23:07:04 +00:00
Pawel Jakub Dawidek
b4b2596b97 - Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of type
u_long. Before this change it was of type int for syscalls, but prototypes
  in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not
  for lchflags(2)) stated that it was u_long. Now some related functions
  use u_long type for flags (strtofflags(3), fflagstostr(3)).
- Make path argument of type 'const char *' for consistency.

Discussed on:	arch
Sponsored by:	The FreeBSD Foundation
2013-03-21 22:44:33 +00:00
Neel Natu
7778bd576f Set WARNS=3 so this actually compiles. 2013-03-20 21:47:05 +00:00
Pawel Jakub Dawidek
b48fdae147 Update the tests now that absence of the O_APPEND flag requires CAP_SEEK
capability. Add some more tests.

Sponsored by:	The FreeBSD Foundation
2013-03-16 23:13:49 +00:00
Pawel Jakub Dawidek
ac978022d3 The mode argument for open(2)/openat(2) only makes sense if the O_CREAT flag
was given.

Sponsored by:	The FreeBSD Foundation
2013-03-16 23:10:40 +00:00
Jilles Tjoelker
d70ad6f2d0 sh: Recognize "--" and explicitly reject options in wait builtin.
If syntactically invalid job identifiers are to be taken as jobs that exited
with status 127, this should not apply to options, so that we can add
options later if need be.
2013-03-15 20:29:31 +00:00
Pawel Jakub Dawidek
374b056ce8 Make file name generation to work with both new and old versions of OpenSSL.
Sponsored by:	The FreeBSD Foundation
2013-03-15 00:10:38 +00:00
Navdeep Parhar
144d9d11b8 Fix compile warning by including ctype.h for isdigit().
MFC after:	1 day
2013-03-05 19:37:29 +00:00
Baptiste Daroussin
e51c53f366 Import libyaml as libbsdyml (private brand name)
LibYAML is a YAML 1.1 parser and emitter under MIT license which will
soon be used by the pkg boostrap (usr.bin/pkg) and bhyve

Reviewed by:	roberto, antoine
2013-03-04 11:27:41 +00:00
Jilles Tjoelker
3fe1119f98 sh: When executing a trap, keep exit status along with evalskip.
This ensures 'return' in a trap returns the correct status to the caller.

If evalskip is not set or if it is overridden by a previous evalskip, keep
the old behaviour of restoring the exit status from before the trap.
2013-03-03 17:33:59 +00:00
Pawel Jakub Dawidek
2328a74aa8 If all ioctls are allowed, cap_ioctls_get(2) will return CAP_IOCTLS_ALL.
Update regression tests.
2013-03-02 23:40:42 +00:00
Pawel Jakub Dawidek
7099ae5f3d Add support for bindat(2) and connectat(2).
Sponsored by:	The FreeBSD Foundation
2013-03-02 21:16:40 +00:00
Pawel Jakub Dawidek
de50394176 Add regression tests for the new Capsicum system calls.
Sponsored by:	The FreeBSD Foundation
2013-03-02 01:00:26 +00:00
Pawel Jakub Dawidek
f29088987a Update existing regression tests after Capsicum overhaul. 2013-03-02 00:56:53 +00:00
John-Mark Gurney
80ff58b89d fix this script so we don't expand the second $FreeBSD since svn thinks
the $ in $1 ends the keyword, and expands it...
2013-02-27 19:59:58 +00:00
John Baldwin
9240031ac6 Add an implementation of open_memstream() and open_wmemstream(). These
routines provide write-only stdio FILE objects that store their data in a
dynamically allocated buffer.  They are a string builder interface somewhat
akin to a completely dynamic sbuf.

Reviewed by:	bde, jilles (earlier versions)
MFC after:	1 month
2013-02-27 19:50:46 +00:00
Peter Jeremy
293beebc46 Enhance test(1) by adding provision to compare any combination of the
access, birth, change and modify times of two files, instead of only
being able to compare modify times.  The builtin test in sh(1) will
automagically acquire the same expansion.

Approved by:	grog
MFC after:	2 weeks
2013-02-25 19:05:40 +00:00
Jilles Tjoelker
25e0f0f577 sh: If a SIGINT or SIGQUIT interrupts "wait", return status 128+sig. 2013-02-23 22:50:57 +00:00
Jilles Tjoelker
57f00aa510 sh: Test that the exit status is 1 if read encounters EOF. 2013-02-23 15:15:41 +00:00
Adrian Chadd
b5a44455d6 Print out the RTS/CTS rate in the TX descriptor. 2013-02-19 06:42:12 +00:00