summaryrefslogtreecommitdiffstats
path: root/sys/compat
Commit message (Collapse)AuthorAgeFilesLines
* The Linux unlink syscall uses a different errno value when trying to unlinknetchild2006-09-101-0/+7
| | | | | | | | | a directory. PR: 102897 [1] Noticed by: Knut Anders Hatlen <kahatlen@gmail.com>, testrun with LTP [1] Submitted by: Marcin Cieslak <saper@SYSTEM.PL> Tested by: netchild (LTP test run)
* - 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
* Change futex lock from mutex to sx. Make futex_get atomic (protected by thenetchild2006-09-091-8/+4
| | | | | | | | futex lock). Sponsored by: Google SoC 2006 Submitted by: rdivacky Suggested by: jhb
* - don't wake every sleeper just the first one [1]netchild2006-09-091-5/+2
| | | | | | - remove debuging printf [2] Submitted by: intron <mag@intron.ac> [1], rdivacky [2]
* The following functions need not to be reimplemented, reuse 64bitdavidxu2006-09-094-15/+27
| | | | | | syscalls instead: sigqueue, thr_set_name, thr_setscheduler, thr_getscheduler, thr_setschedparam.
* Regenerate.rwatson2006-09-034-29/+29
|
* Set freebsd32 system call event identifiers for:rwatson2006-09-031-47/+49
| | | | | | | | | | | | | | | | | | | | | | | - old truncate, ftruncate - old getpeername, gethostid, sethostid, getrlimit, setrlimit, killpg. - old quota, getsockname, getdirentries. - lgetfh - old getdomainname, setdomainname - sysarch, rtprio, __getcwd, jail, sigtimedwait - extattrctl, extattr_{get,set,delete,list}_{file,fd,link} - getresgid, getresuid, kqueue, eaccess, nmount, sendfile - fhstatfs, kldunloadf Right identifiers for: - nfssvc Remove incorrect identifier for: - __acl_get_file Compile tested with help of: sam Obtained from: TrustedBSD Project
* Regenerate. Looks like someone missed doing this previously as more thanrwatson2006-09-034-6/+10
| | | | just the audit event change appears in the diff.
* Use AUE_NTP_ADJTIME instead of AUE_ADJTIME for ntp_adjtime().rwatson2006-09-031-1/+1
| | | | Obtained from: TrustedBSD Project
* Remove two hypothetical calls to suser() in ifdef'd (and uncompilable)rwatson2006-09-021-4/+0
| | | | | | | | | svr4 code: this code would call centralized sysctl code that does these checks also. MFC after: 1 week Obtained from: TrustedBSD Project Sponsored by: nCircle Network Security, Inc.
* FREE -> freessouhlal2006-08-281-2/+2
| | | | Submitted by: rdivacky
* Add the linux statfs64 call. This allows Tivoli backup to proceed a littlenetchild2006-08-271-0/+51
| | | | | | | | | but further on -current (still not successful, but a step into the right direction). Sponsored by: Google SoC 2006 Submitted by: rdivacky Tested by: Paul Mather <paul@gromit.dlib.vt.edu>
* Correct the number of retries in a futex_wake() call.netchild2006-08-261-2/+6
| | | | | Sponsored by: Google SoC 2006 Submitted by: rdivacky
* Don't call suser_cred() directly from linux_sethostname(), as it justrwatson2006-08-251-3/+0
| | | | | | | wraps userland_sysctl(), which performs necessary privilege checks as part of its normal operation. MFC after: 1 week
* Sync the MI parts for amd64 with i386 and remove the corresponding specialnetchild2006-08-201-13/+1
| | | | | | | | | handling for amd64 in the common code. The MD parts for amd64 are still outstanding, but at least this fixes some panics on amd64. Sponsored by: Google SoC 2006 Submitted by: rdivacky Tested by: bsam
* Get rid of some nested includes.netchild2006-08-191-0/+1
| | | | | | Sponsored by: Google SoC 2006 Submitted by: rdivacky Noticed by: jhb
* MALLOC -> malloc and FREE -> freessouhlal2006-08-191-4/+4
| | | | | Submitted by: rdivacky Pointed out by: jhb
* ifdef DEBUG a printfssouhlal2006-08-191-0/+2
| | | | Submitted by: rdivacky
* while (0); -> while (0) in multi-line macrosimp2006-08-172-3/+2
|
* - disable some more code when osrelease=2.4.2netchild2006-08-171-22/+46
| | | | | | | | | - protect td->td_proc->p_pid with the proc lock in linux_getpid in the amd64 (= non i386) case [1] Sponsored by: Google SoC 2006 Submitted by: rdivacky Noticed by: netchild [1]
* Move some stuff into headers where they belong.netchild2006-08-173-6/+3
| | | | | | Sponsored by: Google SoC 2006 Submitted by: rdivacky Noticed by: jhb, ssouhlal
* Fix the DEBUG build:netchild2006-08-172-5/+3
| | | | | | | | | - linux_emul.c [1] - linux_futex.c [2] Sponsored by: Google SoC 2006 [1] Submitted by: rdivacky [1] netchild [2]
* Grab two syscall numbers. One is used to emulate functionality that linuxpeter2006-08-161-0/+2
| | | | | | has in its procfs (do a readlink of /proc/self/fd/<nn> to find the pathname that corresponds to a given file descriptor). Valgrind-3.x needs this functionality. This is a placeholder only at this time.
* Style fixes to comments.netchild2006-08-162-6/+11
| | | | | | Sponsored by: Google SoC 2006 Submitted by: rdivacky Noticed by: jhb, ssouhlal
* Include sys/limits.h for INT_MAX. freebsd32_proto.h 1.58 does not includejkim2006-08-161-0/+1
| | | | sys/umtx.h any more and previously it was included from there.
* Regen to propogate <prefix>_AUE_<mumble> changes as well as the earlierjhb2006-08-154-725/+850
| | | | systrace changes.
* - Remove unused sysvec variables from various syscalls.conf.jhb2006-08-152-2/+2
| | | | | | | | | - Send the systrace_args files for all the compat ABIs to /dev/null for now. Right now makesyscalls.sh generates a file with a hardcoded function name, so it wouldn't work for any of the ABIs anyway. Probably the function name should be configurable via a 'systracename' variable and the functions should be stored in a function pointer in the sysvec structure.
* Disable some parts of the code on amd64 for now to prevent a panic. A betternetchild2006-08-151-1/+8
| | | | | | | fix will come later. Sponsored by: Google SoC 2006 Submitted by: rdivacky
* Add the linux 2.6.x stuff (not used by default!):netchild2006-08-153-2/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - TLS - complete - pid/tid mangling - complete - thread area - complete - futexes - complete with issues - clone() extension - complete with some possible minor issues - mq*/timer*/clock* stuff - complete but untested and the mq* stuff is disabled when not build as part of the kernel with native FreeBSD mq* support (module support for this will come later) Tested with: - linux-firefox - works, tested - linux-opera - works, tested - linux-realplay - doesnt work, issue with futexes - linux-skype - doesnt work, issue with futexes - linux-rt2-demo - works, tested - linux-acroread - doesnt work, unknown reason (coredump) and sometimes issue with futexes - various unix utilities in linux-base-gentoo3 and linux-base-fc4: everything tried worked On amd64 not everything is supported like on i386, the catchup is planned for later when the remaining bugs in the new functions are fixed. To test this new stuff, you have to run sysctl compat.linux.osrelease=2.6.16 to switch back use sysctl compat.linux.osrelease=2.4.2 Don't switch while running a linux program, strange things may or may not happen. Sponsored by: Google SoC 2006 Submitted by: rdivacky Some suggestions/help by: jhb, kib, manu@NetBSD.org, netchild
* Add some new files needed for linux 2.6.x compatibility.netchild2006-08-155-0/+1140
| | | | | | | | | | 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}.*)
* Lock the vnode around the call to VOP_GETATTR. Move the locked codekib2006-08-081-5/+16
| | | | | | | | | | | | and vn_fullpath (that call malloc(..., M_WAITOK)) from under the vm object lock, since sleep is not allowed while holding the mutex. Being there, wrap VOP_GETATTR call with conditional Giant aquire. Currently this is (almost) noop because pseudofs is Giant-locked. Tested by: kris Approved by: pjd (mentor) MFC after: 2 weeks
* With socket code no longer in svr4_stream.c, MAC includes are no longerrwatson2006-08-051-2/+0
| | | | required, so GC.
* Use TAILQ_EMPTY instead of checking if TAILQ_FIRST is NULL.brooks2006-08-041-1/+1
|
* Regen for MPSAFE flag removal.jhb2006-07-288-425/+435
|
* Now that all system calls are MPSAFE, retire the SYF_MPSAFE flag used tojhb2006-07-282-413/+409
| | | | | | | | | mark system calls as being MPSAFE: - Stop conditionally acquiring Giant around system call invocations. - Remove all of the 'M' prefixes from the master system call files. - Remove support for the 'M' prefix from the script that generates the syscall-related files from the master system call files. - Don't explicitly set SYF_MPSAFE when registering nfssvc.
* Various fixes to comments in the syscall master files including removingjhb2006-07-281-3/+4
| | | | cruft from the audit import and adding mention of COMPAT4 to freebsd32.
* Regen.jhb2006-07-284-7/+7
|
* - Explicitly lock Giant to protect the fields in the svr4_strm structurejhb2006-07-283-12/+44
| | | | | | except for s_family (which is read-only once after it is set when the structure is created). - Mark svr4_sys_ioctl(), svr4_sys_getmsg(), and svr4_sys_putmsg() MPSAFE.
* Fix a file descriptor race I reintroduced when I split accept1() up intojhb2006-07-271-10/+24
| | | | | | | | | | | | | kern_accept() and accept1(). If another thread closed the new file descriptor and the first thread later got an error trying to copyout the socket address, then it would attempt to close the wrong file object. To fix, add a struct file ** argument to kern_accept(). If it is non-NULL, then on success kern_accept() will store a pointer to the new file object there and not release any of the references. It is up to the calling code to drop the references appropriately (including a call to fdclose() in case of error to safely handle the aforementioned race). While I'm at it, go ahead and fix the svr4 streams code to not leak the accept fd if it gets an error trying to copyout the streams structures.
* Regen.jhb2006-07-214-5/+5
|
* Clean up the svr4 socket cache and streams code some to make it more easilyjhb2006-07-214-40/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | locked. - Move all the svr4 socket cache code into svr4_socket.c, specifically move svr4_delete_socket() over from streams.c. Make the socket cache entry structure and svr4_head private to svr4_socket.c as a result. - Add a mutex to protect the svr4 socket cache. - Change svr4_find_socket() to copy the sockaddr_un struct into a caller-supplied sockaddr_un rather than giving the caller a pointer to our internal one. This removes the one case where code outside of svr4_socket.c could access data in the cache. - Add an eventhandler for process_exit and process_exec to purge the cache of any entries for the exiting or execing process. - Add methods to init and destroy the socket cache and call them from the svr4 ABI module's event handler. - Conditionally grab Giant around socreate() in streamsopen(). - Use fdclose() instead of inlining it in streamsopen() when handling socreate() failure. - Only allocate a stream structure and attach it to a socket in streamsopen(). Previously, if a svr4 program performed a stream operation on an arbitrary socket not opened via the streams device, we would attach streams state data to it and change f_ops of the associated struct file while it was in use. The latter was especially not safe, and if a program wants a stream object it should open it via the streams device anyway. - Don't bother locking so_emuldata in the streams code now that we only touch it right after creating a socket (in streamsopen()) or when tearing it down when the file is closed. - Remove D_NEEDGIANT from the streams device as it is no longer needed.
* Add conditional VFS Giant locking to svr4_sys_fchroot() and mark it MPSAFE.jhb2006-07-212-20/+22
| | | | | | | | | Also, call change_dir() instead of doing part of it inline (this now adds a mac_check_vnode_chdir() call) to match fchdir() and call mac_check_vnode_chroot() to match chroot(). Also, use the change_root() function to do the actual change root to match chroot(). Reviewed by: rwatson
* - Pass the MPSAFE flag to namei() in linux_uselib() and handle conditionaljhb2006-07-211-24/+25
| | | | | | | | | | | | | Giant VFS locking in that function. - Remove bogus code to handle the case where namei() returns success but a NULL vnode pointer. - Note that this code duplicates exec_check_permissions() and annotate where it differs. - Hold the vnode lock longer to protect the write to set VV_TEXT in v_vflag. - Mark linux_uselib() MPSAFE. Reviewed by: rwatson
* Regen.jhb2006-07-194-6/+6
|
* Add conditional VFS Giant locking to svr4_sys_resolvepath() and mark itjhb2006-07-192-2/+5
| | | | MPSAFE.
* Make svr4_sys_waitsys() a lot less ugly and mark it MPSAFE.jhb2006-07-192-155/+149
| | | | | | | | | | | | | | | - If the WNOWAIT flag isn't specified and either of WEXITED or WTRAPPED is set, then just call kern_wait() and let it do all the work. This means that this function no longer has to duplicate the work to teardown zombies that is done in kern_wait(). Instead, if the above conditions aren't true, then it uses a simpler loop to implement WNOWAIT and/or tracing for only stopped or continued processes. This function still has to duplicate code from kern_wait() for the latter two cases, but those are much simpler. - Sync the code to handle the WCONTINUED and WSTOPPED cases with the equivalent code in kern_wait(). - Fix several places that would return with the proctree lock still held. - Lock the current process to prevent lost wakeup races when blocking.
* Don't free the sockaddr in kern_bind() and kern_connect() as not alljhb2006-07-191-1/+4
| | | | | callers pass a sockaddr allocated via malloc() from M_SONAME anymore. Instead, free it in the callers when necessary.
* Initialize svr4_head during MOD_LOAD rather than on demand.jhb2006-07-191-24/+0
|
* sync with master.davidxu2006-07-141-6/+11
|
* Regen.jhb2006-07-114-6/+6
|
OpenPOWER on IntegriCloud