summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_emul.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove support for FUTEX_REQUEUE operation.dchagin2009-04-191-0/+1
| | | | | | | | | | | | | | | | Glibc does not use this operation since 2.3.3 version (Jun 2004), as it is racy and replaced by FUTEX_CMP_REQUEUE operation. Glibc versions prior to 2.3.3 fall back to FUTEX_WAKE when FUTEX_REQUEUE returned EINVAL. Any application directly using FUTEX_REQUEUE without return value checking are definitely broken. Limit quantity of messages per process about unsupported operation. Approved by: kib (mentor) MFC after: 1 month
* The code in linux_proc_exit() contains a race when multiple linux basedkib2008-10-311-3/+3
| | | | | | | | | | | | | processes exits at the same time. The linux_emuldata structure is freed but p->p_emuldata is left as a dangling pointer to the just freed memory. The check for W_EXIT in the loop scanning the child processes isn't safe since the state of the child process can change right afterwards. Lock the process and check the W_EXIT before delivering signal. Submitted by: tegge Reviewed by: davidxu MFC after: 1 week
* Implement robust futexes. Most of the code is modelled afterrdivacky2008-05-131-3/+6
| | | | | | | | | | | what Linux does. This is because robust futexes are mostly userspace thing which we cannot alter. Two syscalls maintain pointer to userspace list and when process exits a routine walks this list waking up processes sleeping on futexes from that list. Reviewed by: kib (mentor) MFC after: 1 month
* MFP4: Turn emul_lock into a mutex.jkim2007-04-021-2/+2
| | | | Submitted by: rdivacky
* MFP4: 115220, 115222jkim2007-03-021-2/+2
| | | | | - Fix style(9) and reduce diff between amd64 and i386. - Prefix Linuxulator macros with LINUX_ to prevent future collision.
* Partial MFp4 of 114977:netchild2007-02-241-1/+1
| | | | | | Whitespace commit: Fix grammar, spelling and punctuation. Submitted by: "Scot Hetzel" <swhetzel@gmail.com>
* MFp4 (114193 (i386 part), 114194, 114195, 114200):netchild2007-02-231-4/+8
| | | | | | | | | | | | | - Dont "return" in linux_clone() after we forked the new process in a case of problems. - Move the copyout of p2->p_pid outside the emul_lock coverage in linux_clone(). - Cache the em->pdeath_signal in a local variable and move the copyout out of the emul_lock coverage. - Move the free() out of the emul_shared_lock coverage in a preparation to switch emul_lock to non-sleepable lock (mutex). Submitted by: rdivacky
* MFp4 (part of 114132):netchild2007-02-231-7/+8
| | | | | | - Fix a LOR caused by holding emul_lock and proctree_lock at once. Submitted by: rdivacky
* Remove extern int hz; use proper include file instead.kib2007-02-021-2/+1
|
* No need to synchronize linux_schedtail with linux_proc_init.kib2007-02-011-26/+28
| | | | | | | | | | | | | | | | | | | | | | p->p_emuldata is properly initialized in the time when the child can run. Do not set p->p_emuldata to NULL when the process is exiting. It does not make any sense and only costs 2 mutex operations. Do not lock emul_data to unlock it on the very next line. Comment on possible race while there. Reparent all procs that are part of a threading group but not its leaders to init and SIGCHLD init to finish the zombies off. This fixes zombies left after opera's exit. [1] There is no need to lock p_em in the linux_proc_init CLONE_THREAD case because the process cannot change the address of the p_em->shared because its currently running this code path. Move assigning of em->shared outside emul_shared_lock. Noticed by: Scott Robbins <scottro@nyc.rr.com> [1] Submitted by: rdivacky
* MFp4 (113077, 113083, 113103, 113124, 113097):netchild2007-01-201-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Dont expose em->shared to the outside world before its properly initialized. Might not affect anything but its at least a better coding style. Dont expose em via p->p_emuldata until its properly initialized. This also enables us to get rid of some locking and simplify the code because we are workin on a local copy. In linux_fork and linux_vfork create the process in stopped state to be sure that the new process runs with fully initialized emuldata structure [1]. Also fix the vfork (both in linux_clone and linux_vfork) race that could result in never woken up process [2]. Reported by: Scot Hetzel [1] Suggested by: jhb [2] Reviewed by: jhb (at least some important parts) Submitted by: rdivacky Tested by: Scot Hetzel (on amd64) Change 2 comments (in the new code) to comply to style(9). Suggested by: jhb
* MFp4 (112499):netchild2007-01-071-0/+2
| | | | | | Protect em->shared with the lock in case of CLONE_THREAD. Submitted by: rdivacky
* MFp4 (112498):netchild2007-01-071-9/+9
| | | | | | Rename the locking flags to EMUL_DOLOCK and EMUL_DONTLOCK to prevent confusion. Submitted by: rdivacky
* MFp4:netchild2006-12-311-60/+64
| | | | - semi-automatic style fixes
* Group pid and parent are shared in a case of CLONE_THREAD not CLONE_VM.kib2006-11-151-3/+3
| | | | | | | | This fix lets clone02 LTP test pass with 2.6 emulation. In reality 99% of the cases are that CLONE_VM and CLONE_THREAD are both set so it seemed to work. Submitted by: rdivacky
* MFP4:netchild2006-10-281-1/+23
| | | | | | | Implement prctl(). Submitted by: rdivacky Tested with: LTP
* - change if (cond) panic() to KASSERT.netchild2006-10-081-3/+4
| | | | | | | | - Dont forget to free em in a case of error. Suggested by: ssouhlal Submitted by: rdivacky Tested with: LTP
* - Extend the coverage of PROC_LOCK to cover wakeup(&p->p_emuldata);netchild2006-09-091-1/+3
| | | | | | | | - Lock the emuldata in a case when we just created it. Sponsored by: Google SoC 2006 Submitted by: rdivacky Suggested by: jhb
* FREE -> freessouhlal2006-08-281-2/+2
| | | | Submitted by: rdivacky
* MALLOC -> malloc and FREE -> freessouhlal2006-08-191-4/+4
| | | | | Submitted by: rdivacky Pointed out by: jhb
* Fix the DEBUG build:netchild2006-08-171-3/+0
| | | | | | | | | - linux_emul.c [1] - linux_futex.c [2] Sponsored by: Google SoC 2006 [1] Submitted by: rdivacky [1] netchild [2]
* Style fixes to comments.netchild2006-08-161-5/+9
| | | | | | Sponsored by: Google SoC 2006 Submitted by: rdivacky Noticed by: jhb, ssouhlal
* Add some new files needed for linux 2.6.x compatibility.netchild2006-08-151-0/+297
Please don't style(9) the NetBSD code, we want to stay in sync. Not imported on a vendor branch since we need local changes. Sponsored by: Google SoC 2006 Submitted by: rdivacky With help from: manu@NetBSD.org Obtained from: NetBSD (linux_{futex,time}.*)
OpenPOWER on IntegriCloud