Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: sockets: Use struct timeval provided by libc #41916

Conversation

rlubos
Copy link
Contributor

@rlubos rlubos commented Jan 18, 2022

Instead of redefining own struct zsock_timeval type at the socket
layer, use a standard type provided by libc. This prevents the
compliation errors when application includes both, net/socket.h and
standard C header defining struct timeval (sys/time.h).

Fixes #41503

Signed-off-by: Robert Lubos robert.lubos@nordicsemi.no

Instead of redefining own `struct zsock_timeval` type at the socket
layer, use a standard type provided by libc. This prevents the
compliation errors when application includes both, `net/socket.h` and
standard C header defining `struct timeval` (sys/time.h).

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
@boaks
Copy link

boaks commented Jan 18, 2022

Solves my issue #41503.

Copy link
Member

@jukkar jukkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nashif nashif merged commit 697f415 into zephyrproject-rtos:main Jan 21, 2022
@ycsin
Copy link
Member

ycsin commented Feb 10, 2022

@rlubos should this be backported?

@rlubos
Copy link
Contributor Author

rlubos commented Feb 10, 2022

I don't think we need to backport this, the error can be easily avoided by reordering headers.

@ycsin
Copy link
Member

ycsin commented Feb 10, 2022

I don't think we need to backport this, the error can be easily avoided by reordering headers.

Wouldn't backporting this make it easier?

@rlubos
Copy link
Contributor Author

rlubos commented Feb 10, 2022

Well, if you insist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Networking backport v2.7-branch Request backport to the v2.7-branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

including <net/socket.h> fails with redefinition of 'struct zsock_timeval' (sometimes :-) )
7 participants