summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Order the str*.c files mostly alphabetical.kib2008-12-061-3/+3
| | | | | Submitted by: Florian Smeets <flo kasimir com> MFC after: 2 weeks
* Add an easier example.pjd2008-12-051-1/+16
| | | | Reviewed by: trasz
* The times(3) function returns the number of CLK_TCKs since thekeramida2008-12-011-4/+9
| | | | | | | | startup time of FreeBSD, not since the UNIX Epoch. PR: docs/122359 Submitted by: Viktor &#352;tujber MFC after: 1 week
* Fix fread() to return a correct value on platforms where sizeof(int) !=ru2008-12-011-1/+1
| | | | | | | sizeof(size_t), i.e. on all 64-bit platforms. Reported by: Andrey V. Elsukov MFC after: 3 days
* Fix a lock order reversal bug that could cause deadlock during fork(2).jasone2008-12-011-11/+37
| | | | Reported by: kib
* It's silly to claim recv(2) is to be removed in favour of recvfrom(2)ivoras2008-11-301-1/+0
| | | | | | (at least at this time :) ). Approved by: gnn (mentor)
* Adjust an assertion to handle the case where a lock is contested, butjasone2008-11-301-1/+1
| | | | | | spinning is avoided due to running on a single-CPU system. Reported by: stefanf
* Do not spin when trying to lock on a single-CPU system.jasone2008-11-301-11/+13
| | | | Reported by: davidxu
* MFp4:bz2008-11-292-9/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bring in updated jail support from bz_jail branch. This enhances the current jail implementation to permit multiple addresses per jail. In addtion to IPv4, IPv6 is supported as well. Due to updated checks it is even possible to have jails without an IP address at all, which basically gives one a chroot with restricted process view, no networking,.. SCTP support was updated and supports IPv6 in jails as well. Cpuset support permits jails to be bound to specific processor sets after creation. Jails can have an unrestricted (no duplicate protection, etc.) name in addition to the hostname. The jail name cannot be changed from within a jail and is considered to be used for management purposes or as audit-token in the future. DDB 'show jails' command was added to aid debugging. Proper compat support permits 32bit jail binaries to be used on 64bit systems to manage jails. Also backward compatibility was preserved where possible: for jail v1 syscalls, as well as with user space management utilities. Both jail as well as prison version were updated for the new features. A gap was intentionally left as the intermediate versions had been used by various patches floating around the last years. Bump __FreeBSD_version for the afore mentioned and in kernel changes. Special thanks to: - Pawel Jakub Dawidek (pjd) for his multi-IPv4 patches and Olivier Houchard (cognet) for initial single-IPv6 patches. - Jeff Roberson (jeff) and Randall Stewart (rrs) for their help, ideas and review on cpuset and SCTP support. - Robert Watson (rwatson) for lots and lots of help, discussions, suggestions and review of most of the patch at various stages. - John Baldwin (jhb) for his help. - Simon L. Nielsen (simon) as early adopter testing changes on cluster machines as well as all the testers and people who provided feedback the last months on freebsd-jail and other channels. - My employer, CK Software GmbH, for the support so I could work on this. Reviewed by: (see above) MFC after: 3 months (this is just so that I get the mail) X-MFC Before: 7.2-RELEASE if possible
* Add two rtld exported symbols, _rtld_atfork_pre and _rtld_atfork_post.kib2008-11-272-0/+14
| | | | | | | | | | | | | | Threading library calls _pre before the fork, allowing the rtld to lock itself to ensure that other threads of the process are out of dynamic linker. _post releases the locks. This allows the rtld to have consistent state in the child. Although child may legitimately call only async-safe functions, the call may need plt relocation resolution, and this requires working rtld. Reported and debugging help by: rink Reviewed by: kan, davidxu MFC after: 1 month (anyway, not before 7.1 is out)
* Update ZFS from version 6 to 13 and bring some FreeBSD-specific changes.pjd2008-11-171-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bring huge amount of changes, I'll enumerate only user-visible changes: - Delegated Administration Allows regular users to perform ZFS operations, like file system creation, snapshot creation, etc. - L2ARC Level 2 cache for ZFS - allows to use additional disks for cache. Huge performance improvements mostly for random read of mostly static content. - slog Allow to use additional disks for ZFS Intent Log to speed up operations like fsync(2). - vfs.zfs.super_owner Allows regular users to perform privileged operations on files stored on ZFS file systems owned by him. Very careful with this one. - chflags(2) Not all the flags are supported. This still needs work. - ZFSBoot Support to boot off of ZFS pool. Not finished, AFAIK. Submitted by: dfr - Snapshot properties - New failure modes Before if write requested failed, system paniced. Now one can select from one of three failure modes: - panic - panic on write error - wait - wait for disk to reappear - continue - serve read requests if possible, block write requests - Refquota, refreservation properties Just quota and reservation properties, but don't count space consumed by children file systems, clones and snapshots. - Sparse volumes ZVOLs that don't reserve space in the pool. - External attributes Compatible with extattr(2). - NFSv4-ACLs Not sure about the status, might not be complete yet. Submitted by: trasz - Creation-time properties - Regression tests for zpool(8) command. Obtained from: OpenSolaris
* On i386, the primary function that SYSCALL() generates is with thepeter2008-11-153-3/+3
| | | | | __sys_ prefix. Make END() match. This didn't cause a compile error, but the function size is attached to the .weak symbol, not the real one.
* Several cleanups related to pipe(2).ed2008-11-111-6/+1
| | | | | | | | | | | | | | | | | | - Use `fildes[2]' instead of `*fildes' to make more clear that pipe(2) fills an array with two descriptors. - Remove EFAULT from the manual page. Because of the current calling convention, pipe(2) raises a segmentation fault when an invalid address is passed. - Introduce kern_pipe() to make it easier for binary emulations to implement pipe(2). - Make Linux binary emulation use kern_pipe(), which means we don't have to recover td_retval after calling the FreeBSD system call. Approved by: rdivacky Discussed on: arch
* Mark uname(), getdomainname() and setdomainname() with COMPAT_FREEBSD4.ed2008-11-097-15/+8
| | | | | | | | | | | | | | | | | | | | | Looking at our source code history, it seems the uname(), getdomainname() and setdomainname() system calls got deprecated somewhere after FreeBSD 1.1, but they have never been phased out properly. Because we don't have a COMPAT_FREEBSD1, just use COMPAT_FREEBSD4. Also fix the Linuxolator to build without the setdomainname() routine by just making it call userland_sysctl on kern.domainname. Also replace the setdomainname()'s implementation to use this approach, because we're duplicating code with sysctl_domainname(). I wasn't able to keep these three routines working in our COMPAT_FREEBSD32, because that would require yet another keyword for syscalls.master (COMPAT4+NOPROTO). Because this routine is probably unused already, this won't be a problem in practice. If it turns out to be a problem, we'll just restore this functionality. Reviewed by: rdivacky, kib
* Add one more EACCES clause to rename.2.trasz2008-11-071-0/+5
| | | | Approved by: rwatson (mentor)
* Replace the non-standard disclaimer with the standard one from /COPYRIGHTimp2008-11-0419-152/+152
| | | | Approved by: jedgar@
* Revert to preferring mmap(2) over sbrk(2) when mapping memory, due tojasone2008-11-032-13/+18
| | | | | | | potential extreme contention in the kernel for multi-threaded applications on SMP systems. Reported by: kris
* Implement support for RPCSEC_GSS authentication to both the NFS clientdfr2008-11-033-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and server. This replaces the RPC implementation of the NFS client and server with the newer RPC implementation originally developed (actually ported from the userland sunrpc code) to support the NFS Lock Manager. I have tested this code extensively and I believe it is stable and that performance is at least equal to the legacy RPC implementation. The NFS code currently contains support for both the new RPC implementation and the older legacy implementation inherited from the original NFS codebase. The default is to use the new implementation - add the NFS_LEGACYRPC option to fall back to the old code. When I merge this support back to RELENG_7, I will probably change this so that users have to 'opt in' to get the new code. To use RPCSEC_GSS on either client or server, you must build a kernel which includes the KGSSAPI option and the crypto device. On the userland side, you must build at least a new libc, mountd, mount_nfs and gssd. You must install new versions of /etc/rc.d/gssd and /etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf. As long as gssd is running, you should be able to mount an NFS filesystem from a server that requires RPCSEC_GSS authentication. The mount itself can happen without any kerberos credentials but all access to the filesystem will be denied unless the accessing user has a valid ticket file in the standard place (/tmp/krb5cc_<uid>). There is currently no support for situations where the ticket file is in a different place, such as when the user logged in via SSH and has delegated credentials from that login. This restriction is also present in Solaris and Linux. In theory, we could improve this in future, possibly using Brooks Davis' implementation of variant symlinks. Supporting RPCSEC_GSS on a server is nearly as simple. You must create service creds for the server in the form 'nfs/<fqdn>@<REALM>' and install them in /etc/krb5.keytab. The standard heimdal utility ktutil makes this fairly easy. After the service creds have been created, you can add a '-sec=krb5' option to /etc/exports and restart both mountd and nfsd. The only other difference an administrator should notice is that nfsd doesn't fork to create service threads any more. In normal operation, there will be two nfsd processes, one in userland waiting for TCP connections and one in the kernel handling requests. The latter process will create as many kthreads as required - these should be visible via 'top -H'. The code has some support for varying the number of service threads according to load but initially at least, nfsd uses a fixed number of threads according to the value supplied to its '-n' option. Sponsored by: Isilon Systems MFC after: 1 month
* Add the ffsll and flsll functions. These are ffs and fls operatingkib2008-11-035-8/+122
| | | | | | | | on long long arguments. Reviewed by: bde (previous version, that included asm implementation for all ffs and fls functions on i386 and amd64) MFC after: 2 weeks
* Fix style.kib2008-11-031-1/+1
|
* Sync with OpenBSD's dirname(3) - license change, avoid strcpy() overdelphij2008-11-032-68/+46
| | | | | string constant, use memcpy() instead of strncpy() and improve code readibility. No functional change.
* Add missing END() macros, as per rev 184547 for amd64. The lack of thesepeter2008-11-0243-4/+59
| | | | is mostly harmless, but it does upset some of valgrind's functionality.
* We've been lax about matching END() macros in asm code for some time. Thispeter2008-11-0227-4/+46
| | | | | | | is used to set the ELF size attribute for functions. It isn't normally critical but some things can make use of it (gdb for stack traces). Valgrind needs it so I'm adding it in. The problem is present on all branches and on both i386 and amd64.
* In example use of err(3) and errx(3), use sysexits(3) constants.rwatson2008-10-311-4/+5
| | | | | MFC after: 3 days Submitted by: Bruce Cran <bruce at cran dot org dot uk>
* Pass a pointer to warn2 so the warn2 == IN_ALL would not be andelphij2008-10-301-1/+1
| | | | always-false condition.
* Finish what revision 1.40 started. Revision 1.40 removed a false statementalc2008-10-241-8/+6
| | | | | | | from the description but not the errors section. This revision removes it from the errors statement. Add a statement about the non-portability of non-page-aligned offsets.
* Fix a typo.rdivacky2008-10-231-1/+1
| | | | Approved by: kib (mentor)
* Fix a typo. q is already a pointer.kib2008-10-221-1/+1
| | | | | Reported by: ache Pointy hat to: kib
* Remove doubtful structure definition with variable array members.kib2008-10-221-67/+75
| | | | | | | | | | | | I believe this is not a valid C99 construct. Use directly calculated offsets into the supplied buffer, using specified members length, to fill appropriate structure. Either use sysctl, or copy the value of the UNAME_x environment variable, instead of unconditionally doing sysctl, and then overriding a returned value with user-specified one. Noted and tested by: rdivacky
* - License change to a less restrictive one;delphij2008-10-191-33/+16
| | | | | | | | - ANSIfy; - Convert do {} while loop -> while {} for clarity; - Sync RCS ID with OpenBSD; Obtained from: OpenBSD
* Further simplify the code.delphij2008-10-191-11/+2
| | | | Submitted by: Christoph Mallon <christoph.mallon gmx.de>
* Use strlcpy() in !localized case to avoid the -1's.delphij2008-10-171-2/+1
|
* MTC r183949:netchild2008-10-171-0/+5
| | | | | | | Allow to define MALLOC_PRODUCTION with a make variable instead of polluting the global CFLAGS. Reviewed by: jasone
* Let libstand(3) build on ARM.raj2008-10-141-0/+4
| | | | This is a pre-requisite for loader(8) + U-Boot support library on this arch.
* Add unistd.h to the getosreldate(3) manpage.kib2008-09-301-1/+2
| | | | | | Update referenced example to include unistd.h per manpage. Update example to be more style(9)-ish, silence warnings and add FreeBSD id to the source file.
* Support for CPU sets is going to appear in 7.1 before 8.0.jhb2008-09-292-2/+2
| | | | MFC after: 3 days
* Fix some ifdef logic in the libc syncicache() bit that I somehow missed in thenwhitehorn2008-09-241-1/+3
| | | | last commit. Now it really can use a runtime-set cacheline size.
* Allow the cacheline size on PowerPC to be set at runtime. This is essential fornwhitehorn2008-09-241-16/+16
| | | | | supporting 64-bit CPUs, which often have 128-byte cache lines instead of the standard 32.
* <osreldate.h> does not have a forward declration of getosreldate(), sorodrigc2008-09-201-1/+0
| | | | | | remove it from this man page. MFC after: 3 days
* Move uuid_enc_le, uuid_dec_le, uuid_enc_be and uuid_dec_be symbolsemax2008-09-191-0/+3
| | | | | | | into FBSD_1.1 section where they should be. Pointed out by: kib, deischen MFC after: 3 days
* Add uuid_enc,dec_le,be() functions to Symbol.mapemax2008-09-151-0/+4
| | | | | | Pointy hat goes to me. MFC after: 3 days
* Fix async mode (required for ypbind in manycast mode).dfr2008-09-151-2/+2
|
* Use PAGE_{SIZE,MASK,SHIFT} from machine/param.h rather than hard-codingjasone2008-09-101-120/+88
| | | | | | page size and using sysconf(3). Suggested by: marcel
* Initialise the SVCAUTH field for new transport structures when they aredfr2008-09-092-2/+3
| | | | | | | allocated instead of waiting for the first request. This fixes an issue with rpcbind's support for PMAPPROC_CALLIT. Reviewed by: markm
* Return two fixes from previous backout which does not requireache2008-09-091-1/+2
| | | | | | | | | | | | | | | | | review by secteam@ for the reasons mentioned below. 1) Rename /dev/urandom to /dev/random since urandom marked as XXX Deprecated alias in /sys/dev/random/randomdev.c (this is our naming convention and no review by secteam@ required) 2) Set rs_stired flag after forced initialization to prevent double stearing. (this is already in OpenBSD, i.e. they don't have double stearing. It means that this change matches their code path and no additional secteam@ review required) Submitted by: Thorsten Glaser <tg@mirbsd.de> (2)
* Unbreak ia64: pges are 8KB.marcel2008-09-061-1/+1
|
* Add two example regexps: (1) one for matching all the characterskeramida2008-09-051-0/+8
| | | | | | | | that belong in a character class, and (2) one for matching all the characters *not* in a character class. Submitted by: Mark B, mkbucc at gmail.com MFC after: 3 days
* Add thread-specific caching for small size classes, based on magazines.jasone2008-08-274-256/+1139
| | | | | | | | | | | | | | | | | | | | | | | | This caching allows for completely lock-free allocation/deallocation in the steady state, at the expense of likely increased memory use and fragmentation. Reduce the default number of arenas to 2*ncpus, since thread-specific caching typically reduces arena contention. Modify size class spacing to include ranges of 2^n-spaced, quantum-spaced, cacheline-spaced, and subpage-spaced size classes. The advantages are: fewer size classes, reduced false cacheline sharing, and reduced internal fragmentation for allocations that are slightly over 512, 1024, etc. Increase RUN_MAX_SMALL, in order to limit fragmentation for the subpage-spaced size classes. Add a size-->bin lookup table for small sizes to simplify translating sizes to size classes. Include a hard-coded constant table that is used unless custom size class spacing is specified at run time. Add the ability to disable tiny size classes at compile time via MALLOC_TINY.
* Implement WNOWAIT flag for wait4(2). It specifies that process whose statuskib2008-08-261-2/+10
| | | | | | | | | is returned shall be kept in the waitable state. Add WSTOPPED as an alias for WUNTRACED. Submitted by: Jukka Ukkonen <jau at iki fi> PR: standards/116221 MFC after: 2 weeks
* When calculating arguments to the interpreter for the shebang scriptkib2008-08-261-1/+18
| | | | | | | | executed by fexecve(2), imgp->args->fname is NULL. Moreover, there is no way to recover the path to the script being executed. Do what some other U*ixes do unconditionally, namely supply /dev/fd/n as the script path when called from fexecve(). Document requirement of having fdescfs mounted as caveat.
OpenPOWER on IntegriCloud