summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Merge the remainder of kern_vimage.c and vimage.h into vnet.c andrwatson2009-08-014-4/+0
| | | | | | | | | | vnet.h, we now use jails (rather than vimages) as the abstraction for virtualization management, and what remained was specific to virtual network stacks. Minor cleanups are done in the process, and comments updated to reflect these changes. Reviewed by: bz Approved by: re (vimage blanket)
* Fix the freebsd32 versions of semsys(), shmsys(), and msgsys() to use thejhb2009-07-271-6/+6
| | | | | | | old ABI versions of the relevant control system call (e.g. freebsd7_freebsd32_msgctl() instead of freebsd32_msgctl() for msgsys()). Approved by: re (kib)
* Some jail parameters (in particular, "ip4" and "ip6" for IP addressjamie2009-07-251-35/+43
| | | | | | | | | restrictions) were found to be inadequately described by a boolean. Define a new parameter type with three values (disable, new, inherit) to handle these and future cases. Approved by: re (kib), bz (mentor) Discussed with: rwatson
* Build on Jeff Roberson's linker-set based dynamic per-CPU allocatorrwatson2009-07-144-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (DPCPU), as suggested by Peter Wemm, and implement a new per-virtual network stack memory allocator. Modify vnet to use the allocator instead of monolithic global container structures (vinet, ...). This change solves many binary compatibility problems associated with VIMAGE, and restores ELF symbols for virtualized global variables. Each virtualized global variable exists as a "reference copy", and also once per virtual network stack. Virtualized global variables are tagged at compile-time, placing the in a special linker set, which is loaded into a contiguous region of kernel memory. Virtualized global variables in the base kernel are linked as normal, but those in modules are copied and relocated to a reserved portion of the kernel's vnet region with the help of a the kernel linker. Virtualized global variables exist in per-vnet memory set up when the network stack instance is created, and are initialized statically from the reference copy. Run-time access occurs via an accessor macro, which converts from the current vnet and requested symbol to a per-vnet address. When "options VIMAGE" is not compiled into the kernel, normal global ELF symbols will be used instead and indirection is avoided. This change restores static initialization for network stack global variables, restores support for non-global symbols and types, eliminates the need for many subsystem constructors, eliminates large per-subsystem structures that caused many binary compatibility issues both for monitoring applications (netstat) and kernel modules, removes the per-function INIT_VNET_*() macros throughout the stack, eliminates the need for vnet_symmap ksym(2) munging, and eliminates duplicate definitions of virtualized globals under VIMAGE_GLOBALS. Bump __FreeBSD_version and update UPDATING. Portions submitted by: bz Reviewed by: bz, zec Discussed with: gnn, jamie, jeff, jhb, julian, sam Suggested by: peter Approved by: re (kensmith)
* Regen the freebsd32 parts.trasz2009-07-084-5/+8
| | | | Approved by: re (kib)
* Fix freebsd32 version of lpathconf(2).trasz2009-07-081-1/+1
| | | | Approved by: re (kib)
* There is an optimization in chmod(1), that makes it not to call chmod(2)trasz2009-07-082-1/+3
| | | | | | | | | | | | | if the new file mode is the same as it was before; however, this optimization must be disabled for filesystems that support NFSv4 ACLs. Chmod uses pathconf(2) to determine whether this is the case - however, pathconf(2) always follows symbolic links, while the 'chmod -h' doesn't. This change adds lpathconf(3) to make it possible to solve that problem in a clean way. Reviewed by: rwatson (earlier version) Approved by: re (kib)
* Replace AUDIT_ARG() with variable argument macros with a set more morerwatson2009-06-272-4/+4
| | | | | | | | | | | | | | specific macros for each audit argument type. This makes it easier to follow call-graphs, especially for automated analysis tools (such as fxr). In MFC, we should leave the existing AUDIT_ARG() macros as they may be used by third-party kernel modules. Suggested by: brooks Approved by: re (kib) Obtained from: TrustedBSD Project MFC after: 1 week
* provides a extra write buffer when the NDIS driver want to send aweongyo2009-06-261-2/+3
| | | | | | request whose body has some datas through the default pipe. Tested by: Nikos Vassiliadis <nvass9573 at gmx.com>
* Regen.jhb2009-06-244-36/+79
|
* Change the ABI of some of the structures used by the SYSV IPC API:jhb2009-06-245-85/+355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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]
* Add a new COMPAT7 flag for FreeBSD 7.x compatibility system calls.jhb2009-06-241-1/+2
|
* After cleaning up rt_tables from vnet.h and cleaning up opt_route.hbz2009-06-233-3/+0
| | | | | a lot of files no longer need route.h either. Garbage collect them. While here remove now unneeded vnet.h #includes as well.
* Fix a typeo in the frame len function to unbreak the build, make it shorterthompsa2009-06-231-1/+1
| | | | while I am here.
* - Make struct usb_xfer opaque so that drivers can not access the internalsthompsa2009-06-233-52/+62
| | | | - Reduce the number of headers needed for a usb driver, the common case is just usb.h and usbdi.h
* Regen.jhb2009-06-224-4/+25
|
* Fix a typo in a comment.jhb2009-06-221-1/+1
|
* Rework the credential code to support larger values of NGROUPS andbrooks2009-06-192-15/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Regen.jhb2009-06-174-30/+30
|
* - Add the ability to mix multiple flags seperated by pipe ('|') charactersjhb2009-06-171-4/+7
| | | | | | | | | | | | | | | | | | | in the type field of system call tables. Specifically, one can now use the 'NO*' types as flags in addition to the 'COMPAT*' types. For example, to tag 'COMPAT*' system calls as living in a KLD via NOSTD. The COMPAT* type is required to be listed first in this case. - Add new functions 'type()' and 'flag()' to the embedded awk script in makesyscalls.sh that return true if a requested flag is found in the type field ($3). The flag() function checks all of the flags in the field, but type() only checks the first flag. type() is meant to be used in the top-level "switch" statement and flag() should be used otherwise. - Retire the CPT_NOA type, it is now replaced with "COMPAT|NOARGS" using the flags approach. - Tweak the comment descriptions of COMPAT[46] system calls so that they say "freebsd[46] foo" rather than "old foo". - Document the COMPAT6 type. - Sync comments in compat32 syscall table with the master table.
* Add explicit includes for jail.h to the files that need them andbz2009-06-171-0/+1
| | | | remove the "hidden" one from vimage.h.
* Regen.jhb2009-06-154-5/+8
|
* Add a new 'void closefrom(int lowfd)' system call. When called, it closesjhb2009-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | 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
* Get vnets from creds instead of threads where they're available, and fromjamie2009-06-152-4/+4
| | | | | | | passed threads instead of curthread. Reviewed by: zec, julian Approved by: bz (mentor)
* s/usb2_/usb_|usbd_/ on all function names for the USB stack.thompsa2009-06-151-27/+27
|
* Unlock process lock when return error from getrobustlist call.dchagin2009-06-141-1/+3
| | | | | | Tested by: Alexander Best <alexbestms at math uni-muenster de> Approved by: kib (mentor) MFC after: 3 days
* Add counterparts to getcredhostname:jamie2009-06-132-15/+5
| | | | | | | getcreddomainname, getcredhostuuid, getcredhostid Suggested by: rmacklem Approved by: bz
* Regeneratekib2009-06-104-16/+22
|
* Add several syscall compat32 entries for extattr manipulation syscalls,kib2009-06-101-6/+20
| | | | | | | | that do not require translation of the arguments. Requested by: kientzle Reviewed by: jhb (previous wrong version) MFC after: 1 week
* After r193232 rt_tables in vnet.h are no longer indirectly dependent onbz2009-06-083-4/+0
| | | | | | | | | the ROUTETABLES kernel option thus there is no need to include opt_route.h anymore in all consumers of vnet.h and no longer depend on it for module builds. Remove the hidden include in flowtable.h as well and leave the two explicit #includes in ip_input.c and ip_output.c.
* Rename usb pipes to endpoints as it better represents what they are, and structthompsa2009-06-071-3/+3
| | | | usb_pipe may be used for a different purpose later on.
* Move "options MAC" from opt_mac.h to opt_global.h, as it's now in GENERICrwatson2009-06-056-8/+0
| | | | | | | | and used in a large number of files, but also because an increasing number of incorrect uses of MAC calls were sneaking in due to copy-and-paste of MAC-aware code without the associated opt_mac.h include. Discussed with: pjd
* Add forgotten in previous commit flags argument.dchagin2009-06-011-2/+2
| | | | | Approved by: kib (mentor) MFC after: 1 month
* Implement accept4 syscall.dchagin2009-06-011-1/+19
| | | | | Approved by: kib (mentor) MFC after: 1 month
* Implement a variation of the accept_common() which takesdchagin2009-06-011-14/+21
| | | | | | | | | | a flags argument. Do not preserve td_retval before kern_fcntl(F_SETFL) as it does not changed. Approved by: kib (mentor) MFC after: 1 month
* Split linux_accept() syscall onto linux_accept_common() which shoulddchagin2009-06-011-13/+22
| | | | | | | be used by linuxulator and linux_accept() itself. Approved by: kib (mentor) MFC after: 1 month
* Regenerate generated syscall files following changes to struct sysent inrwatson2009-06-012-759/+759
| | | | r193234.
* Implement a variation of the socketpair() syscall which takes a flagsdchagin2009-05-311-2/+28
| | | | | | | in addition to the type argument. Approved by: kib (mentor) MFC after: 1 month
* Move new socket flags handling into a separate function as Linuxdchagin2009-05-311-15/+23
| | | | | | | introduced more syscalls which uses these flags. Approved by: kib (mentor) MFC after: 1 month
* Remove empty lines.dchagin2009-05-311-2/+0
| | | | | Approved by: kib (mentor) MFC after: 1 month
* Attempt to fix build by updating hostid to follow the new world order.delphij2009-05-301-1/+4
|
* Place hostnames and similar information fully under the prison system.jamie2009-05-292-15/+15
| | | | | | | | | | | | | | | | | The system hostname is now stored in prison0, and the global variable "hostname" has been removed, as has the hostname_mtx mutex. Jails may have their own host information, or they may inherit it from the parent/system. The proper way to read the hostname is via getcredhostname(), which will copy either the hostname associated with the passed cred, or the system hostname if you pass NULL. The system hostname can still be accessed directly (and without locking) at prison0.pr_host, but that should be avoided where possible. The "similar information" referred to is domainname, hostid, and hostuuid, which have also become prison parameters and had their associated global variables removed. Approved by: bz (mentor)
* s/usb2_/usb_/ on all typedefs for the USB stack.thompsa2009-05-291-16/+16
|
* Implement SI_ISALIST.delphij2009-05-291-1/+13
| | | | | | PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD
* Fix the sysinfo(SI_HW_SERIAL, emulation so that we actually get thedelphij2009-05-291-4/+6
| | | | | | | | hostid of the machine rather than always getting "0". PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD
* copyinstr(9) takes parameter 'len' as a size_t *, not int *.delphij2009-05-291-1/+2
| | | | | | PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD
* de-register.delphij2009-05-297-43/+43
| | | | | | Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD PR: kern/91293
* svr4_sys_getdents64() should not assume that the cookie would existdelphij2009-05-291-1/+4
| | | | | | | | everywhere. PR: kern/91293 Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD
* Add new sysconfig bits, Fix the bogus numbering of the old bits.delphij2009-05-292-20/+71
| | | | | | Submitted by: "Pedro f. Giffuni" <giffunip asme org> Obtained from: NetBSD PR: kern/91293
* Use strlcpy().delphij2009-05-281-2/+2
|
OpenPOWER on IntegriCloud