File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
affinity/src/main/java/net/openhft/affinity/impl Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,19 @@ public int getCpu() {
107107 return ret ;
108108 } catch (LastErrorException e ) {
109109 throw new IllegalStateException ("sched_getcpu( ) errorNo=" + e .getErrorCode (), e );
110+ } catch (UnsatisfiedLinkError ule ) {
111+ try {
112+ final IntByReference cpu = new IntByReference ();
113+ final IntByReference node = new IntByReference ();
114+ final int ret = lib .syscall (318 , cpu , node , null );
115+ if (ret != 0 ) {
116+ throw new IllegalStateException ("getcpu( ) return " + ret );
117+ }
118+
119+ return cpu .getValue ();
120+ } catch (LastErrorException lee ) {
121+ throw new IllegalStateException ("getcpu( ) errorNo=" + lee .getErrorCode (), lee );
122+ }
110123 }
111124 }
112125
@@ -183,6 +196,10 @@ int sched_getaffinity(final int pid,
183196 final PointerType cpuset ) throws LastErrorException ;
184197
185198 int sched_getcpu () throws LastErrorException ;
199+
200+ int getcpu (final IntByReference cpu ,
201+ final IntByReference node ,
202+ final PointerType tcache ) throws LastErrorException ;
186203
187204 int getpid () throws LastErrorException ;
188205
You can’t perform that action at this time.
0 commit comments