summaryrefslogtreecommitdiffstats
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Fix acl_set_fd(3) and acl_get_fd(3) for cases where the kernel doesn't knowtrasz2009-06-252-2/+3
| | | | anything about _PC_ACL_NFS4.
* Manual page tweaks.trasz2009-06-251-2/+2
|
* Fix c194955 - somehow I managed all the new files, tripling theirtrasz2009-06-2517-4664/+0
| | | | contents.
* Bump manual page timestamps.trasz2009-06-2519-19/+19
|
* Add NFSv4 ACL support to libc.trasz2009-06-2540-167/+7762
| | | | | | | | | | | This adds the following functions to the acl(3) API: acl_add_flag_np, acl_clear_flags_np, acl_create_entry_np, acl_delete_entry_np, acl_delete_flag_np, acl_get_extended_np, acl_get_flag_np, acl_get_flagset_np, acl_set_extended_np, acl_set_flagset_np, acl_to_text_np, acl_is_trivial_np, acl_strip_np, acl_get_brand_np. Most of them are similar to what Darwin does. There are no backward-incompatible changes. Approved by: rwatson@
* Lock around access to nc_file and netconfig_info ("ni"). The RPCdelphij2009-06-241-3/+49
| | | | | | | | | part of libc is still not thread safe but this would at least reduce the problems we have. PR: threads/118544 Submitted by: Changming Sun <snnn119 gmail com> MFC after: 2 weeks
* Change the ABI of some of the structures used by the SYSV IPC API:jhb2009-06-245-8/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The uid/cuid members of struct ipc_perm are now uid_t instead of unsigned short. - The gid/cgid members of struct ipc_perm are now gid_t instead of unsigned short. - The mode member of struct ipc_perm is now mode_t instead of unsigned short (this is merely a style bug). - The rather dubious padding fields for ABI compat with SV/I386 have been removed from struct msqid_ds and struct semid_ds. - The shm_segsz member of struct shmid_ds is now a size_t instead of an int. This removes the need for the shm_bsegsz member in struct shmid_kernel and should allow for complete support of SYSV SHM regions >= 2GB. - The shm_nattch member of struct shmid_ds is now an int instead of a short. - The shm_internal member of struct shmid_ds is now gone. The internal VM object pointer for SHM regions has been moved into struct shmid_kernel. - The existing __semctl(), msgctl(), and shmctl() system call entries are now marked COMPAT7 and new versions of those system calls which support the new ABI are now present. - The new system calls are assigned to the FBSD-1.1 version in libc. The FBSD-1.0 symbols in libc now refer to the old COMPAT7 system calls. - A simplistic framework for tagging system calls with compatibility symbol versions has been added to libc. Version tags are added to system calls by adding an appropriate __sym_compat() entry to src/lib/libc/incldue/compat.h. [1] PR: kern/16195 kern/113218 bin/129855 Reviewed by: arch@, rwatson Discussed with: kan, kib [1]
* Update SCCS IDs for Berkeley DB 1.86 merge.delphij2009-06-242-2/+2
|
* style: operators should appear at the line end if we have to wrap.delphij2009-06-241-2/+2
|
* Use const instead of __const, and merge the license change from NetBSD.delphij2009-06-231-9/+3
| | | | Obtained from: NetBSD
* Remove duplicate if-statement on gmt_is_set in gmtsub().edwin2009-06-231-8/+6
| | | | MFC after: 1 week
* Usermode portion of the support for swap allocation accounting:kib2009-06-231-0/+9
| | | | | | | | | | | - update for getrlimit(2) manpage; - support for setting RLIMIT_SWAP in login class; - addition to the limits(1) and sh and csh limit-setting builtins; - tuning(7) documentation on the sysctls controlling overcommit. In collaboration with: pho Reviewed by: alc Approved by: re (kensmith)
* Add a limit for child jails via the "children.cur" and "children.max"jamie2009-06-231-7/+7
| | | | | | parameters. This replaces the simple "allow.jails" permission. Approved by: bz (mentor)
* Remove unneeded stdlib directories.ed2009-06-234-12/+0
| | | | | | | It's not necessary to add stdlib directories for each architecture, even if the architecture doesn't implement any files of its own. Submitted by: Christoph Mallon
* Simplify. We can just use .sinclude here.ed2009-06-231-3/+1
| | | | Submitted by: Christoph Mallon
* Remove hand-written labs/abs implementations. GCC is smart enough.ed2009-06-233-95/+1
| | | | | | | It turns out GCC generates code that's a couple of bytes big bigger, but performs no branching whatsoever. Submitted by: Christoph Mallon
* Remove unneeded stores back into the function arguments.ed2009-06-222-4/+0
| | | | Submitted by: Christoph Mallon
* - Eliminate extra subcs instruction. I have not noticed before that westas2009-06-211-2/+1
| | | | | always perform substraction now, so no instruction could be rordered to eliminate the conditional substraction.
* - Fix strncmp on arm. Return 0 as result without performing thestas2009-06-211-5/+9
| | | | | | | | main cycle only if the len passed is equal to 0. If end address overflows use last possible address as the end address. Based on: discussion on arm@ MFC after: 1 month
* Rework the credential code to support larger values of NGROUPS andbrooks2009-06-192-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NGROUPS_MAX, eliminate ABI dependencies on them, and raise the to 1024 and 1023 respectively. (Previously they were equal, but under a close reading of POSIX, NGROUPS_MAX was defined to be too large by 1 since it is the number of supplemental groups, not total number of groups.) The bulk of the change consists of converting the struct ucred member cr_groups from a static array to a pointer. Do the equivalent in kinfo_proc. Introduce new interfaces crcopysafe() and crsetgroups() for duplicating a process credential before modifying it and for setting group lists respectively. Both interfaces take care for the details of allocating groups array. crsetgroups() takes care of truncating the group list to the current maximum (NGROUPS) if necessary. In the future, crsetgroups() may be responsible for insuring invariants such as sorting the supplemental groups to allow groupmember() to be implemented as a binary search. Because we can not change struct xucred without breaking application ABIs, we leave it alone and introduce a new XU_NGROUPS value which is always 16 and is to be used or NGRPS as appropriate for things such as NFS which need to use no more than 16 groups. When feasible, truncate the group list rather than generating an error. Minor changes: - Reduce the number of hand rolled versions of groupmember(). - Do not assign to both cr_gid and cr_groups[0]. - Modify ipfw to cache ucreds instead of part of their contents since they are immutable once referenced by more than one entity. Submitted by: Isilon Systems (initial implementation) X-MFC after: never PR: bin/113398 kern/133867
* In preparation for raising NGROUPS and NGROUPS_MAX, change basebrooks2009-06-195-20/+42
| | | | | | | | | | | | | | | | | | | | | | system callers of getgroups(), getgrouplist(), and setgroups() to allocate buffers dynamically. Specifically, allocate a buffer of size sysconf(_SC_NGROUPS_MAX)+1 (+2 in a few cases to allow for overflow). This (or similar gymnastics) is required for the code to actually follow the POSIX.1-2008 specification where {NGROUPS_MAX} may differ at runtime and where getgroups may return {NGROUPS_MAX}+1 results on systems like FreeBSD which include the primary group. In id(1), don't pointlessly add the primary group to the list of all groups, it is always the first result from getgroups(). In principle the old code was more portable, but this was only done in one of the two places where getgroups() was called to the overall effect was pointless. Document the actual POSIX requirements in the getgroups(2) and setgroups(2) manpages. We do not yet support a dynamic NGROUPS, but we may in the future. MFC after: 2 weeks
* Re-do r192913 in less intrusive way. Only do IP_RECVDSTADDR/IP_SENDSRCADDRkan2009-06-182-21/+36
| | | | | | | | | | | | | dace for UPDv4 sockets bound to INADDR_ANY. Move the code to set IP_RECVDSTADDR/IP_SENDSRCADDR into svc_dg.c, so that both TLI and non-TLI users will be using it. Back out my previous commit to mountd. Turns out the problem was affecting more than one binary so it needs to me addressed in generic rpc code in libc in order to fix them all. Reported by: lstewart Tested by: lstewart
* Retire the unused stub for the nfsclnt() system call.jhb2009-06-171-3/+0
|
* Add revoke(1).ed2009-06-151-1/+2
| | | | | | | | While hacking on TTY code, I often miss a small utility to revoke my own (pseudo-)terminals. This small utility is just a small wrapper around the revoke(2) call, so you can destroy your very own login sessions. Approved by: re
* Add a new 'void closefrom(int lowfd)' system call. When called, it closesjhb2009-06-154-1/+58
| | | | | | | | | | | | | | | | | | | | any open file descriptors >= 'lowfd'. It is largely identical to the same function on other operating systems such as Solaris, DFly, NetBSD, and OpenBSD. One difference from other *BSD is that this closefrom() does not fail with any errors. In practice, while the manpages for NetBSD and OpenBSD claim that they return EINTR, they ignore internal errors from close() and never return EINTR. DFly does return EINTR, but for the common use case (closing fd's prior to execve()), the caller really wants all fd's closed and returning EINTR just forces callers to call closefrom() in a loop until it stops failing. Note that this implementation of closefrom(2) does not make any effort to resolve userland races with open(2) in other threads. As such, it is not multithread safe. Submitted by: rwatson (initial version) Reviewed by: rwatson MFC after: 2 weeks
* Spacing fixes. No actual change.delphij2009-06-091-2/+2
|
* Do not attempt to set source address on outgoing messageskan2009-06-081-2/+2
| | | | on UDP socket if we do not have a valid IP address.
* Document EINVAL for bind(2).pjd2009-06-011-0/+3
| | | | | Reviewed by: rwatson Obtained from: SuSv3
* Use GCC's __SOFTFP__ to test whether we're being compiledmarcel2009-05-313-10/+8
| | | | | with softfloat or not. Now -msoft-float can be overridden more easily.
* Document how to enable strict RFC 1034 enforcements.delphij2009-05-291-1/+14
| | | | PR: kern/129477
* Add an option to enforce strict RFC 1034 compliance.delphij2009-05-291-0/+4
| | | | PR: kern/129477
* Match type for socket option (in practice, unnecessary, but stylistically ↵zml2009-05-281-1/+1
| | | | | | | it's a little nicer). Suggested by: jilles Approved by: dfr (mentor)
* Revert unnecessary memset after calloc.zml2009-05-281-1/+0
| | | | | Suggested by: jhb Approved by: dfr (mentor)
* Fix off by one error in acl_create_entry(3).trasz2009-05-281-1/+6
| | | | | Reviewed by: rwatson@ MFC after: 2 weeks
* Rename the queue macros I introduced last year.ed2009-05-271-1/+1
| | | | | | | | | | | | | | | | Last year I added SLIST_REMOVE_NEXT and STAILQ_REMOVE_NEXT, to remove entries behind an element in the list, using O(1) time. I recently discovered NetBSD also has a similar macro, called SLIST_REMOVE_AFTER. In my opinion this approach is a lot better: - It doesn't have the unused first argument of the list pointer. I added this, mainly because OpenBSD also had it. - The _AFTER suffix makes a lot more sense, because it is related to SLIST_INSERT_AFTER. _NEXT is only used to iterate through the list. The reason why I want to rename this now, is to make sure we don't release a major version with the badly named macros.
* Handle UDP RPC replies correctly on a multi-homed system, in userland RPC. ↵zml2009-05-272-6/+107
| | | | | | Corrects an issue with mountd replies to OS X. Approved by: dfr (mentor)
* Fix an issue when nss fallback routines are used in a multithreaded application.zml2009-05-272-4/+24
| | | | | Reviewed by: bushman Approved by: dfr (mentor)
* Add hierarchical jails. A jail may further virtualize its environmentjamie2009-05-271-5/+21
| | | | | | | | | | | | | | | | | | | | | | by creating a child jail, which is visible to that jail and to any parent jails. Child jails may be restricted more than their parents, but never less. Jail names reflect this hierarchy, being MIB-style dot-separated strings. Every thread now points to a jail, the default being prison0, which contains information about the physical system. Prison0's root directory is the same as rootvnode; its hostname is the same as the global hostname, and its securelevel replaces the global securelevel. Note that the variable "securelevel" has actually gone away, which should not cause any problems for code that properly uses securelevel_gt() and securelevel_ge(). Some jail-related permissions that were kept in global variables and set via sysctls are now per-jail settings. The sysctls still exist for backward compatibility, used only by the now-deprecated jail(2) system call. Approved by: bz (mentor)
* MFV of tzcode2009h revision r192887edwin2009-05-271-1/+1
| | | | | | - Clarify the license for the tzcode: public domain MFC after: 1 month
* Change license to more bori^Wadul^Wcanonical.trasz2009-05-261-11/+11
| | | | Submitted by: rwatson@
* Improve API documentation.trasz2009-05-235-1/+39
| | | | Reviewed by: rwatson (earlier version)
* MFV of tzcode2009e:edwin2009-05-238-376/+922
| | | | | | | | | | | | | | | | | | | | | | | | | Upgrade of the tzcode from 2004a to 2009e. Changes are numerous, but include... - New format of the output of zic, which supports both 32 and 64 bit time_t formats. - zdump on 64 bit platforms will actually produce some output instead of doing nothing for a looooooooong time. - linux_base-fX, with X >= at least 8, will work without problems related to the local time again. The original patch, based on the 2008e, has been running for a long time on both my laptop and desktop machine and have been tested by other people. After the installation of this code and the running of zic(8), you need to run tzsetup(8) again to install the new datafile. Approved by: wollman@ for usr.sbin/zic MFC after: 1 month
* Make 'struct acl' larger, as required to support NFSv4 ACLs. Providetrasz2009-05-2211-6/+111
| | | | | | compatibility interfaces in both kernel and libc. Reviewed by: rwatson
* Since audit(4) isn't based on posix1e, remove the commented out audit.h header,brueffer2009-05-191-2/+2
| | | | | | | xref libbsm(3). Submitted by: rwatson MFC after: 3 days
* As the comment says, close() frees the variable, record. So we obtaindelphij2009-05-141-1/+1
| | | | | | | | the length by evaluating the value from the copy, cbuf instead. This fixes a crash caused by previous commit (use-after-free) Submitted by: Dimitry Andric <dimitry andric com> Pointy hat to: delphij
* TTYs don't necessarily use /dev/ttyxx.ed2009-05-091-3/+2
| | | | Submitted by: csjp
* Add tcsetsid(3).ed2009-05-075-3/+109
| | | | | | | | | | | The entire world seems to use the non-standard TIOCSCTTY ioctl to make a TTY a controlling terminal of a session. Even though tcsetsid(3) is also non-standard, I think it's a lot better to use in our own source code, mainly because it's similar to tcsetpgrp(), tcgetpgrp() and tcgetsid(). I stole the idea from QNX. They do it the other way around; their TIOCSCTTY is just a wrapper around tcsetsid(). tcsetsid() then calls into an IPC framework.
* revert r191633; this breaks at91 & xscale (likely all arm)sam2009-05-061-4/+4
|
* Our grantpt(3) and unlockpt(3) don't comply with POSIX.ed2009-05-041-3/+7
|
* Fix whitespace and sorting in Symbol.map.ed2009-05-041-25/+25
|
OpenPOWER on IntegriCloud