beagleboard / beagleboard/linux
read() on rpmsg device doesn't admit count parameter
- Dominant language
- C
- Stars
- 810
- Forks
- 582
- PR merge metrics
- No merged PRs in 30d
Description
While working with the PRU of beagleboard, I noticed, that the kernel doesn't respect the count parameter of the read() system call.
As example on the Linux side do:
```c
ssize_t size;
int32_t i;
size = read(rpmsg_fd, &i, sizeof(i));
printf("size read: %u\n", size);
```
On the PRU side:
```c
uint64_t val;
val = ...some random value...;
pru_rpmsg_send(&transport, dst, src, &val, sizeof(val));
```
With such code I get 8 bytes reads as result and, what is worse, 8 bytes written to &i. Running strace on the Linux side gives the following output:
```c
read(3, "\32\216\4\0\4\0\37\0", 4) = 8
```
I get this behavior with kernel 4.9.59-ti-r74, but have seen it as well with older 4.9 kernels and 4.4 kernels.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.