Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alejandro Alvarado
torsocks
Commits
54db444d
Commit
54db444d
authored
Mar 09, 2019
by
Alejandro Alvarado
Browse files
Add getpid support re ticket 29659
parent
4c00ec87
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/common/compat.h
View file @
54db444d
...
...
@@ -135,6 +135,9 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine)(void));
#ifndef __NR_getdents64
#define __NR_getdents64 -21
#endif
#ifndef __NR_getpid
#define __NR_getpid -22
#endif
#define TSOCKS_NR_SOCKET __NR_socket
#define TSOCKS_NR_CONNECT __NR_connect
...
...
@@ -157,6 +160,7 @@ void tsocks_once(tsocks_once_t *o, void (*init_routine)(void));
#define TSOCKS_NR_MEMFD_CREATE __NR_memfd_create
#define TSOCKS_NR_GETDENTS __NR_getdents
#define TSOCKS_NR_GETDENTS64 __NR_getdents64
#define TSOCKS_NR_GETPID __NR_getpid
/*
* Despite glibc providing wrappers for these calls for a long time
...
...
src/lib/syscall.c
View file @
54db444d
...
...
@@ -467,6 +467,13 @@ static LIBC_SYSCALL_RET_TYPE handle_getdents64(va_list args)
return
tsocks_libc_syscall
(
TSOCKS_NR_GETDENTS64
,
fd
,
dirp
,
count
);
}
/*
* Handle getpid(2) syscall.
*/
static
LIBC_SYSCALL_RET_TYPE
handle_getpid
(
void
)
{
return
tsocks_libc_syscall
(
TSOCKS_NR_GETPID
);
}
#endif
/* __linux__ */
...
...
@@ -595,6 +602,9 @@ LIBC_SYSCALL_RET_TYPE tsocks_syscall(long int number, va_list args)
case
TSOCKS_NR_GETDENTS64
:
ret
=
handle_getdents64
(
args
);
break
;
case
TSOCKS_NR_GETPID
:
ret
=
handle_getpid
();
break
;
#endif
/* __linux__ */
default:
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment