mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
sock: Introduce cred_to_ucred
To keep the coming code clear and to allow both the sock code and the scm code to share the logic introduce a fuction to translate from struct cred to struct ucred. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
5c1469de75
commit
3f551f9436
2 changed files with 19 additions and 0 deletions
|
@ -24,6 +24,9 @@ struct __kernel_sockaddr_storage {
|
|||
#include <linux/types.h> /* pid_t */
|
||||
#include <linux/compiler.h> /* __user */
|
||||
|
||||
struct pid;
|
||||
struct cred;
|
||||
|
||||
#define __sockaddr_check_size(size) \
|
||||
BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage)))
|
||||
|
||||
|
@ -309,6 +312,8 @@ struct ucred {
|
|||
#define IPX_TYPE 1
|
||||
|
||||
#ifdef __KERNEL__
|
||||
extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred);
|
||||
|
||||
extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
|
||||
extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
|
||||
int offset, int len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue