summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
Commit message (Collapse)AuthorAgeFilesLines
...
* Put the macro declaration in the relevant include file for future use.dchagin2011-02-152-3/+3
|
* Style(9) fix. Do not initialize variables in the declarations.dchagin2011-02-141-2/+5
|
* Sort include files in the alphabetical order.dchagin2011-02-131-1/+1
|
* Remove comment about 'ftlk' LOR.dchagin2011-02-131-2/+1
|
* Stop printing the LOR, as this is expected behavior.dchagin2011-02-131-1/+1
|
* The bitset field of freshly created futex should be initialized explicity.dchagin2011-02-131-0/+1
| | | | Otherwise, REQUEUE operations fails.
* Rename used_requeue and use it as bitwise field to store more flags.dchagin2011-02-123-4/+8
| | | | Reimplement used_requeue logic with LINUX_XDEPR_REQUEUEOP flag.
* Slightly rewrite linux_fork:dchagin2011-02-121-13/+6
| | | | | | 1) Remove bogus error checking. 2) A new process exit from kernel through fork_trampoline(), so remove bogus check.
* Remove bogus include <machine/frame.h>dchagin2011-02-121-2/+0
|
* Move linux_clone(), linux_fork(), linux_vfork() to a MI path.dchagin2011-02-121-0/+297
|
* Linux' shm_open() fails because it wants to find some funky shmfsnetchild2011-02-091-1/+9
| | | | | | | | | | | | | | | | | | | | to construct the full pathname. It starts to search at the default mountpoint which is /dev/shm. If this fails it runs through fstab and searches for shmfs and tmpfs. Whatever it finds will be statfs()'ed to be checked for Linux' fs magic for shmfs (0x01021994). Ideally our tmpfs should deliver this fs magic to Linux processes, but as our tmpfs is considered to be an experimental feature we can not assume that there is always a tmpfs available. To make shared memory work in the Linuxulator, force the fs type of /dev/shm (which can be a symlink) to match what Linux expects. The user is responsible (info has to be added to the linux base ports and the docs) to setup a suitable link for /dev/shm. Noticed by: Andre Albsmeier <Andre.Albsmeier@siemens.com> Submitted by: Andre Albsmeier <Andre.Albsmeier@siemens.com> MFC after: 1 month
* Yet another unimplemented futex operation, print out about.dchagin2011-01-312-0/+8
| | | | | Submitted by: arundel MFC after: 1 month.
* Implement a futex BITSET op.dchagin2011-01-312-25/+46
| | | | | Submitted by: arundel MFC after: 1 month.
* Style(9) fixes.dchagin2011-01-281-28/+28
| | | | MFC after: 1 Month.
* Implement a variation of the linux_common_wait() which shoulddchagin2011-01-282-63/+28
| | | | | | | | | be used by linuxolator itself. Move linux_wait4() to MD path as it requires native struct rusage translation to struct l_rusage on linux32/amd64. MFC after: 1 Month.
* Style(9) fix.dchagin2011-01-281-1/+1
| | | | MFC after: 1 month.
* Style(9) fix.dchagin2011-01-231-1/+1
| | | | | Approved by: kib(mentor) MFC after: 1 month
* In linuxolator getdents_common(), it seems there is no reason to loopkib2011-01-191-3/+4
| | | | | | | | | | | | if no records where returned by VOP_READDIR(). Readdir implementations allowed to return 0 records when first record is larger then supplied buffer. In this case trying to execute VOP_READDIR() again causes the syscall looping forewer. The goto was there from the day 1, which goes back to 1995 year. Reported and tested by: Beat G?tzi <beat chruetertee ch> MFC after: 2 weeks
* Fix the LINUX_SOUND_MIXER_INFO ioctl to return success after thescf2010-12-302-2/+7
| | | | | | | | | | | | information is set to FreeBSD. It had been falling through to the end of linux_ioctl_sound() and returning ENOIOCTL. Noticed when running the Linux ALSA amixer tool. Add a LINUX_SOUND_MIXER_READ_CAPS ioctl which is used by the Skype v2.1.0.81 binary. Reviewed by: gavin MFC after: 2 weeks
* Fix linux kernel module breakage introduced in r215675, by includingdim2010-11-221-0/+1
| | | | | | | <sys/sysent.h>. Noticed by: many Pointy hat to: netchild
* Do not take the process lock. The assignment to u_short inside thenetchild2010-11-221-5/+3
| | | | | | | | | | | properly aligned structure is atomic on all supported architectures, and the thread that should see side-effect of assignment is the same thread that does assignment. Use a more appropriate conditional to detect the linux ABI. Suggested by: kib X-MFC: together with r215664
* Remove trailing dot from the unimplemented futex messages to makenetchild2010-11-221-5/+5
| | | | | | | them consistent with the syscall and ipc messages. Submitted by: arundel MFC after: 3 days
* By using the 32-bit Linux version of Sun's Java Development Kit 1.6netchild2010-11-223-22/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | on FreeBSD (amd64), invocations of "javac" (or "java") eventually end with the output of "Killed" and exit code 137. This is caused by: 1. After calling exec() in multithreaded linux program threads are not destroyed and continue running. They get killed after program being executed finishes. 2. linux_exit_group doesn't return correct exit code when called not from group leader. Which happens regularly using sun jvm. The submitters fix this in a similar way to how NetBSD handles this. I took the PRs away from dchagin, who seems to be out of touch of this since a while (no response from him). The patches committed here are from [2], with some little modifications from me to the style. PR: 141439 [1], 144194 [2] Submitted by: Stefan Schmidt <stefan.schmidt@stadtbuch.de>, gk Reviewed by: rdivacky (in april 2010) MFC after: 5 days
* Some style(9) fixes.netchild2010-11-151-5/+5
| | | | | Submitted by: arundel MFC after: 1 week
* - print out the PID and program name of the program trying to use annetchild2010-11-152-15/+54
| | | | | | | | | | | | | | | | | unsupported futex operation - for those futex operations which are known to be not supported, print out which futex operation it is - shortcut the error return of the unsupported FUTEX_CLOCK_REALTIME in some cases: FUTEX_CLOCK_REALTIME can be used to tell linux to use CLOCK_REALTIME instead of CLOCK_MONOTONIC. FUTEX_CLOCK_REALTIME however must only be set, if either FUTEX_WAIT_BITSET or FUTEX_WAIT_REQUEUE_PI are set too. If that's not the case we can die with ENOSYS right at the beginning. Submitted by: arundel Reviewed by: rdivacky (earlier iteration of the patch) MFC after: 1 week
* Remove stale comment.kib2010-10-141-5/+0
| | | | | Submitted by: arundel MFC after: 3 days
* Simplify timeout check in futex_wait() using itimerfix() and return errorjkim2010-10-061-22/+10
| | | | | if the given timeout is invalid. Consistently use int type for timeout and correct a format string in futex_sleep().
* Fix a comparision of an uninitialised pointer.netchild2010-10-061-1/+1
| | | | | | Submitted by: arundel Found by: clang analysis (automatic service by uqs@) Reviewed by: rdivacky
* Replace sbuf_overflowed() with sbuf_error(), which returns any errormdf2010-09-101-2/+2
| | | | | | code associated with overflow or with the drain function. While this function is not expected to be used often, it produces more information in the form of an errno that sbuf_overflowed() did.
* Tweak the in-kernel API for sending signals to threads:jhb2010-06-291-2/+2
| | | | | | | | | | - Rename tdsignal() to tdsendsignal() and make it private to kern_sig.c. - Add tdsignal() and tdksignal() routines that mirror psignal() and pksignal() except that they accept a thread as an argument instead of a process. They send a signal to a specific thread rather than to an individual process. Reviewed by: kib
* Bring USB fixes for linux(4).wkoszek2010-05-242-14/+147
| | | | | | | | | | | | | | | | | | | | | | Intention of this commit is to let us take a full advantage of libusb(8) ported to Linux. This decreases a possibility of getting any collisions within ioctl() "command" space, especially with relation to LINUX_SNDCTL_SEQ... stuff. Basically, we provide commands, that will be mapped in the kernel to correct ones and forward those to the USB layer. Port enabling functionality brought with this patch is here: http://www.freebsd.org/cgi/query-pr.cgi?pr=146895 Bump __FreeBSD_version to catch, since which version installing a port makes sense. This patch should bring no regressions. So far, only i386 is tested. Tested by: thompsa@ Reviewed by: thompsa@ OKed by: netchild@
* - #ifdef out the cliplist part, skype seems like using an uninitializednetchild2010-05-031-7/+24
| | | | | | | | | | variable and can cause problems, without the cliplist handling it works without problems - improve the cliplist error handling - fix VIDIOCGTUNER and VIDIOCSMICROCODE (still no hardware available to test) Submitted by: J.R. Oldroyd <jr@opal.com> X-MFC after: soon (together with all the v4l stuff)
* Rename st_*timespec fields to st_*tim for POSIX 2008 compliance.ed2010-03-281-9/+18
| | | | | | | | | | | | | | | A nice thing about POSIX 2008 is that it finally standardizes a way to obtain file access/modification/change times in sub-second precision, namely using struct timespec, which we already have for a very long time. Unfortunately POSIX uses different names. This commit adds compatibility macros, so existing code should still build properly. Also change all source code in the kernel to work without any of the compatibility macros. This makes it all a less ambiguous. I am also renaming st_birthtime to st_birthtim, even though it was a local extension anyway. It seems Cygwin also has a st_birthtim.
* Fix some problems which may lead to a panic:netchild2010-03-261-1/+3
| | | | | | | - right order of src and dst in memcpy - NULL out the clips after freeing to prevent an accident Noticed by: hselasky
* Actually make O_DIRECTORY work.ed2010-03-211-6/+2
| | | | | | According to POSIX open() must return ENOTDIR when the path name does not refer to a path name. Change vn_open() to respect this flag. This also simplifies the Linuxolator a bit.
* The NetBSD Foundation has granted permission to remove clause 3 and 4 fromjoel2010-03-012-14/+0
| | | | | | their software. Obtained from: NetBSD
* No need to include security/mac/mac_framework.h here.pjd2010-02-181-2/+0
|
* - Return EAFNOSUPPORT instead of EINVAL for unsupported address family,delphij2010-02-091-2/+7
| | | | | | | | | | | | this matches the Linux behavior. - Check if we have sufficient space allocated for socket structure, which fixes a buffer overflow when wrong length is being passed into the emulation layer. [1] PR: kern/138860 Submitted by: Mateusz Guzik <mjguzik gmail com> Reported by: Alexander Best [1] MFC after: 2 weeks
* Let us to use our libusb(3) in Linuxolator.wkoszek2010-01-182-0/+28
| | | | | | | | | | | With this change, Linux binaries can work with our libusb(3) when it's compiled against our header files on GNU/Linux system -- this solves the problem with differences between /dev layouts. With ported libusb(3), I am able to use my USB JTAG cable with Linux binaries that support it. Reviewed by: thompsa
* Whitespace change to be able to provide the correct commit log for r202364:netchild2010-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ---snip--- Add video clipping support but with the caveats below. Background info: Video clipping allows the user to provide either a series of clip rectangles or a clip bitmap to the driver and have the driver mask the video according to the clipping specs provided. Adding support for clipping to the FreeBSD Linux emulator is problematic because it seems that this feature is not supported by many drivers and therefore it is ignored by many applications. Unfortunately, when not using it, rather than passing in a null clipping list, some apps leave the clipping fields uninitialized, casuing random values to be passed in. In the case where the driver does not use the clipping info, this is not a problem (although it is bad form). But the Linux emulator does not know which drivers will use this and which won't, so the Linux emulator must try to handle this clip list, and deal gracefully with cases where the values seem to be uninitialized. Video clipping info is passed in using the VIDIOCSWIN ioctl in two fields in the video_window structure: the integer clipcount and the pointer clips. How the linuxulator handles this from this commit on: * if (clipcount == VIDEO_CLIP_BITMAP) The clips variable is a void * pointer to a 128*625 byte (1024*625 bit) memory area containing a bitmap of the clipping area. The pointer in the video_window structure is copied, but no video_clip structures are copied. * if (clipcount > 0 && clipcount <= 16384) The clips variable is pointer to a list of video_clip structures. Up to clipcount structures are copied and passed to the driver. The upper limit of 16384 was imposed here so that user code that does not properly initialize clipcount falls through below and no attempt is made to copy an uninitialized list. This value was found by examining Linux drivers that support the clip list. * else The clipcount is either negative (but not VIDEO_CLIP_BITMAP), zero or positive (> 16384). All these cases are treated as invalid data. Both the clipcount field and clips pointer are forced to zero/NULL and passed to the driver. It should be noted that, at the time of developing this V4L emulator code, the pwc(4) V4L driver does not support clipping. Submitted by: J.R. Oldroyd <fbsd@opal.com> MFC after: 1 month ---snip---
* This is v4l support for the linuxulator. This allows to access FreeBSDnetchild2010-01-151-33/+80
| | | | | | | | | | | | | | | native devices which support the v4l API from processes running within the linuxulator, e.g. skype or flash can access the multimedia/pwcbsd driver. Not tested is firmware upload, framebuffer stuff and video tuner stuff due to lack of hardware. The clipping part (VIDIOCSWIN) needs a little bit of further work (partly in progress, but can not be tested due to lack of a suitable device). The submitter tested this sucessfully with Skype and flash apps on amd64 and i386 with the multimedia/pwcbsd driver. Submitted by: J.R. Oldroyd <fbsd@opal.com>
* Since all other comparisons involving ngroups_max usebrooks2010-01-152-2/+2
| | | | | "ngroups_max + 1", use ">= ngroups_max+1" instead of the equivalent "> ngroups_max" to reduce confusion.
* Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamicbrooks2010-01-122-2/+2
| | | | | | | | kern.ngroups+1. kern.ngroups can range from NGROUPS_MAX=1023 to INT_MAX-1. Given that the Windows group limit is 1024, this range should be sufficient for most applications. MFC after: 1 month
* Background:mckusick2010-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When renaming a directory it passes through several intermediate states. First its new name will be created causing it to have two names (from possibly different parents). Next, if it has different parents, its value of ".." will be changed from pointing to the old parent to pointing to the new parent. Concurrently, its old name will be removed bringing it back into a consistent state. When fsck encounters an extra name for a directory, it offers to remove the "extraneous hard link"; when it finds that the names have been changed but the update to ".." has not happened, it offers to rewrite ".." to point at the correct parent. Both of these changes were considered unexpected so would cause fsck in preen mode or fsck in background mode to fail with the need to run fsck manually to fix these problems. Fsck running in preen mode or background mode now corrects these expected inconsistencies that arise during directory rename. The functionality added with this update is used by fsck running in background mode to make these fixes. Solution: This update adds three new fsck sysctl commands to support background fsck in correcting expected inconsistencies that arise from incomplete directory rename operations. They are: setcwd(dirinode) - set the current directory to dirinode in the filesystem associated with the snapshot. setdotdot(oldvalue, newvalue) - Verify that the inode number for ".." in the current directory is oldvalue then change it to newvalue. unlink(nameptr, oldvalue) - Verify that the inode number associated with nameptr in the current directory is oldvalue then unlink it. As with all other fsck sysctls, these new ones may only be used by processes with appropriate priviledge. Reported by: jeff Security issues: rwatson
* Remove extraneous semicolons, no functional changes.mbr2010-01-071-1/+1
| | | | | Submitted by: Marc Balmer <marc@msys.ch> MFC after: 1 week
* Signal 0 is used to check the permission for current process to signalkib2009-12-181-1/+1
| | | | | | | | | target one. Since r184058, linux_do_tkill() calls tdsignal() instead of kill(), without checking for validity of supplied signal number. Prevent panic when supplied signal is 0 by finishing work after checks. Found and tested by: scf MFC after: 3 days
* This is v4l support for the linuxulator. This allows to access FreeBSDnetchild2009-12-044-39/+425
| | | | | | | | | | | | | | | native devices which support the v4l API from processes running within the linuxulator, e.g. skype or flash can access the multimedia/pwcbsd driver. Not tested is firmware upload, framebuffer stuff and video tuner stuff due to lack of hardware. The clipping part (VIDIOCSWIN) needs a little bit of further work (partly in progress, but can not be tested due to lack of a suitable device). The submitter tested this sucessfully with Skype and flash apps on amd64 and i386 with the multimedia/pwcbsd driver. Submitted by: J.R. Oldroyd <fbsd@opal.com>
* Import the unchanged v4l videodev.h from the vendor branch.netchild2009-12-041-0/+372
|
* Fix typo in kernel message. The fix is based upon the patch in the PR.netchild2009-11-051-1/+1
| | | | | | PR: kern/140279 Submitted by: Alexander Best <alexbestms@math.uni-muenster.de> MFC after: 1 week
* Unconditionally call the setsockopt for IPV6_V6ONLY for v6 linux socketsbz2009-10-251-12/+5
| | | | | | | | | | | | | no matter whether we are compiled as module or if our default of the net.inet6.ip6.v6only sysctl already matches what we would set. This avoids unnecessary complications with modules, VIMAGES, INET6 and the sysctl value, especially considering that most users will use linux compat as a module. Discussed with: kib, rwatson (weeks ago) Reviewed by: rwatson MFC after: 6 weeks
OpenPOWER on IntegriCloud