@@ -145,7 +145,7 @@ int socket(int domain, int type, int protocol)
145
145
{
146
146
int rc ;
147
147
148
- ODP_FD_DEBUG ("socket create start \n" );
148
+ ODP_FD_DEBUG ("socket create start , domain %d, type %d \n" , domain , type );
149
149
150
150
if ((inited == 0 ) || (AF_INET != domain ) || (SOCK_STREAM != type && SOCK_DGRAM != type ))
151
151
{
@@ -323,7 +323,7 @@ ssize_t write(int fd, const void *buf, size_t count)
323
323
{
324
324
if (errno == NETDP_EAGAIN )
325
325
{
326
- usleep (200 ); /* no space in netdp stack */
326
+ // usleep(200); /* no space in netdp stack */
327
327
continue ;
328
328
}
329
329
else
@@ -335,7 +335,7 @@ ssize_t write(int fd, const void *buf, size_t count)
335
335
336
336
if (nwrite < n )
337
337
{
338
- usleep (200 );/* no space in netdp stack */
338
+ // usleep(200);/* no space in netdp stack */
339
339
}
340
340
n -= nwrite ;
341
341
@@ -556,9 +556,9 @@ int accept4(int sockfd, struct sockaddr *addr, socklen_t *addrlen, int flags)
556
556
*/
557
557
int shutdown (int fd , int how )
558
558
{
559
- if (netdpsock_check ( fd ) )
559
+ if (fd > ODP_FD_BASE )
560
560
{
561
- // fd &= ~(1 << ODP_FD_BITS) ;
561
+ fd -= ODP_FD_BASE ;
562
562
//netdpsock_close(fd);
563
563
return 0 ;
564
564
}
@@ -642,14 +642,24 @@ int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event)
642
642
643
643
if (epfd > ODP_FD_BASE )
644
644
{
645
+ if (fd <= ODP_FD_BASE )
646
+ {
647
+ printf ("skip linux fd %d \n" , fd );
648
+ return 0 ;
649
+ }
645
650
epfd -= ODP_FD_BASE ;
646
651
fd -= ODP_FD_BASE ;
647
652
648
653
rc = netdpsock_epoll_ctl (epfd , op , fd , event );
649
654
}
650
655
else
651
656
{
652
- // assert(!(__fd & (1 << ODP_FD_BITS)));
657
+ if (fd > ODP_FD_BASE )
658
+ {
659
+ printf ("skip netdp fd %d \n" , fd );
660
+ return 0 ;
661
+ }
662
+
653
663
rc = real_epoll_ctl (epfd , op , fd , event );
654
664
}
655
665
return rc ;
0 commit comments