aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux
Commit message (Collapse)AuthorAgeFilesLines
* Add accounting for most of the memory-related resources.Edward Tomasz Napierala2011-04-051-1/+4
| | | | | | | | Sponsored by: The FreeBSD Foundation Reviewed by: kib (earlier version) Notes: svn path=/head/; revision=220373
* Revert r220032:linux compat: add SO_PASSCRED option with basic handlingAndriy Gapon2011-03-311-14/+0
| | | | | | | | | | | | | I have not properly thought through the commit. After r220031 (linux compat: improve and fix sendmsg/recvmsg compatibility) the basic handling for SO_PASSCRED is not sufficient as it breaks recvmsg functionality for SCM_CREDS messages because now we would need to handle sockcred data in addition to cmsgcred. And that is not implemented yet. Pointyhat to: avg Notes: svn path=/head/; revision=220186
* linux compat: add SO_PASSCRED option with basic handlingAndriy Gapon2011-03-261-0/+14
| | | | | | | | | | | This seems to have been a part of a bigger patch by dchagin that either haven't been committed or committed partially. Submitted by: dchagin, nox MFC after: 2 weeks Notes: svn path=/head/; revision=220032
* linux compat: improve and fix sendmsg/recvmsg compatibilityAndriy Gapon2011-03-264-53/+252
| | | | | | | | | | | | | | | | | | | | - implement baseic stubs for capget, capset, prctl PR_GET_KEEPCAPS and prctl PR_SET_KEEPCAPS. - add SCM_CREDS support to sendmsg and recvmsg - modify sendmsg to ignore control messages if not using UNIX domain sockets This should allow linux pulse audio daemon and client work on FreeBSD and interoperate with native counter-parts modulo the differences in pulseaudio versions. PR: kern/149168 Submitted by: John Wehle <john@feith.com> Reviewed by: netchild MFC after: 2 weeks Notes: svn path=/head/; revision=220031
* Staticize functions which are not used somewhere else, move theAlexander Leidinger2011-03-152-6/+7
| | | | | | | corresponding prototypes from the header to the code file. Notes: svn path=/head/; revision=219668
* Style(9) fixes. No functional changes.Dmitry Chagin2011-03-121-252/+261
| | | | | | | MFC after: 2 Week Notes: svn path=/head/; revision=219558
* Remove now-obsolete comment.John Baldwin2011-03-101-6/+1
| | | | | | | | Submitted by: netchild MFC after: 1 week Notes: svn path=/head/; revision=219460
* Indeed, remove bogus since r219405 check of the Linux ABI.Dmitry Chagin2011-03-091-3/+0
| | | | | | | | | Pointed out: jhb MFC after: 2 Week Notes: svn path=/head/; revision=219421
* Extend struct sysvec with new method sv_schedtail, which is used for anDmitry Chagin2011-03-082-3/+6
| | | | | | | | | | | | | | | | | | explicit process at fork trampoline path instead of eventhadler(schedtail) invocation for each child process. Remove eventhandler(schedtail) code and change linux ABI to use newly added sysvec method. While here replace explicit comparing of module sysentvec structure with the newly created process sysentvec to detect the linux ABI. Discussed with: kib MFC after: 2 Week Notes: svn path=/head/; revision=219405
* Print out shared flag for debug purpose.Dmitry Chagin2011-03-031-8/+8
| | | | | | | MFC after: 1 Week Notes: svn path=/head/; revision=219242
* Switch PROCESS_SHARE to AUTO_SHARE (as umtx do). Even for SHARED,Dmitry Chagin2011-03-031-1/+1
| | | | | | | | | | | if page mapped MAP_ANON linux uses private algorithm too. Disscussed with: jhb MFC after: 3 Days Notes: svn path=/head/; revision=219240
* Use umtx_key objects to uniquely identify futexes. Private futexes inJohn Baldwin2011-02-231-17/+32
| | | | | | | | | | | | | | | different processes that happen to use the same user address in the separate processes will now be treated as distinct futexes rather than the same futex. We can now honor shared futexes properly by mapping them to a PROCESS_SHARED umtx_key. Private futexes use THREAD_SHARED umtx_key objects. In conjunction with: dchagin Reviewed by: kib MFC after: 1 week Notes: svn path=/head/; revision=218970
* Do not clobber %rdx.Dmitry Chagin2011-02-201-1/+0
| | | | | | | | Before calling vfork() syscall the linux user-space stores the current PID in the %rdx and restore it when the parent process will leave the kernel. Notes: svn path=/head/; revision=218879
* For realtime signals fill the sigval value.Dmitry Chagin2011-02-151-0/+4
| | | | Notes: svn path=/head/; revision=218720
* Make a linux_rt_sigtimedwait() system call is actually working.Dmitry Chagin2011-02-151-10/+6
| | | | | | | | | | 1) Translate the native signal number in the appropriate Linux signal. 2) Remove bogus code, which can lead to a panic as it calls kern_sigtimedwait with same ksiginfo. 3) Return the corresponding signal number. Notes: svn path=/head/; revision=218719
* Style(9) fix. Wrap long lines in linux_rt_sigtimedwait().Dmitry Chagin2011-02-151-5/+8
| | | | Notes: svn path=/head/; revision=218718
* Put the macro declaration in the relevant include file for future use.Dmitry Chagin2011-02-152-3/+3
| | | | Notes: svn path=/head/; revision=218717
* Style(9) fix. Do not initialize variables in the declarations.Dmitry Chagin2011-02-141-2/+5
| | | | Notes: svn path=/head/; revision=218686
* Sort include files in the alphabetical order.Dmitry Chagin2011-02-131-1/+1
| | | | Notes: svn path=/head/; revision=218668
* Remove comment about 'ftlk' LOR.Dmitry Chagin2011-02-131-2/+1
| | | | Notes: svn path=/head/; revision=218655
* Stop printing the LOR, as this is expected behavior.Dmitry Chagin2011-02-131-1/+1
| | | | Notes: svn path=/head/; revision=218654
* The bitset field of freshly created futex should be initialized explicity.Dmitry Chagin2011-02-131-0/+1
| | | | | | | Otherwise, REQUEUE operations fails. Notes: svn path=/head/; revision=218646
* Rename used_requeue and use it as bitwise field to store more flags.Dmitry Chagin2011-02-123-4/+8
| | | | | | | Reimplement used_requeue logic with LINUX_XDEPR_REQUEUEOP flag. Notes: svn path=/head/; revision=218621
* Slightly rewrite linux_fork:Dmitry Chagin2011-02-121-13/+6
| | | | | | | | | 1) Remove bogus error checking. 2) A new process exit from kernel through fork_trampoline(), so remove bogus check. Notes: svn path=/head/; revision=218618
* Remove bogus include <machine/frame.h>Dmitry Chagin2011-02-121-2/+0
| | | | Notes: svn path=/head/; revision=218617
* Move linux_clone(), linux_fork(), linux_vfork() to a MI path.Dmitry Chagin2011-02-121-0/+297
| | | | Notes: svn path=/head/; revision=218616
* Linux' shm_open() fails because it wants to find some funky shmfsAlexander Leidinger2011-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 Notes: svn path=/head/; revision=218497
* Yet another unimplemented futex operation, print out about.Dmitry Chagin2011-01-312-0/+8
| | | | | | | | Submitted by: arundel MFC after: 1 month. Notes: svn path=/head/; revision=218118
* Implement a futex BITSET op.Dmitry Chagin2011-01-312-25/+46
| | | | | | | | Submitted by: arundel MFC after: 1 month. Notes: svn path=/head/; revision=218117
* Style(9) fixes.Dmitry Chagin2011-01-281-28/+28
| | | | | | | MFC after: 1 Month. Notes: svn path=/head/; revision=218031
* Implement a variation of the linux_common_wait() which shouldDmitry Chagin2011-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. Notes: svn path=/head/; revision=218030
* Style(9) fix.Dmitry Chagin2011-01-281-1/+1
| | | | | | | MFC after: 1 month. Notes: svn path=/head/; revision=218005
* Style(9) fix.Dmitry Chagin2011-01-231-1/+1
| | | | | | | | Approved by: kib(mentor) MFC after: 1 month Notes: svn path=/head/; revision=217743
* In linuxolator getdents_common(), it seems there is no reason to loopKonstantin Belousov2011-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 Notes: svn path=/head/; revision=217578
* Fix the LINUX_SOUND_MIXER_INFO ioctl to return success after theSean Farley2010-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 Notes: svn path=/head/; revision=216813
* Fix linux kernel module breakage introduced in r215675, by includingDimitry Andric2010-11-221-0/+1
| | | | | | | | | | <sys/sysent.h>. Noticed by: many Pointy hat to: netchild Notes: svn path=/head/; revision=215706
* Do not take the process lock. The assignment to u_short inside theAlexander Leidinger2010-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 Notes: svn path=/head/; revision=215675
* Remove trailing dot from the unimplemented futex messages to makeAlexander Leidinger2010-11-221-5/+5
| | | | | | | | | | them consistent with the syscall and ipc messages. Submitted by: arundel MFC after: 3 days Notes: svn path=/head/; revision=215666
* By using the 32-bit Linux version of Sun's Java Development Kit 1.6Alexander Leidinger2010-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 Notes: svn path=/head/; revision=215664
* Some style(9) fixes.Alexander Leidinger2010-11-151-5/+5
| | | | | | | | Submitted by: arundel MFC after: 1 week Notes: svn path=/head/; revision=215339
* - print out the PID and program name of the program trying to use anAlexander Leidinger2010-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 Notes: svn path=/head/; revision=215338
* Remove stale comment.Konstantin Belousov2010-10-141-5/+0
| | | | | | | | Submitted by: arundel MFC after: 3 days Notes: svn path=/head/; revision=213846
* Simplify timeout check in futex_wait() using itimerfix() and return errorJung-uk Kim2010-10-061-22/+10
| | | | | | | | if the given timeout is invalid. Consistently use int type for timeout and correct a format string in futex_sleep(). Notes: svn path=/head/; revision=213490
* Fix a comparision of an uninitialised pointer.Alexander Leidinger2010-10-061-1/+1
| | | | | | | | | Submitted by: arundel Found by: clang analysis (automatic service by uqs@) Reviewed by: rdivacky Notes: svn path=/head/; revision=213471
* Replace sbuf_overflowed() with sbuf_error(), which returns any errorMatthew D Fleming2010-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. Notes: svn path=/head/; revision=212425
* Tweak the in-kernel API for sending signals to threads:John Baldwin2010-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 Notes: svn path=/head/; revision=209592
* Bring USB fixes for linux(4).Wojciech A. Koszek2010-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@ Notes: svn path=/head/; revision=208486
* - #ifdef out the cliplist part, skype seems like using an uninitializedAlexander Leidinger2010-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) Notes: svn path=/head/; revision=207569
* Rename st_*timespec fields to st_*tim for POSIX 2008 compliance.Ed Schouten2010-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. Notes: svn path=/head/; revision=205792
* Fix some problems which may lead to a panic:Alexander Leidinger2010-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 Notes: svn path=/head/; revision=205678