File: message.h

package info (click to toggle)
fakeroot 1.5.10
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,804 kB
  • ctags: 455
  • sloc: sh: 9,226; ansic: 2,554; makefile: 277
file content (56 lines) | stat: -rw-r--r-- 1,185 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef FAKEROOT_MESSAGE_H
#define FAKEROOT_MESSAGE_H

#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
# ifdef HAVE_INTTYPES_H
# include <inttypes.h>
# else
#  error Problem
# endif
#endif

#if __BYTE_ORDER == __BIG_ENDIAN
# define htonll(n)  (n)
# define ntohll(n)  (n)
#elif __BYTE_ORDER == __LITTLE_ENDIAN
# define htonll(n)  ((((uint64_t) htonl(n)) << 32LL) | htonl((n) >> 32LL))
# define ntohll(n)  ((((uint64_t) ntohl(n)) << 32LL) | ntohl((n) >> 32LL))
#endif

#define FAKEROOTKEY_ENV "FAKEROOTKEY"

typedef uint32_t func_id_t;

typedef uint64_t fake_ino_t;
typedef uint64_t fake_dev_t;
typedef uint32_t fake_uid_t;
typedef uint32_t fake_gid_t;
typedef uint32_t fake_mode_t;
typedef uint32_t fake_nlink_t;

struct fakestat {
	fake_uid_t   uid;
	fake_gid_t   gid;
	fake_ino_t   ino;
	fake_dev_t   dev;
	fake_dev_t   rdev;
	fake_mode_t  mode;
	fake_nlink_t nlink;
} FAKEROOT_ATTR(packed);

struct fake_msg {
#ifndef FAKEROOT_FAKENET
	long mtype; /* message type in SYSV message sending */
#endif
	func_id_t       id; /* the requested function */
#ifndef FAKEROOT_FAKENET
	pid_t pid;
	int serial;
#endif
	struct fakestat st;
	uint32_t        remote;
} FAKEROOT_ATTR(packed);

#endif