337561 |
10-Aug-2018 |
kevans |
MFC r337549: libnv: Remove -I${SRCTOP}/sys
This should have been done as part of r336019 -- including ${SRCTOP}/sys is not a good business model for something that's build in legacy/bootstrap stages.
Beyond that, libnv seems to build quite alright as legacy, part of buildworld, and standalone without. Axe it.
Approved by: re (bdrewery) |
336346 |
16-Jul-2018 |
kevans |
MFC r304910, r304912, r304915, r304952, r325019, r328164, r331094, r332664, r335341-r335345, r335347, r335379-r335380, r335382
r304910: Introduce cnv man page.
r304912: Add missed header file for cnv.h .
r304915: Bump date in the man page.
r304952: Remove duplicated declaration.
r325019: Introduce cnvlist_name() and cnvlist_type() functions.
Those function can be used when we are iterating over nvlist to reduce amount of extra variables we need to declare.
r328164: libnv: Use mallocarray(9) for the nv_calloc.
r331094: Fix formatting errors that resulted in apropos(1) output looking weird.
r332664: Add missing argument in the cnv man page.
r335341: libnv: change name of cookie from cookiep to cookie.
The name was inconsistent with rest of the library. No functional change intended.
r335342: libnv: add const to cookies arguments
r335343: libnv: Remove nvlist argument from cnvlist_{take,free}_* functions.
All information which are need for those operations is already stored in the cookie.
We decided not to bump libnv version because this API is not used yet in the base system.
r335344: libnv: clean parent in nvlist_array when removing it.
When we are removing element form the nvlist we should also clean parent, because the array is not a part of the nvlist anymore.
r335345: libnv: add regression test for r335344.
r335347: libnv: Add nvlist_append_*_array() family of functions.
The nvlist_append_{bool,number,string,nvlist,descriptor}_array() functions allows to dynamically extend array stored in the nvlist.
r335379: Set prev to NULL so its garaunteed to have a value of some kind and gcc doesn't explode. Feel free to fix this correctly or whatever for gcc builds.
This *should* quiesce tinderbox after r335347 for the gcc builds.
r335380: style(9) fix, I was also going to silence gcc.
r335382: Really fix the style. |
299094 |
04-May-2016 |
ngie |
Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed after r298107
Summary of changes:
- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)
Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info.
MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
|
298107 |
16-Apr-2016 |
gjb |
Merge the projects/release-pkg branch to head.
This allows packaging the base system with pkg(8), including but not limited to providing the ability to provide upstream binary update possibilities for non-tier-1 architectures.
This merge is a requirement of the 11.0-RELEASE, and as such, thank you to everyone that has tested the project branch.
Documentation in build(7) etc. is still somewhat sparse, but updates to those parts will follow.
Sponsored by: The FreeBSD Foundation
|
293130 |
04-Jan-2016 |
ngie |
Rename nitems and string variables to avoid collisions
Rename the `nitems` variable to `num_items` to avoid collisions with the macro in sys/param.h for counting elements in an array
Similarly, rename `string` to `string_arr` to avoid future collisions with potential keywords, as well as make it clear that `string_arr` isn't a char* value, but instead a char** value.
Differential Revision: https://reviews.freebsd.org/D4769 (part of larger diff) MFC after: 5 days Reviewed by: oshogbo Sponsored by: EMC / Isilon Storage Division
|
286796 |
15-Aug-2015 |
oshogbo |
Add support for the arrays in nvlist library.
- Add nvlist_{add,get,take,move,exists,free}_{number,bool,string,nvlist, descriptor} functions. - Add support for (un)packing arrays. - Add the nvl_array_next field to the nvlist structure. If an array is added by the nvlist_{move,add}_nvlist_array function this field will contains next element in the array. - Add the nitems field to the nvpair and nvpair_header structure. This field contains number of elements in the array. - Add special flag (NV_FLAG_IN_ARRAY) which is set if nvlist is a part of an array. - Add special type (NV_TYPE_NVLIST_ARRAY_NEXT).This type is used only on packing/unpacking. - Add new API for traversing arrays (nvlist_get_array_next). - Add the nvlist_get_pararr function which combines the nvlist_get_array_next and nvlist_get_parent functions. If nvlist is in the array it will return next element from array. If nvlist is last element in array or it isn't in array it will return his container (parent). This function should simplify traveling over nvlist. - Add tests for new features. - Add documentation for new functions. - Add my copyright. - Regenerate the sys/cddl/compat/opensolaris/sys/nvpair.h file.
PR: 191083 Reviewed by: allanjude (doc) Approved by: pjd (mentor)
|
282346 |
02-May-2015 |
oshogbo |
Approved, oprócz użycie RESTORE_ERRNO() do ustawiania errno.
Change the nvlist_recv() function to take additional argument that specifies flags expected on the received nvlist. Receiving a nvlist with different set of flags than the ones we expect might lead to undefined behaviour, which might be potentially dangerous.
Update consumers of this and related functions and update the tests.
Approved by: pjd (mentor)
Update man page for nvlist_unpack, nvlist_recv, nvlist_xfer, cap_recv_nvlist and cap_xfer_nvlist.
Reviewed by: AllanJude Approved by: pjd (mentor)
|
282257 |
29-Apr-2015 |
oshogbo |
Remove the nvlist_.*[fv] functions.
Those functions are problematic, because there is no way to report memory allocation problems without complicating the API, so we can either abort or potentially return invalid results. None of which is acceptable.
In most cases the caller knows the size of the name, so he can allocate buffer on the stack and use snprintf(3) to prepare the name.
After some discussion the conclusion is to removed those functions, which also simplifies the API.
Discussed with: pjd, rstone Approved by: pjd (mentor)
|
279435 |
01-Mar-2015 |
rstone |
Don't allocate memory for operations that do not insert
Almost every operation performed on an nvlist was allocating a new string to hold the key name. The nvlist_exists* family of functions would always return false if they failed to allocate the string. The rest of the functions would outright abort(). Fix the non-varargs variants of the functions to perform the requested operations directly and the varargs versions to allocate the string and call into the non-varargs versions. The varargs versions are still broken and really can't be fixed, so we might consider axing them entirely. However, now the non- varargs functions are always safe to call.
Differential Revision: https://reviews.freebsd.org/D1879 Reviewed by: pjd, jfv MFC after: 1 month Sponsored by: Sandvine Inc.
|
277920 |
30-Jan-2015 |
pjd |
If moving descriptor or binary data to an nvlist fails, we need to close the descriptor or free the memory before returning.
Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org>
While here, protect errno, so it won't be overwritted by close(2) or free(3).
|
259430 |
15-Dec-2013 |
pjd |
MFp4 @1189139:
Get rid of the msg_peek() function, which has a problem. If there was less data in the socket buffer than requested by the caller, the function would busy loop, as select(2) will always return immediately.
We can just receive nvlhdr now, because some time ago we splitted receive of data from the receive of descriptors.
MFC after: 1 week
|