summaryrefslogtreecommitdiffstats
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Remove the current directory from _PATH_STDPATH.jilles2009-12-301-1/+1
|
* Don't name parameters, for consistency with the rest of the file, and becausecognet2009-12-221-6/+6
| | | | | | it breaks third-party apps. Submitted by: gahr
* Decompose <sys/termios.h>.ed2009-11-282-2/+102
| | | | | | | | | | | | | | | | | | | | The <sys/termios.h> header file is hardlinked to <termios.h>. It contains both the structures and the flag definitions, but also the C library interface that's implemented by the C library. This header file has the typical problem of including too many random things and being badly ordered. Instead of trying to fix this, decompose it into two header files: - <sys/_termios.h>, which contains struct termios and the flags. - <termios.h>, which includes <sys/_termios.h> and contains the C library interface. This means userspace has to include <termios.h> for struct termios, while kernelspace code has to include <sys/tty.h>. Also add a <sys/termios.h>, which prints a warning message before including <termios.h>. I am aware that there are some applications that use this header file as well.
* Implement sighold, sigignore, sigpause, sigrelse, sigset functionskib2009-11-261-1/+6
| | | | | | | | | | from SUSv4 XSI. Note that the functions are obsoleted, and only provided to ease porting from System V-like systems. Since sigpause already exists in compat with different interface, XSI sigpause is named xsi_sigpause. Reviewed by: davidxu MFC after: 3 weeks
* Add basename_r(3) to complement basename(3). basename_r(3) which acceptsrwatson2009-10-061-0/+1
| | | | | | | | a caller-allocated buffer of at least MAXPATHLEN, rather than using a global buffer. MFC after: 1 month Sponsored by: Google
* Modified locale(1) to be able to show the altmon_X fields and the [cxX]_fmt's.edwin2009-10-051-0/+14
| | | | | | Also modify the "-k list" option to display only fields with a certain prefix. MFC after: 1 week
* ntroduce mfiutil, a basic utility for managing LSI SAS-RAID & Dell PERC5/6scottl2009-08-131-1/+1
| | | | | | | | | | | | | | controllers. Controller, array, and drive status can be checked, basic attributes can be changed, and arrays and spares can be created and deleted. Controller firmware can also be flashed. This does not replace MegaCLI, found in ports, as that is officially sanctioned and supported by LSI and includes vastly more functionality. However, mfiutil is open source and guaranteed to provide basic functionality, which can be especially useful if you have a problem and can't get MegaCLI to work. Approved by: re Obtained from: Yahoo! Inc.
* Implement RTLD_NOLOAD flag for dlopen(3).kib2009-07-171-0/+1
| | | | | | Requested and tested by: jkim Reviewed by: kan Approved by: re (kensmith)
OpenPOWER on IntegriCloud