1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 15:17:45 +00:00

Kernel+LibC: Pack SC_stat_params struct tighter

Flagged by pvs-studio, ordering the members from largest to smallest
allows us to save a few bytes in the size of the struct.
This commit is contained in:
Brian Gianforcaro 2021-09-15 23:45:30 -07:00 committed by Andreas Kling
parent be15bd3c86
commit 07b314e843
2 changed files with 2 additions and 2 deletions

View file

@ -450,9 +450,9 @@ struct SC_waitid_params {
}; };
struct SC_stat_params { struct SC_stat_params {
int dirfd;
StringArgument path; StringArgument path;
struct stat* statbuf; struct stat* statbuf;
int dirfd;
int follow_symlinks; int follow_symlinks;
}; };

View file

@ -57,7 +57,7 @@ static int do_stat(int dirfd, const char* path, struct stat* statbuf, bool follo
errno = EFAULT; errno = EFAULT;
return -1; return -1;
} }
Syscall::SC_stat_params params { dirfd, { path, strlen(path) }, statbuf, follow_symlinks }; Syscall::SC_stat_params params { { path, strlen(path) }, statbuf, dirfd, follow_symlinks };
int rc = syscall(SC_stat, &params); int rc = syscall(SC_stat, &params);
__RETURN_WITH_ERRNO(rc, rc, -1); __RETURN_WITH_ERRNO(rc, rc, -1);
} }