---
name: "kernel_recvmsg"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/kernel_recvmsg"
---

# kernel\_recvmsg(9)

Receive a message from a socket (kernel space)

## NAME

kernel\_recvmsg - Receive a message from a socket (kernel space)

## SYNOPSIS

**int kernel\_recvmsg(struct socket \*** *sock***, struct msghdr \*** *msg***, struct kvec \*** *vec***, size\_t** *num***, size\_t** *size***, int** *flags***);**

## ARGUMENTS

*sock*

The socket to receive the message from

*msg*

Received message

*vec*

Input s/g array for message data

*num*

Size of input s/g array

*size*

Number of bytes to read

*flags*

Message flags (MSG\_DONTWAIT, etc...)

## DESCRIPTION

On return the msg structure contains the scatter/gather array passed in the vec argument. The array is modified so that it consists of the unfilled portion of the original array.

The returned value is the total number of bytes received, or an error.

## COPYRIGHT
