MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mlx4_fd_set_non_blocking

Function mlx4_fd_set_non_blocking

dpdk/drivers/net/mlx4/mlx4_utils.c:31–41  ·  view source on GitHub ↗

* Make a file descriptor non-blocking. * * @param fd * File descriptor to alter. * * @return * 0 on success, negative errno value otherwise and rte_errno is set. */

Source from the content-addressed store, hash-verified

29 * 0 on success, negative errno value otherwise and rte_errno is set.
30 */
31int
32mlx4_fd_set_non_blocking(int fd)
33{
34 int ret = fcntl(fd, F_GETFL);
35
36 if (ret != -1 && !fcntl(fd, F_SETFL, ret | O_NONBLOCK))
37 return 0;
38 MLX4_ASSERT(errno);
39 rte_errno = errno;
40 return -rte_errno;
41}
42
43/**
44 * Internal helper to allocate memory once for several disparate objects.

Callers 2

mlx4_rx_queue_setupFunction · 0.85
mlx4_pci_probeFunction · 0.85

Calls 1

fcntlFunction · 0.50

Tested by

no test coverage detected