summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Make _Complex_I a proper float _Complex when using GCC 4.2.ed2012-01-051-1/+5
| | | | | | | | | | | | | | | | | | It turns out our GCC has quite an interesting bug: typeof(1.0fi) != float _Complex typeof((float _Complex)1.0fi) != float _Complex typeof((float _Complex)1.0i) == float _Complex In other words: if casting to an equal size, GCC seems to take a shortcut. By casting down from a double to a float, GCC doesn't take this shortcut, yielding the proper type. To prevent foot-shooting, add a _Static_assert() to guarantee that _Complex_I is always a float _Complex. I'm not going to MFC this part of the diff. MFC after: 2 weeks
* Reimplement <tgmath.h> on top of __generic().ed2012-01-051-45/+66
| | | | | | | | | | | | The macro construction used now, is almost identical to the code provided in C11 proposal N1404. This new version doesn't seem to introduce any regressions according to the regression test in tools/, but still seems to malfunction with Clang on certain aspects. The new code does work successfully with GCC 4.2, 4.6 and 4.7. With 4.7, it also works when __generic() is implemented on top of _Generic(). Discussed with: stefanf
* Simply disallow <stdnoreturn.h> to be used in combination with C++.ed2012-01-031-2/+4
| | | | | | | | | | | | | | | | | | | | | There is no way one could possibly use this header file in combination with C++ code. The problem is that in C11 the `noreturn' macro expands to the `_Noreturn' function specifier, while in C++11 the `noreturn' keyword is an attribute. So in C11 you have to write: noreturn void exit(int status); While in C++11 you have to write: [[noreturn]] void exit(int status); It is impossible to #define noreturn for C++ in such a way that it allows both conventions. By intentionally breaking this header this way, we prevent people from using this header in their C++<11 sources.
* Remove extraneous semicolons.ed2012-01-021-2/+2
| | | | | These macros are supposed to be invoked as regular functions, so remove them.
* Extend <stdatomic.h> to support GCC 4.7's __atomic.ed2011-12-301-7/+41
| | | | | | | | | The development version of GCC also supports an atomics interface similar to Clang's. Change the header file to work as follows: - __CLANG_ATOMICS: Use Clang's new atomics interface, - __GNUC_ATOMICS: Use GCC's new atomics interface, - else: fall back to GCC's __sync interface.
* Don't define static_assert for C++.ed2011-12-291-1/+10
| | | | | | | | | | | | | | | Even though _Static_assert() is pretty robust for C code, it cannot work correctly with C++ code. This is due to the fact that C++ template parameters may contain commas that are not enclosed in parentheses. For example: static_assert(foo<int, int>::bar == baz, "..."); This causes _Static_assert to be called with an excessive number of parameters. If you want to use static_assert in C++, just use a C++11 compiler. Reported on: current@, ports@
* In POSIX.1-2008:delphij2011-12-281-1/+1
| | | | | | | | | | P_tmpdir [OB XSI] Default directory prefix for tempnam(). This macro is used in a lot of places in legacy applications, and is why we see a lot of programs written for e.g. Linux store volatile temporary files in /var/tmp and not /tmp. MFC after: 2 months
* Fix some bugs in <stdatomic.h>.ed2011-12-261-9/+12
| | | | | | | | - Make atomic_init() work for GCC, as assigning to structs doesn't work. - Fix misplaced parenthesis in atomic_is_lock_free() for GCC. - Make atomic_compare_exchange_strong() for GCC return the proper boolean value, whether object == expected. - Fix argument passing in atomic_exchange_explicit() for GCC.
* As per C11, add static_assert() to <assert.h>.ed2011-12-261-0/+6
|
* Improve C11 bits in <stdlib.h>:ed2011-12-261-5/+5
| | | | | | | - Add missing semicolon to quick_exit(), - Remove `func' parameter name from at_quick_exit(), - Fix indentation. - Compare against 2011 value.
* Make white space in this file a bit more consistent.ed2011-12-251-14/+14
| | | | | Remove trailing whitespace and place all macro definitions at the same column.
* Fix field name.ed2011-12-251-1/+1
| | | | The value field in the atomic structure is called __val; not value.
* Add <stdalign.h> and <stdnoreturn.h>.ed2011-12-253-2/+85
| | | | | | | Even though these header files make little sense to me, they are part of the standard. By including these header files, you can simply use `alignas', `alignof' and `noreturn' instead of the underscore-prefixed versions.
* Remove unneeded guard.ed2011-12-251-5/+0
| | | | | There is no reason why <stdbool.h> needs an include guard. It is already protected by __bool_true_false_are_defined.
* Restore __is_threaded in C++ mode. Some Google stuff needs it apparently.theraven2011-12-251-1/+3
| | | | | Reported by: swills Approved by: dim (mentor)
* ...and actually install it.theraven2011-12-241-1/+1
| | | | Approved by: dim (mentor)
* Initial implementation of stdatomic.h. Works (at least in the parts that weretheraven2011-12-241-0/+296
| | | | | | | | | tested) with clang and gcc, and more efficiently with clang+a big out-of-tree diff that I need to commit soon (once it's been tidied and reviewed a bit). Large portions by: ed Reviewed by: ed Approved by: dim (mentor)
* Fix a problem whereby a corrupt DNS record can cause named to crash. [11:06]cperciva2011-12-231-0/+1
| | | | | | | | | | | | | | | | | | | | Add an API for alerting internal libc routines to the presence of "unsafe" paths post-chroot, and use it in ftpd. [11:07] Fix a buffer overflow in telnetd. [11:08] Make pam_ssh ignore unpassphrased keys unless the "nullok" option is specified. [11:09] Add sanity checking of service names in pam_start. [11:10] Approved by: so (cperciva) Approved by: re (bz) Security: FreeBSD-SA-11:06.bind Security: FreeBSD-SA-11:07.chroot Security: FreeBSD-SA-11:08.telnetd Security: FreeBSD-SA-11:09.pam_ssh Security: FreeBSD-SA-11:10.pam
* - Add restrict keyword to glob(3)eadler2011-12-201-1/+2
| | | | | | | PR: kern/161958 Submitted by: Henning Petersen <henning.petersen@t-online.de> Approved by: jilles MFC after: 3 days
* Replace __const by const in all non-contributed source code.ed2011-12-135-8/+8
| | | | | | As C1X is close to being released, there is no need to wrap around a feature that is already part of C90. Most of these files already use `const' in different placed as well.
* - Define true and false in sys/types.h for _KERNEL consumers, andmdf2011-12-121-0/+2
| | | | | | | | | | | | | | | | typedef bool. Due to macro expansion it seemed better to use a typedef for kernel consumers (specifically ofed won't compile without more changes if a define is used). - <stdbool.h> should also not re-define bool/true/false if they are defined by <sys/types.h>. It would probably be a programming error to define _KERNEL for user-space code, but downstream consumers like Isilon have already been including <stdbool.h> in kernel sources, and this protects that usage. - sizeof(_Bool) is not necessarily the same as sizeof(int), so kernel modules should be rebuild with this change. Bump __FreeBSD_version. MFC after: 2 weeks Sponsored by: Isilon Systems, LLC
* As per das@'s suggestion, s/__noreturn/_Noreturn/, since the latter is antheraven2011-12-071-4/+4
| | | | | | | | identifier reserved for the implementation in C99 and earlier so there is no sensible reason for introducing yet another reserved identifier when we could just use the one C1x uses. Approved by: brooks (mentor)
* Implement quick_exit() / at_quick_exit() from C++11 / C1x. Also add atheraven2011-12-071-3/+11
| | | | | | | | | | | | | | | | __noreturn macro and modify the other exiting functions to use it. The __noreturn macro, unlike __dead2, must be used BEFORE the function. This is in line with the C and C++ specifications that place _Noreturn (c1x) and [[noreturn]] (C++11) in front of the functions. As with __dead2, this macro falls back to using the GCC attribute. Unfortunately, clang currently sets the same value for the C version macro in C99 and C1x modes, so these functions are hidden by default. At some point before 10.0, I need to go through the headers and clean up the C1x / C++11 visibility. Reviewed by: brooks (mentor)
* Implement xlocale APIs from Darwin, mainly for use by libc++. This adds atheraven2011-11-206-5/+480
| | | | | | | | | | | | load of _l suffixed versions of various standard library functions that use the global locale, making them take an explicit locale parameter. Also adds support for per-thread locales. This work was funded by the FreeBSD Foundation. Please test any code you have that uses the C standard locale functions! Reviewed by: das (gdtoa changes) Approved by: dim (mentor)
* Hide some more macros that will break C++ when compiling in C++ mode.theraven2011-11-131-1/+3
| | | | Approved by: dim (mentor)
* The spec says that FILE must be defined in wchar.h, but it wasn't. Ittheraven2011-11-132-20/+28
| | | | | | | is now. Also hide some macros in C++ mode that will break C++ namespaced calls. Approved by: dim (mentor)
* Don't expose the wctype.h macros in C++ mode. They cause problems whentheraven2011-11-121-1/+3
| | | | | | | people try to invoke the namespaced versions of the functions of the same names. Approved by: dim (mentor)
* People porting FreeBSD to new architectures ought not have todas2011-10-211-11/+0
| | | | | | | | | | | | | implement a deprecated FPU control interface in addition to the standard one. To make this clearer, further deprecate ieeefp.h by not declaring the function prototypes except on architectures that implement them already. Currently i386 and amd64 implement the ieeefp.h interface for compatibility, and for fp[gs]etprec(), which doesn't exist on most other hardware. Powerpc, sparc64, and ia64 partially implement it and probably shouldn't, and other architectures don't implement it at all.
* Add c{cos,sin,tan}{,h}{,f} functions. This is joint work withdas2011-10-171-1/+13
| | | | bde and kargl.
* Avoid accidental conflicts with C++ operator keywords.jkim2011-09-271-0/+4
| | | | MFC after: 1 week
* Install ciss(4) ioctl header (together with other .h files from sys/dev/ciss).kib2011-09-271-1/+1
| | | | | | | PR: kern/109813 Discussued with: Alex Samorukov <samm os2 kiev ua> (smartmontools maintainer) MFC after: 1 week
* Revert the previous change and add xdr_sizeofkevlo2011-07-101-39/+37
| | | | Requested by: bde
* - Add xdr_sizeof(3) to libckevlo2011-07-091-37/+40
| | | | | | - Document xdr_sizeof(3); from NetBSD Discussed with: kib
* * Add the readline(3) API to libedit. The libedit versions ofobrien2011-04-052-230/+1
| | | | | | | | | | | | | | | | {readline,history}.h are in /usr/include/edit so as to not conflict with the GNU libreadline versions. To use the libedit readline(3) one should add "-I/usr/include/edit" to their Makefile (spelled "-I${DESTDIR}/${INCLUDEDIR}/edit" within the FreeBSD source tree). * Enable its use in the BSD licensed utilities that support readline(3). * To make it easier to sync libedit development with NetBSD, histedit.h is moved into libedit's directory as history shows shown we keep merging it into that location. Obtained from: NetBSD Sponsored by: Juniper Networks
* MFgraid/head:mav2011-03-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new RAID GEOM class, that is going to replace ataraid(4) in supporting various BIOS-based software RAIDs. Unlike ataraid(4) this implementation does not depend on legacy ata(4) subsystem and can be used with any disk drivers, including new CAM-based ones (ahci(4), siis(4), mvs(4), ata(4) with `options ATA_CAM`). To make code more readable and extensible, this implementation follows modular design, including core part and two sets of modules, implementing support for different metadata formats and RAID levels. Support for such popular metadata formats is now implemented: Intel, JMicron, NVIDIA, Promise (also used by AMD/ATI) and SiliconImage. Such RAID levels are now supported: RAID0, RAID1, RAID1E, RAID10, SINGLE, CONCAT. For any all of these RAID levels and metadata formats this class supports full cycle of volume operations: reading, writing, creation, deletion, disk removal and insertion, rebuilding, dirty shutdown detection and resynchronization, bad sector recovery, faulty disks tracking, hot-spare disks. For Intel and Promise formats there is support multiple volumes per disk set. Look graid(8) manual page for additional details. Co-authored by: imp Sponsored by: Cisco Systems, Inc. and iXsystems, Inc.
* Add missing declarations that I intended to commit with r219359.das2011-03-071-0/+2
| | | | Not sure why we have math.h in lib/msun/ and complex.h in include/.
* Include stdio.h, so we can include printf.h in any order, as it needs FILE.pjd2011-03-061-0/+1
| | | | MFC after: 2 weeks
* Add two new system calls, setloginclass(2) and getloginclass(2). This makestrasz2011-03-051-0/+2
| | | | | | | | | it possible for the kernel to track login class the process is assigned to, which is required for RCTL. This change also make setusercontext(3) call setloginclass(2) and makes it possible to retrieve current login class using id(1). Reviewed by: kib (as part of a larger patch)
* POSIX.1-2008 moved some constants from the XSI option to the Base.jilles2011-03-041-4/+7
| | | | MFC after: 2 weeks
* Fix some _POSIX minimum/maximum values in limits.h:jilles2011-03-031-4/+15
| | | | | | | | | | | * Some values changed in POSIX.1-2001; provide the former value if a program requests compliance to an earlier version of POSIX. [1] * Add missing _POSIX_CLOCKRES_MIN constant. This is a maximum value but otherwise works the same as the minimum values. PR: standards/104743 Submitted by: bde [1] (not exact #ifdefs, but the values) MFC after: 2 weeks
* Add the BSD-licensed Citrus iconv to the base system with default offgabor2011-02-253-0/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setting. It can be built by setting the WITH_ICONV knob. While this knob is unset, the library part, the binaries, the header file and the metadata files will not be built or installed so it makes no impact on the system if left turned off. This work is based on the iconv implementation in NetBSD but a great number of improvements and feature additions have been included: - Some utilities have been added. There is a conversion table generator, which can compare conversion tables to reference data generated by GNU libiconv. This helps ensuring conversion compatibility. - UTF-16 surrogate support and some endianness issues have been fixed. - The rather chaotic Makefiles to build metadata have been refactored and cleaned up, now it is easy to read and it is also easier to add support for new encodings. - A bunch of new encodings and encoding aliases have been added. - Support for 1->2, 1->3 and 1->4 mappings, which is needed for transliterating with flying accents as GNU does, like "u. - Lots of warnings have been fixed, the major part of the code is now WARNS=6 clean. - New section 1 and section 5 manual pages have been added. - Some GNU-specific calls have been implemented: iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into() - Support for GNU's //IGNORE suffix has been added. - The "-" argument for stdin is now recognized in iconv(1) as per POSIX. - The Big5 conversion module has been fixed. - The iconv.h header files is supposed to be compatible with the GNU version, i.e. sources should build with base iconv.h and GNU libiconv. It also includes a macro magic to deal with the char ** and const char ** incompatibility. - GNU compatibility: "" or "char" means the current local encoding in use - Various cleanups and style(9) fixes. Approved by: delphij (mentor) Obtained from: The NetBSD Project Sponsored by: Google Summer of Code 2009
* Add restrict keyword to pthread_sigmask prototype and manpage.kib2011-02-201-1/+2
| | | | MFC after: 1 week
* Install iodev.h.kib2011-02-171-1/+1
| | | | | Reviewed by: attilio MFC after: 1 week
* Introduce a non-portable function pthread_getthreadid_np(3) to retrievejkim2011-02-071-0/+1
| | | | | | | calling thread's unique integral ID, which is similar to AIX function of the same name. Bump __FreeBSD_version to note its introduction. Reviewed by: kib
* Add missing __dead2 to __assert().ed2011-01-091-1/+1
| | | | | | | | __assert() is called when an assertion fails. After printing an error message, it will call abort(). abort() never returns, hence it has the __dead2 attribute. Also add this attribute to __assert(). MFC after: 3 weeks
* Remove leftover for r214093.davidxu2011-01-061-9/+0
|
* rpc.lockd(8) WARNS cleanupuqs2010-12-201-0/+1
| | | | | | | | | - Provide function prototype for nlm_syscall - Don't assign a variable from the stack to a global var[1] - Remove unused vars Found by: clang static analyser [1] Reviewed by: dfr
* Sync with OpenBSD, primarily better signal and terminal handling.delphij2010-11-131-23/+17
| | | | | Obtained from: OpenBSD MFC after: 2 weeks
* Add a new libc function: cfmakesane(3).ed2010-11-021-0/+1
| | | | | | | | | | | I've noticed various terminal emulators that need to obtain a sane default termios structure use very complex `hacks'. Even though POSIX doesn't provide any functionality for this, extend our termios API with cfmakesane(3), which is similar to the commonly supported cfmakeraw(3), except that it fills the termios structure with sane defaults. Change all code in our base system to use this function, instead of depending on <sys/ttydefaults.h> to provide TTYDEF_*.
* Add an x86/include directory to the kernel to hold headers that are commonjhb2010-11-011-5/+12
| | | | | | | | to amd64, i386, and pc98. The headers are installed to /usr/include/x86 during an installworld, and an 'x86' symlink is created for kernel builds similar to 'machine' so that the headers can be included as <x86/foo.h>. Reviewed by: imp
OpenPOWER on IntegriCloud