1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
TP-Link_Archer-XR500v/BBA1.5_platform/host_tools/fakeroot/message.h
2024-07-22 01:58:46 -03:00

69 lines
1.3 KiB
C
Executable File

#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;
#if __SUNPRO_C
#pragma pack(4)
#endif
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);
#if __SUNPRO_C
#pragma pack()
#endif
#if __SUNPRO_C
#pragma pack(4)
#endif
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);
#if __SUNPRO_C
#pragma pack()
#endif
#endif