summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* Remove extern int hz; use proper include file instead.kib2007-02-021-2/+1
|
* Introduce some more SO_ option equivalents from Linux to FreeBSD.kib2007-02-011-0/+18
| | | | | | | The msg variable in linux_recvmsg() was not initialized. Copy it from userspace. Submitted by: rdivacky
* No need to lock emul_lock in exit_group() because em->sharedkib2007-02-011-3/+2
| | | | | | | | | cannot change (because its referenced by curthread). This fixes a LOR caused by acquiring emul_shared_lock while holding emul_lock. Fix typo in comment. Submitted by: rdivacky
* 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
* Use a printf-modifier which doesn't need a cast.netchild2007-01-211-2/+2
| | | | Submitted by: scottl
* Fix tinderbox build on amd64.netchild2007-01-201-2/+2
|
* 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
* Ooops, fix the ratelimit.netchild2007-01-201-1/+3
|
* Convert a KASSERT into a runtime warning (rate limited) + failsafe fallback.netchild2007-01-201-4/+12
| | | | | | | Because of a stupid bug (also fixed with this commit) the KASSERT was triggered when runnung the linux top. Pointy hat to: netchild
* Add support for LINUX_O_DIRECT, LINUX_O_DIRECT and LINUX_O_NOFOLLOW flagskib2007-01-181-17/+46
| | | | | | | | | | to open() [1]. Improve locking for accessing session control structures [2]. Try to document (most likely harmless) races in the code [3]. Based on submission by: Intron (intron at intron ac) [1] Reviewed by: jhb [2] Discussed with: netchild, rwatson, jhb [3]
* MFp4 (112379):netchild2007-01-141-2/+6
| | | | | | | Implement SETALL/GETALL IPC primitives. This fixes some LTP testcases and LabView is able to proceed a little bit further. Submitted by: rdivacky
* MFp4 (112705):netchild2007-01-141-3/+2
| | | | | | | Inherit setting of the default emulation version to the jails. Pointed out by: jhb Submitted by: rdivacky
* MFp4 (112646):netchild2007-01-071-1/+1
| | | | | | | | | Now (ok it's been a while...) that FreeBSD has RLIMIT_AS too, we can use it in the linuxolator instead of ignoring it. This fixes a LTP test. Submitted by: rdivacky
* MFp4 (112535):netchild2007-01-071-2/+0
| | | | | | | | | No need to lock prison in a case of linux_use26 because the int setting is atomic and process cannot leave jail. Submitted by: kib Reviewed by: jhb Requested by: rdivacky
* MFp4 (112534):netchild2007-01-072-7/+3
| | | | | | | | | Dont lock em in a case of just using em->shared->group_pid because the group_pid never changes. Submitted by: rdivacky Reviewed by: kib Glanced at 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-074-18/+18
| | | | | | Rename the locking flags to EMUL_DOLOCK and EMUL_DONTLOCK to prevent confusion. Submitted by: rdivacky
* Fix amd64 build.delphij2007-01-011-2/+2
| | | | Submitted by: Divacky Roman <xdivac02 stud fit vutbr cz>
* MFp4 (111746, 108671, 108945, 112352):netchild2006-12-312-0/+117
| | | | | | | | | - add linux utimes syscall [1] - add linux rt_sigtimedwait syscall [2] Submitted by: "Scot Hetzel" <swhetzel@gmail.com> [1] Submitted by: Bruce Becker <hostmaster@whois.gts.net> [2] PR: 93199 [2]
* MFp4:netchild2006-12-312-73/+77
| | | | - semi-automatic style fixes
* MFp4 (111746+):netchild2006-12-313-9/+33
| | | | | | | | | | | | | | Redo the checking for 2.6 emulation. We now cache the value of use26 and replace calls to linux_get_osrelease() + parsing with a call to linux_use26(). Typical path is lockless now. Pointed out by: kib This allows to ship RELENG_7_0 with a default osrelease of 2.4.2 and the possibility to enable 2.6.x emulation without the possible performance impact of the previous version of the check. Submitted by: rdivacky
* MFp4:netchild2006-12-312-67/+75
| | | | | | - semi-automatic style fixes - spelling fixes in comments - add some comments
* add entry points required by newer broadcom wireless driversam2006-12-251-0/+77
| | | | | | PR: kern/106131 Submitted by: Scot Hetzel MFC after: 2 weeks
* MFP4 (110956):netchild2006-12-211-0/+2
| | | | | | | | Add definition for LINUX_MSG_INFO. This fixes the tinderbox errors. Submitted by: rdivacky
* MFP4: 109655jkim2006-12-201-30/+68
| | | | | | | | - Move linux_nanosleep() from src/sys/amd64/linux32/linux32_machdep.c to src/sys/compat/linux/linux_time.c. - Validate timespec ranges before use as Linux kernel does. - Fix l_timespec structure. - Clean up style(9) nits.
* MFP4: 110179jkim2006-12-201-3/+41
| | | | | | Add rudimentary IPC_INFO/MSG_INFO command support for linux_msgctl() to pacify Linux ipcs(1). While I am here, add more bound checks for linux_msgsnd() and linux_msgrcv().
* Regen.jkim2006-12-204-10/+27
|
* MFP4: (part of) 110058jkim2006-12-202-6/+58
| | | | Fix 32-bit msgsnd(3) and msgrcv(3) emulations for amd64.
* MFP4: (part of) 110058jkim2006-12-201-24/+26
| | | | Use new kern_msgsnd()/kern_msgrcv() to fix linux32 emulation on amd64.
* MFP4: 109653jkim2006-12-041-2/+25
| | | | | Linux mknod(2) can open any files, not just char/block or fifo files. This fixes Linux Test Project test cases mknod01, mknod07 and mknod09.
* MFP4: 109652jkim2006-12-041-39/+38
| | | | | | | | | | | | Fixes for 'blocking in fifoor state' problem of LTP tests. linux_*stat*() functions were opening files with O_RDONLY to get major/minor pair for char/block special files. Unfortunately, when these functions are used against fifo, it is blocked forever because there is no writer. Instead, we only open char/block special files for major/minor conversion. We have to get rid of kern_open() entirely from translate_path_major_minor() but today is not the day. While I am here, add checks for errors before calling translate_path_major_minor().
* MFP4 (110957)netchild2006-12-031-2/+3
| | | | | | | | | | Use TAILQ_FOREACH_SAFE instead of the unsafe one where an item is removed from the queue. This prevents a panic on kldunload. Submitted by: rdivacky Tested by: bsam
* MFP4 (108673, 110519, 110874):netchild2006-12-021-5/+30
| | | | | | | | | | | | | | - Currently LINUX_MAX_COMM_LEN is smaller than MAXCOMLEN, but in case this will change we have a buffer overflow. Apply some defensive programming to DTRT when this should happen. - Use copyinstr() instead of copyin where appropriate. * Fallback to copyin() in case of ENAMETOOLONG. [1] * Use the right source and destination (it was wrong before). - Use strlcpy instead of strcpy. - Properly lock the read case (PR_GET_NAME) like the write case. Reviewed by: rwatson (except [1]) Suggested by: rwatson [1]
* MFP4: Change 109654jkim2006-11-271-0/+60
| | | | | | | | | | | | | | | | Add two linprocfs entries for Linux IPC: /proc/sys/kernel/msgmni -> kern.ipc.msgmni /proc/sys/kernel/sem -> kern.ipc.semmsl kern.ipc.semmns kern.ipc.semopm kern.ipc.semmni This fixes msgget03 and semget05 from Linux Test Project (LTP) test suite. msgctl08 and msgctl09 also use /proc/sys/kernel/msgmni but another fix is required from p4 (Change 110179). Requested by: netchild
* Add missed ")". Fix the build.kib2006-11-181-1/+1
| | | | Pointy hat to: kib
* Sync struct sysinfo with real one from linux.kib2006-11-181-1/+2
| | | | Submitted by: rdivacky
* Use standard debugging facilities in linux_getcwd().kib2006-11-181-2/+2
| | | | Submitted by: rdivacky
* Add debuging printfs to syscalls that do not contain it yet. Inkib2006-11-181-0/+36
| | | | | | | sethostname do not print the hostname because it would require to copyin the string. Sethostname is not very frequently used. Submitted by: rdivacky
* Remove unecessary locking of process in linux_getpid.kib2006-11-181-2/+0
| | | | | Suggested by: jhb Submitted by: rdivacky
* 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
* In rev 1.188 of linux_misc.c the added check for valid options ommitedkib2006-11-151-1/+1
| | | | | | | | __WCLONE. This fixes it thus fixing skype/teamspeak to not keep zombies after exit. Submitted by: rdivacky Reported by: Bakul Shah (bakul at bitblocks com)
* Regen.ru2006-11-112-2/+2
| | | | Forgotten by: trhodes
* Merge posix4/* into normal kernel hierarchy.trhodes2006-11-111-2/+1
| | | | | Reviewed by: glanced at by jhb Approved by: silence on -arch@ and -standards@
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-064-5/+13
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* Regen.ru2006-11-034-43/+4
|
* Fix build breakage introduced in previous commit (redeclatationru2006-11-031-6/+6
| | | | of sctp functions).
* This commits the remake in kern/ make sysent to getrrs2006-11-034-5/+56
| | | | | | | the correct syscalls.master's $FreeBSD$ tag record and a make sysent in sys/compat/freebsd32. Thanks Ruslan for pointing out the steps I missed :-0 Approved by: gnn
* Ok, here it is, we finally add SCTP to current. Note that thisrrs2006-11-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | work is not just mine, but it is also the works of Peter Lei and Michael Tuexen. They both are my two key other developers working on the project.. and they need ata-boy's too: **** peterlei@cisco.com tuexen@fh-muenster.de **** I did do a make sysent which updated the syscall's and sysproto.. I hope that is correct... without it you don't build since we have new syscalls for SCTP :-0 So go out and look at the NOTES, add option SCTP (make sure inet and inet6 are present too) and play with SCTP. I will see about comitting some test tools I have after I figure out where I should place them. I also have a lib (libsctp.a) that adds some of the missing socketapi functions that I need to put into lib's.. I will talk to George about this :-) There may still be some 64 bit issues in here, none of us have a 64 bit processor to test with yet.. Michael may have a MAC but thats another beast too.. If you have a mac and want to use SCTP contact Michael he maintains a web site with a loadable module with this code :-) Reviewed by: gnn Approved by: gnn
* Backout the linux aio stuff. Several problems where identified and thenetchild2006-10-292-1447/+0
| | | | | | | | | | | | | | | dynamic nature (if no native aio code is available, the linux part returns ENOSYS because of missing requisites) should be solved differently than it is. All this will be done in P4. Not included in this commit is a backout of the changes to the native aio code (removing static in some places). Those changes (and some more) will also be needed when the reworked linux aio stuff will reenter the tree. Requested by: rwatson Discussed with: rwatson
* style(9)netchild2006-10-291-0/+1
| | | | Noticed by: rwatson
OpenPOWER on IntegriCloud