aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_file.c
Commit message (Collapse)AuthorAgeFilesLines
* kern: allow kern_shm_open2 of an anonymous preconstructed shmfdKyle Evans7 days1-1/+1
| | | | | | | | | | | The motivation here is for future changes to the coredump code to be able to build up a coredump into a shmfd instead of a vnode, which then gets tapped out to userland via a character device. This also opens up the possibility that it's useful for the kernel to be able to construct a shmfd and pass it out to a process that shouldn't need to write to it. Reviewed by: emaste, kib, markj Differential Revision: https://reviews.freebsd.org/D51336
* linux: Add inotify supportMark Johnston2025-07-041-0/+121
| | | | | | | | | | | Implement the Linux inotify system calls using the native implementation in vfs_inotify.c. PR: 240874 Reviewed by: brooks MFC after: 3 months Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50761
* faccessat(2): Honor AT_SYMLINK_NOFOLLOWFernando ApesteguĂ­a2024-08-111-2/+4
| | | | | | | | | | | | Make the system call honor `AT_SYMLINK_NOFOLLOW`. Also enable this from `linux_faccessat2` where the issue arised the first time. Update manual pages accordingly. PR: 275295 Reported by: kenrap@kennethraplee.com Approved by: kib@ Differential Revision: https://reviews.freebsd.org/D46267
* linux: Export linux_common_openflags()Ricardo Branco2024-05-231-1/+1
| | | | | Reviewed by: imp, kib Pull Request: https://github.com/freebsd/freebsd-src/pull/1248
* Abstract UIO allocation and deallocation.Alfredo Mazzinghi2024-02-101-3/+3
| | | | | | | | | | | | | Introduce the allocuio() and freeuio() functions to allocate and deallocate struct uio. This hides the actual allocator interface, so it is easier to modify the sub-allocation layout of struct uio and the corresponding iovec array. Obtained from: CheriBSD Reviewed by: kib, markj MFC after: 2 weeks Sponsored by: CHaOS, EPSRC grant EP/V000292/1 Differential Revision: https://reviews.freebsd.org/D43711
* linux(4): Replace linux32_copyinuio by freebsd32_copyinuioDmitry Chagin2023-08-201-2/+2
| | | | MFC after: 1 month
* linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in pwriteDmitry Chagin2023-08-201-1/+2
| | | | MFC after: 1 month
* linux(4): Return EAGAIN instead of ENOBUFS for non-blocking sockets in pwritevDmitry Chagin2023-08-201-1/+1
| | | | MFC after: 1 month
* linux(4): Add a dedicated writev syscall wrapperDmitry Chagin2023-08-201-0/+19
| | | | | | | | Adding a writev syscall wrapper is needed due to Linux family of write syscalls doesn't distinguish between in kernel blocking operations and always returns EAGAIN while FreeBSD can return ENOBUFS. MFC after: 1 month
* linux(4): Add a write syscall wrapperDmitry Chagin2023-08-201-0/+28
| | | | | | | | Adding a write syscall wrapper is needed due to Linux family of write syscalls doesn't distinguish between in kernel blocking operations and always returns EAGAIN while FreeBSD can return ENOBUFS. MFC after: 1 month
* linux(4): Remove sys/cdefs.h inclusion where it's not needed due to 685dc743Dmitry Chagin2023-08-181-1/+0
|
* sys: Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* linux(4): Use M_LINUX for malloc type in getdentsDmitry Chagin2023-07-181-4/+4
| | | | MFC after: 2 weeks
* linux(4): Use M_LINUX for malloc type in getdents64Dmitry Chagin2023-07-181-4/+4
| | | | MFC after: 2 weeks
* linux(4): Delete a useless variable in getdents64Dmitry Chagin2023-07-181-4/+3
| | | | MFC after: 2 weeks
* linux(4): Use M_LINUX for malloc type in readdirDmitry Chagin2023-07-181-4/+4
| | | | MFC after: 2 weeks
* linux(4): Delete a useless variable in readdirDmitry Chagin2023-07-181-5/+4
| | | | MFC after: 2 weeks
* linux(4): Properly allocate buffer for kern_getdirentries in readdirDmitry Chagin2023-07-181-1/+1
| | | | | | | | | | Looks like prior to ino64 project the size of the struct linux_dirent was greater (or equal) to the size of the native struct dirent so the native dirent fit into the buffer. After ino64 project the size of the native struct dirent has increased. Spotted by gcc12. MFC after: 2 weeks
* linux(4): Use pwd_altroot() to tell namei() about ABI root pathDmitry Chagin2023-05-291-342/+65
| | | | | | PR: 72920 Differential Revision: https://reviews.freebsd.org/D40090 MFC after: 2 month
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* linux(4): Add a dedicated statat() implementationDmitry Chagin2023-04-281-4/+4
| | | | | | | | Get rid of calling Linux stat translation hook and specific to Linux handling of non-vnode dirfd from kern_statat(), Reviewed by: kib, mjg Differential revision: https://reviews.freebsd.org/D35474
* linux(4): Implement close_range over nativeDmitry Chagin2023-04-041-0/+26
| | | | | | | | | Handling of the CLOSE_RANGE_UNSHARE flag is not implemented due to difference in fd unsharing mechanism in the Linux and FreeBSD. Reviewed by: mjg Differential revision: https://reviews.freebsd.org/D39398 MFC after: 2 weeks
* linux(4): Cleanup includes under compat/linuxDmitry Chagin2023-02-141-7/+0
| | | | | | | Cleanup unneeded includes, sort the rest according to style(9). No functional changes. MFC after: 2 weeks
* linux(4): Get rid of the opt_compat.h include.Dmitry Chagin2023-02-121-2/+0
| | | | | | | Since e013e369 COMPAT_LINUX, COMPAT_LINUX32 build options are removed, so include of opt_compat.h is no more needed. MFC after: 2 weeks
* linux(4): Fix unlinkat() after a125ed50Dmitry Chagin2022-05-231-1/+1
| | | | MFC after: 2 weeks
* linux(4): Fix unlink() after a125ed50Dmitry Chagin2022-05-231-1/+1
| | | | MFC after: 2 weeks
* linux(4): Fixed offset miscalculation in the preadv/pwritev syscalls.Dmitry Chagin2022-05-091-4/+11
| | | | MFC after: 2 weeks
* linux(4): readlink should fail if bufzis <= 0.Dmitry Chagin2022-03-311-0/+6
| | | | MFC after: 2 weeks
* linux(4): Fixup miscalculation of d_off of struct dirent in getdents() syscalls.Dmitry Chagin2022-03-311-3/+3
| | | | | | | | Avoid calculating d_off value as it is specific to the underlying filesystem and can be used by others API, like lseek(), seekdir() as input offset. Differential revision: https://reviews.freebsd.org/D31551 MFC after: 2 weeks
* linux: remove the always curthread argument from lconvpathMateusz Guzik2021-11-251-35/+35
|
* linux_name_to_handle_at: Support AT_EMPTY_PATH.John Baldwin2021-11-171-3/+2
| | | | | | Reviewed by: kib Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D33050
* linux_linkat: Don't invert AT_* flags.John Baldwin2021-11-171-2/+2
| | | | | | Reviewed by: kib Sponsored by: The University of Cambridge, Google Inc. Differential Revision: https://reviews.freebsd.org/D33048
* linux(4): Implement faccessat2 system call.Dmitry Chagin2021-08-121-7/+38
| | | | | | | | It's used by bash on arm64 with glibc-2.32. Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D31345 MFC after: 2 weeks
* linux: improve reporting for unsupported syscall flagsEdward Tomasz Napierala2021-06-151-3/+4
| | | | | | | | | Filter out the flags we do support; previously we would print out the flag value verbatim. Reviewed By: dchagin Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D30693
* linux: improve FUSE supportEdward Tomasz Napierala2021-06-071-4/+3
| | | | | | | | | | This fixes a number of AppImages; tested with scribus-1.5.6.1-linux-x86_64.AppImage. Reported By: @probonopd Reviewed By: asomers, emaste Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D30606
* linux(4): Add F_GETPIPE_SZ fcntl operation which returns the capacityDmitry Chagin2021-05-311-0/+18
| | | | | | | of the pipe referred by fd. Differential Revision: https://reviews.freebsd.org/D30517 MFC after: 2 weeks
* linux(4): make linkat(2) handle AT_EMPTY_PATHEdward Tomasz Napierala2021-05-041-1/+2
| | | | | Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29974
* kern_linkat: modify to accept AT_ flags instead of FOLLOW/NOFOLLOWEdward Tomasz Napierala2021-04-251-7/+8
| | | | | | | | This makes this API match other kern_xxxat() functions. Reviewed By: kib Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29776
* linux: support AT_EMPTY_PATH flag in fchownat(2)Edward Tomasz Napierala2021-04-161-2/+7
| | | | | | | | This fixes rsyslog package installation scripts in Bionic. Reviewed By: kib Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29108
* linux: implement O_PATHEdward Tomasz Napierala2021-04-151-0/+2
| | | | | | Reviewed By: kib Sponsored By: EPSRC Differential Revision: https://reviews.freebsd.org/D29773
* linux: remove spurious newline.Edward Tomasz Napierala2021-01-191-1/+1
| | | | Sponsored by: The FreeBSD Foundation
* linux(4): Implement name_to_handle_at(), open_by_handle_at()Conrad Meyer2020-11-171-6/+110
| | | | | | | | | They are similar to our getfhat(2) and fhopen(2) syscalls. Differential Revision: https://reviews.freebsd.org/D27111 Notes: svn path=/head/; revision=367773
* Make it possible to mount a fuse filesystem, such as squashfuse,Edward Tomasz Napierala2020-11-091-8/+36
| | | | | | | | | | | | from a Linux binary. Should come handy for AppImages. Reviewed by: asomers MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D26959 Notes: svn path=/head/; revision=367517
* linux: silence renameat2 flags warningMateusz Guzik2020-10-261-0/+8
| | | | | | | Hogs the console while building the Linux kernel in a Ubuntu Focal jail. Notes: svn path=/head/; revision=367066
* linux: add missing conversions for compat.linux.use_emul_path handlingMateusz Guzik2020-10-261-44/+107
| | | | Notes: svn path=/head/; revision=367065
* compat: clean up empty lines in .c and .h filesMateusz Guzik2020-09-011-1/+0
| | | | Notes: svn path=/head/; revision=365080
* linux: add sysctl compat.linux.use_emul_pathMateusz Guzik2020-08-181-31/+71
| | | | | | | | | | | | | | | | This is a step towards facilitating jails with only Linux binaries. Supporting emul_path adds path lookups which are completely spurious if the binary at hand runs in a Linux-based root directory. It defaults to on (== current behavior). make -C /root/linux-5.3-rc8 -s -j 1 bzImage: use_emul_path=1: 101.65s user 68.68s system 100% cpu 2:49.62 total use_emul_path=0: 101.41s user 64.32s system 100% cpu 2:45.02 total Notes: svn path=/head/; revision=364366
* Make linux fallocate(2) return EOPNOTSUPP, not ENOSYS, on unsupported mode,Edward Tomasz Napierala2020-07-181-1/+1
| | | | | | | | | | as documented in the man page. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=363307
* Add a trivial linux(4) splice(2) implementation, which simplyEdward Tomasz Napierala2020-07-181-0/+14
| | | | | | | | | | | | | | 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
* memfd_create: turn on SHM_GROW_ON_WRITEKyle Evans2020-07-101-1/+1
| | | | | | | | | | | memfd_create fds will no longer require an ftruncate(2) to set the size; they'll grow (to the extent that it's possible) upon write(2)-like syscalls. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D25502 Notes: svn path=/head/; revision=363066