Bug #1390
openUse id_t type for {get,set}priority()
Description
Salute!
Both get- and set-priority() functions take a `who' argument that may refer to
process ID, group ID or a user ID depending on the situation. The id_t type,
which is already available in our src tree, guarantees that it's large enough to
hold pid, gid, etc.
The attached patch replaces `int' with `id_t' wherever appropriate. I have done
a build{world,kernel} and install{world,kernel} and I don't broke anything. Plus
some test cases I have, continue to pass.
If anyone objects to this patch speak now or forever hold your peace!
Cheers,
Stathis
Updated by Anonymous over 15 years ago
The attached patch replaces `int' with `id_t' wherever appropriate. I have done
a build{world,kernel} and install{world,kernel} and I don't broke anything. Plus
some test cases I have, continue to pass.
I withdraw the patch for the moment and I'll provide a better one soon.
Cheers,
Stathis
Updated by dillon over 15 years ago
:The attached patch replaces `int' with `id_t' wherever appropriate. I have =
:done
:a build{world,kernel} and install{world,kernel} and I don't broke anything.=
: Plus
:some test cases I have, continue to pass.
:
:If anyone objects to this patch speak now or forever hold your peace!
:
:Cheers,
:Stathis
I dunno. id_t is declared in GCC's sys-types.h. I don't see it in
any of our own header files. pid_t might be the better choice there,
since pid_t is also used for things like setpgrp() and setpgid().
-Matt
Updated by tuxillo over 14 years ago
Hi,
I was wondering ... where's the patch?
Cheers,
Antonio Huete
Updated by tuxillo over 14 years ago
Okay, I see it at the bottom. I was expecting to have it in the top part just
like others.
Sorry for the noise.
Updated by tuxillo over 14 years ago
id_t is defined in our sys/types.h as described in posix (look for types.h in
http://www.opengroup.org/onlinepubs/9699919799/)
It says:
id_t
Used as a general identifier; can be used to contain at least a pid_t,
uid_t, or gid_t.
So from my understanding I think it is okay to use id_t.
Regards,
Antonio Huete
Updated by tuxillo almost 12 years ago
- Status changed from New to Feedback
Stathis,
Any opinion on this?
Cheers,
Antonio Huete
Updated by pavalos almost 12 years ago
Standards say it should be an id_t, so I'd say this is a valid issue.
Updated by tuxillo almost 11 years ago
- Description updated (diff)
- Category set to Other
- Assignee changed from Anonymous to tuxillo
- Target version set to 3.8
Updated by tuxillo over 10 years ago
- Status changed from Feedback to In Progress
Hi,
As far as I could check NetBSD and OpenBSD use id_t for 'who' in their args struct. See here:
http://grok.qc.to/source/xref/netbsd/sys/sys/syscallargs.h#617
http://grok.qc.to/source/xref/openbsd/sys/sys/syscallargs.h#480
I'll change it to id_t for us too in master after the release.
Cheers,
Antonio Huete