[lkml]   [2001]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: uid_t and gid_t vs. __kernel_uid_t and __kernel_gid_t

> I am trying to understand what's the cleanest coding that would allow
> 1) user code to just use uid/gid for interfacing the driver control
> structures
> 2) driver code to read/write the corresponding structure fields with minimum
> awareness of the actual difference between kernel and user uid_t/gid_t
> layout.

Just define a structure like:

struct user-to-kernel {
unsigned int uid;
unsigned int gid;

and copy the header into your user space program. The alignments may
differ between different Linux architectures, but that won't matter.
You aren't going to be running a program compiled on a sparc on an i386

If you are writing a filesystem or sending data over the network directly
via the kernel (without going through the user space program), then you
will need to decide upon a fixed byte order and alignment. (but this
doesn't seem to be the case for you, right?)


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:53    [W:0.025 / U:0.316 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site