aboutsummaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* MFS9 r255306:Dimitry Andric2013-09-061-0/+1
| | | | | | | | | | | | | | | MFC r245428: Add CLOCK_PROCESS_CPUTIME_ID to <time.h>, to synchronize the CLOCK_* values with those in <sys/time.h>. Otherwise, if a program includes <time.h> before <sys/time.h>, the CLOCK_PROCESS_CPUTIME_ID macro never gets defined. Reviewed by: davidxu Approved by: re (kib) Notes: svn path=/releng/9.2/; revision=255308
* MF9 r254783: Correct implementation of atomic_flag_test_and_setEd Maste2013-08-241-1/+1
| | | | | | | Approved by: re Notes: svn path=/releng/9.2/; revision=254785
* 1) POSIX requires rand(3) return values to be in the [0, RAND_MAX]Andrey A. Chernov2013-07-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | range, but ACM formula we use have internal state (and return value) in the [1, 0x7ffffffe] range, so our RAND_MAX (0x7fffffff) is never reached because it is off by one, zero is not reached too. Correct both RAND_MAX and rand(3) return value, shifting last one to the 0 by 1 subtracted, resulting POSIXed [0, 0x7ffffffd(=new RAND_MAX)] range. 2) Add a checks for not overflowing on too big seeds. It may happens on the machines, where sizeof(unsigned int) > 32 bits. This change is binary compatible because range is reduced, not expanded, so no bump is needed. Reviewed by: bde Approved by: re (glebius) Notes: svn path=/stable/9/; revision=253607
* MFC 246120,246148,246206,246587,247411,247415:John Baldwin2013-06-282-0/+3
| | | | | | | | | | Add fmemopen(3), open_memstream(3), and open_wmemstream(3) which provide stdio FILE objects for memory buffers. port exprun by: bdrewery Notes: svn path=/stable/9/; revision=252343
* 240618, 240621, 240633, 240671, 240672, 240697, 240700, 241433,Jim Harris2013-06-251-2/+2
| | | | | | | | | | | | | | | 241434, 241657, 241658, 241659, 241660, 241661, 241662, 241663, 241664, 241665, 241689, 242420, 243951, 244410, 244411, 244413, 244549, 245136, 247963, 248729, 248730, 248731, 248732, 248733, 248734, 248735, 248736, 248737, 248738, 248739, 248740, 248741, 248746, 248747, 248748, 248749, 248754, 248755, 248756, 248757, 248758, 248759, 248760, 248761, 248762, 248763, 248764, 248765, 248766, 248767, 248768, 248769, 248770, 248771, 248772, 248773, 248780, 248834, 248835, 248913, 248977, 249067, 249416, 249417, 249418, 249419, 249420, 249421, 249422, 249432 Notes: svn path=/stable/9/; revision=252222
* MFC remainder of r249802 (eadler) to fix build:Glen Barber2013-04-261-1/+1
| | | | | | | | - sl_find does not modify 'name' - make the prototype of sl_find match NetBSD Notes: svn path=/stable/9/; revision=249922
* MFC r245886,245911Brooks Davis2013-03-151-1/+6
| | | | | | | Don't install telnet.h if it will be installed by libtelnet. Notes: svn path=/stable/9/; revision=248357
* MFC 246367:John Baldwin2013-03-011-4/+21
| | | | | | | | Install <dev/agp/agpreg.h> and <dev/pci/pcireg.h> as userland headers in /usr/include. Notes: svn path=/stable/9/; revision=247566
* MFC r243245:Edward Tomasz Napierala2013-02-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add UFS writesuspension mechanism, designed to allow userland processes to modify on-disk metadata for filesystems mounted for write. Reviewed by: kib, mckusick Sponsored by: FreeBSD Foundation MFC r243247: Add change missed in 243245. MFC r243250: Fix build of kdump(1). MFC r243254: Fix build on powerpc. Reviewed by: nwhitehorn MFC r243305 by marius: Fix build after r243245. Submitted by: trasz MFC r243339 by kib: Fix module build after r243245. Notes: svn path=/stable/9/; revision=246234
* MFC r244401,245305,245308:Brooks Davis2013-01-142-92/+4
| | | | | | | | | | | | | Replace our implementation of the vis(3) and unvis(3) APIs with NetBSD's. This output size limited versions of vis and unvis functions as well as a set of vis variants that allow arbitrary characters to be specified for encoding. Finally, MIME Quoted-Printable encoding as described in RFC 2045 is supported. Notes: svn path=/stable/9/; revision=245439
* MFC r241731:Brooks Davis2013-01-102-0/+8
| | | | | | | | | | | | | | Replace our version of the pwcache(3) API with NetBSD's implementation. This adds two features: * uid_from_user() and gid_from_group() as the reverse of user_from_uid() and groups_from_gid(). * pwcache_userdb() and pwcache_groupdb() which allow alternative lookup functions to be used. For example lookups from passwd and group databases in a non-standard location. Notes: svn path=/stable/9/; revision=245267
* MFC r229848:Ed Schouten2012-11-221-0/+1
| | | | | | | | | | | | | | | | | Add aligned_alloc(3). 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). I'm MFCing this now, as it seems aligned_alloc(3) is needed to make the new version of libc++ work, which was merged back to FreeBSD 9 in r243376. Requested by: dim Notes: svn path=/stable/9/; revision=243405
* MFC r243032:Dmitry Sivachenko2012-11-201-1/+1
| | | | | | | | | Use defined() to test macro definitions. Approved by: theraven Notes: svn path=/stable/9/; revision=243331
* MFC r241141, r241165, r241165, r241181;Pedro F. Giffuni2012-10-072-8/+7
| | | | | | | | | | | | | rpc: convert all uid and gid variables to u_int. Follow a similar change in Solaris and linux where the uid and gid variables were made more similar to what the system expects. In our case we use u_int which is what XDR can manage, Reviewed by: bde Notes: svn path=/stable/9/; revision=241309
* MFC r241007, r241008:Pedro F. Giffuni2012-09-302-7/+8
| | | | | | | | | | | | Complete revert of r239963 (from head). The attempt to merge changes from the linux libtirpc caused rpc.lockd to exit after startup under unclear conditions. Reported by: David Wolfskill Notes: svn path=/stable/9/; revision=241059
* MFC r239963:Pedro F. Giffuni2012-09-222-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bring some changes from Bull's NFSv4 libtirpc implementation. ____ Fixed infinite loop in svc_run() ____ __rpc_taddr2uaddr_af() assumes the netbuf to always have a non-zero data. This is a bad assumption and can lead to a seg-fault. This patch adds a check for zero length and returns NULL when found. ____ Changed clnt_spcreateerror() to return clearer and more concise error messages. ____ Converted all uid and gid variables of the type uid_t and gid_t. ____ libtirpc: set r_netid and r_owner in __rpcb_findaddr_timed These fields in the rpcbind GETADDR call are being passed uninitialized to CLNT_CALL. In the case of x86_64 at least, this usually leads to a segfault. On x86, it sometimes causes segfaults and other times causes garbage to be sent on the wire. rpcbind generally ignores the r_owner field for calls that come in over the wire, so it really doesn't matter what we send in that slot. We just need to send something. The reference implementation from Sun seems to send a blank string. Have ours follow suit. ____ libtirpc: be sure to free cl_netid and cl_tp When creating a client with clnt_tli_create, it uses strdup to copy strings for these fields if nconf is passed in. clnt_dg_destroy frees these strings already. Make sure clnt_vc_destroy frees them in the same way. ____ Obtained from: Bull GNU/Linux NFSv4 Project Notes: svn path=/stable/9/; revision=240799
* MFC r240060, r240062:Pedro F. Giffuni2012-09-161-10/+10
| | | | | | | | | | Rename __rpc_xdr with XDR. This fixes at least one C++ application and matches what upstream (Solaris) has done on their xdr.h header. PR: 137443 Notes: svn path=/stable/9/; revision=240542
* MFH r236751: document sha256 / sha512 supportDag-Erling Smørgrav2012-07-151-1/+0
| | | | | | | | | | | MFH r236892: remove mention of auth.conf from programs that don't use it MFH r236963: remove dead code relating to auth.conf MFH r236965 r236966 r236967 r237005 r237006 r237011: retire auth.conf Approved by: re Notes: svn path=/stable/9/; revision=238481
* MFC: r237279: install filemon.h into /usr/include for userland consumption.David E. O'Brien2012-07-021-1/+1
| | | | Notes: svn path=/stable/9/; revision=237968
* MFC r228862, 228880, 228882, 228906, 228977, 229332, 229575, 229591, 229704,David Chisnall2012-05-302-45/+419
| | | | | | | | | | | 229716, 230062, 230225, 230267, 234958 This brings stdatomic.h into -STABLE and includes improvements to tgmath.h that significantly decrease compile times on a C11 compiler (such as the clang in the base system). Notes: svn path=/stable/9/; revision=236326
* Merge quick_exit and changes required for C++11 code to compile against ↵David Chisnall2012-05-223-5/+17
| | | | | | | | | | | FreeBSD headers. Merges changes from: r227472 r227475 r227475 r227476 r227476 r227490 r227490 r228322 r228323 r228329 r228330 r228528 r228529 r228529 r228901 r228918 r228918 r232971 r232971 Also bump __FreeBSD_version for this and the xlocale merge. Notes: svn path=/stable/9/; revision=235786
* MFC the xlocale implementation.David Chisnall2012-05-2225-27/+954
| | | | | | | | | | Merged revisions: 227487,227753,227807,227818,227999,228002,228875,230156,231673,232498,232601,232620,232626,232926-232927,232929,232931,232935,233173,233600,234573,234578,235239 This currently defines __NO_TLS on ARM (unlike head), because the required support function has not been MFC'd. Notes: svn path=/stable/9/; revision=235785
* MFC r234785:Dimitry Andric2012-05-172-4/+4
| | | | | | | | | Add a convenience macro for the returns_twice attribute, and apply it to the prototypes of the appropriate functions (getcontext, savectx, setjmp, sigsetjmp and vfork). Notes: svn path=/stable/9/; revision=235539
* MFC r228924:Xin LI2012-02-281-1/+1
| | | | | | | | | | | | | In POSIX.1-2008: 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. Notes: svn path=/stable/9/; revision=232277
* MFC r231118:Dimitry Andric2012-02-142-2/+2
| | | | | | | | Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor set via ${CPP} is used, instead of always using hardcoded /usr/bin/cpp. Notes: svn path=/stable/9/; revision=231702
* MFC r229590 manually:Ed Schouten2012-02-091-1/+1
| | | | | | | | | | | | | | | 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. Notes: svn path=/stable/9/; revision=231282
* MFC r229768:Konstantin Belousov2012-01-211-0/+1
| | | | | | | | Implement fdlopen(3), an rtld interface to load shared object by file descriptor. Notes: svn path=/stable/9/; revision=230410
* MFC r228754:Eitan Adler2012-01-081-1/+2
| | | | | | | | | | - Add restrict keyword to glob(3) PR: kern/161958 Approved by: jilles Notes: svn path=/stable/9/; revision=229823
* MFC r228444:Matthew D Fleming2012-01-021-0/+2
| | | | | | | | | | | | | | | | | | | - Define true and false in sys/types.h for _KERNEL consumers, and 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 rebuilt with this change. Bump __FreeBSD_version. No KBI change is expected based on review of the code. Notes: svn path=/stable/9/; revision=229285
* Fix a problem whereby a corrupt DNS record can cause named to crash. [11:06]Colin Percival2011-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 Notes: svn path=/stable/9/; revision=228843
* MFC: r226035Jung-uk Kim2011-10-051-0/+4
| | | | | | | | | Avoid accidental conflicts with C++ operator keywords. Approved by: re (kib) Notes: svn path=/stable/9/; revision=226036
* MFC r225790:Konstantin Belousov2011-10-041-1/+1
| | | | | | | | | | Install ciss(4) ioctl header. PR: kern/109813 Approved by: re (bz) Notes: svn path=/stable/9/; revision=225967
* Revert the previous change and add xdr_sizeofKevin Lo2011-07-101-39/+37
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=223906
* - Add xdr_sizeof(3) to libcKevin Lo2011-07-091-37/+40
| | | | | | | | | - Document xdr_sizeof(3); from NetBSD Discussed with: kib Notes: svn path=/head/; revision=223877
* * Add the readline(3) API to libedit. The libedit versions ofDavid E. O'Brien2011-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 Notes: svn path=/head/; revision=220370
* MFgraid/head:Alexander Motin2011-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. Notes: svn path=/head/; revision=219974
* Add missing declarations that I intended to commit with r219359.David Schultz2011-03-071-0/+2
| | | | | | | Not sure why we have math.h in lib/msun/ and complex.h in include/. Notes: svn path=/head/; revision=219379
* Include stdio.h, so we can include printf.h in any order, as it needs FILE.Pawel Jakub Dawidek2011-03-061-0/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=219343
* Add two new system calls, setloginclass(2) and getloginclass(2). This makesEdward Tomasz Napierala2011-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) Notes: svn path=/head/; revision=219304
* POSIX.1-2008 moved some constants from the XSI option to the Base.Jilles Tjoelker2011-03-041-4/+7
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=219271
* Fix some _POSIX minimum/maximum values in limits.h:Jilles Tjoelker2011-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 Notes: svn path=/head/; revision=219256
* Add the BSD-licensed Citrus iconv to the base system with default offGabor Kovesdan2011-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 Notes: svn path=/head/; revision=219019
* Add restrict keyword to pthread_sigmask prototype and manpage.Konstantin Belousov2011-02-201-1/+2
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=218881
* Install iodev.h.Konstantin Belousov2011-02-171-1/+1
| | | | | | | | Reviewed by: attilio MFC after: 1 week Notes: svn path=/head/; revision=218772
* Introduce a non-portable function pthread_getthreadid_np(3) to retrieveJung-uk Kim2011-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 Notes: svn path=/head/; revision=218414
* Add missing __dead2 to __assert().Ed Schouten2011-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 Notes: svn path=/head/; revision=217207
* Remove leftover for r214093.David Xu2011-01-061-9/+0
| | | | Notes: svn path=/head/; revision=217039
* rpc.lockd(8) WARNS cleanupUlrich Spörlein2010-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 Notes: svn path=/head/; revision=216603
* Sync with OpenBSD, primarily better signal and terminal handling.Xin LI2010-11-131-23/+17
| | | | | | | | Obtained from: OpenBSD MFC after: 2 weeks Notes: svn path=/head/; revision=215236
* Add a new libc function: cfmakesane(3).Ed Schouten2010-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_*. Notes: svn path=/head/; revision=214680