socket file descriptors seem broken inside components

jsarrett
Posts: 4
Joined: Thu Apr 20, 2017 7:52 am

socket file descriptors seem broken inside components

Postby jsarrett » Thu Apr 20, 2017 8:09 am

Hi there,

I think the read() and write() system calls are broken for socket file descriptors. If I use read() and write() in a function compiled with my app_main, when I look at the assembly, I see that apparently the read and write calls are getting mapped directly onto lwip_read_r and lwip_write_r, which is almost certainly wrong, even though it 'works'. HOWEVER, when I move that function into a component and pass in the file descriptor I see that they are getting mapped to something inside libc, as I would have expected. Unfortunately this causes crashes and I don't know why, because my JTAG pins are taken up by an SD card.

Can someone please fix this! It's really a problem to have to re-write all my library code to use send/recv when it doesn't have to care about the difference between files and sockets.

ESP_igrr
Posts: 2072
Joined: Tue Dec 01, 2015 8:37 am

Re: socket file descriptors seem broken inside components

Postby ESP_igrr » Thu Apr 20, 2017 11:39 am

There's an open issue about this, https://github.com/espressif/esp-idf/issues/273.

We do have this planned, but not for the next version (2.1). Will likely be done in the one after that.

Who is online

Users browsing this forum: No registered users and 38 guests