aboutsummaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* Change readlink(2)'s return type and type of the last argumentRuslan Ermilov2008-02-121-1/+1
| | | | | | | | | to match POSIX. Prodded by: Alexey Lyashkov Notes: svn path=/head/; revision=176215
* Per discussion on -threads, rename _islocked_np() to _isowned_np().Dag-Erling Smørgrav2008-02-061-1/+1
| | | | Notes: svn path=/head/; revision=176049
* Add pthread_mutex_islocked_np(), a cheap way to verify that a mutex isDag-Erling Smørgrav2008-02-031-0/+1
| | | | | | | | | | locked. This is intended primarily to support the userland equivalent of the various *_ASSERT_LOCKED() macros we have in the kernel. MFC after: 2 weeks Notes: svn path=/head/; revision=175958
* Our fts(3) API, as inherited from 4.4BSD, suffers from integerYaroslav Tykhiy2008-01-261-18/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fields in FTS and FTSENT structs being too narrow. In addition, the narrow types creep from there into fts.c. As a result, fts(3) consumers, e.g., find(1) or rm(1), can't handle file trees an ordinary user can create, which can have security implications. To fix the historic implementation of fts(3), OpenBSD and NetBSD have already changed <fts.h> in somewhat incompatible ways, so we are free to do so, too. This change is a superset of changes from the other BSDs with a few more improvements. It doesn't touch fts(3) functionality; it just extends integer types used by it to match modern reality and the C standard. Here are its points: o For C object sizes, use size_t unless it's 100% certain that the object will be really small. (Note that fts(3) can construct pathnames _much_ longer than PATH_MAX for its consumers.) o Avoid the short types because on modern platforms using them results in larger and slower code. Change shorts to ints as follows: - For variables than count simple, limited things like states, use plain vanilla `int' as it's the type of choice in C. - For a limited number of bit flags use `unsigned' because signed bit-wise operations are implementation-defined, i.e., unportable, in C. o For things that should be at least 64 bits wide, use long long and not int64_t, as the latter is an optional type. See FTSENT.fts_number aka FTS.fts_bignum. Extending fts_number `to satisfy future needs' is pointless because there is fts_pointer, which can be used to link to arbitrary data from an FTSENT. However, there already are fts(3) consumers that require fts_number, or fts_bignum, have at least 64 bits in it, so we must allow for them. o For the tree depth, use `long'. This is a trade-off between making this field too wide and allowing for 64-bit inode numbers and/or chain-mounted filesystems. On the one hand, `long' is almost enough for 32-bit filesystems on a 32-bit platform (our ino_t is uint32_t now). On the other hand, platforms with a 64-bit (or wider) `long' will be ready for 64-bit inode numbers, as well as for several 32-bit filesystems mounted one under another. Note that fts_level has to be signed because -1 is a magic value for it, FTS_ROOTPARENTLEVEL. o For the `nlinks' local var in fts_build(), use `long'. The logic in fts_build() requires that `nlinks' be signed, but our nlink_t currently is uint16_t. Therefore let's make the signed var wide enough to be able to represent 2^16-1 in pure C99, and even 2^32-1 on a 64-bit platform. Perhaps the logic should be changed just to use nlink_t, but it can be done later w/o breaking fts(3) ABI any more because `nlinks' is just a local var. This commit also inludes supporting stuff for the fts change: o Preserve the old versions of fts(3) functions through libc symbol versioning because the old versions appeared in all our former releases. o Bump __FreeBSD_version just in case. There is a small chance that some ill-written 3-rd party apps may fail to build or work correctly if compiled after this change. o Update the fts(3) manpage accordingly. In particular, remove references to fts_bignum, which was a FreeBSD-specific hack to work around the too narrow types of FTSENT members. Now fts_number is at least 64 bits wide (long long) and fts_bignum is an undocumented alias for fts_number kept around for compatibility reasons. According to Google Code Search, the only big consumers of fts_bignum are in our own source tree, so they can be fixed easily to use fts_number. o Mention the change in src/UPDATING. PR: bin/104458 Approved by: re (quite a while ago) Discussed with: deischen (the symbol versioning part) Reviewed by: -arch (mostly silence); das (generally OK, but we didn't agree on some types used; assuming that no objections on -arch let me to stick to my opinion) Notes: svn path=/head/; revision=175688
* _POSIX_THREAD_CPUTIME is now supported.David Xu2008-01-181-1/+1
| | | | Notes: svn path=/head/; revision=175431
* Add a feature_present(3) function which checks to see if a named kernelJohn Baldwin2008-01-101-0/+1
| | | | | | | | | feature is present by checking the kern.features sysctl MIB. MFC after: 1 week Notes: svn path=/head/; revision=175220
* Implement and document csqrt(3) and csqrtf(3).David Schultz2007-12-151-1/+3
| | | | Notes: svn path=/head/; revision=174617
* 1. Add function pthread_mutex_setspinloops_np to turn a mutex's spinDavid Xu2007-12-141-0/+4
| | | | | | | | | | | loop count. 2. Add function pthread_mutex_setyieldloops_np to turn a mutex's yield loop count. 3. Make environment variables PTHREAD_SPINLOOPS and PTHREAD_YIELDLOOPS to be only used for turnning PTHREAD_MUTEX_ADAPTIVE_NP mutex. Notes: svn path=/head/; revision=174585
* Implement carg(3) and cargf(3).David Schultz2007-12-121-0/+2
| | | | | | | Rotting in an old src tree since: March 2005 Notes: svn path=/head/; revision=174561
* Implementing 'fallback' nsswitch source. 'fallback' source is usedMichael Bushkov2007-12-121-1/+3
| | | | | | | | | | | | | | | when particular function can't be found in nsswitch-module. For example, getgrouplist(3) will use module-supplied 'getgroupmembership' function (which can work in an optimal way for such source as LDAP) and will fall back to the stanard iterate-through-all-groups implementation otherwise. PR: ports/114655 Submitted by: Michael Hanselmann <freebsd AT hansmi DOT ch> Reviewed by: brooks (mentor) Notes: svn path=/head/; revision=174547
* Only protect the prototypes with #ifndef _ASSERT_H_, the standardsPoul-Henning Kamp2007-12-011-3/+2
| | | | | | | specifically allow changes to the NDEBUG macro between #includes of assert.h Notes: svn path=/head/; revision=174133
* Add missing #ifndef _ASSERT_H_ protection against multiple inclusionsPoul-Henning Kamp2007-12-011-0/+4
| | | | Notes: svn path=/head/; revision=174131
* Remove some OpenSolaris compatibility stuff now that we're doing it aJohn Birrell2007-11-281-4/+0
| | | | | | | different way. Notes: svn path=/head/; revision=174044
* Use a forward definition of an opaque structure rather than a voidJohn Birrell2007-11-201-1/+2
| | | | | | | to avoid a strict alias type check failure in gcc 4.2. Notes: svn path=/head/; revision=173762
* Back out not human readable optimization in prev. commit which shownAndrey A. Chernov2007-11-011-1/+1
| | | | | | | to generate 3bytes longer opcode. Notes: svn path=/head/; revision=173244
* Add a new "non-portable" mutex type, PTHREAD_MUTEX_ADAPTIVE_NP. ThisKris Kennaway2007-10-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is also implemented in glibc and is used by a number of existing applications (mysql, firefox, etc). This mutex type is a default mutex with the additional property that it spins briefly when attempting to acquire a contested lock, doing trylock operations in userland before entering the kernel to block if eventually unsuccessful. The expectation is that applications requesting this mutex type know that the mutex is likely to be only held for very brief periods, so it is faster to spin in userland and probably succeed in acquiring the mutex, than to enter the kernel and sleep, only to be woken up almost immediately. This can help significantly in certain cases when pthread mutexes are heavily contended and held for brief durations (such as mysql). Spin up to 200 times before entering the kernel, which represents only a few us on modern CPUs. No performance degradation was observed with this value and it is sufficient to avoid a large performance drop in mysql performance in the heavily contended pthread mutex case. The libkse implementation is a NOP. Reviewed by: jeff MFC after: 3 days Notes: svn path=/head/; revision=173154
* Remove 3rd clause and renumber after getting permission from theWarner Losh2007-10-291-4/+1
| | | | | | | author (quite some time ago). Notes: svn path=/head/; revision=173127
* Micro-optimization of prev. commit, changeAndrey A. Chernov2007-10-271-1/+1
| | | | | | | (_c < 0 || _c >= 128) to (_c & ~0x7F) Notes: svn path=/head/; revision=173084
* Small improvement for __isctype(): don't use __mb_sb_limit butAndrey A. Chernov2007-10-271-1/+1
| | | | | | | | hardcode 128 here instead, since default locale never define anything above 127 char. Notes: svn path=/head/; revision=173053
* Back out iswascii change from prev. commit, iswascii was right,Andrey A. Chernov2007-10-141-1/+1
| | | | | | | some overlook from me. Notes: svn path=/head/; revision=172630
* The problem is: currently our single byte ctype(3) functions are brokenAndrey A. Chernov2007-10-133-23/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | for wide characters locales in the argument range >= 0x80 - they may return false positives. Example 1: for UTF-8 locale we currently have: iswspace(0xA0)==1 and isspace(0xA0)==1 (because iswspace() and isspace() are the same code) but must have iswspace(0xA0)==1 and isspace(0xA0)==0 (because there is no such character and all others in the range 0x80..0xff for the UTF-8 locale, it keeps ASCII only in the single byte range because our internal wchar_t representation for UTF-8 is UCS-4). Example 2: for all wide character locales isalpha(arg) when arg > 0xFF may return false positives (must be 0). (because iswalpha() and isalpha() are the same code) This change address this issue separating single byte and wide ctype and also fix iswascii() (currently iswascii() is broken for arguments > 0xFF). This change is 100% binary compatible with old binaries. Reviewied by: i18n@ Notes: svn path=/head/; revision=172619
* Install the forgotten /usr/include/geom/multipath/ header.Ruslan Ermilov2007-10-011-2/+4
| | | | | | | Approved by: re (kensmith) Notes: svn path=/head/; revision=172397
* Bring in the GEOM Virtualisation class, which allows to create huge GEOMPawel Jakub Dawidek2007-09-231-1/+1
| | | | | | | | | | | | providers with limited physical storage and add physical storage as needed. Submitted by: Ivan Voras Sponsored by: Google Summer of Code 2006 Approved by: re (kensmith) Notes: svn path=/head/; revision=172302
* Remove old prototypes for addr2ascii() and ascii2addr(), functions which noBruce M Simpson2007-08-241-2/+0
| | | | | | | | | | longer exist in libc. Requested by: Craig Rodrigues Approved by: re (kensmith) Notes: svn path=/head/; revision=171954
* declare struct tftphdr and embedded union as beeing packed, which isBernd Walter2007-08-011-2/+2
| | | | | | | | | | | required for arm. Tested on: arm, i386, amd64 Approved by: re (rwatson) MFC after: 1 week Notes: svn path=/head/; revision=171680
* Disconnect netatm from the build as it is not MPSAFE and relies onRobert Watson2007-07-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | NET_NEEDS_GIANT, which will shortly be removed. This is done in a away that it may be easily reattached to the build before 7.1 if appropriate locking is added. Specifics: - Don't install netatm include files - Disconnect netatm command line management tools - Don't build libatm - Don't include ATM parts in rescue or sysinstall - Don't install sample configuration files and documents - Don't build kernel support as a module or in NOTES - Don't build netgraph wrapper nodes for netatm This removes the last remaining consumer of NET_NEEDS_GIANT. Reviewed by: harti Discussed with: bz, bms Approved by: re (kensmith) Notes: svn path=/head/; revision=171453
* I4B header files were repo-copied from sys/i386/include toBjoern A. Zeeb2007-07-061-0/+15
| | | | | | | | | | | | | | | sys/i4b/include/ so they will be available to all architectures once I4B compiles on those. I4B header files are now installed in include/i4b/ and no longer in include/machine/. For now we still install the headers for i386 only. Approved by: re (kensmith) Notes: svn path=/head/; revision=171271
* Significantly reduce the memory leak as noted in BUGS section forSean Farley2007-07-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | setenv(3) by tracking the size of the memory allocated instead of using strlen() on the current value. Convert all calls to POSIX from historic BSD API: - unsetenv returns an int. - putenv takes a char * instead of const char *. - putenv no longer makes a copy of the input string. - errno is set appropriately for POSIX. Exceptions involve bad environ variable and internal initialization code. These both set errno to EFAULT. Several patches to base utilities to handle the POSIX changes from Andrey Chernov's previous commit. A few I re-wrote to use setenv() instead of putenv(). New regression module for tools/regression/environ to test these functions. It also can be used to test the performance. Bump __FreeBSD_version to 700050 due to API change. PR: kern/99826 Approved by: wes Approved by: re (kensmith) Notes: svn path=/head/; revision=171195
* Commit IPv6 support for FAST_IPSEC to the tree.George V. Neville-Neil2007-07-011-1/+1
| | | | | | | | | | | This commit includes all remaining changes for the time being including user space updates. Submitted by: bz Approved by: re Notes: svn path=/head/; revision=171135
* - Remove UMAP filesystem. It was disconnected from build three years ago,Rong-En Fan2007-06-251-2/+1
| | | | | | | | | | and it is seriously broken. Discussed on: freebsd-arch@ Approved by: re (mux) Notes: svn path=/head/; revision=171023
* Require users to provide a length information for inet_ntoa_r,Xin LI2007-06-141-1/+1
| | | | | | | | | this is common on other platforms. Reported by: pointyhat via kris Notes: svn path=/head/; revision=170715
* Add inet_ntoa_r, a reentrant version of inet_ntoa. This isXin LI2007-06-111-0/+2
| | | | | | | | | available on a lot of platforms, as well as libkern for years. Submitted by: "MQ" Notes: svn path=/head/; revision=170548
* Use tabs after #define.Stefan Farfeleder2007-06-111-5/+5
| | | | | | | | Obtained from: NetBSD Spotted by: njl Notes: svn path=/head/; revision=170547
* Add _PATH_FWMEM for libkvm.Hidetoshi Shimokawa2007-06-111-0/+1
| | | | Notes: svn path=/head/; revision=170527
* Merge NetBSD changes, among them:Stefan Farfeleder2007-06-101-2/+5
| | | | | | | | | | | | | | | | | el.c 1.44, el.h 1.17, editline.3 1.53, histedit.h 1.31: # add EL_GETFP, and EL_SETFP. el.c 1.42, term.c 1.46, term.h 1.18, editline.3 1.52, histedit.h 1.29: # - Add more readline functions, enough for gdb-6.5 # - Make el_get varyadic, and implement EL_GETTC. # - XXX: the EL_SETTC api will change in the future. Note: The latter change breaks the ABI of the el_get() function. Approved by: re (kensmith) Notes: svn path=/head/; revision=170511
* Merge BIND 9.4.1 into main chunk.Hajimu UMEMOTO2007-06-035-298/+302
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=170244
* Back out all POSIXified *env() changes.Andrey A. Chernov2007-05-011-2/+2
| | | | | | | | | | | | Not because I admit they are technically wrong and not because of bug reports (I receive nothing). But because I surprisingly meets so strong opposition and resistance so lost any desire to continue that. Anyone who interested in POSIX can dig out what changes and how through cvs diffs. Notes: svn path=/head/; revision=169177
* Fix unsetenv and putenv prototypes to conform Open Group specs Issue 6Andrey A. Chernov2007-04-301-2/+2
| | | | | | | (also IEEE Std 1003.1-2001) Notes: svn path=/head/; revision=169110
* Install only types.h from sys/rpc/.Pawel Jakub Dawidek2007-04-131-1/+9
| | | | | | | | Requested by: ache Explained how by: ru Notes: svn path=/head/; revision=168677
* Move rpc/types.h under sys/, as this is used by ZFS kernel module.Pawel Jakub Dawidek2007-04-103-108/+2
| | | | | | | Repo-copied by: simon Notes: svn path=/head/; revision=168606
* - Remove SEEK_DATA and SEEK_HOLE from stdio.h, they don't belong here.Pawel Jakub Dawidek2007-04-071-6/+0
| | | | | | | | | | - Only define SEEK_DATA and SEEK_HOLE in sys/unistd.h when neither _POSIX_SOURCE nor _XOPEN_SOURCE is defined. Pointed out by: bde, ache Notes: svn path=/head/; revision=168469
* Implement SEEK_DATA and SEEK_HOLE extensions to lseek(2) as found inPawel Jakub Dawidek2007-04-051-0/+6
| | | | | | | | | OpenSolaris. For more information please refer to: http://blogs.sun.com/bonwick/entry/seek_hole_and_seek_data Notes: svn path=/head/; revision=168397
* Update the dump program to save extended attributes. UpdateKirk McKusick2007-02-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the restore program to restore all dumped extended attributes. If the restore is running as root, it will always be able to restore all extended attributes. If it is not running as root, it makes a best effort to set them. Using the -v command line flag or the `verbose' command in interactive mode will display all the extended attributes being set on files (and at the end on directories) that are being restored. It will note any extended attributes that could not be set. The extended attributes are placed on the dump image immediately following each file's data. Older versions of restore can work with the newer dump images. Old versions of restore will correctly restore the file data and then (silently) skip over the extended attribute data and proceed to the next file. This resolves PR 93085 which will be closed once the code has been MFC'ed. Note that this code will not compile until these header files have been updated: <protocols/dumprestore.h> and <sys/extattr.h>. PR: bin/93085 Comments from: Poul-Henning Kamp and Robert Watson MFC after: 3 weeks Notes: svn path=/head/; revision=167011
* Makefile changes to reflect moving sys/isofs/cd9660 to sys/fs/cd9660.Craig Rodrigues2007-02-111-1/+8
| | | | | | | | Continue to install userland include files in /usr/include/isofs/cd9660 so as not to break userland applications such as libstand. Notes: svn path=/head/; revision=166640
* Properly parenthesize the __tg_is_complex() macro by moving a closingJens Schweikhardt2007-02-021-2/+2
| | | | | | | | | paren to where it belongs. MFC after: 7 days Notes: svn path=/head/; revision=166432
* Comment the token after #endif, like we do everywhere else.Jens Schweikhardt2007-02-021-6/+6
| | | | | | | | | Static analyzers like FlexeLint complain about it. MFC after: 7 days Notes: svn path=/head/; revision=166431
* Oops, remove an objformat.h reference.Peter Wemm2007-01-251-1/+1
| | | | Notes: svn path=/head/; revision=166243
* Remove more a.out strays, as threatened in 2002.Peter Wemm2007-01-251-39/+0
| | | | Notes: svn path=/head/; revision=166241
* Add function __mq_oshandle() to get file handle of a mqueue.David Xu2007-01-061-0/+2
| | | | Notes: svn path=/head/; revision=165828
* Merge BIND9 9.3.3 into main chunk.Hajimu UMEMOTO2006-12-151-1/+1
| | | | | | | | Obtained from: ISC MFC after: 1 week Notes: svn path=/head/; revision=165258