lkml.org 
[lkml]   [2009]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][v5][PATCH 8/8]: Define clone_with_pids() syscall
H. Peter Anvin [hpa@zytor.com] wrote:
| On 09/09/2009 05:19 AM, Arnd Bergmann wrote:
| >
| > This is a complex problem. The structure above would need a conversion
| > for the pointer size that you can avoid by using a u64, but that introduces
| > another problem:
| >
| > 2. use a single pointer, with variable length data structures:
| >
| > struct pid_set {
| > int num_pids;
| > pid_t pids[0];
| > };
| >
| > Since pid_t is always an int, you have no problem with padding or
| > incompatible types, but rely on a data structure definition that
| > is not in C89 (not sure about C99).

C90 or C99 below should work. Is it ok to use a data structure that is
not in C89 ?

BTW, would it work if we defined

struct pid_set {
u64 pids;
int num_pids;
}

where ->pids can be still be a pointer ? The data structure would
have the same size on all architectures.

Thanks for the input

Sukadev


\
 
 \ /
  Last update: 2009-09-09 20:01    [W:0.116 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site