mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-01-12 13:14:38 +00:00
mkvmerge: set I/O priority class to 'idle' for lower/lowest --priorities on Linux
Implements #863.
This commit is contained in:
parent
b5c5961125
commit
a156d0d5be
@ -17,5 +17,5 @@ PKG_PROG_PKG_CONFIG
|
||||
|
||||
dnl Check for headers
|
||||
AC_HEADER_STDC()
|
||||
AC_CHECK_HEADERS([inttypes.h stdint.h sys/types.h])
|
||||
AC_CHECK_FUNCS(vsscanf,,)
|
||||
AC_CHECK_HEADERS([inttypes.h stdint.h sys/types.h sys/syscall.h])
|
||||
AC_CHECK_FUNCS([vsscanf syscall],,)
|
||||
|
@ -17,6 +17,9 @@
|
||||
#ifdef SYS_WINDOWS
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#if defined(HAVE_SYS_SYSCALL_H)
|
||||
# include <sys/syscall.h>
|
||||
#endif
|
||||
|
||||
#include <matroska/KaxVersion.h>
|
||||
#include <matroska/FileKax.h>
|
||||
@ -107,6 +110,14 @@ set_process_priority(int priority) {
|
||||
// 'warn if return value is ignored'.
|
||||
if (!nice(s_nice_levels[priority + 2])) {
|
||||
}
|
||||
|
||||
# if defined(HAVE_SYSCALL) && defined(SYS_ioprio_set)
|
||||
if (0 < s_nice_levels[priority + 2])
|
||||
syscall(SYS_ioprio_set,
|
||||
1, // IOPRIO_WHO_PROCESS
|
||||
0, // current process/thread
|
||||
3 << 13); // I/O class 'idle'
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user