aboutsummaryrefslogtreecommitdiff
path: root/lib/libnv/msgio.c
Commit message (Collapse)AuthorAgeFilesLines
* lib: Automated cleanup of cdefs and other formattingWarner Losh2023-11-271-1/+0
| | | | | | | | | | | | | | | | Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row. Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/ Sponsored by: Netflix
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* libnv: let nvlist_recv() pass flags to recv()Robert Wing2021-12-061-2/+2
| | | | Differential Revision: https://reviews.freebsd.org/D32721
* Use a platform-independent constant for PKG_MAX_SIZE.Mark Johnston2019-07-161-1/+7
| | | | | | | | | | | | | | | | | | This constant determines the number of rights libnv will attempt to transmit in a given control message. In practice, the upper limit defined by the kernel is machine-dependent and is smaller on 64-bit kernels than on 32-bit kernels. To ensure that a 32-bit libnv works as expected when run on a 64-bit kernel, use a limit that will work on both 32-bit and 64-bit kernels. PR: 238511 Discussed with: oshogbo MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D20942 Notes: svn path=/head/; revision=350054
* libnv: add support for nvlist_send()/nvlist_recv() on LinuxMariusz Zaborski2019-04-151-43/+41
| | | | | | | | | | This may be useful for cross build in the feature. Submitted by: Mindaugas Rasiukevicius <rmind@noxt.eu> MFC after: 2 weeks Notes: svn path=/head/; revision=346218
* Allow bootstrapping libnv on macOS and LinuxAlex Richardson2018-12-141-0/+9
| | | | | | | | | | | | MacOS/Linux do not define struct cmsgcred but we need to bootstrap libnv when building on non-FreeBSD systems. Since they are not used during bootstrap we can just omit these two functions there. Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D18472 Notes: svn path=/head/; revision=342101
* Ensure that libnv can be used when kern.trap_enotcap=1.Mark Johnston2018-11-131-5/+0
| | | | | | | | | | | | | | | | | | | libnv used fcntl(fd, F_GETFL) to test whether fd is a valid file descriptor. Aside from being racy, this check requires CAP_FCNTL rights on fd. Instead, use fcntl(fd, F_GETFD), which does not require any capability rights. Also remove some redundant fd_is_valid() checks to avoid extra system calls; in many cases we were performing this check immediately before dup()ing the descriptor. Reviewed by: cem, oshogbo (previous version) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17963 Notes: svn path=/head/; revision=340408
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-261-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326219
* Remove redundant initialization. Don't use variable - just return the value.Mariusz Zaborski2017-09-211-1/+0
| | | | | | | | | | | | Make scan-build happy by casting to 'void *' instead of 'void **'. Submitted by: pjd@ MFC after: 1 month Found by: scan-build and cppcheck Sponsored by: Wheel Systems Notes: svn path=/head/; revision=323851
* Remove the limit on descriptors that can be send in one nvlist.Pawel Jakub Dawidek2014-09-141-17/+96
| | | | | | | Submitted by: Mariusz Zaborski Notes: svn path=/head/; revision=271578
* Assert input arguments to buf_send() and buf_recv().Pawel Jakub Dawidek2014-02-021-0/+7
| | | | | | | Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org> Notes: svn path=/head/; revision=261408
* Fix sending empty nvlist.Pawel Jakub Dawidek2014-02-021-2/+2
| | | | | | | Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org> Notes: svn path=/head/; revision=261407
* MFp4 @1189139:Pawel Jakub Dawidek2013-12-151-24/+0
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=259430
* Bring in libnv library for managing name/value pairs. The following typesPawel Jakub Dawidek2013-11-121-0/+407
are currently supported: - NV_TYPE_NULL - only name, no data; - NV_TYPE_BOOL - boolean (true or false); - NV_TYPE_NUMBER - 64bit unsigned integer; - NV_TYPE_STRING - C string; - NV_TYPE_NVLIST - nested nvlist; - NV_TYPE_DESCRIPTOR - file descriptor; - NV_TYPE_BINARY - binary data. For detailed documentation and examples see nv(3) manual page. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=258065