summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Create a separate script to generate osreldate.h rather than sourcingian2013-09-212-13/+59
| | | | | | | | | | | | | | | | | newvers.sh into a temporary subshell with inline make rules. Using a separate script fixes a variety of problems, including establishing the correct dependencies in the makefiles. It also eliminates a problem with the way newvers.sh uses `realpath $0`, because $0 expands differently within a script sourced into a rule in a makefile depending on the version of make and of /bin/sh being used. The latter can cause build breakage in a cross-build environment, and can also make it difficult to compile 10.0 on older pre-10.0 systems. PR: 160646 174422 Submitted by: Garrett Cooper <yaneurabeya@gmail.com> Approved by: re (gjb) MFC after: 2 weeks
* Assume that the -f argument is /dev/gpioc0 if it is not passed.sbruno2013-09-171-0/+1
| | | | | | | | hrs@ provided this verison of the patch and showed me where all the needed changes were to be made outside of gpioctl.c Approved by: re (hrs) MFC after: 2 weeks
* Fix the namespace pollution caused by iconv.h including stdbool.htheraven2013-09-061-2/+8
| | | | | This broke any C89 ports that defined bool themselves, including things like gcc, gtk, and so on.
* Implement fdclosedir(3) function, which is equivalent to the closedir(3)pjd2013-08-181-0/+1
| | | | | | | function, but returns directory file descriptor instead of closing it. Submitted by: Mariusz Zaborski <oshogbo@FreeBSD.org> Sponsored by: Google Summer of Code 2013
* Add dup3(), based on F_DUP2FD and F_DUP2FD_CLOEXEC fcntls.jilles2013-08-161-0/+1
| | | | | | | | I removed functionality not proposed for POSIX in Austin group issue #411. A man page (my own) and test cases will follow in later commits. PR: 176233 Submitted by: Jukka Ukkonen
* The iconv in libc did two things - implement the standard APIs, the GNUpeter2013-08-132-19/+40
| | | | | | | | | | | | | | | | | | | | | | | | extensions and also tried to be link time compatible with ports libiconv. This splits that functionality and enables the parts that shouldn't interfere with the port by default. WITH_ICONV (now on by default) - adds iconv.h, iconv_open(3) etc. WITH_LIBICONV_COMPAT (off by default) adds the libiconv_open etc API, linker symbols and even a stub libiconv.so.3 that are good enough to be able to 'pkg delete -f libiconv' on a running system and reasonably expect it to work. I have tortured many machines over the last few days to try and reduce the possibilities of foot-shooting as much as I can. I've successfully recompiled to enable and disable the libiconv_compat modes, ports that use libiconv alongside system iconv etc. If you don't enable the WITH_LIBICONV_COMPAT switch, they don't share symbol space. This is an extension of behavior on other system. iconv(3) is a standard libc interface and libiconv port expects to be able to run alongside it on systems that have it. Bumped osreldate.
* Add mkostemp() and mkostemps().jilles2013-08-091-0/+2
| | | | | These are like mkstemp() and mkstemps() but allow passing open(2) flags like O_CLOEXEC.
* stdlib.h: Add correct POSIX version for POSIX extensions to C.jilles2013-07-051-6/+8
|
* 1) POSIX requires rand(3) return values to be in the [0, RAND_MAX] range,ache2013-07-031-1/+1
| | | | | | | | | | | | | | | | but ACM formula we use have internal state (and return value) in the [1, 0x7ffffffe] range, so our RAND_MAX (0x7fffffff) is never reached because it is off by one, zero is not reached too. Correct both RAND_MAX and rand(3) return value, shifting last one to the 0 by 1 subtracted, resulting POSIXed [0, 0x7ffffffd(=new RAND_MAX)] range. 2) Add a checks for not overflowing on too big seeds. It may happens on the machines, where sizeof(unsigned int) > 32 bits. Reviewed by: bde [1] MFC after: 2 weeks
* Replace the #define for "iconv" so it is for the function name instead ofpeter2013-07-031-3/+3
| | | | | | a macro with parameters. Remove a __DECONST hack and add consts instead for gnu libiconv API compatability. This makes it work with things like devel/boost-libs that expects to use "iconv" as though it were a pointer.
* Fix gssapi/gssapi_krb5.h after Heimdal 1.5.1 import.hrs2013-06-301-0/+27
| | | | Reviewed by: dfr
* - Trim an unused and bogus Makefile for mount_smbfs.davide2013-06-281-2/+3
| | | | | | - Reconnect with some minor modifications, in particular now selsocket() internals are adapted to use sbintime units after recent'ish calloutng switch.
* - Add vnode-backed swap space specification support. This is enabled whenhrs2013-06-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | device names "md" or "md[0-9]*" and a "file" option are specified in /etc/fstab like this: md none swap sw,file=/swap.bin 0 0 - Add GBDE/GELI encrypted swap space specification support, which rc.d/encswap supported. The /etc/fstab lines are like the following: /dev/ada1p1.bde none swap sw 0 0 /dev/ada1p2.eli none swap sw 0 0 .eli devices accepts aalgo, ealgo, keylen, and sectorsize as options. swapctl(8) can understand an encrypted device in the command line like this: # swapctl -a /dev/ada2p1.bde - "-L" flag is added to support "late" option to defer swapon until rc.d/mountlate runs. - rc.d script change: rc.d/encswap -> removed rc.d/addswap -> just display a warning message if $swapfile is defined rc.d/swap1 -> renamed to rc.d/swap rc.d/swaplate -> newly added to support "late" option These changes alleviate a race condition between device creation/removal and swapon/swapoff. MFC after: 1 week Reviewed by: wblock (manual page)
* Move <stdatomic.h> into sys/sys/.ed2013-06-012-328/+3
| | | | | This will allow us to use C11 atomics in kernelspace, although it will need to be included as <sys/stdatomic.h>.
* Fix misspelling of structure field name.ed2013-05-311-1/+1
|
* I'm happy to finally commit stephen@'s implementations of cacos,das2013-05-301-0/+12
| | | | | | | | cacosh, casin, casinh, catan, and catanh. Thanks to stephen@ and bde@ for working on these. Submitted by: stephen@ Reviewed by: bde
* Make the malloc(3) family of functions weak and make their non-weakmarcel2013-05-251-0/+12
| | | | | | | | | | | | | | implementations visible for use by applications. The functions $F that are now weak symbols are: allocm, calloc, dallocm, free, malloc, malloc_usable_size, nallocm, posix_memalign, rallocm, realloc, sallocm The non-weak implementations of $F are exported as __$F. Submitted by: stevek@juniper.net Reviewed by: jasone@, kib@ Approved by: jasone@ (jemalloc) Obtained from: juniper Networks, Inc
* Add C11 macros CMPLX(), CMPLXF() and CMPLXL().ed2013-05-251-0/+12
| | | | | | Clang allows us to initialize complex numbers using an array initializer, casted to a complex type. GCC has a builtin called __builtin_complex().
* Fix <uchar.h> in for C++11.ed2013-05-251-3/+10
| | | | | | | | | | | It turns out that in C++11, char16_t and char32_t are built-in types; language keywords. Just fix this by putting traditional _*_T_DECLARED blocks around the definitions. We'll just predefine these in <sys/_types.h>. This also opens up the possibility to define char16_t in other header files, if ever needed (e.g. if we would gain a <ctype.h> for char16_t/char32_t).
* Add proper prerequisites for even two more headers.ed2013-05-211-1/+3
| | | | Spotted by: http://hacks.owlfolio.org/header-survey/
* Allow certain headers to be included more easily.ed2013-05-213-9/+13
| | | | Spotted by: http://hacks.owlfolio.org/header-survey/
* Add <uchar.h>.ed2013-05-215-4/+108
| | | | | | | | | | | | 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
* Add pipe2() system call.jilles2013-05-011-0/+1
| | | | | | | | | | | | | The pipe2() function is similar to pipe() but allows setting FD_CLOEXEC and O_NONBLOCK (on both sides) as part of the function. If p points to two writable ints, pipe2(p, 0) is equivalent to pipe(p). If the pointer is not valid, behaviour differs: pipe2() writes into the array from the kernel like socketpair() does, while pipe() writes into the array from an architecture-specific assembler wrapper. Reviewed by: kan, kib
* Enable improved <tgmath.h> for Clang even when not using C11.ed2013-04-271-1/+2
| | | | | | | | By using __has_extension(c_generic_selections), we can explicitly test whether we're dealing with a version of Clang that supports _Generic(). That way we can use the improved <tgmath.h> code, even when not using -std=c11. This massively reduces the compilation time when invoking these functions.
* - sl_find does not modify 'name'eadler2013-04-231-1/+1
| | | | | | | | - make the prototype of sl_find match NetBSD Reviewed by: jilles Approved by: cperciva (mentor) MFC After: 3 days
* - Correct mispellings of the word necessarygabor2013-04-171-1/+1
| | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail)
* Add static/const keywords to the arrays.ed2013-04-091-1/+3
| | | | | | | | | This theoretically allows a compiler to optimize (parts of) the array away if unused. While there, make the array size implicit and use a _Static_assert() to ensure that the definition matches up with the number of elements in the list.
* Add an implementation of open_memstream() and open_wmemstream(). Thesejhb2013-02-272-0/+2
| | | | | | | | | 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
* FreeBSD uses #if __BSD_VISIBLE to hide non-standard functions, fix this.zeising2013-02-141-1/+1
| | | | | Noticed by: kib Approved by: kib
* Add strchrnul(), a GNU function similar to strchr(), except that it returnszeising2013-02-131-0/+3
| | | | | | | a pointer to the end of the string, rather than NULL, if the character was not found. Approved by: theraven
* Install <dev/agp/agpreg.h> and <dev/pci/pcireg.h> as userland headersjhb2013-02-051-4/+21
| | | | | | in /usr/include. MFC after: 2 weeks
* Add fmemopen(3), an interface to get a FILE * from a buffer in memory, alonggahr2013-01-301-0/+1
| | | | | | | | with the respective regression test. See http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html Reviewed by: cognet Approved by: cognet
* MK_* variable should be compared to "no" not "NO".brooks2013-01-251-1/+1
| | | | Submitted by: "b.f." <bf1783@googlemail.com>
* Don't install telnet.h if it will be installed by libtelnet.brooks2013-01-241-1/+6
|
* Add CLOCK_PROCESS_CPUTIME_ID to <time.h>, to synchronize the CLOCK_*dim2013-01-141-0/+1
| | | | | | | | | values with those in <sys/time.h>. Otherwise, if a program includes <time.h> before <sys/time.h>, the CLOCK_PROCESS_CPUTIME_ID macro never gets defined. Reviewed by: davidxu X-MFC-With: 239347
* Replace our implementation of the vis(3) and unvis(3) APIs withbrooks2012-12-182-92/+4
| | | | | | | | | NetBSD's. This output size limited versions of vis and unvis functions as well as a set of vis variants that allow arbitrary characters to be specified for encoding. Finally, MIME Quoted-Printable encoding as described in RFC 2045 is supported.
* Add change missed in 243245.trasz2012-11-181-0/+1
|
* Use defined() to test macro definitions.demon2012-11-141-1/+1
| | | | Approved by: theraven
* Replace our version of the pwcache(3) API with NetBSD's implementation.brooks2012-10-192-0/+8
| | | | | | | | | This adds two features: * uid_from_user() and gid_from_group() as the reverse of user_from_uid() and groups_from_gid(). * pwcache_userdb() and pwcache_groupdb() which allow alternative lookup functions to be used. For example lookups from passwd and group databases in a non-standard location.
* Disconnect non-MPSAFE SMBFS from the build in preparation for droppingattilio2012-10-181-3/+2
| | | | | | | | | | | | | GIANT from VFS. In addition, disconnect also netsmb, which is a base requirement for SMBFS. In the while SMBFS regular users can use FUSE interface and smbnetfs port to work with their SMBFS partitions. Also, there are ongoing efforts by vendor to support in-kernel smbfs, so there are good chances that it will get relinked once properly locked. This is not targeted for MFC.
* Include a piece that was left out during r241629.attilio2012-10-171-1/+1
| | | | Pointy hat to: me
* Disconnect non-MPSAFE NTFS from the build in preparation for droppingattilio2012-10-171-1/+1
| | | | | | | | | | | | | | GIANT from VFS. This code is particulary broken and fragile and other in-kernel implementations around, found in other operating systems, don't really seem clean and solid enough to be imported at all. If someone wants to reconsider in-kernel NTFS implementation for inclusion again, a fair effort for completely fixing and cleaning it up is expected. In the while NTFS regular users can use FUSE interface and ntfs-3g port to work with their NTFS partitions. This is not targeted for MFC.
* Disconnect non-MPSAFE NWFS from the build in preparation for droppingattilio2012-10-171-6/+1
| | | | | | | | | | | | GIANT from VFS. In addition, disconnect also netncp, which is a base requirement for NWFS. In the possibility of a future maintenance of the code and later readd to the FreeBSD base, maybe we should think about a better location for netncp. I'm not entirely sure the / top location is actually right, however I will let network people to comment on that more specifically. This is not targeted for MFC.
* Disconnect non-MPSAFE PORTALFS from the build in preparation for droppingattilio2012-10-161-1/+1
| | | | | | GIANT from VFS. This is not targeted for MFC.
* rpc: convert all uid and gid variables to u_int.pfg2012-10-042-7/+7
| | | | | | | | | | | After further discussion, instead of pretending to use uid_t and gid_t as upstream Solaris and linux try to, we are better using u_int, which is in fact what the code can handle and best approaches the range of values used by uid and gid. Discussed with: bde Reviewed by: bde
* RPC: Convert all uid and gid variables of the type uid_t and gid_t.pfg2012-10-022-8/+7
| | | | | | | | This matches what upstream (OpenSolaris) does. Tested by: David Wolfskill Obtained from: Bull GNU/Linux NFSv4 project (libtirpc) MFC after: 3 days
* - Simplify the implementation of atomic_compare_exchange_strong_explicit.tijl2012-09-301-26/+13
| | | | | | | | | - Evaluate the memory order argument in atomic_fetch_*_explicit macros. - Implement atomic_store_explicit using atomic_exchange_explicit instead of a plain assignment. Reviewed by: theraven MFC after: 2 weeks
* Complete revert of r239963:pfg2012-09-272-7/+8
| | | | | | | | | | | | | | | The attempt to merge changes from the linux libtirpc caused rpc.lockd to exit after startup under unclear conditions. After many hours of selective experiments and inconsistent results the conclusion is that it's better to just revert everything and restart in a future time with a much smaller subset of the changes. ____ MFC after: 3 days Reported by: David Wolfskill Tested by: David Wolfskill
* - Make C11 atomic macros usable in expressions:tijl2012-09-261-25/+33
| | | | | | | | | | | | | | | | | | - Replace do-while statements with void expressions. - Wrap __asm statements in statement expressions. - Make the macros function-like: - Evaluate all arguments exactly once. - Make sure there's a sequence point between evaluation of the arguments and the function body. Arguments should be evaluated before any memory barriers. - Fix use of __atomic_is_lock_free built-in. It requires the address of an atomic variable as second argument. Use this built-in on clang as well because clang's __c11_atomic_is_lock_free only takes the size of the variable into account. - In atomic_exchange_explicit put the barrier before instead of after the __sync_lock_test_and_set call. Reviewed by: theraven
* Integrate nvmecontrol(8) into the amd64 and i386 builds.jimharris2012-09-171-2/+2
| | | | | | This includes adding NVMe header files to /usr/include/dev/nvme. Sponsored by: Intel
OpenPOWER on IntegriCloud