mittu
mittu

Reputation: 11

how to use sendmsg() system call in server client program

I'm going through sendmsg systemcall, i want to trigger this sendmsg systemcall using a server client programs and what to use ftrace to trace what functions are involved and understand the flow of sendmsg

Upvotes: -1

Views: 193

Answers (1)

Chin2
Chin2

Reputation: 53

You can invoke the msgsnd() system call as follows. Reference

syntax:

int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg);

int ret = msgsnd(msq_id, &msg, sizeof(msg.data), 0);
    if(ret< 0){
        perror("msgsnd() failed");
        _exit(-1);
    }
// message is sent

Upvotes: 0

Related Questions