1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

Kernel+LibC: Pack SC_accept4_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:41:01 -07:00 committed by Andreas Kling
parent b45ca5d56e
commit 9956607283
2 changed files with 2 additions and 2 deletions

View file

@ -285,9 +285,9 @@ struct SC_clock_nanosleep_params {
}; };
struct SC_accept4_params { struct SC_accept4_params {
int sockfd;
sockaddr* addr; sockaddr* addr;
socklen_t* addrlen; socklen_t* addrlen;
int sockfd;
int flags; int flags;
}; };

View file

@ -39,7 +39,7 @@ int accept(int sockfd, sockaddr* addr, socklen_t* addrlen)
int accept4(int sockfd, sockaddr* addr, socklen_t* addrlen, int flags) int accept4(int sockfd, sockaddr* addr, socklen_t* addrlen, int flags)
{ {
Syscall::SC_accept4_params params { sockfd, addr, addrlen, flags }; Syscall::SC_accept4_params params { addr, addrlen, sockfd, flags };
int rc = syscall(SC_accept4, &params); int rc = syscall(SC_accept4, &params);
__RETURN_WITH_ERRNO(rc, rc, -1); __RETURN_WITH_ERRNO(rc, rc, -1);
} }