mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:47:44 +00:00
Kernel+LibC: Pack SC_setsockopt_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:
parent
9956607283
commit
dcb327a83b
2 changed files with 2 additions and 2 deletions
|
@ -300,10 +300,10 @@ struct SC_getsockopt_params {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SC_setsockopt_params {
|
struct SC_setsockopt_params {
|
||||||
|
const void* value;
|
||||||
int sockfd;
|
int sockfd;
|
||||||
int level;
|
int level;
|
||||||
int option;
|
int option;
|
||||||
const void* value;
|
|
||||||
socklen_t value_size;
|
socklen_t value_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ int getsockopt(int sockfd, int level, int option, void* value, socklen_t* value_
|
||||||
|
|
||||||
int setsockopt(int sockfd, int level, int option, const void* value, socklen_t value_size)
|
int setsockopt(int sockfd, int level, int option, const void* value, socklen_t value_size)
|
||||||
{
|
{
|
||||||
Syscall::SC_setsockopt_params params { sockfd, level, option, value, value_size };
|
Syscall::SC_setsockopt_params params { value, sockfd, level, option, value_size };
|
||||||
int rc = syscall(SC_setsockopt, ¶ms);
|
int rc = syscall(SC_setsockopt, ¶ms);
|
||||||
__RETURN_WITH_ERRNO(rc, rc, -1);
|
__RETURN_WITH_ERRNO(rc, rc, -1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue