summaryrefslogtreecommitdiff
path: root/sys/i386/linux/linux_dummy.c
Commit message (Collapse)AuthorAgeFilesLines
* linux(4): Deduplicate unimpl/dummy syscall handlersConrad Meyer2020-11-051-200/+0
| | | | | | | | | | No functional change. Reviewed by: emaste, trasz Differential Revision: https://reviews.freebsd.org/D27099 Notes: svn path=/head/; revision=367395
* Add a trivial linux(4) splice(2) implementation, which simplyEdward Tomasz Napierala2020-07-181-1/+0
| | | | | | | | | | | | | | returns EINVAL. Fixes grep (grep-3.1-2build1). PR: kern/218699 Reported by: avos Reviewed by: emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D25636 Notes: svn path=/head/; revision=363304
* linuxolator: implement memfd_create syscallKyle Evans2020-06-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This effectively mirrors our libc implementation, but with minor fudging -- name needs to be copied in from userspace, so we just copy it straight into stack-allocated memfd_name into the correct position rather than allocating memory that needs to be cleaned up. The sealing-related fcntl(2) commands, F_GET_SEALS and F_ADD_SEALS, have also been implemented now that we support them. Note that this implementation is still not quite at feature parity w.r.t. the actual Linux version; some caveats, from my foggy memory: - Need to implement SHM_GROW_ON_WRITE, default for memfd (in progress) - LTP wants the memfd name exposed to fdescfs - Linux allows open() of an fdescfs fd with O_TRUNC to truncate after dup. (?) Interested parties can install and run LTP from ports (devel/linux-ltp) to confirm any fixes. PR: 240874 Reviewed by: kib, trasz Differential Revision: https://reviews.freebsd.org/D21845 Notes: svn path=/head/; revision=362769
* linuxulator: implement sendfileEd Maste2020-02-051-1/+0
| | | | | | | | | | | Submitted by: Bora Özarslan <borako.ozarslan@gmail.com> Submitted by: Yang Wang <2333@outlook.jp> Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19917 Notes: svn path=/head/; revision=357577
* Add basic getcpu(2) support to linuxulator. The purpose of thisEdward Tomasz Napierala2019-12-311-2/+0
| | | | | | | | | | | | | | | | | | | syscall is to query the CPU number and the NUMA domain the calling thread is currently running on. The third argument is ignored. It doesn't do anything regarding scheduling - it's literally just a way to query the current state, without any guarantees you won't get rescheduled an opcode later. This unbreaks Java from CentOS 8 (java-11-openjdk-11.0.5.10-0.el8_0.x86_64). Reviewed by: kib MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22972 Notes: svn path=/head/; revision=356241
* linux(4): implement copy_file_range(2)Pawel Biernacki2019-12-301-2/+0
| | | | | | | | | | | | copy_file_range(2) is implemented natively since r350315, make it available for Linux binaries too. Reviewed by: kib (mentor), trasz (previous version) Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D22959 Notes: svn path=/head/; revision=356206
* Implement Linux syslog(2) syscall; just enough to make Linux dmesg(8)Edward Tomasz Napierala2019-12-291-1/+0
| | | | | | | | | | | utility work. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22465 Notes: svn path=/head/; revision=356177
* Add sync_file_range(2) implementation to linux(4); it's a thin wrapperEdward Tomasz Napierala2019-12-141-1/+0
| | | | | | | | | | | | | | over the usual fsync(2). This silences some warnings when running "apt-get upgrade". Reviewed by: brooks, emaste MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D22371 Notes: svn path=/head/; revision=355754
* Update comments and ordering in linux*_dummy.cEd Maste2019-09-111-1/+1
| | | | | | | | | - sort alphabetically - getcpu arrived in Linux 2.6.19 - fanotify_* arrived in 2.6.36 Notes: svn path=/head/; revision=352224
* linuxulator: memfd_create first appeared in Linux 3.17Ed Maste2019-09-111-2/+1
| | | | | | | Reference: http://man7.org/linux/man-pages/man2/memfd_create.2.html Notes: svn path=/head/; revision=352222
* linuxulator: seccomp syscall first appeared in Linux 3.17Ed Maste2019-09-111-1/+2
| | | | | | | Reference: http://man7.org/linux/man-pages/man2/seccomp.2.html Notes: svn path=/head/; revision=352221
* linux: add trivial renameat2 implementationEd Maste2019-09-111-2/+0
| | | | | | | | | | | | | | | | Just return EINVAL if flags != 0. The Linux man page documents one case of EINVAL as "The filesystem does not support one of the flags in flags." After r351723 userland binaries will try using new system calls. Reported by: mjg Reviewed by: mjg, trasz Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21590 Notes: svn path=/head/; revision=352210
* Update syscall.master to 5.0.Dmitry Chagin2019-03-241-0/+31
| | | | | | | | | | | For 32-bit Linuxulator, ipc() syscall was historically the entry point for the IPC API. Starting in Linux 4.18, direct syscalls are provided for the IPC. Enable it. MFC after: 1 month Notes: svn path=/head/; revision=345471
* Fix errno values returned from DUMMY_XATTR linuxulator callsFedor Uporov2019-01-111-1/+1
| | | | | | | | | | Reported by: weiss@uni-mainz.de Reviewed by: markj MFC after: 1 day Differential Revision: https://reviews.freebsd.org/D18812 Notes: svn path=/head/; revision=342933
* Move most of the contents of opt_compat.h to opt_global.h.Brooks Davis2018-04-061-2/+0
| | | | | | | | | | | | | | | | | | | | | opt_compat.h is mentioned in nearly 180 files. In-progress network driver compabibility improvements may add over 100 more so this is closer to "just about everywhere" than "only some files" per the guidance in sys/conf/options. Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h is created on all architectures. Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the set of compiled files. Reviewed by: kib, cem, jhb, jtl Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D14941 Notes: svn path=/head/; revision=332122
* Correct proper nouns in the LinuxulatorEd Maste2018-02-221-29/+29
| | | | | | | | | | | - Capitalize Linux - Spell FreeBSD out in full - Address some style(9) on changed lines Sponsored by: Turing Robotic Industries Inc. Notes: svn path=/head/; revision=329794
* Rationalize license text on Linuxolator filesEd Maste2018-02-161-15/+13
| | | | | | | | | | | | | | | Many licenses on Linuxolator files contained small variations from the standard FreeBSD license text. To avoid license proliferation switch to the standard 2-clause FreeBSD license for those files where I have permission from each of the listed copyright holders. Additional files waiting on permission from others are listed in review D14210. Approved by: kan, marcel, sos, rdivacky MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=329370
* Linuxolator whitespace cleanupEd Maste2018-02-051-1/+1
| | | | | | | | | | | | | A version of each of the MD files by necessity exists for each CPU architecture supported by the Linuxolator. Clean these up so that new architectures do not inherit whitespace issues. Clean up shared Linuxolator files while here. Sponsored by: Turing Robotic Industries Inc. Notes: svn path=/head/; revision=328890
* sys/i386: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326260
* Implement Linux mincore() system call.Dmitry Chagin2017-03-251-1/+0
| | | | | | | | | | This is necessary for the upcoming drm-next. Suggested by: hselasky@ MFC after: 1 month Notes: svn path=/head/; revision=315957
* Implement getrandom() syscall.Dmitry Chagin2017-03-181-1/+0
| | | | | | | | | Note. GRND_RANDOM option is not supported for now. MFC after: 1 month Notes: svn path=/head/; revision=315505
* Add UNIMPLEMENTED() placeholder macro forMahdi Mokhtari2017-03-061-4/+18
| | | | | | | | | | | | | the syscalls that are not implemented in Linux kernel itself. Cleanup DUMMY() macros. Reviewed by: dchagin, trasz Approved by: dchagin MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D9804 Notes: svn path=/head/; revision=314782
* Implement timerfd family syscalls.Dmitry Chagin2017-02-261-4/+0
| | | | | | | MFC after: 1 month Notes: svn path=/head/; revision=314295
* Add linux_preadv() and linux_pwritev() syscalls to Linuxulator.Mahdi Mokhtari2017-02-241-3/+0
| | | | | | | | | | Reviewed by: dchagin Approved by: dchagin, trasz (src committers) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9722 Notes: svn path=/head/; revision=314219
* Revert r314217. Commit is not match that I have approved.Dmitry Chagin2017-02-241-0/+3
| | | | Notes: svn path=/head/; revision=314218
* Add linux_preadv() and linux_pwritev() syscalls to Linuxulator.Mahdi Mokhtari2017-02-241-3/+0
| | | | | | | | | | Reviewed by: dchagin Approved by: dchagin, trasz (src committers) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D9722 Notes: svn path=/head/; revision=314217
* Implement rt_tgsigqueueinfo system call used by glibc for pthread_sigqueue(3).Dmitry Chagin2017-02-191-1/+0
| | | | | | | MFC after: 2 week Notes: svn path=/head/; revision=313940
* Update syscall.master to 4.10-rc6. Also fix comments, a typo,Dmitry Chagin2017-02-051-3/+36
| | | | | | | | | | | | | | | | | and wrong numbering for a few unimplemented syscalls. For 32-bit Linuxulator, socketcall() syscall was historically the entry point for the sockets API. Starting in Linux 4.3, direct syscalls are provided for the sockets API. Enable it. The initial version of patch was provided by trasz@ and extended by me. Submitted by: trasz MFC after: 2 week Differential Revision: https://reviews.freebsd.org/D9381 Notes: svn path=/head/; revision=313284
* Implement fstatfs64 system call.Dmitry Chagin2016-03-201-1/+0
| | | | | | | | | PR: 181012 Submitted by: John Wehle MFC after: 1 week Notes: svn path=/head/; revision=297061
* Implement Linux specific syncfs() system call.Dmitry Chagin2015-05-241-1/+0
| | | | Notes: svn path=/head/; revision=283492
* Implement recvmmsg() and sendmmsg() system calls.Dmitry Chagin2015-05-241-2/+0
| | | | Notes: svn path=/head/; revision=283488
* Implement epoll_pwait() system call.Dmitry Chagin2015-05-241-1/+0
| | | | Notes: svn path=/head/; revision=283484
* Add utimensat() system call.Dmitry Chagin2015-05-241-1/+0
| | | | | | | | The patch developed by Jilles Tjoelker and Andrew Wilcox and adopted for lemul branch by me. Notes: svn path=/head/; revision=283480
* Add preliminary fallocate system call implementationDmitry Chagin2015-05-241-2/+0
| | | | | | | | | | to emulate posix_fallocate() function. Differential Revision: https://reviews.freebsd.org/D1523 Reviewed by: emaste Notes: svn path=/head/; revision=283465
* Implement ppoll() system call.Dmitry Chagin2015-05-241-1/+0
| | | | | | | | Differential Revision: https://reviews.freebsd.org/D1105 Reviewed by: trasz Notes: svn path=/head/; revision=283451
* Implement eventfd system call.Dmitry Chagin2015-05-241-2/+0
| | | | | | | | Differential Revision: https://reviews.freebsd.org/D1094 In collaboration with: Jilles Tjoelker Notes: svn path=/head/; revision=283444
* Implement epoll family system calls. This is a tiny wrapperDmitry Chagin2015-05-241-4/+0
| | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=283441
* Implement pselect6() system call.Dmitry Chagin2015-05-241-1/+0
| | | | | | | | Differential Revision: https://reviews.freebsd.org/D1051 Reviewed by: trasz Notes: svn path=/head/; revision=283403
* Implement prlimit64() system call.Dmitry Chagin2015-05-241-2/+0
| | | | | | | | Differential Revision: https://reviews.freebsd.org/D1050 Reviewed by: emaste, trasz Notes: svn path=/head/; revision=283401
* Implement dup3() system call.Dmitry Chagin2015-05-241-1/+0
| | | | | | | | Differential Revision: https://reviews.freebsd.org/D1049 Reviewed by: emaste Notes: svn path=/head/; revision=283399
* Implement rt_sigqueueinfo() system call.Dmitry Chagin2015-05-241-1/+0
| | | | | | | | Differential Revision: https://reviews.freebsd.org/D1047 Reviewed by: trasz Notes: svn path=/head/; revision=283396
* Implement waitid() system call.Dmitry Chagin2015-05-241-1/+0
| | | | | | | Differential Revision: https://reviews.freebsd.org/D1046 Notes: svn path=/head/; revision=283394
* - For kernel compiled only with KDTRACE_HOOKS and not any lock debuggingAttilio Rao2013-11-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | option, unbreak the lock tracing release semantic by embedding calls to LOCKSTAT_PROFILE_RELEASE_LOCK() direclty in the inlined version of the releasing functions for mutex, rwlock and sxlock. Failing to do so skips the lockstat_probe_func invokation for unlocking. - As part of the LOCKSTAT support is inlined in mutex operation, for kernel compiled without lock debugging options, potentially every consumer must be compiled including opt_kdtrace.h. Fix this by moving KDTRACE_HOOKS into opt_global.h and remove the dependency by opt_kdtrace.h for all files, as now only KDTRACE_FRAMES is linked there and it is only used as a compile-time stub [0]. [0] immediately shows some new bug as DTRACE-derived support for debug in sfxge is broken and it was never really tested. As it was not including correctly opt_kdtrace.h before it was never enabled so it was kept broken for a while. Fix this by using a protection stub, leaving sfxge driver authors the responsibility for fixing it appropriately [1]. Sponsored by: EMC / Isilon storage division Discussed with: rstone [0] Reported by: rstone [1] Discussed with: philip Notes: svn path=/head/; revision=258541
* Revert r255672, it has some serious flaws, leaking file references etc.Roman Divacky2013-09-181-0/+4
| | | | | | | Approved by: re (delphij) Notes: svn path=/head/; revision=255675
* Implement epoll support in Linuxulator. This is a tiny wrapper around kqueueRoman Divacky2013-09-181-4/+0
| | | | | | | | | | | | | | | | | to implement epoll subset of functionality. The kqueue user data are 32bit on i386 which is not enough for epoll user data so this patch overrides kqueue fileops to maintain enough space in struct file. Initial patch developed by me in 2007 and then extended and finished by Yuri Victorovich. Approved by: re (delphij) Sponsored by: Google Summer of Code Submitted by: Yuri Victorovich <yuri at rawbw dot com> Tested by: Yuri Victorovich <yuri at rawbw dot com> Notes: svn path=/head/; revision=255672
* - >500 static DTrace probes for the linuxulatorAlexander Leidinger2012-05-051-0/+9
| | | | | | | | | | | | | | | | | | | | | - DTrace scripts to check for errors, performance, ... they serve mostly as examples of what you can do with the static probe;s with moderate load the scripts may be overwhelmed, excessive lock-tracing may influence program behavior (see the last design decission) Design decissions: - use "linuxulator" as the provider for the native bitsize; add the bitsize for the non-native emulation (e.g. "linuxuator32" on amd64) - Add probes only for locks which are acquired in one function and released in another function. Locks which are aquired and released in the same function should be easy to pair in the code, inter-function locking is more easy to verify in DTrace. - Probes for locks should be fired after locking and before releasing to prevent races (to provide data/function stability in DTrace, see the man-page of "dtrace -v ..." and the corresponding DTrace docs). Notes: svn path=/head/; revision=235063
* - Implement pipe2 syscall for Linuxulator. This syscall appeared in 2.6.27Jung-uk Kim2012-04-161-1/+0
| | | | | | | | | | | | | but GNU libc used it without checking its kernel version, e. g., Fedora 10. - Move pipe(2) implementation for Linuxulator from MD files to MI file, sys/compat/linux/linux_file.c. There is no MD code for this syscall at all. - Correct an argument type for pipe() from l_ulong * to l_int *. Probably this was the source of MI/MD confusion. Reviewed by: emulation Notes: svn path=/head/; revision=234352
* - add comments to syscalls.master and linux(32)_dummy about which linuxAlexander Leidinger2012-03-101-0/+47
| | | | | | | | | | | | | kernel version introduced the sysctl (based upon a linux man-page) - add comments to sscalls.master regarding some names of sysctls which are different than the linux-names (based upon the linux unistd.h) - add some dummy sysctls - name an unimplemented sysctl MFC after: 1 month Notes: svn path=/head/; revision=232799
* Convert files to UTF-8Ulrich Spörlein2012-01-151-1/+1
| | | | Notes: svn path=/head/; revision=230132
* Implement linux_fadvise64() and linux_fadvise64_64() usingJohn Baldwin2011-12-291-2/+0
| | | | | | | | | | kern_posix_fadvise(). Reviewed by: silence on emulation@ MFC after: 2 weeks Notes: svn path=/head/; revision=228957