|
Lines 28-33
Link Here
|
| 28 |
#ifndef _MM_FDPASS_H_ |
28 |
#ifndef _MM_FDPASS_H_ |
| 29 |
#define _MM_FDPASS_H_ |
29 |
#define _MM_FDPASS_H_ |
| 30 |
|
30 |
|
|
|
31 |
/* given pointer to struct cmsghdr, return pointer to data */ |
| 32 |
#ifndef CMSG_DATA |
| 33 |
# define MY_ALIGN(p) (((u_int)(p) + (sizeof(int) - 1)) &~ (sizeof(int) - 1)) |
| 34 |
# define CMSG_DATA(cmsg) \ |
| 35 |
((u_char *)(cmsg) + MY_ALIGN(sizeof(struct cmsghdr))) |
| 36 |
#endif /* CMSG_DATA */ |
| 37 |
|
| 38 |
/* |
| 39 |
* RFC 2292 requires to check msg_controllen, in case that the kernel returns |
| 40 |
* an empty list for some reasons. |
| 41 |
*/ |
| 42 |
#ifndef CMSG_FIRSTHDR |
| 43 |
# define CMSG_FIRSTHDR(mhdr) \ |
| 44 |
((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \ |
| 45 |
(struct cmsghdr *)(mhdr)->msg_control : \ |
| 46 |
(struct cmsghdr *)NULL) |
| 47 |
#endif /* CMSG_FIRSTHDR */ |
| 48 |
|
| 31 |
void mm_send_fd(int, int); |
49 |
void mm_send_fd(int, int); |
| 32 |
int mm_receive_fd(int); |
50 |
int mm_receive_fd(int); |
| 33 |
|
51 |
|