summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_signal.c
Commit message (Collapse)AuthorAgeFilesLines
* Use __FBSDID().obrien2003-06-101-2/+3
|
* Argh! We want to return the old signal set when the error return is zerojhb2003-04-281-1/+1
| | | | | | | (i.e. success), not non-zero (failure). Submitted by: tegge Pointy hat to: jhb
* Use a switch to convert the Linux sigprocmask flags to the equivalentjhb2003-04-251-3/+14
| | | | | | | | | | | FreeBSD flags instead of just adding one to the Linux flags. This should be identical to the previous version except that I have at least one report of this patch fixing problems people were having with Linux apps after my last commit to this file. It is safer to use the switch then to make assumptions about the flag values anyways, esp. since we currently use MD defines for the values of the flags and this is MI code. Tested by: Michael Class <michael_class@gmx.net>
* - Replace inline implementations of sigprocmask() with calls tojhb2003-04-221-29/+11
| | | | | | | kern_sigprocmask() in the various binary compatibility emulators. - Replace calls to sigsuspend(), sigaltstack(), sigaction(), and sigprocmask() that used the stackgap with calls to the corresponding kern_sig*() functions instead without using the stackgap.
* Don't hold the proc lock while performing sigset conversions on localjhb2003-04-171-1/+1
| | | | variables.
* - Move p->p_sigmask to td->td_sigmask. Signal masks will be per thread withjeff2003-03-311-14/+15
| | | | | | | a follow on commit to kern_sig.c - signotify() now operates on a thread since unmasked pending signals are stored in the thread. - PS_NEEDSIGCHK moves to TDF_NEEDSIGCHK.
* Add MPSAFE comment to linux_sigpending().tjr2003-02-161-0/+3
|
* Back our kernel support for reliable signal queues.jmallett2002-10-011-2/+1
| | | | Requested by: rwatson, phk, and many others
* First half of implementation of ksiginfo, signal queues, and such. Thisjmallett2002-09-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | gets signals operating based on a TailQ, and is good enough to run X11, GNOME, and do job control. There are some intricate parts which could be more refined to match the sigset_t versions, but those require further evaluation of directions in which our signal system can expand and contract to fit our needs. After this has been in the tree for a while, I will make in kernel API changes, most notably to trapsignal(9) and sendsig(9), to use ksiginfo more robustly, such that we can actually pass information with our (queued) signals to the userland. That will also result in using a struct ksiginfo pointer, rather than a signal number, in a lot of kern_sig.c, to refer to an individual pending signal queue member, but right now there is no defined behaviour for such. CODAFS is unfinished in this regard because the logic is unclear in some places. Sponsored by: New Gold Technology Reviewed by: bde, tjr, jake [an older version, logic similar]
* Use the new kern_* functions to avoid the need to store argumentsiedowse2002-09-011-17/+9
| | | | | | | | in the stack gap. This converts most VFS and signal related system calls, as well as select(). Discussed on: -arch Approved by: marcel
* Fix typo in the BSD copyright: s/withough/without/schweikh2002-06-021-1/+1
| | | | | Spotted and suggested by: des MFC after: 3 weeks
* Moved signal handling and rescheduling from userret() to ast() so thatbde2002-04-041-0/+3
| | | | | | | | | | | they aren't in the usual path of execution for syscalls and traps. The main complication for this is that we have to set flags to control ast() everywhere that changes the signal mask. Avoid locking in userret() in most of the remaining cases. Submitted by: luoqi (first part only, long ago, reorganized by me) Reminded by: dillon
* KSE Milestone 2julian2001-09-121-20/+24
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Round of cleanups and enhancements. These include (in random order):marcel2001-09-081-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Introduce private types for use in linux syscalls for two reasons: 1. establish type independence for ease in porting and, 2. provide a visual queue as to which syscalls have proper prototypes to further cleanup the i386/alpha split. Linuxulator types are prefixed by 'l_'. void and char have not been "virtualized". o Provide dummy functions for all syscalls and remove dummy functions or implementations of truely obsolete syscalls. o Sanitize the shm*, sem* and msg* syscalls. o Make a first attempt to implement the linux_sysctl syscall. At this time it only returns one MIB (KERN_VERSION), but most importantly, it tells us when we need to add additional sysctls :-) o Bump the kenel version up to 2.4.2 (this is not the same as the KERN_VERSION MIB, BTW). o Implement new syscalls, of which most are specific to i386. Our syscall table is now up to date with Linux 2.4.2. Some highlights: - Implement the 32-bit uid_t and gid_t bases syscalls. - Implement a couple of 64-bit file size/offset bases syscalls. o Fix or improve numerous syscalls and prototypes. o Reduce style(9) violations while I'm here. Especially indentation inconsistencies within the same file are addressed. Re-indenting did not obfuscate actual changes to the extend that it could not be combined. NOTE: I spend some time testing these changes and found that if there were regressions, they were not caused by these changes AFAICT. It was observed that installing a RH 7.1 runtime environment did make matters worse. Hangs and/or reboots have been observed with and without these changes, so when it failed to make life better in cases it doesn't look like it made it worse.
* Undo part of the tangle of having sys/lock.h and sys/mutex.h included inmarkm2001-05-011-1/+3
| | | | | | | | | | | other "system" header files. Also help the deprecation of lockmgr.h by making it a sub-include of sys/lock.h and removing sys/lockmgr.h form kernel .c files. Sort sys/*.h includes where possible in affected files. OK'ed by: bde (with reservations)
* Allow debugging output to be controlled on a per-syscall granularity.jlemon2001-02-161-15/+21
| | | | | | Also clean up debugging output in a slightly more uniform fashion. The default behavior remains the same (all debugging output is turned on)
* Lock access to proc members.jhb2000-12-151-8/+9
| | | | Glanced over by: marcel
* Don't auto-generate the syscalls.marcel2000-12-031-4/+0
|
* Revert auto-generation. The Alpha port is broken.marcel2000-11-101-0/+4
| | | | Syncing with it is wrong.
* Sync with Alpha:marcel2000-11-091-4/+0
| | | | | Do not use sysent.c, proto.h and syscall.h in source tree; use auto-generated versions.
* The MI/MD split wasn't perfect and the MI files need hacks for theobrien2000-11-011-5/+28
| | | | | | AlphaLinux compat bits. This will be better cleaned up soon. Agreed to what ever was necessary by: marcel
* A start at an implemention of linux_rt_sendsig & linux_rt_sigreturngallatin2000-10-171-1/+1
| | | | | | | | | | | | | | and associated user-level signal trampoline glue. Without this patch, an SA_SIGINFO style handler can be installed by a linux app, but if the handler accesses its sip argument, it will get a garbage pointer and likely segfault. We currently supply a valid pointer, but its contents are mainly garbage. Filling this in properly is future work. This is the second of 3 commits that will get IBM's JDK 1.3 working with FreeBSD ...
* Update include directives.marcel2000-08-221-158/+6
| | | | | | | Make linux_to_bsd_sigset and linux_do_sigaction non-static. Move linux_sigaction. linux_sigsuspend, linux_rt_sigsuspend, linux_pause and linux_sigaltstack to MD code.
* Fix LINT breakage.archie1999-12-051-1/+1
|
* Implement linux_sigaltstack.marcel1999-11-301-11/+47
|
* sigset_t change (part 4 of 5)marcel1999-09-291-281/+334
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ----------------------------- The compatibility code and/or emulators have been updated: iBCS2 now mostly uses the older syscalls. SVR4 now properly handles all signals. This has been achieved by using the new sigset_t throughout the emulator. The Linuxulator has been severely updated. Internally the new Linux sigset_t is made the default. These are then mapped to and from the new FreeBSD sigset_t. Also, rt_sigsuspend has been implemented in the Linuxulator. Implementing this syscall basicly caused all this sigset_t changing in the first place and the syscall has been used throughout the change as a means for testing. It basicly is too much work to undo the implementation so that it can later be added again. A special note on the use of sv_sigtbl and sv_sigsize in struct sysentvec: Every signal larger than sv_sigsize is not translated and is passed on to the signal handler unmodified. Signals in the range 1 upto and including sv_sigsize are translated. The rationale is that only the system defined signals need to be translated. The emulators also have been updated so that the translation tables are only indexed for valid (system defined) signals. This change also fixes the translation bug already in the SVR4 emulator.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Implementation of linux_rt_sigaction and linux_rt_sigprocmask syscalls. Bothmarcel1999-08-141-75/+216
| | | | | | | | | | functions use the new sigset_t and sigaction_t which allows support for more than 32 signals. Only the lower 32 signals are supported for now. linux_rt_sigaction, linux_sigaction and linux_signal use linux_do_sigaction to do the actual work. That way unnecessary redundancy is avoided. The same has been done for linux_rt_sigprocmask and linux_sigprocmask. They call linux_do_sigprocmask to do the actual work.
* Rename struct members sa_siginfo. POSIX reserves identifiers startingcracauer1999-07-061-17/+17
| | | | | | | with sa_ when <signal.h> is included. They would conflict with the upcoming SA_SIGINFO implementation. Reviewed by: BDE
* Fix up a few easy 'assignment used as truth value' and 'suggest parenspeter1999-05-061-8/+15
| | | | | around && within ||' type warnings. I'm pretty sure I have not masked any problems here, I've committed real problem fixes seperately.
* Kill(pid, 0) normally returns 0 on both FreeBSD and Redhat after havingsos1998-12-211-2/+2
| | | | | | | | | performed all sorts of sanity checks. The FreeBSD linux emulator returns EINVAL in such a case. Allowing signal 0 to be passed to kill will result in compatible behaviour. PR: 9082 Submitted by: Marcel Moolenaar <marcel@scc.nl>
* Fix a couple of out-of-bounds array references in mapping betweenjdp1998-10-111-4/+9
| | | | | | Linux and FreeBSD signal numbers. Also, check signal numbers passed in from application programs for validity. Without these checks, it is trivial to panic the system from a Linux program.
* Oops, the previous fix confused Linux's sigset_t with a pointer type.bde1998-08-151-5/+5
| | | | | | It can be integral or a struct in POSIX, so it is difficult to print, but it is actually declared as unsigned long. Assume that it is unsigned integral.
* Fixed print format errors.bde1998-07-291-7/+9
|
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-20/+19
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Removed unused #includes.bde1997-07-201-3/+1
|
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* update linux_times() and linux_utime() emulation,peter1996-03-041-3/+6
| | | | | fix sigsuspend() (actually back out my recent change there) and regen the syscall tables..
* Minor touch-up... make two functions static, and add missing $Id$peter1996-03-021-3/+3
|
* Mega-commit for Linux emulator update.. This has been stress tested underpeter1996-03-021-80/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | netscape-2.0 for Linux running all the Java stuff. The scrollbars are now working, at least on my machine. (whew! :-) I'm uncomfortable with the size of this commit, but it's too inter-dependant to easily seperate out. The main changes: COMPAT_LINUX is *GONE*. Most of the code has been moved out of the i386 machine dependent section into the linux emulator itself. The int 0x80 syscall code was almost identical to the lcall 7,0 code and a minor tweak allows them to both be used with the same C code. All kernels can now just modload the lkm and it'll DTRT without having to rebuild the kernel first. Like IBCS2, you can statically compile it in with "options LINUX". A pile of new syscalls implemented, including getdents(), llseek(), readv(), writev(), msync(), personality(). The Linux-ELF libraries want to use some of these. linux_select() now obeys Linux semantics, ie: returns the time remaining of the timeout value rather than leaving it the original value. Quite a few bugs removed, including incorrect arguments being used in syscalls.. eg: mixups between passing the sigset as an int, vs passing it as a pointer and doing a copyin(), missing return values, unhandled cases, SIOC* ioctls, etc. The build for the code has changed. i386/conf/files now knows how to build linux_genassym and generate linux_assym.h on the fly. Supporting changes elsewhere in the kernel: The user-mode signal trampoline has moved from the U area to immediately below the top of the stack (below PS_STRINGS). This allows the different binary emulations to have their own signal trampoline code (which gets rid of the hardwired syscall 103 (sigreturn on BSD, syslog on Linux)) and so that the emulator can provide the exact "struct sigcontext *" argument to the program's signal handlers. The sigstack's "ss_flags" now uses SS_DISABLE and SS_ONSTACK flags, which have the same values as the re-used SA_DISABLE and SA_ONSTACK which are intended for sigaction only. This enables the support of a SA_RESETHAND flag to sigaction to implement the gross SYSV and Linux SA_ONESHOT signal semantics where the signal handler is reset when it's triggered. makesyscalls.sh no longer appends the struct sysentvec on the end of the generated init_sysent.c code. It's a lot saner to have it in a seperate file rather than trying to update the structure inside the awk script. :-) At exec time, the dozen bytes or so of signal trampoline code are copied to the top of the user's stack, rather than obtaining the trampoline code the old way by getting a clone of the parent's user area. This allows Linux and native binaries to freely exec each other without getting trampolines mixed up.
* Clean up some warnings by using the generated structures in <sys/sysproto.h>peter1995-12-151-9/+11
| | | | | for passing to the bsd system calls, rather than inveninting our own equivalent structures.
* Completed function declarations and added prototypes.bde1995-11-221-3/+3
| | | | | | Removed some unnecessary #includes. Fixed warnings about nested externs.
* First incarnation of our Linux emulator or rather compatibility code.sos1995-06-251-0/+259
This first shot only incorporaties so much functionality that DOOM can run (the X version), signal handling is VERY weak, so is many other things. But it meets my milestone number one (you guessed it - running DOOM). Uses /compat/linux as prefix for loading shared libs, so it won't conflict with our own libs. Kernel must be compiled with "options COMPAT_LINUX" for this to work.
OpenPOWER on IntegriCloud