View Issue Details

IDProjectCategoryView StatusLast Update
0035914FPCRTLpublic2020-05-01 14:57
ReporterZamrony P. Juhara Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Version3.0.4 
Fixed in Version3.3.1 
Summary0035914: Add support to epoll_create1() and epoll_pwait()
Descriptionlinux.pp unit does not have epoll_create1() and epoll_pwait() declared.
TagsNo tags attached.
Fixed in Revision44666
FPCOldBugId
FPCTarget4.0.0
Attached Files

Relationships

related to 0036895 closedSven Barth epoll_wait call is wrong if generic_linux_syscalls is defined 

Activities

Bi0T1N

2020-04-06 00:19

reporter   ~0121953

As it seems the syscalls are there if generic_linux_syscalls is defined so I guess the attached patch should work.
0001-Add-epoll_create1-and-epoll_pwait.patch (1,463 bytes)   
diff --git rtl/linux/linux.pp rtl/linux/linux.pp
index 90c0831786..abc526e057 100644
--- rtl/linux/linux.pp
+++ rtl/linux/linux.pp
@@ -296,6 +296,11 @@ function epoll_ctl(epfd, op, fd: cint; event: pepoll_event): cint; {$ifdef FPC_U
 { wait for an I/O event on an epoll file descriptor }
 function epoll_wait(epfd: cint; events: pepoll_event; maxevents, timeout: cint): cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'epoll_wait'; {$endif}
 
+{$if defined(generic_linux_syscalls)}
+function epoll_create1(flags: cint): cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'epoll_create1'; {$endif}
+function epoll_pwait(epfd: cint; events: pepoll_event; maxevents, timeout: cint; sigmask: PSigSet): cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'epoll_pwait'; {$endif}
+{$endif}
+
 type Puser_cap_header=^user_cap_header;
      user_cap_header=record
        version: cuint32;
@@ -630,6 +635,19 @@ begin
 {$endif}
 end;
 
+{$if defined(generic_linux_syscalls)}
+function epoll_create1(flags: cint): cint;
+begin
+  epoll_create1 := do_syscall(syscall_nr_epoll_create1, tsysparam(flags));
+end;
+
+function epoll_pwait(epfd: cint; events: pepoll_event; maxevents, timeout: cint; sigmask: PSigSet): cint;
+begin
+  epoll_pwait := do_syscall(syscall_nr_epoll_pwait, tsysparam(epfd),
+    tsysparam(events), tsysparam(maxevents), tsysparam(timeout), tsysparam(sigmask));
+end;
+{$endif}
+
 function capget(header:Puser_cap_header;data:Puser_cap_data):cint;
 
 begin

Michael Van Canneyt

2020-04-09 23:28

administrator   ~0122053

As far as I can see, the system call number exists for all architectures. So I removed the ifdef.

Issue History

Date Modified Username Field Change
2019-07-31 02:42 Zamrony P. Juhara New Issue
2020-04-06 00:19 Bi0T1N File Added: 0001-Add-epoll_create1-and-epoll_pwait.patch
2020-04-06 00:19 Bi0T1N Note Added: 0121953
2020-04-09 23:28 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-04-09 23:28 Michael Van Canneyt Status new => resolved
2020-04-09 23:28 Michael Van Canneyt Resolution open => fixed
2020-04-09 23:28 Michael Van Canneyt Fixed in Version => 3.3.1
2020-04-09 23:28 Michael Van Canneyt Fixed in Revision => 44666
2020-04-09 23:28 Michael Van Canneyt FPCTarget => 4.0.0
2020-04-09 23:28 Michael Van Canneyt Note Added: 0122053
2020-05-01 14:57 Sven Barth Relationship added related to 0036895