summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* * 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
* Add sysctl kern.sched.cpusetsize to export the size of kernel cpuset,davidxu2010-10-291-0/+1
| | | | | | also add sysconf() key _SC_CPUSET_SIZE to get sysctl value. Submitted by: gcooper
* Add pthread_rwlockattr_setkind_np and pthread_rwlockattr_getkind_np, thedavidxu2010-10-181-2/+14
| | | | | | | | | functions set or get pthread_rwlock type, current supported types are: PTHREAD_RWLOCK_PREFER_READER_NP, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, PTHREAD_RWLOCK_PREFER_WRITER_NP, default is PTHREAD_RWLOCK_PREFER_WRITER_NONCECURSIVE_NP, this maintains binary compatible with old code.
* Also the stop function should accept 64-bit exception class.davidxu2010-09-301-1/+1
|
* - Sizeof exception class type should always be 64-bit.davidxu2010-09-301-3/+5
| | | | - Make some functions be visible to BSD source code.
* Import unwind.h from libunwind-0.99.davidxu2010-09-301-0/+154
| | | | Approved by: core (kib, rwatson, imp, brooks)
* In current code, statically initialized and destroyed object havedavidxu2010-09-281-1/+1
| | | | | | | | same null value, the code can not distinguish between them, to fix the problem, now a destroyed object is assigned to a non-null value, and it will be rejected by some pthread functions. PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP is changed to number 1, so that adaptive mutex can be statically initialized correctly.
* Correct value for _POSIX_AIO_LISTIO_MAX in <limits.h>.jilles2010-08-291-1/+1
| | | | | | | | | | All the "Minimum Values" (POSIX.1-2008 XBD 13 Headers <limits.h>) are now correct. These should all be exactly as they are in the specification; the possibly higher values we support are announced differently. PR: standards/104743 Submitted by: gcooper MFC after: 2 weeks
* MFtbemd:imp2010-08-231-2/+2
| | | | | Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want to test of all the CPUs of a given family conform.
* Style: tabs after #definekevlo2010-08-111-1/+1
|
* Remove stale reference to UT_NAMESIZE from <stdio.h>.ed2010-08-061-2/+1
| | | | Spotted by: bde@
* Connect powerpc64 to the build. It is not presently part of make universe,nwhitehorn2010-07-131-3/+3
| | | | | | which will be added soon. Reviewed by: imp
* o addr2ascii(3) was removed ages ago. Fix the comment.maxim2010-07-061-1/+1
| | | | | | PR: docs/148383 Submitted by: pluknet MFC after: 1 week
* libedit: Allow simple quoting in filename completion.jilles2010-06-151-0/+1
| | | | | | | | | | | | | The completer recognizes characters escaped with backslashes as being literal parts of a word, and adds backslashes to avoid almost all misinterpretation. In particular, filenames containing spaces can be completed correctly. For bug compatibility with the NetBSD version, the improved completion function has a new name, _el_fn_sh_complete, and _el_fn_complete is unchanged. Submitted by: Guy Yur
* libedit: Add basic filename completion code from NetBSD.jilles2010-06-131-2/+0
| | | | | | | | | | | | This will be used to provide filename completion in sh(1). Changes from the NetBSD code: * wide character support disabled, as in the rest of libedit * config.h and related portability stuff reduced/disabled, as in the rest of libedit Submitted by: Guy Yur Obtained from: NetBSD
* Move realpath(3) prototype to a POSIX section.kib2010-04-211-1/+1
| | | | | Noted by: bde MFC after: 2 weeks
* Slightly modernize realpath(3).kib2010-04-201-1/+1
| | | | | | | | | | | SUSv4 requires that implementation returns EINVAL if supplied path is NULL, and ENOENT if path is empty string [1]. Bring prototype in conformance with SUSv4, adding restrict keywords. Allow the resolved path buffer pointer be NULL, in which case realpath(3) allocates storage with malloc(). PR: kern/121897 [1] MFC after: 2 weeks
* Add capability to use a db version of services. It is enabled byume2010-04-042-0/+2
| | | | | | specifying `db' as source of service in /etc/nsswitch.conf. MFC after: 2 weeks
* Be like stdlib.h and bring in a wchar_t definition and use it to prototypejmallett2010-03-311-4/+11
| | | | | | | | | | | wcstoimax and wcstoumax, rather than spelling it __wchar_t. This is necessary to use these functions in C++ where wchar_t is different to __wchar_t and is a built-in type. It may be better to use __wchar_t here and to simply define __wchar_t as being wchar_t in C++ mode rather than to bring in wchar_t, but this is less invasive and follows our existing practice, and restores wchar_t usage in this file to what it was before r1.8.
* - Remove const'ness from dlerror(3) prototype, for consistency with POSIX.gahr2010-03-241-2/+1
| | | | | Approved by: cognet MFC after: 1 week
* Trim down libcompat by removing <regexp.h>.ed2010-03-142-71/+1
| | | | | | | | | | | | | | | Erwin ran an exp-run with libcompat and <regexp.h> removed. It turns out the regexp library is almost entirely unused. In fact, it looks like it is sometimes used by accident. Because these function names clash with libc's <regex.h>, some application use both <regex.h> and libcompat, which means they link against the wrong regex library. This commit removes the regexp library and reimplements re_comp() and re_exec() using <regex.h>. It seems the grammar of the regular expressions accepted by these functions is similar to POSIX EREs. After this commit, 1 low-profile port will be broken, but the maintainer already has a patch for it sitting in his mailbox.
* Add warnings to <regexp.h> and <sys/timeb.h>.ed2010-03-091-0/+4
| | | | | | | | | These header files only provide functionality that can be used in combination with libcompat. In order to prevent people from including them without any actual use (which happens a lot with <sys/timeb.h>), put a warning here to make people more aware. This means we have to lower WARNS for libcompat, which is no big deal.
* Remove last traces of <utmp.h>.ed2010-03-032-3/+1
|
* Remove clause 3 from Berkeley copyrights. Add a few $FreeBSD$'s.imp2010-02-1611-55/+17
|
* Remove the Berkeley clause 3's.imp2010-02-1644-216/+54
| | | | Add a few $FreeBSD$
* Remove NetBSD Foundation clauses 3 & 4. They eliminated those clausesimp2010-02-165-35/+0
| | | | last year.
* Add gmountver, disk mount verification GEOM class.trasz2010-01-161-1/+1
| | | | | | | | Note that due to e.g. write throttling ('wdrain'), it can stall all the disk I/O instead of just the device it's configured for. Using it for removable media is therefore not a good idea. Reviewed by: pjd (earlier version)
* Phase out ttyslot(3).ed2010-01-141-1/+0
| | | | | | | | The ttyslot() function was originally part for SUSv1, marked LEGACY in SUSv2 and removed later on. This function only makes sense when using utmp(5), because it was used to determine the offset of the record for the controlling TTY. It makes little sense to keep it here, because the new utmpx file format doesn't index based on TTY slots.
* Remove <utmp.h> and its corresponding manual page.ed2010-01-131-73/+2
|
* Implement <utmpx.h>.ed2010-01-132-2/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The utmpx interface is the standardized interface of the user accounting database. The standard only defines a subset of the functions that were present in System V-like systems. I'd like to highlight some of the traits my implementation has: - The standard allows the on-disk format to be different than the in-memory representation (struct utmpx). Most operating systems don't do this, but we do. This allows us to keep our ABI more stable, while giving us the opportunity to modify the on-disk format. It also allows us to use a common file format across different architectures (i.e. byte ordering). - Our implementation of pututxline() also updates wtmp and lastlog (now called utx.log and utx.lastlogin). This means the databases are more likely to be in sync. - Care must be taken that our implementation discard any fields that are not applicable. For example, our DEAD_PROCESS records do not hold a TTY name. Just a time stamp, a record identifier and a process identifier. It also guarantees that strings (ut_host, ut_line and ut_user) are null terminated. ut_id is obviously not null terminated, because it's not a string. - The API and its behaviour should be conformant to POSIX, but there may be things that slightly deviate from the standard. This implementation uses separate file descriptors when writing to the log files. It also doesn't use getutxid() to search for a field to overwrite. It uses an allocation strategy similar to getutxid(), but prevents DEAD_PROCESS records from accumulating. Make sure libulog doesn't overwrite the manpages shipped with our C library. Also keep the symbol list in Symbol.map sorted. I'll bump __FreeBSD_version later this evening. I first want to convert everything to <utmpx.h> and get rid of <utmp.h>.
* Move scandir(3) and alphasort(3) into XSI namespace.kib2010-01-051-2/+4
| | | | | Noted and reviewed by: bde MFC after: 2 weeks
* Use umtx to implement process sharable semaphore, to make this work,davidxu2010-01-052-2/+66
| | | | | | | | | | | | | | | | | | | | | | now type sema_t is a structure which can be put in a shared memory area, and multiple processes can operate it concurrently. User can either use mmap(MAP_SHARED) + sem_init(pshared=1) or use sem_open() to initialize a shared semaphore. Named semaphore uses file system and is located in /tmp directory, and its file name is prefixed with 'SEMD', so now it is chroot or jail friendly. In simplist cases, both for named and un-named semaphore, userland code does not have to enter kernel to reduce/increase semaphore's count. The semaphore is designed to be crash-safe, it means even if an application is crashed in the middle of operating semaphore, the semaphore state is still safely recovered by later use, there is no waiter counter maintained by userland code. The main semaphore code is in libc and libthr only has some necessary stubs, this makes it possible that a non-threaded application can use semaphore without linking to thread library. Old semaphore implementation is kept libc to maintain binary compatibility. The kernel ksem API is no longer used in the new implemenation. Discussed on: threads@
* This should read #if __BSD_VISIBLE instead of #ifdef __BSD_VISIBLE.ed2010-01-041-1/+1
|
* Modernize scandir(3) and alphasort(3) interfaces according to the IEEEkib2010-01-041-2/+3
| | | | | | | | | | | | | | | | | | | | Std 1003.1-2008. Both Linux and Solaris conforms to the new definitions, so we better follow too (older glibc used old BSDish alphasort prototype and corresponding type of the comparision function for scandir). While there, change the definitions of the functions to ANSI C and fix several style issues nearby. Remove requirement for "sys/types.h" include for functions from manpage. POSIX also requires that alphasort(3) sorts as if strcoll(3) was used, but leave the strcmp(3) call in the function for now. Adapt in-tree callers of scandir(3) to new declaration. The fact that select_sections() from catman(1) could modify supplied struct dirent is a bug. PR: standards/142255 MFC after: 2 weeks
OpenPOWER on IntegriCloud