summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
...
* - Add conditional VFS Giant locking to getdents_common() (linux ABIs),jhb2006-07-113-18/+24
| | | | | | | | ibcs2_getdents(), ibcs2_read(), ogetdirentries(), svr4_sys_getdents(), and svr4_sys_getdents64() similar to that in getdirentries(). - Mark ibcs2_getdents(), ibcs2_read(), linux_getdents(), linux_getdents64(), linux_readdir(), ogetdirentries(), svr4_sys_getdents(), and svr4_sys_getdents64() MPSAFE.
* - Split out kern_accept(), kern_getpeername(), and kern_getsockname() forjhb2006-07-103-406/+68
| | | | | | | | | | | | | | | | | | | | use by ABI emulators. - Alter the interface of kern_recvit() somewhat. Specifically, go ahead and hard code UIO_USERSPACE in the uio as that's what all the callers specify. In place, add a new uioseg to indicate what type of pointer is in mp->msg_name. Previously it was always a userland address, but ABI emulators may pass in kernel-side sockaddrs. Also, remove the namelenp field and instead require the two places that used it to explicitly copy mp->msg_namelen out to userland. - Use the patched kern_recvit() to replace svr4_recvit() and the stock kern_sendit() to replace svr4_sendit(). - Use kern_bind() instead of stackgap use in ti_bind(). - Use kern_getpeername() and kern_getsockname() instead of stackgap in svr4_stream_ti_ioctl(). - Use kern_connect() instead of stackgap in svr4_do_putmsg(). - Use kern_getpeername() and kern_accept() instead of stackgap in svr4_do_getmsg(). - Retire the stackgap from SVR4 compat as it is no longer used.
* Unexpand PTRIN() in several places and fix one instance where 0 was beingjhb2006-07-101-13/+13
| | | | used instead of NULL.
* Add a kern_close() so that the ABIs can close a file descriptor w/o havingjhb2006-07-081-5/+1
| | | | to populate a close_args struct and change some of the places that do.
* Rework kern_semctl a bit to always assume the UIO_SYSSPACE case. Thisjhb2006-07-082-19/+24
| | | | | | | | | | | | | | | mostly consists of pushing a few copyin's and copyout's up into __semctl() as all the other callers were already doing the UIO_SYSSPACE case. This also changes kern_semctl() to set the return value in a passed in pointer to a register_t rather than td->td_retval[0] directly so that callers can only set td->td_retval[0] if all the various copyout's succeed. As a result of these changes, kern_semctl() no longer does copyin/copyout (except for GETALL/SETALL) so simplify the locking to acquire the semakptr mutex before the MAC check and hold it all the way until the end of the big switch statement. The GETALL/SETALL cases have to temporarily drop it while they do copyin/malloc and copyout. Also, simplify the SETALL case to remove handling for a non-existent race condition.
* - Protect the list of linux ioctl handlers with an sx lock.jhb2006-07-061-0/+17
| | | | | | - Hold Giant while calling linux ioctl handlers for now as they aren't all known to be MPSAFE yet. - Mark linux_ioctl() MPSAFE.
* Don't try to copyin extra data for IPC_RMID requests to msgctl() orjhb2006-07-061-6/+1
| | | | | | | shmctl(). None of the other ABI's do this (including the native FreeBSD ABI), and uselessly trying to do a copyin() can actually result in a bogus EFAULT if the a process specifies NULL for the optional argument (which is what they should do in this case).
* Housekeeping. Update for maintainers who have handed in their commit bitsmarkm2006-07-011-2/+0
| | | | or (in my case) no longer feel that oversight is necessary.
* Improve linprovfs to provide/fix thenetchild2006-06-271-27/+51
| | | | | | | | | | | | | | | | | | | | | | | | | - process state (idle, sleeping, running, ...) [1] - the process group ID of the process which owns the connected tty - some page fault stats - time spend in kernel/userland - priority/nice value - starttime [1] - memory/swap stats - scheduling policy Additionally add some new fields and correct some not filled out ones. This brings us down to 15 dummy fields. The fields marked with [1] are needed to get Oracle 10 running. The starttime field is not completely right, since it displays the _same_ starttime for _every_ process, but at least it is not 0 and Oracle accepts this. This is a RELENG_x_y candidate. Noticed by: Dmitry Ganenko <dima@apk-inform.com> [1] Reviewed by: des, rdivacky MFC after: 1 week
* Regen.jhb2006-06-274-6/+6
|
* Use kern_shmctl() in svr4_sys_shmctl() and drop use of the stackgap. Markjhb2006-06-272-47/+32
| | | | svr4_sys_shmctl() MPSAFE.
* Axe the stackgap macros as the Linux ABIs no longer use the stackgap.jhb2006-06-271-26/+0
|
* - Add a kern_semctl() helper function for __semctl(). It accepts a pointerjhb2006-06-273-121/+60
| | | | | | | to a copied-in copy of the 'union semun' and a uioseg to indicate which memory space the 'buf' pointer of the union points to. This is then used in linux_semctl() and svr4_sys_semctl() to eliminate use of the stackgap. - Mark linux_ipc() and svr4_sys_semsys() MPSAFE.
* Regen.jhb2006-06-274-7/+7
|
* - Expand the scope of Giant some in mount(2) to protect the vfsp structurejhb2006-06-271-3/+3
| | | | | | | | from going away. mount(2) is now MPSAFE. - Expand the scope of Giant some in unmount(2) to protect the mp structure (or rather, to handle concurrent unmount races) from going away. umount(2) is now MPSAFE, as well as linux_umount() and linux_oldumount(). - nmount(2) and linux_mount() were already MPSAFE.
* Regen.jhb2006-06-268-19/+19
|
* Change svr4_sys_break() to just call obreak() and mark it MPSAFE.jhb2006-06-262-52/+4
| | | | Not objected to by: alc
* - Sync with master: rmdir(), mkdir(), and extattr_*() are all MPSAFE.jhb2006-06-261-10/+10
| | | | - freebsd32_utimes() is MPSAFE.
* The linux times syscall can be called with a NULL pointer, so keep coolnetchild2006-06-231-11/+13
| | | | | | | | | | | | | and don't panic. This fix is different from the patch submitted as it not only prevents a NULL-pointer dereference, but also skips some work in this case. Noticed by: Dmitry Ganenko <dima@apk-inform.com> Reviewed by: rdivacky (the original version as in emulation@) MFC after: 1 week Security: This is a RELENG_x_y candidate (local DoS). Go ahead by: secteam (cperciva)
* Move conditional preprocessing out of the SYSCTL_ADD_STRING macrodds2006-06-221-1/+4
| | | | | invocation. Per C99 6.10.3 paragraph 11 preprocessing directives appearing inside macro arguments yield undefined behavior.
* Conditionally acquire Giant around VFS operations.jhb2006-06-201-13/+16
|
* - Add a new linker_file_foreach() function that walks the list of linkerjhb2006-06-201-19/+31
| | | | | | | | | | | | | | file objects calling a user-specified predicate function on each object. The iteration terminates either when the entire list has been iterated over or the predicate function returns a non-zero value. linker_file_foreach() returns the value returned by the last invocation of the predicate function. It also accepts a void * context pointer that is passed to the predicate function as well. Using an iterator function avoids exposing linker internals to the rest of the kernel making locking simpler. - Use linker_file_foreach() instead of walking the list of linker files manually to lookup ndis files in ndis(4). - Use linker_file_foreach() to implement linker_hwpmc_list_objects().
* Forcefully turn off GPROF in this file if it is enabled as GPROF'sjhb2006-06-121-0/+5
| | | | | attempt to use a macro for 'ret' doesn't play well with the wrappers trying to implement 'Pascal-style' calling conventions.
* Add the model name, obtained from the hw.model sysctl variable.des2006-06-121-2/+12
| | | | MFC after: 3 weeks
* Do not copy out the iovec in the 32bit recvmsg call since soreceiveps2006-06-081-24/+0
| | | | | | | calls uiomove directly. Reviewed by: ups MFC after: 1 week
* As far as I can tell, the correct CPU family for amd64 (which Linux callsdes2006-06-021-2/+2
| | | | | | x86_64) is 15, not 6. MFC after: 3 weeks
* Fix file leaking in translate_path_major_minor.ambrisko2006-05-161-2/+6
|
* Since DELAY() was moved, most <machine/clock.h> #includes have beenphk2006-05-162-2/+0
| | | | unnecessary.
* Remove various bits of conditional Alpha code and fixup a few comments.jhb2006-05-121-78/+0
|
* Remove the dependency on procfs since it isn't used.ambrisko2006-05-111-2/+0
| | | | Noticed by: des
* Now that we don't have a linuxolator on alpha anymore:netchild2006-05-107-342/+33
| | | | | - unifdef __alpha__ - revert rev. 1.66 of linux_socket.c
* Implement rt_sigpending in the linuxolator.netchild2006-05-101-0/+28
| | | | | PR: 92671 Submitted by: Markus Niemist"o <markus.niemisto@gmx.net>
* Add in linsysfs. A linux 2.6 like sys filesystem to pacify the Linuxambrisko2006-05-091-0/+285
| | | | | | | LSI MegaRAID SAS utility. Sponsored by: IronPort Systems Man page help from: brueffer
* Fix the the duplicate cut-n-paste in linux_fstat64 pointed out byambrisko2006-05-051-1/+0
| | | | Alexander Leidinger. I forget to fix it in this version.
* Enhance the Linux emulation layer to make MegaRAID SAS managements tool happy.ambrisko2006-05-054-16/+250
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add back in a scheme to emulate old type major/minor numbers via hooks into stat, linprocfs to return major/minors that Linux app's expect. Currently only /dev/null is always registered. Drivers can register via the Linux type shim similar to the ioctl shim but by using linux_device_register_handler/linux_device_unregister_handler functions. The structure is: struct linux_device_handler { char *bsd_driver_name; char *linux_driver_name; char *bsd_device_name; char *linux_device_name; int linux_major; int linux_minor; int linux_char_device; }; Linprocfs uses this to display the major number of the driver. The soon to be available linsysfs will use it to fill in the driver name. Linux_stat uses it to translate the major/minor into Linux type values. Note major numbers are dynamically assigned via passing in a -1 for the major number so we don't need to keep track of them. This is somewhat needed due to us switching to our devfs. MegaCli will not run until I add in the linsysfs and mfi Linux compat changes. Sponsored by: IronPort Systems
* Annotate uses of fgetsock() with indications that they should relyrwatson2006-04-012-0/+12
| | | | | | | on their existing file descriptor references to sockets, rather than use fgetsock() to retrieve a direct socket reference. MFC after: 3 months
* regen for 32bit System V shared memoryps2006-03-304-7/+13
|
* Properly support for FreeBSD 4 32bit System V shared memory.ps2006-03-302-7/+169
| | | | | | Submitted by: peter Obtained from: Yahoo! MFC after: 3 weeks
* Unbreaking build by removing a now unused variable.avatar2006-03-271-1/+0
|
* Use td_ucred rather than p_ucred to avoid panics and general unhappiness.jhb2006-03-271-1/+1
| | | | Pointy hat to: netchild
* Fix the LINT build on alpha:netchild2006-03-211-32/+82
| | | | | | | - rename some file local structure definitions, the names clash with autogenerated names - on !alpha add some compatibility defines for those renamed structures - make some functions globally visible on alpha
* Fix tinderbox on alpha.netchild2006-03-201-0/+2
| | | | Tested by: cross-compile
* Unbreak COMPAT_LINUX32 option support on amd64.ru2006-03-1911-0/+17
| | | | Broken by: netchild
* Fixup some problems in my previous commit (COMPAT_43).netchild2006-03-1811-17/+0
| | | | Pointyhat to: netchild
* Get rid of the need of COMPAT_43 in the linuxolator.netchild2006-03-188-31/+211
| | | | | Submitted by: Divacky Roman <xdivac02@stud.fit.vutbr.cz> Obtained from: DragonFly (some parts)
* Fix exec_map resource leaks.ups2006-03-081-9/+13
| | | | Tested by: kris@
* use strlcpy in cvtstatfs and copy_statfs instead of bcopy to ensureps2006-03-041-6/+8
| | | | | | the copied strings are properly terminated. bzero the statfs32 struct in copy_statfs.
* regen for 32bit sendfileps2006-02-284-6/+6
|
* Fix 32bit sendfile by implementing kern_sendfile so that it takesps2006-02-282-20/+66
| | | | | | | | the header and trailers as iovec arguments instead of copying them in inside of sendfile. Reviewed by: jhb MFC after: 3 weeks
* - Always call exec_free_args() in kern_execve() instead of doing it in alljhb2006-02-062-3/+0
| | | | | | the callers if the exec either succeeds or fails early. - Move the code to call exit1() if the exec fails after the vmspace is gone to the bottom of kern_execve() to cut down on some code duplication.
OpenPOWER on IntegriCloud