@@ -65,9 +65,13 @@ def is_present(self, fd):
6565fds for an instance of epoll being watched.
6666If a chain of over 5 levels is detected, return
67671, which will return ELOOP in ql_syscall_epoll_wait
68+ <<<<<<< HEAD
6869"""
6970
7071
72+ == == == =
73+ '''
74+ >>>>>>> 342d61da (More work on test cases)
7175def check_epoll_depth(ql_fd_list, epolls_list, depth):
7276 if depth == 7:
7377=======
@@ -92,6 +96,7 @@ def check_epoll_depth(ql_fd_list, epolls_list, depth):
9296"""
9397Modify an existing epoll
9498man 7 epoll for more details
99+ <<<<<<< HEAD
95100"""
96101
97102
@@ -101,6 +106,10 @@ def ql_syscall_epoll_ctl(
101106=======
102107def ql_epoll_ctl(ql: qiling.Qiling, epfd: int, op: int, fd: int, event: POINTER):
103108>>>>>>> 0aef533c (Initial commit for epoll)
109+ =======
110+ '''
111+ def ql_syscall_epoll_ctl (ql : qiling .Qiling , epfd : int , op : int , fd : int , event : POINTER ):
112+ > >> >> >> 342 d61da (More work on test cases )
104113 # Basic sanity checks first
105114 if event != 0 :
106115 ql_event = ql .unpack32 (ql .mem .read (event , 4 )) # events list is uint32_t
@@ -157,6 +166,7 @@ def ql_epoll_ctl(ql: qiling.Qiling, epfd: int, op: int, fd: int, event: POINTER)
157166 if epoll_obj is None or fd_obj is None :
158167 # epfd or fd is not a valid file descriptor.
159168 return EBADF
169+ < << << << HEAD
160170< << << << HEAD
161171 if epfd == fd : # epoll can't monitor itself
162172 return EINVAL
@@ -193,6 +203,9 @@ def ql_epoll_ctl(ql: qiling.Qiling, epfd: int, op: int, fd: int, event: POINTER)
193203 epoll_parent_obj .set_eventmask (ql_event )
194204== == == =
195205 if epfd == fd :
206+ == == == =
207+ if epfd == fd : # epoll can't monitor itself
208+ > >> >> >> 342 d61da (More work on test cases )
196209 return EINVAL
197210 if epoll_obj .fileno () == fd :
198211 return ELOOP # ELOOP ...or a nesting depth of epoll instances greater than 5.
@@ -202,6 +215,7 @@ def ql_epoll_ctl(ql: qiling.Qiling, epfd: int, op: int, fd: int, event: POINTER)
202215 fd
203216 ): # can't add an fd that's already being waited on
204217 return EEXIST # op was EPOLL_CTL_ADD, and the supplied file descriptor fd is already registered with this epoll instance.
218+
205219 epoll_parent_obj .monitor_fd (
206220 fd , ql_event
207221 ) # add to list of fds to be monitored with per-fd eventmask
@@ -232,13 +246,18 @@ def ql_epoll_ctl(ql: qiling.Qiling, epfd: int, op: int, fd: int, event: POINTER)
232246"""
233247Wait on an existing epoll for events specified
234248earlier. man 7 epoll_wait for more info
249+ <<<<<<< HEAD
235250"""
236251
237252
238253def ql_syscall_epoll_wait (
239254== == == =
240255def ql_epoll_wait (
241256> >> >> >> 0 aef533c (Initial commit for epoll )
257+ == == == =
258+ '''
259+ def ql_syscall_epoll_wait(
260+ >>>>>>> 342d61da (More work on test cases)
242261 ql: qiling.Qiling, epfd: int, epoll_events: POINTER, maxevents: int, timeout: int
243262):
244263 if maxevents <= 0:
@@ -289,13 +308,17 @@ def ql_epoll_wait(
289308Use select.epoll for underlying implementation,
290309just as select.poll is used for emulating poll()
291310"""
311+ <<<<<<< HEAD
292312
293313
294314<<<<<<< HEAD
295315def ql_syscall_epoll_create1(ql: qiling.Qiling, flags: int):
296316=======
297317def ql_epoll_create1(ql: qiling.Qiling, flags: int):
298318>>>>>>> 0aef533c (Initial commit for epoll)
319+ =======
320+ def ql_syscall_epoll_create1(ql: qiling.Qiling, flags: int):
321+ >>>>>>> 342d61da (More work on test cases)
299322 if flags != select.EPOLL_CLOEXEC and flags != 0:
300323 return EINVAL
301324 ret = select.epoll(sizehint=-1, flags=flags)
@@ -310,6 +333,7 @@ def ql_epoll_create1(ql: qiling.Qiling, flags: int):
310333<< << << < HEAD
311334because of the slightly different prototype
312335"""
336+ <<<<<<< HEAD
313337
314338
315339def ql_syscall_epoll_create(ql: qiling.Qiling, size: int):
@@ -321,6 +345,9 @@ def ql_syscall_epoll_create(ql: qiling.Qiling, size: int):
321345
322346def ql_epoll_create (ql : qiling .Qiling , size : int ):
323347>> > >> > > 0 aef533c (Initial commit for epoll )
348+ == == == =
349+ def ql_syscall_epoll_create (ql : qiling .Qiling , size : int ):
350+ >> > >> > > 342 d61da (More work on test cases )
324351 if size < 0 :
325352 return EINVAL
326353 ret = select .epoll (sizehint = size , flags = 0 )
0 commit comments