summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux
Commit message (Collapse)AuthorAgeFilesLines
...
* Finish r283544. In exec case properly detach threads from user spacedchagin2015-06-061-0/+12
| | | | before suicide.
* When I merged the lemul branch I missied kib@'s r282708 commit.dchagin2015-05-251-13/+5
| | | | | | | This is not the final fix as I need properly cleanup thread resources before other threads suicide. Tested by: Ruslan Makhmatkhanov
* Linux nanosleep() and clock_nanosleep() system calls alwaysdchagin2015-05-241-37/+24
| | | | | | | | | | | | writes the remaining time into the structure pointed to by rmtp unless rmtp is NULL. The value of *rmtp can then be used to call nanosleep() again and complete the specified pause if the previous call was interrupted. Note. clock_nanosleep() with an absolute time value does not write the remaining time. While here fix whitespaces and typo in SDT_PROBE.
* Convert SCM_TIMESTAMP in recvmsg().dchagin2015-05-242-1/+18
|
* The latest cp tool is trying to use the btrfs clone operation that isdchagin2015-05-242-3/+16
| | | | | | implemented via ioctl interface. First of all return ENOTSUP for this operation as a cp fallback to usual method in that case. Secondly, do not print out the message about unimplemented operation.
* Fix an mbuf(9) leak in sendmsg() under failure condition anddchagin2015-05-241-2/+1
| | | | | | | remove unneeded check for failed M_WAITOK allocation. Found by: Brainy Code Scanner Reported by: Maxime Villard
* Implement Linux specific syncfs() system call.dchagin2015-05-241-0/+41
|
* Properly check tv_nsec value. The tv_nsec field can also be onedchagin2015-05-241-2/+16
| | | | of the special value UTIME_NOW or UTIME_OMIT.
* Since FreeBSD supports SOCK_CLOEXEC & SOCK_NONBLOCK optionsdchagin2015-05-241-69/+25
| | | | remove its emulation via fcntl call from Linuxulator.
* Implement recvmmsg() and sendmmsg() system calls.dchagin2015-05-242-42/+168
|
* Reduce duplication between MD Linux code by moving msg relateddchagin2015-05-241-0/+16
| | | | struct definitions out into the compat/linux/linux_socket.h
* Implement epoll_pwait() system call.dchagin2015-05-241-10/+54
|
* Convert signal number to native for VT_SETMODE ioctl and removedchagin2015-05-241-4/+10
| | | | | strange and invalid ISSIGVALID macro. The code has not been tested right way but it was originally broken.
* Add utimensat() system call.dchagin2015-05-242-0/+84
| | | | | The patch developed by Jilles Tjoelker and Andrew Wilcox and adopted for lemul branch by me.
* Convert Linux signal number to the FreeBSD.dchagin2015-05-241-2/+2
|
* Rework signal code to allow using it by other modules, like linprocfs:dchagin2015-05-246-104/+322
| | | | | | | | | | | | | | | | | 1. Linux sigset always 64 bit on all platforms. In order to move Linux sigset code to the linux_common module define it as 64 bit int. Move Linux sigset manipulation routines to the MI path. 2. Move Linux signal number definitions to the MI path. In general, they are the same on all platforms except for a few signals. 3. Map Linux RT signals to the FreeBSD RT signals and hide signal conversion tables to avoid conversion errors. 4. Emulate Linux SIGPWR signal via FreeBSD SIGRTMIN signal which is outside of allowed on Linux signal numbers. PR: 197216
* According to Linux man sigaltstack(3) shall return EINVAL if the ssdchagin2015-05-242-0/+28
| | | | | | | | | | | | | argument is not a null pointer, and the ss_flags member pointed to by ss contains flags other than SS_DISABLE. However, in fact, Linux also allows SS_ONSTACK flag which is simply ignored. For buggy apps (at least mono) ignore other than SS_DISABLE flags as a Linux do. While here move MI part of sigaltstack code to the appropriate place. Reported by: abi at abinet dot ru
* Add EPOLLERR flag handling to epoll.dchagin2015-05-242-2/+6
| | | | Tested by: abi at abinet dot ru
* As fo_fill_kinfo() does not check fo_fill_kinfo to NULLdchagin2015-05-241-0/+12
| | | | | | add a fo_fill_kinfo op to eventfdops. Reported by: trinity
* Add preliminary fallocate system call implementationdchagin2015-05-241-0/+15
| | | | | | | to emulate posix_fallocate() function. Differential Revision: https://reviews.freebsd.org/D1523 Reviewed by: emaste
* Delete the duplicate of linux_to_native_clockid() function.dchagin2015-05-243-23/+5
| | | | | Differential Revision: https://reviews.freebsd.org/D1521 Reviewed by: trasz
* Do not use struct l_timespec without conversion. While here movedchagin2015-05-244-48/+54
| | | | | | | args->timeout handling before acquiring the futex key at FUTEX_WAIT path. Differential Revision: https://reviews.freebsd.org/D1520 Reviewed by: trasz
* Add prototypes for static futex functions.dchagin2015-05-241-0/+16
| | | | | Differential Revision: https://reviews.freebsd.org/D1519 Reviewed by: trasz
* As for now our tmpfs is no longer being considereddchagin2015-05-241-8/+3
| | | | | | | | "highly experimental" remove /dev/shm magic commited in r218497 and convert tmpfs type to an expected magic number. Differential Revision: https://reviews.freebsd.org/D1497 Reviewed by: emaste, trasz
* Print out unsupported futex operation message only once for the process.dchagin2015-05-242-23/+46
| | | | Differential Revision: https://reviews.freebsd.org/D1498
* Add some clock mappings used in glibc 2.20.dchagin2015-05-242-17/+205
| | | | | Differential Revision: https://reviews.freebsd.org/D1465 Reviewd by: trasz
* Improve ktr(9) records in thread managment code.dchagin2015-05-242-7/+10
| | | | | Differential Revision: https://reviews.freebsd.org/D1464 Reviewed by: trasz
* Use local struct proc * varable instead of dereferencing td->td_proc.dchagin2015-05-241-8/+11
| | | | | Differential Revision: https://reviews.freebsd.org/D1463 Reviewed by: emaste
* Avoid unnecessary em zeroing in non-exec pathdchagin2015-05-241-4/+5
| | | | | | | | as it already zeroed by malloc with M_ZERO flag and move zeroing to the proper place in exec path. Differential Revision: https://reviews.freebsd.org/D1462 Reviewed by: trasz
* Remove the unnecessary cast.dchagin2015-05-241-1/+1
| | | | | Differential Revision: https://reviews.freebsd.org/D1461 Reviewed by: emaste
* Implement ppoll() system call.dchagin2015-05-241-0/+53
| | | | | Differential Revision: https://reviews.freebsd.org/D1105 Reviewed by: trasz
* td_sigmask of a newly created thread copied from td.dchagin2015-05-241-1/+0
| | | | | | | Remove excess initialization of td_sigmask. Differential Revision: https://reviews.freebsd.org/D1128 Reviewed by: emaste
* Update Linux compat revision to 32.dchagin2015-05-241-1/+1
| | | | | Differential Revision: https://reviews.freebsd.org/D1122 Reviewed by: emaste
* Fix linux_common module build with KTR option.dchagin2015-05-241-1/+0
| | | | | Differential Revision: https://reviews.freebsd.org/D1096 Reviewed by: trasz
* Implement eventfd system call.dchagin2015-05-242-0/+332
| | | | | Differential Revision: https://reviews.freebsd.org/D1094 In collaboration with: Jilles Tjoelker
* Put the correct value for the abi_nfdbits parameter of kern_select() fordchagin2015-05-242-2/+5
| | | | | | | all supported Linuxulators. Differential Revision: https://reviews.freebsd.org/D1093 Reviewed by: trasz
* Implement epoll family system calls. This is a tiny wrapperdchagin2015-05-246-2/+596
| | | | | | | | | | | | around kqueue() to implement epoll subset of functionality. The kqueue user data are 32bit on i386 which is not enough for epoll user data, so we keep user data in the proc emuldata. Initial patch developed by rdivacky@ in 2007, then extended by Yuri Victorovich @ r255672 and finished by me in collaboration with mjg@ and jillies@. Differential Revision: https://reviews.freebsd.org/D1092
* Implement F_DUPFD_CLOEXEC fcntl flag.dchagin2015-05-241-0/+3
| | | | | Differential Revision: https://reviews.freebsd.org/D1089 Reviewed by: trasz
* Add several fcntl flags.dchagin2015-05-241-0/+27
| | | | | Differential Revision: https://reviews.freebsd.org/D1088 Reviewed by: trasz
* To avoid code duplication move open/fcntl definitions to the MIdchagin2015-05-242-0/+45
| | | | | | | header file. Differential Revision: https://reviews.freebsd.org/D1087 Reviewed by: trasz
* Use the BSD_TO_LINUX_SIGNAL() wherever there is no needdchagin2015-05-241-8/+3
| | | | | | to check the ABI as it is known. Differential Revision: https://reviews.freebsd.org/D1086
* Convert Linux wait options to the FreeBSD.dchagin2015-05-241-18/+13
| | | | | | | | | Check wait options as a Linux do. Linux always set WEXITED option not a WUNTRACED|WNOHANG which is a strange bug. Differential Revision: https://reviews.freebsd.org/D1085 Reviewed by: trasz
* Set WIFCONTINUED to the wait status if needed.dchagin2015-05-241-0/+2
| | | | | Differential Revision: https://reviews.freebsd.org/D1083 Reviewed by: trasz
* Rewrite linux_recvfrom. To avoid double conversion of sockaddr usedchagin2015-05-241-29/+37
| | | | | | | kern_recvit() directly. And check fromlen parameter before sockaddr copyin and conversion. Differential Revision: https://reviews.freebsd.org/D1082
* Add AT_RANDOM and AT_EXECFN auxiliary vector entries which are used bydchagin2015-05-241-0/+3
| | | | | | glibc. At list since glibc version 2.16 using AT_RANDOM is mandatory. Differential Revision: https://reviews.freebsd.org/D1080
* Change linux faccessat syscall definition to match actual linux one.dchagin2015-05-241-5/+2
| | | | | | | | | | The AT_EACCESS and AT_SYMLINK_NOFOLLOW flags are actually implemented within the glibc wrapper function for faccessat(). If either of these flags are specified, then the wrapper function employs fstatat() to determine access permissions. Differential Revision: https://reviews.freebsd.org/D1078 Reviewed by: trasz
* Where possible we will use M_LINUX malloc(9) type.dchagin2015-05-2410-31/+32
| | | | | | | Move M_FUTEX defines to the linux_common.ko. Differential Revision: https://reviews.freebsd.org/D1077 Reviewed by: emaste
* Move FEATURE macros for v4l and v4l2 to the common module.dchagin2015-05-242-3/+4
| | | | | Differential Revision: https://reviews.freebsd.org/D1075 Reviewed by: emaste
* Refund the proc emuldata struct for future use. For now move flags fromdchagin2015-05-246-172/+160
| | | | | | | | | | thread emuldata to proc emuldata as it was originally intended. As we can have both 64 & 32 bit Linuxulator running any eventhandler can be called twice for us. To prevent this move eventhandlers code from linux_emul.c to the linux_common.ko module. Differential Revision: https://reviews.freebsd.org/D1073
* Introduce a new module linux_common.ko which is intended for thedchagin2015-05-249-467/+184
| | | | | | | | | | | | | | | | | | | | | | | following primary purposes: 1. Remove the dependency of linsysfs and linprocfs modules from linux.ko, which will be architecture specific on amd64. 2. Incorporate into linux_common.ko general code for platforms on which we'll support two Linuxulator modules (for both instruction set - 32 & 64 bit). 3. Move malloc(9) declaration to linux_common.ko, to enable getting memory usage statistics properly. Currently linux_common.ko incorporates a code from linux_mib.c and linux_util.c and linprocfs, linsysfs and linux kernel modules depend on linux_common.ko. Temporarily remove dtrace garbage from linux_mib.c and linux_util.c Differential Revision: https://reviews.freebsd.org/D1072 In collaboration with: Vassilis Laganakos. Reviewed by: trasz
OpenPOWER on IntegriCloud