Skip to content
Snippets Groups Projects
Commit 89aab460 authored by bors's avatar bors
Browse files

Auto merge of #559 - superriva:superriva-patch-1, r=alexcrichton

Add IPC,SHM,MSG for Freebsd

              INFO for the patch:
FREEBSD [https://github.com/freebsd/freebsd]

        /sys/sys/_types.h
typedef    long        __key_t;

        /sys/sys/types.h
typedef    __key_t        key_t;

        /sys/sys/ipc.h
#define    IPC_CREAT    001000
#define    IPC_EXCL    002000
#define    IPC_NOWAIT    004000
#define    IPC_PRIVATE    (key_t)0
#define    IPC_RMID    0
#define    IPC_SET     1
#define    IPC_STAT    2
#define    IPC_INFO    3

#define    IPC_R        000400
#define    IPC_W        000200
#define    IPC_M        010000

struct ipc_perm {
    uid_t        cuid;
    gid_t        cgid;
    uid_t        uid;
    gid_t        gid;
    mode_t        mode;
    unsigned short    seq;
    key_t        key;
};

key_t    ftok(const char *, int);

        /sys/sys/msg.h
#define MSG_NOERROR    010000

typedef    unsigned long    msglen_t;
typedef    unsigned long    msgqnum_t;

struct msqid_ds {
	struct	ipc_perm msg_perm;
	struct	msg *msg_first;
	struct	msg *msg_last;
	msglen_t msg_cbytes;
	msgqnum_t msg_qnum;
	msglen_t msg_qbytes;
	pid_t	msg_lspid;
	pid_t	msg_lrpid;
	time_t	msg_stime;
	time_t	msg_rtime;
	time_t	msg_ctime;
};

struct msg {
	struct	msg *msg_next;
	long	msg_type;
	u_short	msg_ts;
	short	msg_spot;
	struct	label *label;
};

struct msginfo {
    int    msgmax,
        msgmni,
        msgmnb,
        msgtql,
        msgssz,
        msgseg;
};

int msgctl(int, int, struct msqid_ds *);
int msgget(key_t, int);
ssize_t msgrcv(int, void *, size_t, long, int);
int msgsnd(int, const void *, size_t, int);

        /sys/sys/shm.h
#define SHM_RDONLY  010000
#define SHM_RND     020000
#define SHMLBA      PAGE_SIZE
#define SHM_R       (IPC_R)
#define SHM_W       (IPC_W)
#define SHM_LOCK    11
#define SHM_UNLOCK  12
#define SHM_STAT    13
#define SHM_INFO    14

typedef unsigned int shmatt_t;

struct shmid_ds {
    struct ipc_perm shm_perm;
    size_t          shm_segsz;
    pid_t           shm_lpid;
    pid_t           shm_cpid;
    shmatt_t        shm_nattch;
    time_t          shm_atime;
    time_t          shm_dtime;
    time_t          shm_ctime;
};

void *shmat(int, const void *, int);
int shmget(key_t, size_t, int);
int shmctl(int, int, struct shmid_ds *);
int shmdt(const void *);

	/sys/security/mac/mac_internal.h
#define	MAC_MAX_SLOTS	4
struct label {
	int		l_flags;
	intptr_t	l_perpolicy[MAC_MAX_SLOTS];
};
parents 0203490e 21226161
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment