summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Fix a compilation error with some compilers: __attribute__harti2012-05-221-6/+4
| | | | | | requires two parenthesis for its argument, but instead of using __attribute__ directly, use the appropriate __nonnull macro from cdefs.h.
* Hide DIR definition by making it an opaque struct typedef.gleb2012-05-191-18/+3
| | | | | | | | | | Introduce dirfd() libc exported symbol replacing macro with same name, preserve _dirfd() macro for internal use. Replace dirp->dd_fd with dirfd() call. Avoid using dirfd as variable name to prevent shadowing global symbol. Sponsored by: Google Summer Of Code 2011
* Don't use ino_t in dumprestore protocol definition.gleb2012-05-181-1/+10
| | | | | | | | | Since ino_t size is about to change to 64-bits, replace ino_t used in dump protocol definition with 32-bit dump_ino_t to preserve backward compatibility. At some point, it may be necessary to use spare fields in struct in order to fully support 64-bit inode numbers. Sponsored by: Google Summer of Code 2011
* Import work done under project/nand (@235533) into head.gber2012-05-171-3/+17
| | | | | | | | | | | | | | The NAND Flash environment consists of several distinct components: - NAND framework (drivers harness for NAND controllers and NAND chips) - NAND simulator (NANDsim) - NAND file system (NAND FS) - Companion tools and utilities - Documentation (manual pages) This work is still experimental. Please use with caution. Obtained from: Semihalf Supported by: FreeBSD Foundation, Juniper Networks
* Fix <stdatomic.h> after clang decided to rename all of its builtins to includetheraven2012-05-031-13/+16
| | | | | | | | | a c11 prefix to disambiguate them from the one provided by GCC. Note: Clang 3.1 also supports the GCC builtins for libstdc++ 4.7 compatibility, but I don't recommend using them because they are very poorly designed. MFC after: 2 weeks
* Add a convenience macro for the returns_twice attribute, and apply it todim2012-04-292-4/+4
| | | | | | | the prototypes of the appropriate functions (getcontext, savectx, setjmp, sigsetjmp and vfork). MFC after: 2 weeks
* Fix a bug caused by some misplaced brackets.theraven2012-04-221-2/+2
| | | | Reported by: das
* Import jemalloc 9ef7f5dc34ff02f50d401e41c8d9a4a928e7c2aa (dev branch,jasone2012-04-172-4/+30
| | | | | | | | prior to 3.0.0 release) as contrib/jemalloc, and integrate it into libc. The code being imported by this commit diverged from lib/libc/stdlib/malloc.c in March 2010, which means that a portion of the jemalloc 1.0.0 ChangeLog entries are relevant, as are the entries for all subsequent releases.
* Correctly expose xlocale functions if people include the headers in the wrongtheraven2012-03-289-5/+17
| | | | | | order (as some ports apparently do). Approved by: dim (mentor)
* Expose some C11 stuff that is also C++11 stuff in C++11 mode.theraven2012-03-141-1/+1
| | | | Approved by: dim (mentor)
* And remove the duplicate inlines...theraven2012-03-131-2/+2
| | | | Approved by: dim (mentor)
* Fix the other missing prototypes.theraven2012-03-131-0/+5
| | | | Approved by: dim (mentor)
* Add missing prototypes.theraven2012-03-131-0/+5
| | | | Approved by: dim (mentor)
* More xlocale cleanups.theraven2012-03-131-26/+26
| | | | Approved by: dim (mentor)
* Remove fifo.h. The only used function declaration from the header iskib2012-03-111-1/+1
| | | | | | migrated to sys/vnode.h. Submitted by: gianni
* After r232498, programs built with -ansi or -std=c89 including <ctype.h>dim2012-03-062-3/+3
| | | | | | | | would not compile anymore, due to plain 'inline' keywords. Fix this by using __inline instead. Reported by: Jia-Shiun Li <jiashiun@gmail.com> Discussed with: theraven
* Reapply 227753 (xlocale cleanup), plus some fixes so that it passes buildtheraven2012-03-0422-414/+834
| | | | | | universe with gcc. Approved by: dim (mentor)
* Revert r231673 and r231682 for now, until we can run a full makedim2012-02-1421-678/+269
| | | | | | universe with them. Sorry for the breakage. Pointy hat to: me and brooks
* Fix a misplaced __NO_TLS locations, and change a GNUism to a C11ism fortheraven2012-02-141-1/+1
| | | | | | consistency. Approved by: brooks (mentor)
* Change some headers such that lang/gcc* ports no longer patch them.tijl2012-02-141-3/+3
| | | | | | | The lang/gcc* ports patch headers where they think something is non-standard. These patched headers override the system headers which means you have to rebuild these ports whenever you do installworld to make sure they contain the latest changes.
* Cleanup of xlocale:theraven2012-02-1421-269/+678
| | | | | | | | | | | | | | | | - Address performance regressions encountered by das@ by caching per-thread data in TLS where available. - Add a __NO_TLS flag to cdefs.h to indicate where not available. - Reorganise the xlocale.h definitions into xlocale/*.h so that they can be included from multiple places. - Export the POSIX2008 subset of xlocale when POSIX2008 says it should be exported, independently of whether xlocale.h is included. - Fix the bug where programs using ctype functions always assumed ASCII unless recompiled. - Fix some style(9) violations. Reviewed by: brooks (mentor) Approved by: dim (mentor)
* Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessordim2012-02-072-2/+2
| | | | | | set via ${CPP} is used, instead of always using hardcoded /usr/bin/cpp. MFC after: 1 week
* Only use the static assertion when __generic is available.ed2012-01-171-0/+3
| | | | Reported by: tijl
* Fix clang atomic to use for atomic_is_lock_free().theraven2012-01-171-1/+1
| | | | | Reviewed by: ed Approved by: dim (mentor)
* Use the signal fence builtin in stdatomic.h when using the clang atomictheraven2012-01-161-4/+1
| | | | | | | | | | | builtins, rather than the __asm hack. Somehow I missed the existence of this builtin originally and only noticed that it was there when I went to implement it... Note: Trunk clang now has support for (most of) the C[++]11 atomics stuff. Please test! Approved by: brooks (mentor)
* xlocale.h: consistently use __va_listavg2012-01-151-2/+2
| | | | | | | | | Plain 'va_list' in this header seems to cause troubles with non-base GCC which creates and uses "tortured" versions of some sysem header files including stdio.h (installed in a private 'include-fixed' directory). Reviewed by: theraven X-MFC with: r227753
* Correct mistake in atomic_flag macros.ed2012-01-131-3/+2
| | | | | The _explicit versions only have two parameters, namely the object and the order. There is no need to pass the values of the atomic variable.
* Add aligned_alloc(3).ed2012-01-091-0/+1
| | | | | | | | | The C11 folks reinvented the wheel by introducing an aligned version of malloc(3) called aligned_alloc(3), instead of posix_memalign(3). Instead of returning the allocation by reference, it returns the address, just like malloc(3). Reviewed by: jasone@
* Fix spelling of C11 and sort functions by name.ed2012-01-081-2/+2
|
* Spelling fixes for include/uqs2012-01-077-12/+12
|
* Implement fdlopen(3), an rtld interface to load shared object by filekib2012-01-071-0/+1
| | | | | | | | descriptor. Requested and tested by: des (previous version) Reviewed by: des, kan (previous version) MFC after: 2 weeks
* Last attempt at <tgmath.h>: do enable the new code for C11 compilers.ed2012-01-061-11/+17
| | | | | | | | | | | | I was thinking by myself, if the new code doesn't work with GCC 4.2, why not simply turn it into an efficient version for C11 compilers? By changing the code to use _Generic() directly in that case, I can build the tgmath regression test in a matter of milliseconds with Clang, instead of the 8 seconds it used to take. So by the time C11 becomes the default, it will pick up the new code automatically. And now I will refrain from making more changes to <tgmath.h>.
* Add an even faster implementation of <tgmath.h> for the future.ed2012-01-061-0/+20
| | | | | | | Instead of using an exponential number of cases with respect to the number of arguments, this version only uses a linear number. Unfortunately, it works with Clang, GCC 4.6 and GCC 4.7, but not GCC 4.2. Therefore, leave it commented out.
* Remove redundant inclusion of <sys/cdefs.h>.ed2012-01-051-2/+0
| | | | Mea culpa.
* Remove _Complex_I workaround from <tgmath.h>.ed2012-01-051-9/+4
| | | | | This removes the use of __typeof() from this header, thus making it work with a plain C11 compiler.
* 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)
OpenPOWER on IntegriCloud