forked from chipsalliance/VeeR-ISS
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSyscall.cpp
2185 lines (1868 loc) · 54.1 KB
/
Syscall.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2020 Western Digital Corporation or its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <iomanip>
#include <iostream>
#include <fstream>
#include <optional>
#include <span>
#include <sstream>
#include <cstring>
#include <ctime>
#include <sys/times.h>
#include <fcntl.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/mman.h>
#include <dirent.h>
#include <sys/ioctl.h>
#include <sys/uio.h>
#include <sys/utsname.h>
#include <linux/futex.h>
#include <sched.h>
#include "Hart.hpp"
#include "Syscall.hpp"
#include "Filesystem.hpp"
using namespace WdRiscv;
#if defined(__APPLE__)
#define off64_t off_t
#define MREMAP_MAYMOVE 0
#endif
template <typename URV, typename T>
requires requires (T& t) { std::span<char>(std::begin(t), std::end(t)); }
static bool
copyRvString(Hart<URV>& hart, uint64_t rvAddr,
T& dest)
{
for (size_t i = 0; i < std::size(dest); ++i)
{
uint8_t byte = 0;
if (not hart.peekMemory(rvAddr + i, byte, true))
return false;
dest[i] = byte;
if (byte == 0)
return true;
}
return false;
}
/// Read from the RISCV system memory at address readAddr up size
/// elements placing them in the dest array (which must be large enough
/// to accomodate size bytes). Return number of elements successfully
/// read. Reading of elements is done sequentially and stopped at the
/// first failure.
template <typename URV, typename T>
requires requires(T t) { std::span(t); }
static uint64_t
readHartMemory(Hart<URV>& hart, uint64_t readAddr, T&& dest, std::optional<std::size_t> size = std::nullopt)
{
std::span<std::byte> destBytes = std::as_writable_bytes(std::span(std::forward<T>(dest)));
for (uint64_t i = 0; i < size.value_or(destBytes.size()); ++i)
{
uint8_t byte = 0;
if (not hart.peekMemory(readAddr + i, byte, true))
return i;
destBytes[i] = static_cast<std::byte>(byte);
}
return size.value_or(dest.size());
}
template <typename URV, typename T>
static inline uint64_t
readHartMemory(Hart<URV>& hart, uint64_t readAddr, T& dest)
{
return readHartMemory(hart, readAddr, std::span<T, 1>(&dest, 1));
}
template <typename URV, typename T>
requires requires(T t) { std::span(t); }
static uint64_t
writeHartMemory(Hart<URV>& hart, T&& data, uint64_t writeAddr, std::optional<std::size_t> size = std::nullopt)
{
std::span<const std::byte> dataBytes = std::as_bytes(std::span(std::forward<T>(data)));
for (uint64_t i = 0; i < size.value_or(dataBytes.size()); ++i)
{
uint8_t byte = static_cast<uint8_t>(dataBytes[i]);
if (not hart.pokeMemory(writeAddr + i, byte, true))
return i;
}
return size.value_or(dataBytes.size());
}
template <typename URV, typename T>
static uint64_t
writeHartMemory(Hart<URV>& hart, const T& data, uint64_t writeAddr)
{
return writeHartMemory(hart, std::span<const T, 1>(&data, 1), writeAddr);
}
// Copy x86 stat buffer to riscv kernel_stat buffer.
template <typename URV>
static size_t
copyStatBufferToRiscv(Hart<URV>& hart, const struct stat& buff,
uint64_t rvBuff, bool& writeOk)
{
writeOk = false;
uint64_t addr = rvBuff;
if (not hart.pokeMemory(addr, uint64_t(buff.st_dev), true))
return addr - rvBuff;
addr += 8;
if (not hart.pokeMemory(addr, uint64_t(buff.st_ino), true))
return addr - rvBuff;
addr += 8;
if (not hart.pokeMemory(addr, uint32_t(buff.st_mode), true))
return addr - rvBuff;
addr += 4;
if (not hart.pokeMemory(addr, uint32_t(buff.st_nlink), true))
return addr - rvBuff;
addr += 4;
if (not hart.pokeMemory(addr, uint32_t(buff.st_uid), true))
return addr - rvBuff;
addr += 4;
if (not hart.pokeMemory(addr, uint32_t(buff.st_gid), true))
return addr - rvBuff;
addr += 4;
if (not hart.pokeMemory(addr, uint64_t(buff.st_rdev), true))
return addr - rvBuff;
addr += 8;
addr += 8; // __pad1
if (not hart.pokeMemory(addr, uint64_t(buff.st_size), true))
return addr - rvBuff;
addr += 8;
#ifdef __APPLE__
// TODO: adapt code for Mac OS.
addr += 40;
#else
if (not hart.pokeMemory(addr, uint32_t(buff.st_blksize), true))
return addr - rvBuff;
addr += 4;
addr += 4; // __pad2
if (not hart.pokeMemory(addr, uint64_t(buff.st_blocks), true))
return addr - rvBuff;
addr += 8;
if (not hart.pokeMemory(addr, uint64_t(buff.st_atim.tv_sec), true))
return addr - rvBuff;
addr += 8;
if (not hart.pokeMemory(addr, uint64_t(buff.st_atim.tv_nsec), true))
return addr - rvBuff;
addr += 8;
if (not hart.pokeMemory(addr, uint64_t(buff.st_mtim.tv_sec), true))
return addr - rvBuff;
addr += 8;
if (not hart.pokeMemory(addr, uint64_t(buff.st_mtim.tv_nsec), true))
return addr - rvBuff;
addr += 8;
if (not hart.pokeMemory(addr, uint64_t(buff.st_ctim.tv_sec), true))
return addr - rvBuff;
addr += 8;
if (not hart.pokeMemory(addr, uint64_t(buff.st_ctim.tv_nsec), true))
return addr - rvBuff;
addr += 8;
#endif
writeOk = true;
return addr - rvBuff;
}
// Copy x86 tms struct (used by times) to riscv.
template <typename URV>
static size_t
copyTmsToRiscv(Hart<URV>& hart, const struct tms& buff, URV addr)
{
URV addr0 = addr;
if (not hart.pokeMemory(addr, URV(buff.tms_utime), true))
return addr - addr0;
addr += sizeof(URV);
if (not hart.pokeMemory(addr, URV(buff.tms_stime), true))
return addr - addr0;
addr += sizeof(URV);
if (not hart.pokeMemory(addr, URV(buff.tms_cutime), true))
return addr - addr0;
addr += sizeof(URV);
if (not hart.pokeMemory(addr, URV(buff.tms_cstime), true))
return addr -addr0;
addr += sizeof(URV);
return addr -addr0;
}
// Copy x86 timeval buffer to riscv timeval buffer (32-bit version).
template <typename URV>
static size_t
copyTimevalToRiscv32(Hart<URV>& hart, const struct timeval& tv, URV addr)
{
size_t written = 0;
if (not hart.pokeMemory(addr, uint32_t(tv.tv_sec), true))
return written;
written += sizeof(uint32_t);
addr += sizeof(uint32_t);
if (not hart.pokeMemory(addr, uint64_t(tv.tv_usec), true))
return written;
written += sizeof(uint64_t);
return written;
}
// Copy x86 timeval buffer to riscv timeval buffer (32-bit version).
template <typename URV>
static size_t
copyTimevalToRiscv64(Hart<URV>& hart, const struct timeval& tv, URV addr)
{
size_t written = 0;
if (not hart.pokeMemory(addr, uint64_t(tv.tv_sec), true))
return written;
written += sizeof(uint64_t);
addr += sizeof(uint64_t);
if (not hart.pokeMemory(addr, uint64_t(tv.tv_usec), true))
return written;
written += sizeof(uint64_t);
return written;
}
// Copy x86 timezone to riscv
template<typename URV>
static size_t
copyTimezoneToRiscv(Hart<URV>& hart, const struct timezone& tz, URV dest)
{
size_t written = 0;
if (not hart.pokeMemory(dest, URV(tz.tz_minuteswest), true))
return written;
written += sizeof(URV);
dest += sizeof(URV);
if (not hart.pokeMemory(dest, URV(tz.tz_dsttime), true))
return written;
written += sizeof(URV);
return written;
}
template <typename URV>
bool
Syscall<URV>::redirectOutputDescriptor(int fd, const std::string& path)
{
if (fdMap_.contains(fd))
{
std::cerr << "Hart::redirectOutputDecritpor: Error: File decriptor " << fd
<< " alrady used.\n";
return false;
}
int newFd = open(path.c_str(), O_WRONLY | O_CREAT,
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (newFd < 0)
{
std::cerr << "Error: Failed to open file " << path << " for output\n";
return false;
}
fdMap_[fd] = newFd;
fdIsRead_[fd] = false;
fdPath_[fd] = path;
auto absPath = Filesystem::absolute(path);
writePaths_.insert(absPath.string());
return true;
}
template <typename URV>
bool
Syscall<URV>::redirectInputDescriptor(int fd, const std::string& path)
{
if (fdMap_.contains(fd))
{
std::cerr << "Hart::redirectOutputDecritpor: Error: File decriptor " << fd
<< " already used.\n";
return false;
}
int newFd = open(path.c_str(), O_RDONLY);
if (newFd < 0)
{
std::cerr << "Error: Failed to open file " << path << " for input\n";
return false;
}
fdMap_[fd] = newFd;
fdIsRead_[fd] = true;
fdPath_[fd] = path;
return true;
}
template <typename URV>
void
Syscall<URV>::reportOpenedFiles(std::ostream& out)
{
if (not readPaths_.empty())
{
out << "Files opened for read:\n";
for (const auto& path : readPaths_)
out << " " << path << '\n';
}
if (not writePaths_.empty())
{
out << "Files opened for write/read-write:\n";
for (const auto& path : writePaths_)
out << " " << path << '\n';
}
}
template <typename URV>
int
Syscall<URV>::registerLinuxFd(int linuxFd, const std::string& path, bool isRead)
{
if (linuxFd < 0)
return linuxFd;
int riscvFd = linuxFd;
int maxFd = linuxFd;
bool used = false;
for (auto kv : fdMap_)
{
int rfd = kv.first;
if (riscvFd == rfd)
used = true;
maxFd = std::max(maxFd, rfd);
}
if (used)
riscvFd = maxFd + 1;
fdMap_[riscvFd] = linuxFd;
fdIsRead_[riscvFd] = isRead;
fdPath_[riscvFd] = path;
auto absPath = Filesystem::absolute(path);
if (isRead)
readPaths_.insert(absPath.string());
else
writePaths_.insert(absPath.string());
return riscvFd;
}
template <typename URV>
URV
Syscall<URV>::emulateSemihost(unsigned hartIx, URV a0, URV a1)
{
enum Operation { Open = 1, Close = 2, Writec = 3, Write0 = 4, Write = 5, Read = 6,
Readc = 7, Iserror = 8, Istty = 9, Seek = 10, Flen = 12, Tmpnam = 13,
Remove = 14, Rename = 15, Clock = 16, Time = 17, System = 18,
Errno = 19, GetCmdline = 21, Heapinfo = 22, Exit = 24, ExitExtended = 32,
Elapsed = 48, Tickfreq = 49 };
static std::unordered_map<Operation, std::string> names =
{
{ Open, "open" },
{ Close, "close" },
{ Writec, "writec" },
{ Write0, "write0" },
{ Write, "write" },
{ Read, "read" },
{ Readc, "readc" },
{ Iserror, "iserror" },
{ Istty, "istty" },
{ Seek, "seek" },
{ Flen, "flen" },
{ Tmpnam, "tmpnam" },
{ Remove, "remove" },
{ Rename, "rename" },
{ Clock, "clock" },
{ Time, "time" },
{ System, "system" },
{ Errno, "errno" },
{ GetCmdline, "get_cmdline" },
{ Heapinfo, "heapinfo" },
{ Exit, "exit" },
{ ExitExtended, "exit_extended" },
{ Elapsed, "elapsed" },
{ Tickfreq, "tickfreq" }
};
std::lock_guard<std::mutex> lock(semihostMutex_);
auto& hart = *harts_.at(hartIx);
Operation op = Operation(a0);
switch (op)
{
case Open:
{
URV addr = 0, mode = 0, len = 0; // Addr: address of name string
if (not hart.peekMemory(a1, addr, true) or
not hart.peekMemory(a1 + sizeof(URV), mode, true) or
not hart.peekMemory(a1 + 2*sizeof(URV), len, true))
return SRV(-1);
std::array<char, 1024> path;
if (not copyRvString(hart, addr, path))
return SRV(-1);
int flags = O_RDONLY; // Linux flags corresponding to mode.
switch (mode)
{
case 2:
case 3: flags = O_RDWR; break;
case 4:
case 5: flags = O_WRONLY | O_CREAT; break;
case 6:
case 7: flags = O_RDWR | O_CREAT; break;
case 8:
case 9: flags = O_WRONLY | O_APPEND | O_CREAT; break;
case 10:
case 11: flags = O_RDWR | O_APPEND | O_CREAT; break;
}
int handle = open(path.data(), flags, S_IRWXU);
if (handle < 0)
return SRV(-1);
bool isRead = not (flags & (O_WRONLY | O_RDWR));
int effHandle = registerLinuxFd(handle, path.data(), isRead);
if (effHandle < 0)
{
close(handle);
return SRV(-1);
}
return effHandle;
}
break;
case Close:
{
URV handle = 0;
if (not hart.peekMemory(a1, handle, true))
return SRV(-1);
SRV rc = emulate(hartIx, 57 /*close*/, handle, 0, 0, 0);
return rc == 0? 0 : SRV(-1);
}
case Writec:
{
uint8_t c = 0;
hart.peekMemory(a1, c, true);
fputc(c, stderr);
return c;
}
case Write0:
{
uint8_t c = 0;
URV addr = a1;
while (hart.peekMemory(addr++, c, true) and c != 0)
fputc(c, stderr);
return a1;
}
case Write:
{
URV handle = 0, addr = 0, size = 0;
if (not hart.peekMemory(a1, handle, true) or
not hart.peekMemory(a1 + sizeof(URV), addr, true) or
not hart.peekMemory(a1 + 2*sizeof(URV), size, true))
return SRV(-1);
SRV rc = emulate(hartIx, 64 /*write*/, handle, addr, size, 0);
return rc >= 0? rc : SRV(-1);
}
case Read:
{
URV handle = 0, addr = 0, size = 0;
if (not hart.peekMemory(a1, handle, true) or
not hart.peekMemory(a1 + sizeof(URV), addr, true) or
not hart.peekMemory(a1 + 2*sizeof(URV), size, true))
return SRV(-1);
SRV rc = emulate(hartIx, 63 /*read*/, handle, addr, size, 0);
return rc >= 0? rc : SRV(-1);
}
case Readc:
break;
case Iserror:
{
URV code = 0;
if (not hart.peekMemory(a1, code, true))
return SRV(-1);
if (code == 0)
return 0;
return SRV(-1);
}
case Istty:
{
URV fd = 0;
if (not hart.peekMemory(a1, fd, true))
return SRV(-1);
fd = effectiveFd(fd);
if (isatty(fd))
return 1;
return 0;
}
case Seek:
{
URV fd = 0, position = 0;
if (not hart.peekMemory(a1, fd, true) or
not hart.peekMemory(a1 + sizeof(URV), position, true))
return SRV(-1);
fd = effectiveFd(fd);
off_t offset = position;
ssize_t rc = lseek(fd, offset, SEEK_SET);
return rc < 0 ? SRV(-1) : SRV(0);
}
case Flen:
{
URV fd = 0;
if (not hart.peekMemory(a1, fd, true))
return SRV(-1);
fd = effectiveFd(fd);
struct stat buff;
int rc = fstat(fd, &buff);
if (rc < 0)
return SRV(-1);
return buff.st_size;
}
case Tmpnam:
break;
#if 0
// Spec is dangerous. Unimplementable.
{
URV addr = 0, id = 0, len = 0;
if (not hart.peekMemory(a1, addr, true) or
not hart.peekMemory(a1 + sizeof(URV), id, true) or
not hart.peekMemory(a1 + 2*sizeof(URV), len, true))
return SRV(-1);
if (len > L_tmpnam)
return SRV(-1);
char name[L_tmpnam];
if (not std::mkstmp(name))
return SRV(-1);
writeHartMemory(hart, name, len);
return 0;
}
#endif
case Remove:
{
URV addr = 0, len = 0;
if (not hart.peekMemory(a1, addr, true) or
not hart.peekMemory(a1 + sizeof(URV), len, true))
return SRV(-1);
SRV rc = emulate(hartIx, 1026 /*unlink*/, addr, 0, 0, 0);
return rc >= 0 ? rc : SRV(-1);
}
case Rename:
{
URV addr1 = 0, addr2 = 0; // Old and new name addresses
URV len1 = 0, len2 = 0;
if (not hart.peekMemory(a1, addr1, true) or
not hart.peekMemory(a1 + sizeof(URV), len1, true) or
not hart.peekMemory(a1 + 2*sizeof(URV), addr2, true) or
not hart.peekMemory(a1 + 3*sizeof(URV), len2, true))
return SRV(-1);
SRV rc = emulate(hartIx, 276 /*rename*/, len1, addr1, len2, addr2);
return rc >= 0 ? rc : SRV(-1);
}
case Clock:
break;
case Time:
break;
case System:
break;
case Errno:
break;
case GetCmdline:
break;
case Heapinfo:
break;
case Exit:
throw CoreException(CoreException::Exit, "", a1);
break;
case Elapsed:
break;
case Tickfreq:
break;
default:
std::cerr << "Error: Unknown semi-hosting syscall number: " << a0 << '\n';
return SRV(-1);
}
std::cerr << "Warning: Unimplemented semi-hosting syscall \"" << names[op]
<< "\" number " << a0 << '\n';
return SRV(-1);
}
template <typename URV>
URV
Syscall<URV>::emulate(unsigned hartIx, unsigned syscallIx, URV a0, URV a1, URV a2, URV a3)
{
static std::unordered_map<unsigned, std::string> names =
{
{0, "io_setup"},
{1, "io_destroy"},
{2, "io_submit"},
{3, "io_cancel"},
{4, "io_getevents"},
{5, "setxattr"},
{6, "lsetxattr"},
{7, "fsetxattr"},
{8, "getxattr"},
{9, "lgetxattr"},
{10, "fgetxattr"},
{11, "listxattr"},
{12, "llistxattr"},
{13, "flistxattr"},
{14, "removexattr"},
{15, "lremovexattr"},
{16, "fremovexattr"},
{17, "getcwd"},
{18, "lookup_dcookie"},
{19, "eventfd2"},
{20, "epoll_create1"},
{21, "epoll_ctl"},
{22, "epoll_pwait"},
{23, "dup"},
{24, "dup3"},
{25, "fcntl"},
{26, "inotify_init1"},
{27, "inotify_add_watch"},
{28, "inotify_rm_watch"},
{29, "ioctl"},
{30, "ioprio_get"},
{31, "ioprio_set"},
{32, "flock"},
{33, "mknodat"},
{34, "mkdirat"},
{35, "unlinkat"},
{36, "symlinkat"},
{37, "linkat"},
{38, "renameat"},
{39, "umount2"},
{40, "mount"},
{41, "pivot_root"},
{42, "nfsservctl"},
{43, "statfs"},
{44, "fstatfs"},
{45, "truncate"},
{46, "ftruncate"},
{47, "fallocate"},
{48, "faccessat"},
{49, "chdir"},
{50, "fchdir"},
{51, "chroot"},
{52, "fchmod"},
{53, "fchmodat"},
{54, "fchownat"},
{55, "fchown"},
{56, "openat"},
{57, "close"},
{58, "vhangup"},
{59, "pipe2"},
{60, "quotactl"},
{61, "getdents64"},
{62, "lseek"},
{63, "read"},
{64, "write"},
{66, "writev"},
{67, "pread64"},
{68, "pwrite64"},
{69, "preadv"},
{70, "pwritev"},
{71, "sendfile"},
{72, "pselect6"},
{73, "ppoll"},
{74, "signalfd64"},
{75, "vmsplice"},
{76, "splice"},
{77, "tee"},
{78, "readlinkat"},
{79, "fstatat"},
{80, "fstat"},
{81, "sync"},
{82, "fsync"},
{83, "fdatasync"},
{84, "sync_file_range2"},
{85, "timerfd_create"},
{86, "timerfd_settime"},
{87, "timerfd_gettime"},
{88, "utimensat"},
{89, "acct"},
{90, "capget"},
{91, "capset"},
{92, "personality"},
{93, "exit"},
{94, "exit_group"},
{95, "waitid"},
{96, "set_tid_address"},
{97, "unshare"},
{98, "futex"},
{99, "set_robust_list"},
{100, "get_robust_list"},
{101, "nanosleep"},
{102, "getitimer"},
{103, "setitimer"},
{104, "kexec_load"},
{105, "init_module"},
{106, "delete_module"},
{107, "timer_create"},
{108, "timer_gettime"},
{109, "timer_getoverrun"},
{110, "timer_settime"},
{111, "timer_delete"},
{112, "clock_settime"},
{113, "clock_gettime"},
{114, "clock_getres"},
{115, "clock_nanosleep"},
{116, "syslog"},
{117, "ptrace"},
{118, "sched_setparam"},
{119, "sched_setscheduler"},
{120, "sched_getscheduler"},
{121, "sched_getparam"},
{122, "sched_setaffinity"},
{123, "sched_getaffinity"},
{124, "sched_yield"},
{125, "sched_get_priority_max"},
{126, "sched_get_priority_min"},
{127, "scheD_rr_get_interval"},
{128, "restart_syscall"},
{129, "kill"},
{130, "tkill"},
{131, "tgkill"},
{132, "sigaltstack"},
{133, "rt_sigsuspend"},
{134, "rt_sigaction"},
{135, "rt_sigprocmask"},
{136, "rt_sigpending"},
{137, "rt_sigtimedwait"},
{138, "rt_sigqueueinfo"},
{139, "rt_sigreturn"},
{140, "setpriority"},
{141, "getpriority"},
{142, "reboot"},
{143, "setregid"},
{144, "setgid"},
{145, "setreuid"},
{146, "setuid"},
{147, "setresuid"},
{148, "getresuid"},
{149, "getresgid"},
{150, "getresgid"},
{151, "setfsuid"},
{152, "setfsgid"},
{153, "times"},
{154, "setpgid"},
{155, "getpgid"},
{156, "getsid"},
{157, "setsid"},
{158, "getgroups"},
{159, "setgroups"},
{160, "uname"},
{161, "sethostname"},
{162, "setdomainname"},
{163, "getrlimit"},
{164, "setrlimit"},
{165, "getrusage"},
{166, "umask"},
{167, "prctl"},
{168, "getcpu"},
{169, "gettimeofday"},
{170, "settimeofday"},
{171, "adjtimex"},
{172, "getpid"},
{173, "getppid"},
{174, "getuid" },
{175, "geteuid"},
{176, "getgid" },
{177, "getegid"},
{178, "gettid" },
{179, "sysinfo"},
{180, "mq_open"},
{181, "mq_unlink"},
{182, "mq_timedsend"},
{183, "mq_timedrecieve"},
{184, "mq_notify"},
{185, "mq_getsetattr"},
{186, "msgget"},
{187, "msgctl"},
{188, "msgrcv"},
{189, "msgsnd"},
{190, "semget"},
{191, "semctl"},
{192, "semtimedop"},
{193, "semop"},
{194, "shmget"},
{195, "shmctl"},
{196, "shmat"},
{197, "shmdt"},
{198, "socket"},
{199, "socketpair"},
{200, "bind"},
{201, "listen"},
{202, "accept"},
{203, "connect"},
{204, "getsockname"},
{205, "getpeername"},
{206, "sendo"},
{207, "recvfrom"},
{208, "setsockopt"},
{209, "getsockopt"},
{210, "shutdown"},
{211, "sendmsg"},
{212, "recvmsg"},
{213, "readahead"},
{214, "brk"},
{215, "munmap"},
{216, "mremap"},
{217, "add_key"},
{218, "request_key"},
{219, "keyctl"},
{220, "clone"},
{221, "execve"},
{222, "mmap"},
{223, "fadvise64"},
{224, "swapon"},
{225, "swapoff"},
{226, "mprotect"},
{227, "msync"},
{228, "mlock"},
{229, "munlock"},
{230, "mlockall"},
{231, "munlockall"},
{232, "mincore"},
{233, "madvise"},
{234, "remap_file_pages"},
{235, "mbind"},
{236, "get_mempolicy"},
{237, "set_mempolicy"},
{238, "migrate_pages"},
{239, "move_pages"},
{240, "tgsigqueueinfo"},
{241, "perf_event_open"},
{242, "accept4"},
{243, "recvmmsg"},
{260, "wait4"},
{261, "prlimit64"},
{262, "fanotify_init"},
{263, "fanotify_mark"},
{264, "name_to_handle_at"},
{265, "open_by_handle_at"},
{266, "clock_adjtime"},
{267, "syncfs"},
{268, "setns"},
{269, "sendmmsg"},
{270, "process_vm_ready"},
{271, "process_vm_writev"},
{272, "kcmp"},
{273, "finit_module"},
{274, "sched_setattr"},
{275, "sched_getattr"},
{276, "renameat2"},
{277, "seccomp"},
{278, "getrandom"},
{279, "memfd_create"},
{280, "bpf"},
{281, "execveat"},
{282, "userfaultid"},
{283, "membarrier"},
{284, "mlock2"},
{285, "copy_file_range"},
{286, "preadv2"},
{287, "pwritev2"},
{435, "clone3"},
{1024, "open"},
{1025, "link"},
{1026, "unlink"},
{1027, "mknod"},
{1028, "chmod"},
{1029, "chown"},
{1030, "mkdir"},
{1031, "rmdir"},
{1032, "lchown"},
{1033, "access"},
{1034, "rename"},
{1035, "readlink"},
{1036, "symlink"},
{1037, "utimes"},
{1038, "stat"},
{1039, "lstat"},
{1040, "pipe"},
{1041, "dup2"},
{1042, "epoll_create"},
{1043, "inotifiy_init"},
{1044, "eventfd"},
{1045, "signalfd"},
{1046, "sendfile"},
{1047, "ftruncate"},
{1048, "truncate"},
{1049, "stat"},
{1050, "lstat"},
{1051, "fstat"},
{1052, "fcntl" },
{1053, "fadvise64"},
{1054, "newfstatat"},
{1055, "fstatfs"},
{1056, "statfs"},
{1057, "lseek"},
{1058, "mmap"},
{1059, "alarm"},