aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux
Commit message (Collapse)AuthorAgeFilesLines
* Implement the CDROMREADAUDIO ioctl.Marcel Moolenaar2002-10-191-1/+37
| | | | Notes: svn path=/head/; revision=105477
* - Use strlcpy() rather than strncpy() to copy NUL terminatedRobert Drehmel2002-10-171-6/+6
| | | | | | | | strings. - Pass the correct buffer size to getcredhostname(). Notes: svn path=/head/; revision=105359
* - Add support for IPC_64 extensions into shmctl(2), semctl(2) and msgctl(2);Maxim Sobolev2002-10-114-23/+318
| | | | | | | | | | | | | | | | - add wrappers for mmap2(2) and ftruncate64(2) system calls; - don't spam console with printf's when VFAT_READDIR_BOTH ioctl(2) is invoked; - add support for SOUND_MIXER_READ_STEREODEVS ioctl(2); - make msgctl(IPC_STAT) and IPC_SET actually working by converting from BSD msqid_ds to Linux and vice versa; - properly return EINVAL if semget(2) is called with nsems being negative. Reviewed by: marcel Approved by: marcel Tested with: LSB runtime test Notes: svn path=/head/; revision=104893
* Back our kernel support for reliable signal queues.Juli Mallett2002-10-012-4/+2
| | | | | | | Requested by: rwatson, phk, and many others Notes: svn path=/head/; revision=104306
* First half of implementation of ksiginfo, signal queues, and such. ThisJuli Mallett2002-09-302-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | 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] Notes: svn path=/head/; revision=104233
* - Hold the vn lock over vm_mmap().Jeff Roberson2002-09-251-4/+4
| | | | Notes: svn path=/head/; revision=103941
* Back out last commit. Linux uses the old 4.3BSD sockaddr format.Jonathan Mini2002-09-242-36/+11
| | | | Notes: svn path=/head/; revision=103886
* Don't use compatability syscall wrappers in emulation code.Jonathan Mini2002-09-232-11/+40
| | | | | | | | | This is needed for the COMPAT_FREEBSD3 option split. Reviewed by: alfred, jake Notes: svn path=/head/; revision=103839
* Remove NVIDIA ioctl bits. They will be provided in a kernel module.Matthew N. Dodd2002-09-202-29/+0
| | | | Notes: svn path=/head/; revision=103712
* Put an XXX comment here to point somebody in the right direction.Poul-Henning Kamp2002-09-201-0/+1
| | | | Notes: svn path=/head/; revision=103705
* Current uses struct thread *td rather than struct proc *p.Warner Losh2002-09-201-2/+2
| | | | Notes: svn path=/head/; revision=103664
* Pass flags to msync() accounting for differences in the definition ofMatthew N. Dodd2002-09-191-1/+5
| | | | | | | | | MS_SYNC on FreeBSD and Linux. Submitted by: Christian Zander <zander@minion.de> Notes: svn path=/head/; revision=103652
* This patch extends the FreeBSD Linux compatibility layer to supportMatthew N. Dodd2002-09-192-0/+29
| | | | | | | | | | NVIDIA API calls; more specifically, it adds an ioctl() handler for the range of possible NVIDIA ioctl numbers. Submitted by: Christian Zander <zander@minion.de> Notes: svn path=/head/; revision=103651
* Do not cast from a pointer to an integer of a possibly different size.Bruce Evans2002-09-051-1/+1
| | | | | | | This fixes a warning on i386's with 64-bit longs. Notes: svn path=/head/; revision=102963
* Include <sys/malloc.h> instead of depending on namespace pollution 2Bruce Evans2002-09-054-14/+10
| | | | | | | | | layers deep in <sys/proc.h> or <sys/vnode.h>. Removed unused includes. Sorted includes. Notes: svn path=/head/; revision=102954
* Implement LINUX_TIOCSCTTY.Marcel Moolenaar2002-09-051-1/+4
| | | | | | | PR: kern/42404 Notes: svn path=/head/; revision=102947
* Use the new kern_*() functions to avoid using the stack gap inIan Dowse2002-09-022-90/+49
| | | | | | | linux_fcntl*() and linux_getcwd(). Notes: svn path=/head/; revision=102872
* Use the new kern_* functions to avoid the need to store argumentsIan Dowse2002-09-016-328/+264
| | | | | | | | | | | in the stack gap. This converts most VFS and signal related system calls, as well as select(). Discussed on: -arch Approved by: marcel Notes: svn path=/head/; revision=102814
* Add a new function linux_emul_convpath(), which is a version ofIan Dowse2002-09-012-32/+64
| | | | | | | | | | | linux_emul_find() that does not use stack gap storage but instead always returns the resulting path in a malloc'd kernel buffer. Implement linux_emul_find() in terms of this function. Also add LCONVPATH* macros that wrap linux_emul_convpath in the same way that the CHECKALT* macros wrap linux_emul_find(). Notes: svn path=/head/; revision=102803
* Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoidMaxim Sobolev2002-08-181-1/+1
| | | | | | | | | | breaking application ABI use unused ifreq.ifru_flags[1] for upper 16 bits in SIOCSIFFLAGS and SIOCGIFFLAGS ioctl's. Reviewed by: -hackers, -net Notes: svn path=/head/; revision=102052
* In continuation of early fileop credential changes, modify fo_ioctl() toRobert Watson2002-08-172-19/+38
| | | | | | | | | | | | | | | | | | | | | | | | | accept an 'active_cred' argument reflecting the credential of the thread initiating the ioctl operation. - Change fo_ioctl() to accept active_cred; change consumers of the fo_ioctl() interface to generally pass active_cred from td->td_ucred. - In fifofs, initialize filetmp.f_cred to ap->a_cred so that the invocations of soo_ioctl() are provided access to the calling f_cred. Pass ap->a_td->td_ucred as the active_cred, but note that this is required because we don't yet distinguish file_cred and active_cred in invoking VOP's. - Update kqueue_ioctl() for its new argument. - Update pipe_ioctl() for its new argument, pass active_cred rather than td_ucred to MAC for authorization. - Update soo_ioctl() for its new argument. - Update vn_ioctl() for its new argument, use active_cred rather than td->td_ucred to authorize VOP_IOCTL() and the associated VOP_GETATTR(). Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=102003
* Make similar changes to fo_stat() and fo_poll() as made earlier toRobert Watson2002-08-161-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | fo_read() and fo_write(): explicitly use the cred argument to fo_poll() as "active_cred" using the passed file descriptor's f_cred reference to provide access to the file credential. Add an active_cred argument to fo_stat() so that implementers have access to the active credential as well as the file credential. Generally modify callers of fo_stat() to pass in td->td_ucred rather than fp->f_cred, which was redundantly provided via the fp argument. This set of modifications also permits threads to perform these operations on behalf of another thread without modifying their credential. Trickle this change down into fo_stat/poll() implementations: - badfo_poll(), badfo_stat(): modify/add arguments. - kqueue_poll(), kqueue_stat(): modify arguments. - pipe_poll(), pipe_stat(): modify/add arguments, pass active_cred to MAC checks rather than td->td_ucred. - soo_poll(), soo_stat(): modify/add arguments, pass fp->f_cred rather than cred to pru_sopoll() to maintain current semantics. - sopoll(): moidfy arguments. - vn_poll(), vn_statfile(): modify/add arguments, pass new arguments to vn_stat(). Pass active_cred to MAC and fp->f_cred to VOP_POLL() to maintian current semantics. - vn_close(): rename cred to file_cred to reflect reality while I'm here. - vn_stat(): Add active_cred and file_cred arguments to vn_stat() and consumers so that this distinction is maintained at the VFS as well as 'struct file' layer. Pass active_cred instead of td->td_ucred to MAC and to VOP_GETATTR() to maintain current semantics. - fifofs: modify the creation of a "filetemp" so that the file credential is properly initialized and can be used in the socket code if desired. Pass ap->a_td->td_ucred as the active credential to soo_poll(). If we teach the vnop interface about the distinction between file and active credentials, we would use the active credential here. Note that current inconsistent passing of active_cred vs. file_cred to VOP's is maintained. It's not clear why GETATTR would be authorized using active_cred while POLL would be authorized using file_cred at the file system level. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=101983
* Another fix that wasn't pulled in from the MAC branch: theRobert Watson2002-08-121-1/+2
| | | | | | | | | | | struct mount is not cached as *mp at this point, so use vp->v_mount directly, following the check that it's non-NULL. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=101707
* Fix missing parens in MAC readdir() check. This fix was in the MACRobert Watson2002-08-121-1/+1
| | | | | | | | | | branch, but apparently didn't get moved over when it was made. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=101706
* - Replace v_flag with v_iflag and v_vflagJeff Roberson2002-08-042-2/+3
| | | | | | | | | | | | | | | | | | - v_vflag is protected by the vnode lock and is used when synchronization with VOP calls is needed. - v_iflag is protected by interlock and is used for dealing with vnode management issues. These flags include X/O LOCK, FREE, DOOMED, etc. - All accesses to v_iflag and v_vflag have either been locked or marked with mp_fixme's. - Many ASSERT_VOP_LOCKED calls have been added where the locking was not clear. - Many functions in vfs_subr.c were restructured to provide for stronger locking. Idea stolen from: BSD/OS Notes: svn path=/head/; revision=101308
* Introduce support for Mandatory Access Control and extensibleRobert Watson2002-08-014-2/+45
| | | | | | | | | | | | | | | kernel access control. Invoke appropriate MAC entry points for a number of VFS-related operations in the Linux ABI module. In particular, handle uselib in a manner similar to open() (more work is probably needed here), as well as handle statfs(), and linux readdir()-like calls. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=101189
* Move the switch statement labels for the explicit 64-bitRobert Drehmel2002-07-091-3/+3
| | | | | | | | | | | command arguments into the correct function, linux_fcntl64(), and thus out of the scope of a compilation for the alpha platform. Requested by: obrien Notes: svn path=/head/; revision=99687
* Enable emulation of the F_GETLK64, F_SETLK64, and F_SETLKW64Robert Drehmel2002-07-091-0/+3
| | | | | | | lock commands arguments to linux_fcntl64(). Notes: svn path=/head/; revision=99670
* - Remove the Giant acquisition from linux_socket_ioctl() as it was reallyAndrew R. Reiter2002-06-261-11/+2
| | | | | | | | | | | there to protect fdrop() (which in turn can call vrele()), however, fdrop_locked() grabs Giant for us, so we do not have to. Reviewed by: jhb Inspired by: alc Notes: svn path=/head/; revision=98878
* Add a comment about how we should use vn_open() here instead of directlyRobert Watson2002-06-141-0/+4
| | | | | | | | invoking VOP_OPEN(). This would reduce code redundancy with the rest of the kernel, and also is required for MAC to work properly. Notes: svn path=/head/; revision=98209
* Fix typo in the BSD copyright: s/withough/without/Jens Schweikhardt2002-06-028-8/+8
| | | | | | | | Spotted and suggested by: des MFC after: 3 weeks Notes: svn path=/head/; revision=97748
* In msgrcv(), set msgtyp correctly. Hardwiring 0 as the message typeMarcel Moolenaar2002-05-181-1/+1
| | | | | | | | | | | | | yields incorrect behaviour. The hardwiring was present in the very first commit that implemented msgrcv() (revision 1.4) and hasn't been changed since. The native implementation was complete at that time, so there doesn't seem to be a reason for the hardwiring from a technical point of view. Submitted by: Reinier Bezuidenhout <rbezuide@yahoo.com> Notes: svn path=/head/; revision=96840
* sysctl -w -> sysctlDima Dorfman2002-05-111-2/+2
| | | | Notes: svn path=/head/; revision=96398
* Zap some stale unused headers, including one machine/psl.h (which isPeter Wemm2002-05-011-6/+0
| | | | | | | a stub on alpha). Compile tested on alpha and x86. Notes: svn path=/head/; revision=95837
* Add an XXX: linux_uselib() should be using vn_open() rather than invokingRobert Watson2002-04-201-0/+4
| | | | | | | | | | | | | | VOP_OPEN() and doing lots of manual checking. This would further centralize use of the name functions, and once the MAC code is integrated, meaning few extraneous MAC checks scattered all over the place. I don't have time to fix this now, but want to make sure it doesn't get forgotten. Anyone interested in fixing this should feel free. Obtained from: TrustedBSD Project Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=95130
* Rework logic of syscalls that modify process credentials as described inJohn Baldwin2002-04-132-25/+39
| | | | | | | rev 1.152 of sys/kern/kern_prot.c. Notes: svn path=/head/; revision=94621
* Use td_ucred in a few spots.John Baldwin2002-04-111-3/+3
| | | | Notes: svn path=/head/; revision=94454
* Moved signal handling and rescheduling from userret() to ast() so thatBruce Evans2002-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 Notes: svn path=/head/; revision=93793
* Change the suser() API to take advantage of td_ucred as well as do aJohn Baldwin2002-04-012-2/+2
| | | | | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@ Notes: svn path=/head/; revision=93593
* Fixed some style bugs in the removal of __P(()). Tabs before "__P(("Bruce Evans2002-03-241-6/+6
| | | | | | | were not removed. Notes: svn path=/head/; revision=93073
* Remove references to vm_zone.h and switch over to the new uma API.Jeff Roberson2002-03-201-1/+0
| | | | Notes: svn path=/head/; revision=92787
* Remove __P.Alfred Perlstein2002-03-205-26/+25
| | | | Notes: svn path=/head/; revision=92761
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredJohn Baldwin2002-02-275-13/+13
| | | | | | | reference. Notes: svn path=/head/; revision=91406
* Use the updated getcredhostname() function.Robert Drehmel2002-02-271-2/+1
| | | | Notes: svn path=/head/; revision=91392
* Use the getcredhostname function to fill the hostname intoRobert Drehmel2002-02-271-1/+3
| | | | | | | | | | | the linux_newuname_args structure. This should fix the case of jailed linux processes not using the jail's hostname. PR: 35336 Reviewed by: phk Notes: svn path=/head/; revision=91385
* Lock struct pgrp, session and sigio.Seigo Tanimura2002-02-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current) Notes: svn path=/head/; revision=91140
* fix file descriptor leak.Alfred Perlstein2002-02-201-1/+2
| | | | | | | Submitted by: Mark Santcroos <marks@ripe.net> Notes: svn path=/head/; revision=90984
* Garbage collect options AVM_A1_PCI, AVM_A1_PCMCIA, DEBUG_LINUX, DEV_APM,Bruce Evans2002-02-151-2/+0
| | | | | | | | GUS_DMA, GUS_DMA2, GUS_IRQ, OLTR_NO_BULLSEYE_MAC, OLTR_NO_HAWKEYE_MAC, OLTR_NO_TMS_MAC and PCIC_RESUME_RESET. Notes: svn path=/head/; revision=90690
* Have SIOCGIFCONF return all (if any) AF_INET addresses for theMarcel Moolenaar2002-01-291-4/+22
| | | | | | | | | | | | | | | | | | | | | | | | interfaces we encounter. In Linux, all addresses are returned for which gifconf handlers are installed. This boils down to AF_DECnet and AF_INET. We care mostly about AF_INET for now. Adding additional families is simple enough. Returning the addresses is important for RPC clients to function properly. Andrew found in some reference code that the logic that handles the retransmission looks for an interface that's up and has an AF_INET address. This obviously failed as we didn't return any addresses at all. Note also that with this change we don't return interfaces that don't have AF_INET addresses, whereas before we returned any interface present in the system. This is in line with what Linux does (modulo interfaces with only AF_DECnet addresses of course :-) Reported by: "Andrew Atrens" <atrens@nortelnetworks.com> MFC after: 1 week Notes: svn path=/head/; revision=89944
* Linux/alpha uses the same BSDish return mechanism we do forAndrew Gallatin2002-01-231-0/+4
| | | | | | | | | | | getpid, getuid, getgid and pipe, since they bootstrapped from OSF/1 and never cleaned up. Switch to the native syscalls on alpha so that the above functions work MFC after: 7 days Notes: svn path=/head/; revision=89717