Open
Conversation
Fixed line spacing and long lines
1. Fixed trailing whitespace. 2. Added sign off. Signed-off-by: Momen Kadry <kadry.momen6@proton.me>
I switched to CONFIG_HAVE_PAGING when testing and forgot reverting Signed-off-by: Momen Kadry <kadry.momen6@proton.me>
Other changes I forgot to revert in sysinfo.c Signed-off-by: Momen Kadry <kadry.momen6@proton.me>
Used sizeof instead of strlen to avoid possibility of overflow Signed-off-by: Momen Kadry <kadry.momen6@proton.me>
Replaced pointer name with char array so we can use sizeof Signed-off-by: Momen Kadry <kadry.momen6@proton.me>
Replaced pointer name with char array so we can use sizeof Signed-off-by: Momen Kadry <kadry.momen6@proton.me>
…-poc Merged Signed-off-by: Momen Kadry <kadry.momen6@proton.me>
Added unlikely() attribute to rare cases in checks in sysinfo.c Signed-off-by: Momen Kadry <kadry.momen6@proton.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
posix-sysinfolibrarysysinfo()sysinfo_no_infosysinfo_no_pagingsysinfo_with_pagingtotal_memory = __UL_MAX, verifiesmem_unit,totalram,freeramsc_nprocessors_onln_SC_NPROCESSORS_ONLN→ 1sc_pagesize_SC_PAGESIZE→__PAGE_SIZEsc_phys_pages_SC_PHYS_PAGES→total_memory / PAGE_SIZEsc_avphys_pages_SC_AVPHYS_PAGES→free_memory / PAGE_SIZEsc_open_max_SC_OPEN_MAX→MAXFDSor 0sc_getpw_r_size_max_SC_GETPW_R_SIZE_MAX→ -1 or 0sc_unkown_name__PAGE_SIZEuname()uname_null_bufuname_valid_bufsethostname()sethostname_null_namesethostname_too_long_namesethostname_valid_nameuname(), restoresgethostname_valid_casegethostname_buf_too_longerrno == ENAMETOOLONGgetcpu()getcpu_validcpu&nodenon-NULL → set to 0getcpu_null_argsgetcpu_partialcpunon-NULL → set to 0AI usage note: I used AI mainly to understand existing code and navigate the codebase, and when I finished writing and reviewing the tests I asked for a coverage analysis to make sure nothing was missed and discussed findings with it but nothing was written without understanding it first.
Related Work
N/A
PR Checklist
checkpatch.ukon your commit series before opening this PR;