summaryrefslogtreecommitdiff
path: root/sys/compat/linux/common/linux_misc.c
AgeCommit message (Collapse)Author
2010-03-03When implementing "read directory", when there are too many empty entrieshe
in a row, and we need to try to read the next block, and have passed a non-NULL cookie pointer to VOP_READDIR, ensure that we free the cookie buffer before re-doing VOP_READDIR, so that we don't leak memory. This fix is similar to nfs_serv.c revisions 1.115 + 1.124. This should fix the long-standing problem observed by e.g. using Linux- emulated programs to take backup of servers, which is one of the problems which were reported in PR#42661. Thanks to pooka@ for the hints for traversing the VOP* layer.
2009-12-05Remove the portalfs kernel file system driver. Replace mount_portal(8)pooka
with a version based on puffs. User functionality remains the same.
2009-11-24Update personality(2) to match Linux definition where the argument is annjoly
unsigned long.
2009-11-11- selcommon/pollcommon: drop redundant l argument.rmind
- Use cached curlwp->l_fd, instead of p->p_fd. - Inline selscan/pollscan.
2009-11-04do_sys_wait(): fix previous by checking for ru != NULL. Noticed byrmind
Onno van der Linden. Also, remove redundant arguments (seems that was_zombie was not used since rev 1.177 ?).
2009-07-22Make compat linux/linux32 getdents(2) fail with ENOTDIR instead ofnjoly
EINVAL when file descriptor does not refer to a directory.
2009-05-15pad -> PADpooka
2009-03-29Move the internal poll/select related API's to use timespec insteadchristos
of timeval (rides the uvm bump).
2009-03-14ANSIfy another 1261 function definitions.dsl
The only ones left in sys are beyond by sed script! (or in sys/dist or sys/external) Mostly they have function pointer parameters.
2009-01-19Small personality(2) update.njoly
- Allow querying current personality. - Use symbolic names instead of magic values.
2009-01-17Convert linux/linux32 wait(4) to use a compat50 rusage structure.njoly
2009-01-11merge christos-time_tchristos
2008-11-12Remove LKMs and switch to the module framework, pass 1.ad
Proposed on tech-kern@.
2008-06-24Replace references to getsock/getvnode.ad
2008-06-24ioctl commands are defined unsigned long, so cast cmd to unsigned long ↵gmcgarry
before comparison.
2008-05-28Add LINUX_TMPFS_SUPER_MAGIC, and map it to our tmpfs.njoly
This makes sem_open/sem_unlink (POSIX named semaphores) work under NPTL emulation.
2008-04-28Remove clause 3 and 4 from TNF licensesmartin
2008-04-24Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, sincead
we no longer need to guard against access from hardware interrupt handlers. Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the child process share the parent's lock so that signal state may be kept in sync. Partially addresses PR kern/37437.
2008-04-23Fix locking.ad
2008-04-04Cleanup. Kill linux_sys_msync and use sys___msync13 instead.njoly
No functional changes expected.
2008-03-21Catch up with descriptor handling changes. See kern_descrip.c revisionad
1.173 for details.
2008-01-15compat linux (and linux32) uid16 functions cleanup and fixes.njoly
- Move uid16 functions to their own file linux_uid16.c, included by needed archs (arm, i386 and m68k). - Add new MI types linux_{u,g}id16_t. - Add macros to handle linux_uid16_t and uid_t conversions. - Add linux_sys_getres{uid,gid}16 syscalls, to fix an overflow with bad sizes given to copyout when linux_sys_getres{uid,gid} are used. - Update arm syscall table to use more uid16 functions.
2007-12-24Kill unneeded linux_sys_getpgid and use native sys_getpgid instead.njoly
2007-12-21- Fix setfsuid to return uid on success.njoly
- Replace getfsuid, which never existed on Linux, by correct setfsgid syscall. ok by christos and dsl.
2007-12-20Convert all the system call entry points from:dsl
int foo(struct lwp *l, void *v, register_t *retval) to: int foo(struct lwp *l, const struct foo_args *uap, register_t *retval) Fixup compat code to not write into 'uap' and (in some cases) to actually pass a correctly formatted 'uap' structure with the right name to the next routine. A few 'compat' routines that just call standard ones have been deleted. All the 'compat' code compiles (along with the kernels required to test build it). 98% done by automated scripts.
2007-12-08ANSIfy most of the function definitions in sys/compat (but not ndis).dsl
All by the magic of sed ...
2007-12-04Remove all the __Pdsl
2007-11-26Remove the "struct lwp *" argument from all VFS and VOP interfaces.pooka
The general trend is to remove it from all kernel interfaces and this is a start. In case the calling lwp is desired, curlwp should be used. quick consensus on tech-kern
2007-11-08Replace strncpy with strlcpy in compat linux and linux32 uname,njoly
old_uname and oldold_uname syscalls to ensure that all *utsname fields are always NUL terminated.
2007-11-07Remove remaining 64-bit compat linux syscalls linux_sys_xxx() (exceptnjoly
for ones without arguments), and replace them by their 32-bit equivalent linux32_sys_xxxx().
2007-10-19Add compat_linux and exec_linux_elf lkm support for amd64:njoly
- Add needed COMPAT_OSSAUDIO to GENERIC. - Add missing includes needed by linux_syscallargs.h. - Add lkm building.
2007-07-17Add native mremap system call based on the UVM implementation forjoerg
Linux compat. Add code to enforce alignment of the new location. Special thanks to wizd for helping with the man page.
2007-07-04It seems that min(16,16) isn't a compile time constant.dsl
So don't bother limiting the local arrays to NGROUPS, just use 16.
2007-06-30Match updates to kauth_cred_set/getgroups.dsl
2007-06-23Simplify code to get/set 16bit group lists.dsl
Cloned from ibcs2 copy (maybe I should have worked out somewhere to put this as common code...)
2007-06-23These now need sys/prot.hdsl
2007-06-04Fix select() without a timeout parameter.dsl
2007-06-02Call selcommon() directly instead of using the stackgap...dsl
2007-05-12There is no need to use the stackgap for get/setrlimit.dsl
2007-05-10- linux uname -m on x86 returns i{3,4,5,6}86 make it so.christos
- delete the machine sysctl that never worked, and gc linux_machine.
2007-05-08Remember to copy the rusage to the users buffer.dsl
2007-05-07Split sys_wait4() so that compat code can fiddle with the returned 'status'dsl
and 'rusage' without having to copy data to/from stackgap buffers. The old split (find_stopped_child) could be removed. amd64 seems to run netbsd32, linux and linux32 emulations. sparc64 compiles.
2007-04-30Rework compat stat() and statvfs() code so that it no longer uses the stackgap.dsl
2007-04-22Change the way that emulations locate files within the emulation root todsl
avoid having to allocate space in the 'stackgap' - which is very LWP unfriendly. The additional code for non-emulation namei() is trivial, the reduction for the emulations is massive. The vnode for a processes emulation root is saved in the cwdi structure during process exec. If the emulation root the TRYEMULROOT flag are set, namei() will do an initial search for absolute pathnames in the emulation root, if that fails it will retry from the normal root. ".." at the emulation root will always go to the real root, even in the middle of paths and when expanding symlinks. Absolute symlinks found using absolute paths in the emulation root will be relative to the emulation root (so /usr/lib/xxx.so -> /lib/xxx.so links inside the emulation root don't need changing). If the root of the emulation would be returned (for an emulation lookup), then the real root is returned instead (matching the behaviour of emul_lookup, but being a cheap comparison here) so that programs that scan "../.." looking for the root dircetory don't loop forever. The target for symbolic links is no longer mangled (it used to get the CHECK_ALT_xxx() treatment, so could get /emul/xxx prepended). CHECK_ALT_xxx() are no more. Most of the change is deleting them, and adding TRYEMULROOT to the flags to NDINIT(). A lot of the emulation system call stubs could now be deleted.
2007-04-11- Add compat amd64 linux32 statfs support, adapted from PR/35956.njoly
- Move bsd_to_linux_statfs() function to its own file to be shared between both linux compats. ok by manu.
2007-03-23implement emul.linux.kern.machine, which can be set to "i686", likemrg
some applications seem to want.
2007-03-14Fix compat linux statfs/fstatfs syscalls on amd64.njoly
- Do not use statfs64/fstatfs64 as they have an extra size argument. - Add full 64bit linux struct statfs support. ok by manu
2007-03-04Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.christos
2007-02-09Merge newlock2 to head.ad
2006-11-16__unused removal on arguments; approved by core.christos