1 | /* |
1 | /* |
2 | * libev select fd activity backend |
2 | * libev select fd activity backend |
3 | * |
3 | * |
4 | * Copyright (c) 2007,2008,2009 Marc Alexander Lehmann <libev@schmorp.de> |
4 | * Copyright (c) 2007,2008,2009,2010 Marc Alexander Lehmann <libev@schmorp.de> |
5 | * All rights reserved. |
5 | * All rights reserved. |
6 | * |
6 | * |
7 | * Redistribution and use in source and binary forms, with or without modifica- |
7 | * Redistribution and use in source and binary forms, with or without modifica- |
8 | * tion, are permitted provided that the following conditions are met: |
8 | * tion, are permitted provided that the following conditions are met: |
9 | * |
9 | * |
… | |
… | |
139 | struct timeval tv; |
139 | struct timeval tv; |
140 | int res; |
140 | int res; |
141 | int fd_setsize; |
141 | int fd_setsize; |
142 | |
142 | |
143 | EV_RELEASE_CB; |
143 | EV_RELEASE_CB; |
144 | tv.tv_sec = (long)timeout; |
144 | EV_TV_SET (tv, timeout); |
145 | tv.tv_usec = (long)((timeout - (ev_tstamp)tv.tv_sec) * 1e6); |
|
|
146 | |
145 | |
147 | #if EV_SELECT_USE_FD_SET |
146 | #if EV_SELECT_USE_FD_SET |
148 | fd_setsize = sizeof (fd_set); |
147 | fd_setsize = sizeof (fd_set); |
149 | #else |
148 | #else |
150 | fd_setsize = vec_max * NFDBYTES; |
149 | fd_setsize = vec_max * NFDBYTES; |