this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add ext/fanotify.c into libsystem_kernel for FSEvents rework

+135
+1
src/kernel/emulation/linux/CMakeLists.txt
··· 265 265 ext/futex.c 266 266 ext/mremap.c 267 267 ext/file_handle.c 268 + ext/fanotify.c 268 269 bsdthread/bsdthread_register.c 269 270 bsdthread/bsdthread_create.c 270 271 bsdthread/bsdthread_terminate.c
+47
src/kernel/emulation/linux/ext/fanotify.c
··· 1 + #include "fanotify.h" 2 + #include "../errno.h" 3 + #include "../vchroot_expand.h" 4 + #include "../bsdthread/per_thread_wd.h" 5 + #include "../../../../../platform-include/sys/errno.h" 6 + #include <linux-syscalls/linux.h> 7 + 8 + extern long cerror(int __err); 9 + 10 + int fanotify_init(unsigned flags, unsigned event_f_flags) 11 + { 12 + int rv = LINUX_SYSCALL(__NR_fanotify_init, flags, event_f_flags); 13 + if (rv < 0) 14 + { 15 + cerror(errno_linux_to_bsd(-rv)); 16 + return -1; 17 + } 18 + return rv; 19 + } 20 + 21 + int fanotify_mark(int fanotify_fd, unsigned flags, unsigned long long mask, int dfd, const char *pathname) 22 + { 23 + struct vchroot_expand_args vc; 24 + 25 + if (!pathname) 26 + return -EFAULT; 27 + 28 + vc.flags = 0; 29 + vc.dfd = dfd; 30 + 31 + strcpy(vc.path, pathname); 32 + int rv = vchroot_expand(&vc); 33 + 34 + if (rv < 0) 35 + { 36 + cerror(errno_linux_to_bsd(-rv)); 37 + return -1; 38 + } 39 + 40 + rv = LINUX_SYSCALL(__NR_fanotify_mark, fanotify_fd, flags, mask, dfd, vc.path); 41 + if (rv < 0) 42 + { 43 + cerror(errno_linux_to_bsd(-rv)); 44 + return -1; 45 + } 46 + return rv; 47 + }
+20
src/kernel/emulation/linux/ext/fanotify.h
··· 1 + #ifndef _EXT_FANOTIFY_H 2 + #define _EXT_FANOTIFY_H 3 + #include "../base.h" 4 + 5 + #ifdef __cplusplus 6 + extern "C" { 7 + #endif 8 + 9 + VISIBLE 10 + int fanotify_init(unsigned flags, unsigned event_f_flags); 11 + 12 + VISIBLE 13 + int fanotify_mark(int fanotify_fd, unsigned flags, unsigned long long mask, int dfd, const char *pathname); 14 + 15 + 16 + #ifdef __cplusplus 17 + } 18 + #endif 19 + 20 + #endif
+49
src/kernel/emulation/linux/linux-syscalls/linux-x86.h
··· 377 377 #define __NR_copy_file_range 377 378 378 #define __NR_preadv2 378 379 379 #define __NR_pwritev2 379 380 + #define __NR_pkey_mprotect 380 381 + #define __NR_pkey_alloc 381 382 + #define __NR_pkey_free 382 383 + #define __NR_statx 383 384 + #define __NR_arch_prctl 384 385 + #define __NR_io_pgetevents 385 386 + #define __NR_rseq 386 387 + #define __NR_semget 393 388 + #define __NR_semctl 394 389 + #define __NR_shmget 395 390 + #define __NR_shmctl 396 391 + #define __NR_shmat 397 392 + #define __NR_shmdt 398 393 + #define __NR_msgget 399 394 + #define __NR_msgsnd 400 395 + #define __NR_msgrcv 401 396 + #define __NR_msgctl 402 397 + #define __NR_clock_gettime64 403 398 + #define __NR_clock_settime64 404 399 + #define __NR_clock_adjtime64 405 400 + #define __NR_clock_getres_time64 406 401 + #define __NR_clock_nanosleep_time64 407 402 + #define __NR_timer_gettime64 408 403 + #define __NR_timer_settime64 409 404 + #define __NR_timerfd_gettime64 410 405 + #define __NR_timerfd_settime64 411 406 + #define __NR_utimensat_time64 412 407 + #define __NR_pselect6_time64 413 408 + #define __NR_ppoll_time64 414 409 + #define __NR_io_pgetevents_time64 416 410 + #define __NR_recvmmsg_time64 417 411 + #define __NR_mq_timedsend_time64 418 412 + #define __NR_mq_timedreceive_time64 419 413 + #define __NR_semtimedop_time64 420 414 + #define __NR_rt_sigtimedwait_time64 421 415 + #define __NR_futex_time64 422 416 + #define __NR_sched_rr_get_interval_time64 423 417 + #define __NR_pidfd_send_signal 424 418 + #define __NR_io_uring_setup 425 419 + #define __NR_io_uring_enter 426 420 + #define __NR_io_uring_register 427 421 + #define __NR_open_tree 428 422 + #define __NR_move_mount 429 423 + #define __NR_fsopen 430 424 + #define __NR_fsconfig 431 425 + #define __NR_fsmount 432 426 + #define __NR_fspick 433 427 + #define __NR_pidfd_open 434 428 + #define __NR_clone3 435 380 429 381 430 #endif /* _ASM_X86_UNISTD_32_H */
+18
src/kernel/emulation/linux/linux-syscalls/linux-x86_64.h
··· 330 330 #define __NR_copy_file_range 326 331 331 #define __NR_preadv2 327 332 332 #define __NR_pwritev2 328 333 + #define __NR_pkey_mprotect 329 334 + #define __NR_pkey_alloc 330 335 + #define __NR_pkey_free 331 336 + #define __NR_statx 332 337 + #define __NR_io_pgetevents 333 338 + #define __NR_rseq 334 339 + #define __NR_pidfd_send_signal 424 340 + #define __NR_io_uring_setup 425 341 + #define __NR_io_uring_enter 426 342 + #define __NR_io_uring_register 427 343 + #define __NR_open_tree 428 344 + #define __NR_move_mount 429 345 + #define __NR_fsopen 430 346 + #define __NR_fsconfig 431 347 + #define __NR_fsmount 432 348 + #define __NR_fspick 433 349 + #define __NR_pidfd_open 434 350 + #define __NR_clone3 435 333 351 334 352 #endif /* _ASM_X86_UNISTD_64_H */