Bug #1390

Use id_t type for {get,set}priority()

Added by Anonymous over 5 years ago. Updated 3 months ago.

Status:In ProgressStart date:
Priority:NormalDue date:
Assignee:tuxillo% Done:

0%

Category:Other
Target version:3.9.x

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

History

#1 Updated by Anonymous about 5 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

#2 Updated by dillon about 5 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

#3 Updated by alexh over 4 years ago

anything new about this?

#4 Updated by tuxillo over 4 years ago

Hi,

I was wondering ... where's the patch?

Cheers,
Antonio Huete

#5 Updated by tuxillo over 4 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.

#6 Updated by tuxillo over 4 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

#7 Updated by tuxillo over 1 year ago

  • Status changed from New to Feedback

Stathis,

Any opinion on this?

Cheers,
Antonio Huete

#8 Updated by pavalos over 1 year ago

Standards say it should be an id_t, so I'd say this is a valid issue.

#9 Updated by tuxillo 6 months ago

  • Description updated (diff)
  • Category set to Other
  • Assignee changed from Anonymous to tuxillo
  • Target version set to 3.8.0

#10 Updated by tuxillo 3 months 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

#11 Updated by tuxillo 3 months ago

  • Target version changed from 3.8.0 to 3.9.x

Also available in: Atom PDF