zephyr/drivers/can/can_native_linux_adapt.h
Alberto Escolar Piedras 5382f827d6 drivers can_native_linux: Avoid using ssize
ssize is a POSIX.1-2001 extension, which may or may
not be provided by the C library, or may be defined
to a different size in the host and embedded C library.

Two internal functions were returning ssize, but
one of them was a trampoline into the same host API,
which is already provided by the native simulator
so let's just use that instead.

The other is only carrying data that fits into an
int and is anyhow being cast in/to ints, so let's just
avoid the trouble by defining it as returning int.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
2024-01-15 21:59:56 +01:00

25 lines
626 B
C

/*
* Copyright (c) 2019 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
/** @file
* @brief Private functions for native posix canbus driver.
*/
#ifndef ZEPHYR_DRIVERS_CAN_NATIVE_POSIX_LINUX_SOCKETCAN_H_
#define ZEPHYR_DRIVERS_CAN_NATIVE_POSIX_LINUX_SOCKETCAN_H_
int linux_socketcan_iface_open(const char *if_name);
int linux_socketcan_iface_close(int fd);
int linux_socketcan_poll_data(int fd);
int linux_socketcan_read_data(int fd, void *buf, size_t buf_len, bool *msg_confirm);
int linux_socketcan_set_mode_fd(int fd, bool mode_fd);
#endif /* ZEPHYR_DRIVERS_CAN_NATIVE_POSIX_LINUX_SOCKETCAN_H_ */