projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
unix: receive pid on non-linux platforms
[lttng-tools.git]
/
src
/
common
/
compat
/
socket.h
diff --git
a/src/common/compat/socket.h
b/src/common/compat/socket.h
index a510473c35fbdeb4e78e245b35732c7f52e1dca9..464678292b95eed68afa5cc2d9e0311bd6843b41 100644
(file)
--- a/
src/common/compat/socket.h
+++ b/
src/common/compat/socket.h
@@
-117,6
+117,7
@@
typedef struct ucred lttng_sock_cred;
struct lttng_sock_cred {
uid_t uid;
gid_t gid;
struct lttng_sock_cred {
uid_t uid;
gid_t gid;
+ pid_t pid;
};
typedef struct lttng_sock_cred lttng_sock_cred;
};
typedef struct lttng_sock_cred lttng_sock_cred;
@@
-155,7
+156,7
@@
typedef struct lttng_sock_cred lttng_sock_cred;
#include <ucred.h>
static inline
#include <ucred.h>
static inline
-int getpeereid(int s, uid_t *euid, gid_t *gid)
+int getpeereid(int s, uid_t *euid, gid_t *gid
, pid_t *pid
)
{
int ret = 0;
ucred_t *ucred = NULL;
{
int ret = 0;
ucred_t *ucred = NULL;
@@
-176,6
+177,13
@@
int getpeereid(int s, uid_t *euid, gid_t *gid)
goto free;
}
*gid = ret;
goto free;
}
*gid = ret;
+
+ ret = ucred_getpid(ucred);
+ if (ret == -1) {
+ goto free;
+ }
+ *pid = ret;
+
ret = 0;
free:
ucred_free(ucred);
ret = 0;
free:
ucred_free(ucred);
This page took
0.026401 seconds
and
5
git commands to generate.