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

Re: [Minios-devel] [UNIKRAFT PATCH v2 01/10] errptr.h: include errno.h



Hi.

> The idea was that you can use this mechanism even with your own
> defined error codes.

What I am going to say is orthogonal to the question of including
errno.h. I don't think own defined error codes is a nice thing. Error
numbers really should be standardized, to avoid the nightmare of
multiple conversions from one error system to another.

The standard error codes are well established over the years they exist.
And, I can not remember a situation when the standard errors list was
not enough.  Even if it is the case, there is quite a bit of not used
codes - better just extend it, if somebody wants so badly his own error
codes.

If we are talking about some third party code - I think the probability
that it was developed for running in non-unix OS is close to 0. That
means it either should be using definitions from the standard errno.h or
at least it's own definitions have to be not in conflict with standard
ones. Anyways, uk/errptr.h is in the Kernel scope. We should not mix up
kernel and application level scopes.

- Yuri.

Simon Kuenzer <simon.kuenzer@xxxxxxxxx> writes:

> Hey Costin,
>
> On 23.08.2018 12:59, Costin Lupu wrote:
>> Given that definitions from errptr.h are using together
>> with errno numbers, it would make sense to simply include
>> errno.h in errptr.h.
>> 
>> Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
>> ---
>>   include/uk/errptr.h | 1 +
>>   1 file changed, 1 insertion(+)
>> 
>> diff --git a/include/uk/errptr.h b/include/uk/errptr.h
>> index 5806f73..27aa7d8 100644
>> --- a/include/uk/errptr.h
>> +++ b/include/uk/errptr.h
>> @@ -36,6 +36,7 @@
>>   #ifndef __UK_ERRPTR_H__
>>   #define __UK_ERRPTR_H__
>>   
>> +#include <errno.h>
>>   #include <uk/arch/types.h>
>>   
>>   #ifndef MAXERRNO
>> 
>
> hum, errptr is just a mechanism to return error codes on functions that 
> only return pointers as data type. This header does itself not depend on 
> errno, nothing is used from errno. The idea was that you can use this 
> mechanism even with your own defined error codes. So, I would keep the 
> inclusion of errno.h separate. Just include errno.h on your libraries 
> API when these error codes are used there.
>
> Cheers,
>
> Simon

-- 
Yuri Volchkov
Software Specialist

NEC Europe Ltd
Kurfürsten-Anlage 36
D-69115 Heidelberg

_______________________________________________
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®.