[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH 2/2] lib/uksysinfo: Implement sysconf check for _SC_NPROCESSORS_ONLN



Hi Vlad,

On 6/10/19 2:34 PM, Vlad-Andrei BĂDOIU (78692) wrote:
> The sysconf function should return the number of active processors when
> _SC_NPROCESSORS_ONLN is passed. Since we do not have SMP on Unikraft we 
> return 1
> when _SC_NPROCESSORS_ONLN is passed as argument to the function.
> 
> Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
> ---
>  lib/uksysinfo/sysinfo.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/uksysinfo/sysinfo.c b/lib/uksysinfo/sysinfo.c
> index 4c133493..4988a78f 100644
> --- a/lib/uksysinfo/sysinfo.c
> +++ b/lib/uksysinfo/sysinfo.c
> @@ -34,6 +34,7 @@
>  
>  #include <stddef.h>
>  #include <limits.h>
> +#include <unistd.h>
>  #include <sys/utsname.h>
>  #include <uk/essentials.h>
>  
> @@ -47,8 +48,11 @@ long pathconf(const char *path __unused, int name __unused)
>       return 0;
>  }
>  
> -long sysconf(int name __unused)
> +long sysconf(int name)
>  {
> +     if (name == _SC_NPROCESSORS_ONLN)
> +         return 1;
> +

You have checkpatch warnings here. You still didn't automate this
upstreaming procedure, didn't you?

>       return 0;
>  }
>  
> 

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.