Skip to content

Commit

Permalink
clusterd: Remove i686 and amd64 architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Jan 27, 2025
1 parent 9570162 commit e81378e
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions clusterd/clusterd
Original file line number Diff line number Diff line change
Expand Up @@ -981,36 +981,18 @@ sub udp_rx_amdtardata {
system '/sbin/make-automaps';
}

our ($machine,$SYS_lchown,$SYS_mknod,$lmtime_sub);
our ($machine,$SYS_lchown,$SYS_mknod);
our ($SYS_utimensat,$AT_FDCWD,$UTIME_OMIT,$AT_SYMLINK_NOFOLLOW);

sub lmtime_unsupported {
my ($path,$mtime)=@_;
warn "$path: don't known how to change symlink mtime on target architecture\n";
}
sub lmtime_utimensat {
my ($path,$mtime)=@_;
my $tsa=pack 'qqqq',0,$UTIME_OMIT,$mtime,0;
syscall($SYS_utimensat,$AT_FDCWD,$path,$tsa,$AT_SYMLINK_NOFOLLOW)==0 or return warn "$path: failed to lmtime: $!\n";
}
$lmtime_sub=\&lmtime_unsupported;

chomp($machine=`uname -m`);
if ($machine eq 'i686') {
$SYS_lchown=198; # __NR_lchown32 in /usr/include/asm/unistd.h
$SYS_mknod=14; # __NR_mknod
} elsif ($machine eq 'x86_64') {
if ($machine eq 'x86_64') {
$SYS_lchown=94; # __NR_lchown in /usr/include/asm-x86_64/unistd.h
$SYS_mknod=133; # __NR_mknod

$SYS_utimensat=280; # /usr/include/asm/unistd_64.h
$AT_FDCWD=-100; # /usr/include/fcntl.h
$UTIME_OMIT=(1<<30)-2; # /usr/include/bits/stat.h
$AT_SYMLINK_NOFOLLOW=0x100; # /usr/include/fcntl.h
$lmtime_sub=\&lmtime_utimensat;
} elsif ($machine eq 'amd64') {
$SYS_lchown=254; # SYS_lchown in /usr/include/syscall.h
$SYS_mknod=14; # SYS_mknod
} elsif ($machine eq 'ppc64le') {
$SYS_lchown=16; # __NR_lchown in /usr/include/powerpc64le-linux-gnu/asm/unistd.h
$SYS_mknod=14; # __NR_mknod
Expand All @@ -1019,7 +1001,6 @@ if ($machine eq 'i686') {
$AT_FDCWD=-100; # /usr/include/linux/fcntl.h
$UTIME_OMIT=(1<<30)-2; # /usr/include/powerpc64le-linux-gnu/bits/stat.h
$AT_SYMLINK_NOFOLLOW=0x100; # /usr/include/linux/fcntl.h
$lmtime_sub=\&lmtime_utimensat;
} else {
warn "unknown machine type $machine: symlink ownership can't be set.\n";
warn "unknown machine type $machine: named pipes,character and block devices can't be created\n";
Expand All @@ -1033,8 +1014,8 @@ sub lchown {

sub lmtime {
my ($mtime,$path)=@_;
$lmtime_sub or return;
$lmtime_sub->($path,$mtime);
my $tsa=pack 'qqqq',0,$UTIME_OMIT,$mtime,0;
syscall($SYS_utimensat,$AT_FDCWD,$path,$tsa,$AT_SYMLINK_NOFOLLOW)==0 or return warn "$path: failed to lmtime: $!\n";
}

sub udp_rx_filedata {
Expand Down

0 comments on commit e81378e

Please sign in to comment.