mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-15 04:06:52 +00:00

Raw syscall numbers were not platform independent, so replace them with the helpers provided from the syscall.ph perl bits helper. This makes reading the code easier as a nice side effect. As syscall.ph is not an ordinary module and makes problems when it is required by multiple modules we make a own module PVE::Syscall which loads it and allows to export the necessary constants in a sane way. Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 lines
432 B
Perl
23 lines
432 B
Perl
package PVE::Syscall;
|
|
|
|
my %syscalls;
|
|
BEGIN {
|
|
die "syscall.ph can only be required once!\n" if $INC{'syscall.ph'};
|
|
require("syscall.ph");
|
|
%syscalls = (
|
|
unshare => &SYS_unshare,
|
|
setns => &SYS_setns,
|
|
syncfs => &SYS_syncfs,
|
|
openat => &SYS_openat,
|
|
close => &SYS_close,
|
|
mkdirat => &SYS_mkdirat,
|
|
faccessat => &SYS_faccessat,
|
|
);
|
|
};
|
|
|
|
use constant \%syscalls;
|
|
|
|
use base 'Exporter';
|
|
|
|
our @EXPORT_OK = keys(%syscalls);
|