Red Hat Bugzilla – Bug 198615
types.h does not set gid_t/uid_t as defined
Last modified: 2007-11-30 17:11:37 EST
Description of problem:
Some packages using Linux kernel headers do not compile
Version-Release number of selected component (if applicable):
a normal linux/types.h defines things this way (stock vanilla kernel, and other
typedef __kernel_uid_t uid_t;
typedef __kernel_gid_t gid_t;
#endif /* __KERNEL__ */
So that uid_t/gid_t are marked as defined.
However, the glibc-kernheaders package do not tell that they are defined (with
When you need to include both <linux/types.h> and <unistd.h>, compilation will
fail because the type gets redefined.
If you read the /usr/include/unistd.h file you will find this:
/* The Single Unix specification says that some more types are
available here. */
# ifndef __gid_t_defined
typedef __gid_t gid_t;
# define __gid_t_defined
# ifndef __uid_t_defined
typedef __uid_t uid_t;
# define __uid_t_defined
I did not find why this was changed in Fedora.
Thank you for reading.
External bug reference: http://bugtracker.rsbac.org/view.php?id=76
(In reply to comment #0)
> Description of problem:
> Some packages using Linux kernel headers do not compile
> Version-Release number of selected component (if applicable):
> a normal linux/types.h defines things this way (stock vanilla kernel, and
> other Linux distributions):
> #ifdef __KERNEL__
> typedef __kernel_uid_t uid_t;
> #define __uid_t_defined
> typedef __kernel_gid_t gid_t;
> #define __gid_t_defined
> #endif /* __KERNEL__ */
That doesn't match the upstream kernel. See
> When you need to include both <linux/types.h> and <unistd.h>, compilation will
> fail because the type gets redefined.
Including kernel headers from userspace is generally broken. Please show an
example to justify your usage of <linux/types.h>. Shouldn't <asm/types.h>
generally be sufficient?
> I did not find why this was changed in Fedora.
> Thank you for reading.
Fedora's headers match the upstream kernel in this.
> External bug reference: http://bugtracker.rsbac.org/view.php?id=76
Seems to give me a login page.
Ok, you're right, linux/ should generally not be included.
Also, it seems to have changed (most distributions still have the #define
__gid.. in linux/types.h too)
probably until packages and so on update.
i switched to asm/types.h + sys/types.h which define the same types anyway.
(asm/types.h wasnt then sufficient)
about the other bugtracker: yes it seems not to allow anonymous access. (beeh)
you may close this bug as invalid, thanks for the quick reply :)
The upstream kernel (as of 2.6.18-rc1) now has a 'make headers_install' target
which exports sanitised kernel headers. So Fedora doesn't have its own version
of anything now; it's all just taken from upstream. And hopefully the other
distributions will catch up with that shortly, and there'll be _no_ more
inconsistency between distributions.