66 */
77
88#include <stdbool.h>
9- #include <zephyr/posix/fcntl.h>
109
1110#include <zephyr/logging/log.h>
1211LOG_MODULE_REGISTER (net_sock_tls , CONFIG_NET_SOCKETS_LOG_LEVEL );
@@ -797,13 +796,13 @@ static int wait_for_reason(int sock, int timeout, int reason)
797796
798797static bool is_blocking (int sock , int flags )
799798{
800- int sock_flags = zsock_fcntl (sock , F_GETFL , 0 );
799+ int sock_flags = zsock_fcntl (sock , ZVFS_F_GETFL , 0 );
801800
802801 if (sock_flags == -1 ) {
803802 return false;
804803 }
805804
806- return !((flags & ZSOCK_MSG_DONTWAIT ) || (sock_flags & O_NONBLOCK ));
805+ return !((flags & ZSOCK_MSG_DONTWAIT ) || (sock_flags & ZVFS_O_NONBLOCK ));
807806}
808807
809808static int timeout_to_ms (k_timeout_t * timeout )
@@ -2362,15 +2361,15 @@ int ztls_connect_ctx(struct tls_context *ctx, const struct net_sockaddr *addr,
23622361 int sock_flags ;
23632362 bool is_non_block ;
23642363
2365- sock_flags = zsock_fcntl (ctx -> sock , F_GETFL , 0 );
2364+ sock_flags = zsock_fcntl (ctx -> sock , ZVFS_F_GETFL , 0 );
23662365 if (sock_flags < 0 ) {
23672366 return - EIO ;
23682367 }
23692368
2370- is_non_block = sock_flags & O_NONBLOCK ;
2369+ is_non_block = sock_flags & ZVFS_O_NONBLOCK ;
23712370 if (is_non_block ) {
2372- (void )zsock_fcntl (ctx -> sock , F_SETFL ,
2373- sock_flags & ~O_NONBLOCK );
2371+ (void )zsock_fcntl (ctx -> sock , ZVFS_F_SETFL ,
2372+ sock_flags & ~ZVFS_O_NONBLOCK );
23742373 }
23752374
23762375 ret = zsock_connect (ctx -> sock , addr , addrlen );
@@ -2379,7 +2378,7 @@ int ztls_connect_ctx(struct tls_context *ctx, const struct net_sockaddr *addr,
23792378 }
23802379
23812380 if (is_non_block ) {
2382- (void )zsock_fcntl (ctx -> sock , F_SETFL , sock_flags );
2381+ (void )zsock_fcntl (ctx -> sock , ZVFS_F_SETFL , sock_flags );
23832382 }
23842383
23852384#if defined(CONFIG_NET_SOCKETS_ENABLE_DTLS )
@@ -3919,8 +3918,8 @@ static int tls_sock_ioctl_vmeth(void *obj, unsigned int request, va_list args)
39193918
39203919 switch (request ) {
39213920 /* fcntl() commands */
3922- case F_GETFL :
3923- case F_SETFL : {
3921+ case ZVFS_F_GETFL :
3922+ case ZVFS_F_SETFL : {
39243923 const struct fd_op_vtable * vtable ;
39253924 struct k_mutex * lock ;
39263925 void * fd_obj ;
0 commit comments