Commit Graph

200514 Commits

Author SHA1 Message Date
Dmitry Chagin
5c5aac2d45 Regen for r283492. 2015-05-24 18:09:01 +00:00
Dmitry Chagin
9802eb9ebc Implement Linux specific syncfs() system call. 2015-05-24 18:08:01 +00:00
Dmitry Chagin
d9cbe8f0ef Properly check tv_nsec value. The tv_nsec field can also be one
of the special value UTIME_NOW or UTIME_OMIT.
2015-05-24 18:06:46 +00:00
Dmitry Chagin
4cf10e2934 Since FreeBSD supports SOCK_CLOEXEC & SOCK_NONBLOCK options
remove its emulation via fcntl call from Linuxulator.
2015-05-24 18:06:12 +00:00
Dmitry Chagin
c532a88cfc Regen for r283488. 2015-05-24 18:05:21 +00:00
Dmitry Chagin
e1ff74c0f7 Implement recvmmsg() and sendmmsg() system calls. 2015-05-24 18:04:04 +00:00
Dmitry Chagin
b7aaa9fdb0 Reduce duplication between MD Linux code by moving msg related
struct definitions out into the compat/linux/linux_socket.h
2015-05-24 18:03:14 +00:00
Dmitry Chagin
3ce05165b1 Regen for r283484. 2015-05-24 18:02:17 +00:00
Dmitry Chagin
6e4c8004dc Implement epoll_pwait() system call. 2015-05-24 18:00:14 +00:00
Dmitry Chagin
b7c4ebdb56 Convert signal number to native for VT_SETMODE ioctl and remove
strange and invalid ISSIGVALID macro.
The code has not been tested right way but it was originally broken.
2015-05-24 17:59:17 +00:00
Dmitry Chagin
ca045164a7 Regen for r283480. 2015-05-24 17:58:24 +00:00
Dmitry Chagin
19d8b461f4 Add utimensat() system call.
The patch developed by Jilles Tjoelker and Andrew Wilcox and
adopted for lemul branch by me.
2015-05-24 17:57:07 +00:00
Dmitry Chagin
0c38abc250 The kernel sends signals to the processes via ABI specific sv_sendsig method.
Native ABI do not need signal conversion, only emulators may want this. Usually
emulators implements its own sv_sendsig method. For now only ibcs2 emulator does
not have own sv_sendsig implementation and depends on native sendsig() method.
So, remove any extra attempts to convert signal numbers from native sendsig()
methods except from i386 where ibsc2 is living.
2015-05-24 17:56:02 +00:00
Dmitry Chagin
dcc0e6c493 Simplify linprocfs_doprocenviron(). Remove extra proc visibility checks
and initialize pn_vis by well known procfs_candebug().
2015-05-24 17:53:48 +00:00
Dmitry Chagin
5885e5ab29 Convert Linux signal number to the FreeBSD. 2015-05-24 17:49:09 +00:00
Dmitry Chagin
94c0ee30b4 Convert Linux sigsets before showing.
Linux kernel displays sigset always as 16x4 bit mask.
2015-05-24 17:48:34 +00:00
Dmitry Chagin
4ab7403bbd Rework signal code to allow using it by other modules, like linprocfs:
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
2015-05-24 17:47:20 +00:00
Dmitry Chagin
a6fd8bb2bb Add support for /proc/<pid>/auxv. 2015-05-24 17:46:04 +00:00
Dmitry Chagin
ffefd5707d Add vdso and stack names to the /proc/self/maps. 2015-05-24 17:44:42 +00:00
Dmitry Chagin
a7ac457613 According to Linux man sigaltstack(3) shall return EINVAL if the ss
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
2015-05-24 17:44:08 +00:00
Dmitry Chagin
76672e1113 Add EPOLLERR flag handling to epoll.
Tested by:	abi at abinet dot ru
2015-05-24 17:42:45 +00:00
Dmitry Chagin
e2ff4b9864 As fo_fill_kinfo() does not check fo_fill_kinfo to NULL
add a fo_fill_kinfo op to eventfdops.

Reported by:	trinity
2015-05-24 17:40:14 +00:00
Dmitry Chagin
657100de57 Regen for r283467. 2015-05-24 17:39:18 +00:00
Dmitry Chagin
fcdffc03f8 Call nosys in case when the incorrect syscall number is specified.
Reported by:	trinity
2015-05-24 17:38:02 +00:00
Dmitry Chagin
8d939ad405 Regen for r283465. 2015-05-24 17:35:42 +00:00
Dmitry Chagin
b6aeb7d5dd Add preliminary fallocate system call implementation
to emulate posix_fallocate() function.

Differential Revision:	https://reviews.freebsd.org/D1523
Reviewed by:	emaste
2015-05-24 17:33:21 +00:00
Dmitry Chagin
16ac71bc4f Delete the duplicate of linux_to_native_clockid() function.
Differential Revision:	https://reviews.freebsd.org/D1521
Reviewed by:	trasz
2015-05-24 17:30:31 +00:00
Dmitry Chagin
680982281b Do not use struct l_timespec without conversion. While here move
args->timeout handling before acquiring the futex key at FUTEX_WAIT path.

Differential Revision:	https://reviews.freebsd.org/D1520
Reviewed by:	trasz
2015-05-24 17:29:18 +00:00
Dmitry Chagin
7e947ccc81 Add prototypes for static futex functions.
Differential Revision:	https://reviews.freebsd.org/D1519
Reviewed by:	trasz
2015-05-24 17:27:59 +00:00
Dmitry Chagin
2166e4e0a5 As for now our tmpfs is no longer being considered
"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
2015-05-24 17:26:58 +00:00
Dmitry Chagin
5dd1d097f8 Print out unsupported futex operation message only once for the process.
Differential Revision:	https://reviews.freebsd.org/D1498
2015-05-24 17:25:57 +00:00
Dmitry Chagin
2711aba97e Add some clock mappings used in glibc 2.20.
Differential Revision:	https://reviews.freebsd.org/D1465
Reviewd by:	trasz
2015-05-24 17:23:08 +00:00
Dmitry Chagin
7d96520b25 Improve ktr(9) records in thread managment code.
Differential Revision:	https://reviews.freebsd.org/D1464
Reviewed by:	trasz
2015-05-24 17:09:07 +00:00
Dmitry Chagin
68cf0367e9 Use local struct proc * varable instead of dereferencing td->td_proc.
Differential Revision:	https://reviews.freebsd.org/D1463
Reviewed by:	emaste
2015-05-24 17:08:25 +00:00
Dmitry Chagin
97cfa5c899 Avoid unnecessary em zeroing in non-exec path
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
2015-05-24 17:07:10 +00:00
Dmitry Chagin
e0327ddba0 Remove the unnecessary cast.
Differential Revision:	https://reviews.freebsd.org/D1461
Reviewed by:	emaste
2015-05-24 17:05:59 +00:00
Dmitry Chagin
274d2df2e5 Regen for r283451. 2015-05-24 17:00:43 +00:00
Dmitry Chagin
a6b40812ec Implement ppoll() system call.
Differential Revision:	https://reviews.freebsd.org/D1105
Reviewed by:	trasz
2015-05-24 16:59:25 +00:00
Dmitry Chagin
3d7b4b3720 td_sigmask of a newly created thread copied from td.
Remove excess initialization of td_sigmask.

Differential Revision:	https://reviews.freebsd.org/D1128
Reviewed by:	emaste
2015-05-24 16:56:32 +00:00
Dmitry Chagin
2c4f134b25 Update Linux compat revision to 32.
Differential Revision:	https://reviews.freebsd.org/D1122
Reviewed by:	emaste
2015-05-24 16:55:32 +00:00
Dmitry Chagin
c0fe996d3c Connect linux64 module to the build.
Differential Revision:	https://reviews.freebsd.org/D1097
Reviewed by:	emaste
2015-05-24 16:53:32 +00:00
Dmitry Chagin
520e9c187d Fix linux_common module build with KTR option.
Differential Revision:	https://reviews.freebsd.org/D1096
Reviewed by:	trasz
2015-05-24 16:52:45 +00:00
Dmitry Chagin
e8b026b37e Include opt_compat.h, so that COMPAT_LINUX32 is defined, and we can
access to the semop structs and functions.

Submitted by:	cognet@

Differential Revision:	https://reviews.freebsd.org/D1095
Reviewed by:	trasz
2015-05-24 16:51:04 +00:00
Dmitry Chagin
22f3dfdc12 Regen for r283444. 2015-05-24 16:50:17 +00:00
Dmitry Chagin
a31d76867d Implement eventfd system call.
Differential Revision:	https://reviews.freebsd.org/D1094
In collaboration with:	Jilles Tjoelker
2015-05-24 16:49:14 +00:00
Dmitry Chagin
3e89b64168 Put the correct value for the abi_nfdbits parameter of kern_select() for
all supported Linuxulators.

Differential Revision:	https://reviews.freebsd.org/D1093
Reviewed by:	trasz
2015-05-24 16:47:13 +00:00
Dmitry Chagin
28fb55359b Regen for r283441. 2015-05-24 16:42:49 +00:00
Dmitry Chagin
e16fe1c730 Implement epoll family system calls. This is a tiny wrapper
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
2015-05-24 16:41:39 +00:00
Dmitry Chagin
7236f2c220 For future use in the Linuxulator:
1. Add a kern_kqueue() counterpart for kqueue() with flags parameter.

2. Be a bit secure. To avoid a double fp lookup add a kern_kevent_fp()
counterpart for kern_kevent() with file pointer parameter instead
of file descriptor an pass the buck to it.

Suggested by: mjg [2]

Differential Revision:	https://reviews.freebsd.org/D1091
Reviewed by:	trasz
2015-05-24 16:36:29 +00:00
Dmitry Chagin
d2b6dbc06f Implement F_DUPFD_CLOEXEC fcntl flag.
Differential Revision:	https://reviews.freebsd.org/D1089
Reviewed by:	trasz
2015-05-24 16:34:57 +00:00