summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_ioctl.c
Commit message (Collapse)AuthorAgeFilesLines
* Implement SOUND_MIXER_INFO ioctl in compat layer.mdodd2005-04-131-3/+36
|
* Use the CTASSERT() macro instead of rolling my own, non-portable onebrooks2005-03-241-3/+1
| | | | | | using #error. Suggested by: jhb
* Compile errors are way more useful then panics later.brooks2005-03-241-3/+4
| | | | | | Replace a KASSERT of LINUX_IFNAMSIZ == IFNAMSIZ with a preprocessor check and #error message. This will prevent nasty suprises if users change IFNAMSIZ without updating the linux code appropriatly.
* Boot away another stackgap (one of the lest ones in linuxlator/i386) bysobomax2005-01-301-14/+13
| | | | | | | | | | providing special version of CDIOCREADSUBCHANNEL ioctl(), which assumes that result has to be placed into kernel space not user space. In the long run more generic solution has to be designed WRT emulating various ioctl()s that operate on userspace buffers, but right now there is only one such ioctl() is emulated, so that it makes little sense. MFC after: 2 weeks
* Match the LINUX32's style with existing styleobrien2005-01-141-5/+5
| | | | | | Submitted by: Jung-uk Kim <jkim@niksun.com> Use positive, not negative logic.
* Start each of the license/copyright comments with /*-imp2005-01-051-1/+1
|
* Changes to MI Linux emulation code necessary to run 32-bit Linux binariestjr2004-08-161-2/+13
| | | | | | | | | | | | | | | on AMD64, and the general case where the emulated platform has different size pointers than we use natively: - declare certain structure members as l_uintptr_t and use the new PTRIN and PTROUT macros to convert to and from native pointers. - declare some structures __packed on amd64 when the layout would differ from that used on i386. - include <machine/../linux32/linux.h> instead of <machine/../linux/linux.h> if compiling with COMPAT_LINUX32. This will need to be revisited before 32-bit and 64-bit Linux emulation support can coexist in the same kernel. - other small scattered changes. This should be a no-op on i386 and Alpha.
* Implement SNDCTL_DSP_SETDUPLEX. This may fix sound apps which want tonetchild2004-07-021-0/+4
| | | | | | use full duplex mode. Approved by: matk
* Add stub for Linux SOUND_MIXER_READ_RECMASK, required by some Linux soundbms2004-06-181-0/+4
| | | | | | | applications. PR: misc/27471 Submitted by: Gavin Atkinson (with cleanups)
* Add a stub for the Linux SOUND_MIXER_INFO ioctl (even though we don'tbms2004-06-181-0/+4
| | | | | | | | actually implement it), as some applications, such as RealProducer, expect to be able to use it. PR: kern/65971 Submitted by: Matt Wright
* Linux applications expect to be able to call SIOCGIFCONF with anbms2004-06-181-0/+14
| | | | | | | | | | NULL ifc.ifc_buf pointer, to determine the expected buffer size. The submitted fix only takes account of interfaces with an AF_INET address configured. This could no doubt be improved. PR: kern/45753 Submitted by: Jacques Garrigue (with cleanups)
* Fix the VT_SETMODE/CDROMIOCTOCENTRY problem correctly.bms2004-06-181-15/+17
| | | | Reviewed by: tjr
* Fix two attempts to use an unchecked NULL pointer provided from thebms2004-06-181-7/+10
| | | | | | userland, for the CDIOREADTOCENTRY and VT_SETMODE cases respectively. Noticed by: tjr
* Add support for more linux ioctls.phk2004-06-141-0/+105
| | | | | | | | I've had this sitting in my tree for a long time and I can't seem to find who sent it to me in the first place, apologies to whoever is missing out on a Contributed by: line here. I belive it works as it should.
* Add BSD compatibility tty ioctls LINUX_TIOCSBRK and LINUX_TIOCCBRK. Thisbms2004-02-191-0/+10
| | | | | | | addition appears to allow VMware 3 Workstation to operate with nmdm(4) as a virtual COM device. Tested by: Guido van Rooij
* Replace the if_name and if_unit members of struct ifnet with new membersbrooks2003-10-311-7/+4
| | | | | | | | | | | | | if_xname, if_dname, and if_dunit. if_xname is the name of the interface and if_dname/unit are the driver name and instance. This change paves the way for interface renaming and enhanced pseudo device creation and configuration symantics. Approved By: re (in principle) Reviewed By: njl, imp Tested On: i386, amd64, sparc64 Obtained From: NetBSD (if_xname)
* fix build: linux_to_bsd_msf_lba is no longer used because of previous commitsam2003-10-201-12/+0
|
* We dont support CDROMREADAUDIO anymore.sos2003-10-201-18/+1
|
* Don't map LINUX_POSIX_VDISABLE to _POSIX_VDISABLE and vice versa formarcel2003-06-281-2/+4
| | | | | | | | | | | | | | | | the VMIN and VTIME members of the c_cc array. These members are not special control characters. By not excluding these members we changed the noncanonical mode input processing when both members were 0 on entry (=LINUX_POSIX_VDISABLE) as we would remap them to 255 (=_POSIX_VDISABLE). See termios(4) case A for how that screws up your terminal I/O. PR: 23173 Originator: Bjarne Blichfeldt <bbl@dk.damgaard.com> Patch by: Boris Nikolaus <bn@dali.tellique.de> (original submission) Philipp Mergenthaler <philipp.mergenthaler@stud.uni-karlsruhe.de> Reminders by: Joseph Holland King <gte743n@cad.gatech.edu> MFC after: 5 days
* Use __FBSDID().obrien2003-06-101-2/+3
|
* Add an ioctl handler for the DRM. This removes the need for the DRM_LINUXanholt2003-04-241-0/+14
| | | | option, which has been a source of frustration for many users.
* Don't include <sys/disklabel.h>phk2003-04-161-1/+0
|
* Add #include <sys/conf.h> so we don't rely on <sys/disk.h> doing it.phk2003-04-011-0/+1
|
* Fix an XXX: and implement LINUX_BLKGETSIZE correctly.phk2003-03-281-6/+14
|
* - Change the linux_[gs]et_os{name, release, s_version}() functions tojhb2003-03-131-1/+1
| | | | | | | | | | | | | take a thread instead of a proc for their first argument. - Add a mutex to protect the system-wide Linux osname, osrelease, and oss_version variables. - Change linux_get_prison() to take a thread instead of a proc for its first argument and to use td_ucred rather than p_ucred. This is ok because a thread's prison does not change even though it's ucred might. - Also, change linux_get_prison() to return a struct prison * instead of a struct linux_prison * since it returns with the struct prison locked and this makes it easier to safely unlock the prison when we are done messing with it.
* More caddr_t removal, in conjunction with copy{in,out}(9) this time.des2003-03-031-44/+37
| | | | Also clean up some egregious casts and incorrect use of sizeof.
* Clean up whitespace, s/register //, refrain from strong urge to ANSIfy.des2003-03-021-22/+22
|
* uiomove-related caddr_t -> void * (just the low-hanging fruit)des2003-03-021-2/+1
|
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* Add function linux_msg() for regulating output from the linux emulationalfred2003-01-021-1/+1
| | | | | | | | | | | code, make the emulator use it. Rename unsupported_msg() to unimplemented_syscall(). Rename some arguments for clarity Fixup grammar. Requested by: bde
* SMP locking for ifnet list.hsu2002-12-221-2/+12
|
* Implement the CDROMREADAUDIO ioctl.marcel2002-10-191-1/+37
|
* - Add support for IPC_64 extensions into shmctl(2), semctl(2) and msgctl(2);sobomax2002-10-111-0/+15
| | | | | | | | | | | | | - 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
* Remove NVIDIA ioctl bits. They will be provided in a kernel module.mdodd2002-09-201-22/+0
|
* Put an XXX comment here to point somebody in the right direction.phk2002-09-201-0/+1
|
* Current uses struct thread *td rather than struct proc *p.imp2002-09-201-2/+2
|
* This patch extends the FreeBSD Linux compatibility layer to supportmdodd2002-09-191-0/+22
| | | | | | | 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>
* Implement LINUX_TIOCSCTTY.marcel2002-09-051-1/+4
| | | | PR: kern/42404
* Increase size of ifnet.if_flags from 16 bits (short) to 32 bits (int). To avoidsobomax2002-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
* In continuation of early fileop credential changes, modify fo_ioctl() torwatson2002-08-171-18/+36
| | | | | | | | | | | | | | | | | | | | | | 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
* - Remove the Giant acquisition from linux_socket_ioctl() as it was reallyarr2002-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
* Fix typo in the BSD copyright: s/withough/without/schweikh2002-06-021-1/+1
| | | | | Spotted and suggested by: des MFC after: 3 weeks
* fix file descriptor leak.alfred2002-02-201-1/+2
| | | | Submitted by: Mark Santcroos <marks@ripe.net>
* Have SIOCGIFCONF return all (if any) AF_INET addresses for themarcel2002-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
* Reinstate linux_ifname. Although the Linuxulator doesn't use itmarcel2002-01-151-0/+27
| | | | | | itself, it's used outside the Linuxulator. Reimplement the function so that its behaviour matches the current renaming scheme. It's probably better to formalize these interdependencies.
* Replace ffind_* with fget calls.alfred2002-01-141-15/+11
| | | | | | | | Make fget MPsafe. Make fgetvp and fgetsock use the fget subsystem to reduce code bloat. Push giant down in fpathconf().
* SMP Lock struct file, filedesc and the global file list.alfred2002-01-131-94/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seigo Tanimura (tanimura) posted the initial delta. I've polished it quite a bit reducing the need for locking and adapting it for KSE. Locks: 1 mutex in each filedesc protects all the fields. protects "struct file" initialization, while a struct file is being changed from &badfileops -> &pipeops or something the filedesc should be locked. 1 mutex in each struct file protects the refcount fields. doesn't protect anything else. the flags used for garbage collection have been moved to f_gcflag which was the FILLER short, this doesn't need locking because the garbage collection is a single threaded container. could likely be made to use a pool mutex. 1 sx lock for the global filelist. struct file * fhold(struct file *fp); /* increments reference count on a file */ struct file * fhold_locked(struct file *fp); /* like fhold but expects file to locked */ struct file * ffind_hold(struct thread *, int fd); /* finds the struct file in thread, adds one reference and returns it unlocked */ struct file * ffind_lock(struct thread *, int fd); /* ffind_hold, but returns file locked */ I still have to smp-safe the fget cruft, I'll get to that asap.
* Further fixes related to the interface renaming. Now that wemarcel2002-01-101-52/+12
| | | | | | | | | | | | | | properly translate the interface name passed to us, make sure we also translate correctly before we return the list of interfaces with the SIOCGIFCONF ioctl. It is common to use the interface names returned by that ioctl in further ioctls, such as SIOCGIFFLAGS. Remove linux_ifname as it is no longer used. Also remove ifname_bsd_to_linux as it cannot be used anymore now that linux_ifname is removed (was deadcode anyway). Reported and tested by: Andrew Atrens <atrens@nortelnetworks.com>
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-101-5/+5
| | | | also don't use ANSI string concatenation.
OpenPOWER on IntegriCloud