make exported headers use strict posix types
authorArnd Bergmann <arnd@arndb.de>
Wed, 25 Feb 2009 23:51:39 +0000 (00:51 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 26 Mar 2009 17:14:14 +0000 (18:14 +0100)
A number of standard posix types are used in exported headers, which
is not allowed if __STRICT_KERNEL_NAMES is defined. In order to
get rid of the non-__STRICT_KERNEL_NAMES part and to make sane headers
the default, we have to change them all to safe types.

There are also still some leftovers in reiserfs_fs.h, elfcore.h
and coda.h, but these files have not compiled in user space for
a long time.

This leaves out the various integer types ({u_,u,}int{8,16,32,64}_t),
which we take care of separately.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Cc: netdev@vger.kernel.org
Cc: linux-ppp@vger.kernel.org
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
18 files changed:
include/asm-generic/fcntl.h
include/asm-generic/siginfo.h
include/linux/agpgart.h
include/linux/cn_proc.h
include/linux/cyclades.h
include/linux/dvb/video.h
include/linux/if_pppol2tp.h
include/linux/mroute6.h
include/linux/netfilter_ipv4/ipt_owner.h
include/linux/netfilter_ipv6/ip6t_owner.h
include/linux/ppp_defs.h
include/linux/suspend_ioctls.h
include/linux/time.h
include/linux/times.h
include/linux/utime.h
include/linux/xfrm.h
include/mtd/mtd-abi.h
include/sound/asound.h

index b8477414c5c85858de58d6489673da501f93d7bf..4d3e48373e74eee4ce2881bc56442c7ef59409c3 100644 (file)
 struct flock {
        short   l_type;
        short   l_whence;
-       off_t   l_start;
-       off_t   l_len;
-       pid_t   l_pid;
+       __kernel_off_t  l_start;
+       __kernel_off_t  l_len;
+       __kernel_pid_t  l_pid;
        __ARCH_FLOCK_PAD
 };
 #endif
@@ -140,9 +140,9 @@ struct flock {
 struct flock64 {
        short  l_type;
        short  l_whence;
-       loff_t l_start;
-       loff_t l_len;
-       pid_t  l_pid;
+       __kernel_loff_t l_start;
+       __kernel_loff_t l_len;
+       __kernel_pid_t  l_pid;
        __ARCH_FLOCK64_PAD
 };
 #endif
index 969570167e9ef84e528d373ca88746c87acedfb9..35752dadd6dfb5472d6dbf3edead6e1e75ba6a96 100644 (file)
@@ -23,7 +23,7 @@ typedef union sigval {
 #endif
 
 #ifndef __ARCH_SI_UID_T
-#define __ARCH_SI_UID_T        uid_t
+#define __ARCH_SI_UID_T        __kernel_uid32_t
 #endif
 
 /*
@@ -47,13 +47,13 @@ typedef struct siginfo {
 
                /* kill() */
                struct {
-                       pid_t _pid;             /* sender's pid */
+                       __kernel_pid_t _pid;    /* sender's pid */
                        __ARCH_SI_UID_T _uid;   /* sender's uid */
                } _kill;
 
                /* POSIX.1b timers */
                struct {
-                       timer_t _tid;           /* timer id */
+                       __kernel_timer_t _tid;  /* timer id */
                        int _overrun;           /* overrun count */
                        char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)];
                        sigval_t _sigval;       /* same as below */
@@ -62,18 +62,18 @@ typedef struct siginfo {
 
                /* POSIX.1b signals */
                struct {
-                       pid_t _pid;             /* sender's pid */
+                       __kernel_pid_t _pid;    /* sender's pid */
                        __ARCH_SI_UID_T _uid;   /* sender's uid */
                        sigval_t _sigval;
                } _rt;
 
                /* SIGCHLD */
                struct {
-                       pid_t _pid;             /* which child */
+                       __kernel_pid_t _pid;    /* which child */
                        __ARCH_SI_UID_T _uid;   /* sender's uid */
                        int _status;            /* exit code */
-                       clock_t _utime;
-                       clock_t _stime;
+                       __kernel_clock_t _utime;
+                       __kernel_clock_t _stime;
                } _sigchld;
 
                /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
index 110c600c885faab66310d67736c631f381028568..f6778eceb8f4058bbc932d9ead806968e2a27b6e 100644 (file)
@@ -77,20 +77,20 @@ typedef struct _agp_setup {
  * The "prot" down below needs still a "sleep" flag somehow ...
  */
 typedef struct _agp_segment {
-       off_t pg_start;         /* starting page to populate    */
-       size_t pg_count;        /* number of pages              */
-       int prot;               /* prot flags for mmap          */
+       __kernel_off_t pg_start;        /* starting page to populate    */
+       __kernel_size_t pg_count;       /* number of pages              */
+       int prot;                       /* prot flags for mmap          */
 } agp_segment;
 
 typedef struct _agp_region {
-       pid_t pid;              /* pid of process               */
-       size_t seg_count;       /* number of segments           */
+       __kernel_pid_t pid;             /* pid of process       */
+       __kernel_size_t seg_count;      /* number of segments   */
        struct _agp_segment *seg_list;
 } agp_region;
 
 typedef struct _agp_allocate {
        int key;                /* tag of allocation            */
-       size_t pg_count;        /* number of pages              */
+       __kernel_size_t pg_count;/* number of pages             */
        __u32 type;             /* 0 == normal, other devspec   */
        __u32 physical;         /* device specific (some devices  
                                 * need a phys address of the     
@@ -100,7 +100,7 @@ typedef struct _agp_allocate {
 
 typedef struct _agp_bind {
        int key;                /* tag of allocation            */
-       off_t pg_start;         /* starting page to populate    */
+       __kernel_off_t pg_start;/* starting page to populate    */
 } agp_bind;
 
 typedef struct _agp_unbind {
index 1c86d65bc4b9aaf8aa9955bb283fd0670a05bf39..b8125b2eb665744feb23862ade25b7095903e80f 100644 (file)
@@ -65,20 +65,20 @@ struct proc_event {
                } ack;
 
                struct fork_proc_event {
-                       pid_t parent_pid;
-                       pid_t parent_tgid;
-                       pid_t child_pid;
-                       pid_t child_tgid;
+                       __kernel_pid_t parent_pid;
+                       __kernel_pid_t parent_tgid;
+                       __kernel_pid_t child_pid;
+                       __kernel_pid_t child_tgid;
                } fork;
 
                struct exec_proc_event {
-                       pid_t process_pid;
-                       pid_t process_tgid;
+                       __kernel_pid_t process_pid;
+                       __kernel_pid_t process_tgid;
                } exec;
 
                struct id_proc_event {
-                       pid_t process_pid;
-                       pid_t process_tgid;
+                       __kernel_pid_t process_pid;
+                       __kernel_pid_t process_tgid;
                        union {
                                __u32 ruid; /* task uid */
                                __u32 rgid; /* task gid */
@@ -90,8 +90,8 @@ struct proc_event {
                } id;
 
                struct exit_proc_event {
-                       pid_t process_pid;
-                       pid_t process_tgid;
+                       __kernel_pid_t process_pid;
+                       __kernel_pid_t process_tgid;
                        __u32 exit_code, exit_signal;
                } exit;
        } event_data;
index d06fbf286346fdd65eb3e84451866a7c8c84c7f8..788850ba4e7577def670ea0fba81b14ba0a932a0 100644 (file)
@@ -82,9 +82,9 @@ struct cyclades_monitor {
  * open)
  */
 struct cyclades_idle_stats {
-    time_t        in_use;      /* Time device has been in use (secs) */
-    time_t        recv_idle;   /* Time since last char received (secs) */
-    time_t        xmit_idle;   /* Time since last char transmitted (secs) */
+    __kernel_time_t in_use;    /* Time device has been in use (secs) */
+    __kernel_time_t recv_idle; /* Time since last char received (secs) */
+    __kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */
     unsigned long  recv_bytes; /* Bytes received */
     unsigned long  xmit_bytes; /* Bytes transmitted */
     unsigned long  overruns;   /* Input overruns */
index bd49c3ebf916daef78fd00eb8a600619f162100d..ee5d2df2d78dab421620ec31de9394488a0912df 100644 (file)
@@ -137,7 +137,7 @@ struct video_event {
 #define VIDEO_EVENT_FRAME_RATE_CHANGED 2
 #define VIDEO_EVENT_DECODER_STOPPED    3
 #define VIDEO_EVENT_VSYNC              4
-       time_t timestamp;
+       __kernel_time_t timestamp;
        union {
                video_size_t size;
                unsigned int frame_rate;        /* in frames per 1000sec */
index c7a66882b6d0865cb697b981591356335759247a..3a14b088c8ecf26faa996cc4815dd104ca94e7bd 100644 (file)
@@ -26,7 +26,7 @@
  */
 struct pppol2tp_addr
 {
-       pid_t   pid;                    /* pid that owns the fd.
+       __kernel_pid_t  pid;            /* pid that owns the fd.
                                         * 0 => current */
        int     fd;                     /* FD of UDP socket to use */
 
index 5375faca1f72db1134d67d6c8feaedb0e18948ca..43dc97e32183b3f7ac2f444b65966bb62e6140e1 100644 (file)
@@ -65,7 +65,7 @@ struct mif6ctl {
        mifi_t  mif6c_mifi;             /* Index of MIF */
        unsigned char mif6c_flags;      /* MIFF_ flags */
        unsigned char vifc_threshold;   /* ttl limit */
-       u_short  mif6c_pifi;            /* the index of the physical IF */
+       __u16    mif6c_pifi;            /* the index of the physical IF */
        unsigned int vifc_rate_limit;   /* Rate limiter values (NI) */
 };
 
index 92f4bdac54efabfa0e8728c986e170577dbf98aa..a78445be99921a832a1b648d61e7d2bcd555f803 100644 (file)
@@ -9,10 +9,10 @@
 #define IPT_OWNER_COMM 0x10
 
 struct ipt_owner_info {
-    uid_t uid;
-    gid_t gid;
-    pid_t pid;
-    pid_t sid;
+    __kernel_uid32_t uid;
+    __kernel_gid32_t gid;
+    __kernel_pid_t pid;
+    __kernel_pid_t sid;
     char comm[16];
     u_int8_t match, invert;    /* flags */
 };
index 19937da3d1014c97496066eb186f23ead0ff7983..ec5cc7a38c4238917184dbc7c4b917e9b310a2f2 100644 (file)
@@ -8,10 +8,10 @@
 #define IP6T_OWNER_SID 0x08
 
 struct ip6t_owner_info {
-    uid_t uid;
-    gid_t gid;
-    pid_t pid;
-    pid_t sid;
+    __kernel_uid32_t uid;
+    __kernel_gid32_t gid;
+    __kernel_pid_t pid;
+    __kernel_pid_t sid;
     u_int8_t match, invert;    /* flags */
 };
 
index 1c866bda2018a367b822e62620dc8bed246f6205..0f93ed6b4a8823567dbfd6f597ea840040ebb6ed 100644 (file)
@@ -177,8 +177,8 @@ struct ppp_comp_stats {
  * the last NP packet was sent or received.
  */
 struct ppp_idle {
-    time_t xmit_idle;          /* time since last NP packet sent */
-    time_t recv_idle;          /* time since last NP packet received */
+    __kernel_time_t xmit_idle; /* time since last NP packet sent */
+    __kernel_time_t recv_idle; /* time since last NP packet received */
 };
 
 #endif /* _PPP_DEFS_H_ */
index 2c6faec96bde82d3f7d1d837db5646f7e0e9e404..0b30382984fe72da504a1b031ffd09db067a484b 100644 (file)
@@ -1,14 +1,15 @@
 #ifndef _LINUX_SUSPEND_IOCTLS_H
 #define _LINUX_SUSPEND_IOCTLS_H
 
+#include <linux/types.h>
 /*
  * This structure is used to pass the values needed for the identification
  * of the resume swap area from a user space to the kernel via the
  * SNAPSHOT_SET_SWAP_AREA ioctl
  */
 struct resume_swap_area {
-       loff_t offset;
-       u_int32_t dev;
+       __kernel_loff_t offset;
+       __u32 dev;
 } __attribute__((packed));
 
 #define SNAPSHOT_IOC_MAGIC     '3'
@@ -20,13 +21,13 @@ struct resume_swap_area {
 #define SNAPSHOT_S2RAM                 _IO(SNAPSHOT_IOC_MAGIC, 11)
 #define SNAPSHOT_SET_SWAP_AREA         _IOW(SNAPSHOT_IOC_MAGIC, 13, \
                                                        struct resume_swap_area)
-#define SNAPSHOT_GET_IMAGE_SIZE                _IOR(SNAPSHOT_IOC_MAGIC, 14, loff_t)
+#define SNAPSHOT_GET_IMAGE_SIZE                _IOR(SNAPSHOT_IOC_MAGIC, 14, __kernel_loff_t)
 #define SNAPSHOT_PLATFORM_SUPPORT      _IO(SNAPSHOT_IOC_MAGIC, 15)
 #define SNAPSHOT_POWER_OFF             _IO(SNAPSHOT_IOC_MAGIC, 16)
 #define SNAPSHOT_CREATE_IMAGE          _IOW(SNAPSHOT_IOC_MAGIC, 17, int)
 #define SNAPSHOT_PREF_IMAGE_SIZE       _IO(SNAPSHOT_IOC_MAGIC, 18)
-#define SNAPSHOT_AVAIL_SWAP_SIZE       _IOR(SNAPSHOT_IOC_MAGIC, 19, loff_t)
-#define SNAPSHOT_ALLOC_SWAP_PAGE       _IOR(SNAPSHOT_IOC_MAGIC, 20, loff_t)
+#define SNAPSHOT_AVAIL_SWAP_SIZE       _IOR(SNAPSHOT_IOC_MAGIC, 19, __kernel_loff_t)
+#define SNAPSHOT_ALLOC_SWAP_PAGE       _IOR(SNAPSHOT_IOC_MAGIC, 20, __kernel_loff_t)
 #define SNAPSHOT_IOC_MAXNR     20
 
 #endif /* _LINUX_SUSPEND_IOCTLS_H */
index fbbd2a1c92ba29a5ecb36ece87e1f8b88e35f304..242f62499bb7bca6cd6c58fe134e7ffb8e97fa19 100644 (file)
 #ifndef _STRUCT_TIMESPEC
 #define _STRUCT_TIMESPEC
 struct timespec {
-       time_t  tv_sec;         /* seconds */
-       long    tv_nsec;        /* nanoseconds */
+       __kernel_time_t tv_sec;                 /* seconds */
+       long            tv_nsec;                /* nanoseconds */
 };
 #endif
 
 struct timeval {
-       time_t          tv_sec;         /* seconds */
-       suseconds_t     tv_usec;        /* microseconds */
+       __kernel_time_t         tv_sec;         /* seconds */
+       __kernel_suseconds_t    tv_usec;        /* microseconds */
 };
 
 struct timezone {
index e2d3020742a63fc2af7d2eba1186919b198bf372..87b62615cedd171df3ead022010bb28f46951c12 100644 (file)
@@ -4,10 +4,10 @@
 #include <linux/types.h>
 
 struct tms {
-       clock_t tms_utime;
-       clock_t tms_stime;
-       clock_t tms_cutime;
-       clock_t tms_cstime;
+       __kernel_clock_t tms_utime;
+       __kernel_clock_t tms_stime;
+       __kernel_clock_t tms_cutime;
+       __kernel_clock_t tms_cstime;
 };
 
 #endif
index 640be6a1959e8074ad79bce56ef71ecbeb779053..5cdf673afbdb51755a244094a5bbea4c235cf106 100644 (file)
@@ -4,8 +4,8 @@
 #include <linux/types.h>
 
 struct utimbuf {
-       time_t actime;
-       time_t modtime;
+       __kernel_time_t actime;
+       __kernel_time_t modtime;
 };
 
 #endif
index 52f3abd453a1386953963e6765725eb3d60fc025..2d4ec15abaca90f184ff8c64c259187cacbf0b2c 100644 (file)
@@ -58,7 +58,7 @@ struct xfrm_selector
        __u8    prefixlen_s;
        __u8    proto;
        int     ifindex;
-       uid_t   user;
+       __kernel_uid32_t        user;
 };
 
 #define XFRM_INF (~(__u64)0)
index c6c61cd5a254aaa03348924d0f0f864d8bf845e0..fb672013299c151198a3f16709d58d766fc91bc5 100644 (file)
@@ -84,8 +84,8 @@ struct otp_info {
 #define MEMGETREGIONINFO       _IOWR('M', 8, struct region_info_user)
 #define MEMSETOOBSEL           _IOW('M', 9, struct nand_oobinfo)
 #define MEMGETOOBSEL           _IOR('M', 10, struct nand_oobinfo)
-#define MEMGETBADBLOCK         _IOW('M', 11, loff_t)
-#define MEMSETBADBLOCK         _IOW('M', 12, loff_t)
+#define MEMGETBADBLOCK         _IOW('M', 11, __kernel_loff_t)
+#define MEMSETBADBLOCK         _IOW('M', 12, __kernel_loff_t)
 #define OTPSELECT              _IOR('M', 13, int)
 #define OTPGETREGIONCOUNT      _IOW('M', 14, int)
 #define OTPGETREGIONINFO       _IOW('M', 15, struct otp_info)
index 1c02ed1d7c4aab6f49dcb8616437d4d24da25db9..16684c5a608c882645ad53451cb8db22301ac10e 100644 (file)
@@ -385,7 +385,7 @@ struct snd_pcm_sw_params {
 
 struct snd_pcm_channel_info {
        unsigned int channel;
-       off_t offset;                   /* mmap offset */
+       __kernel_off_t offset;          /* mmap offset */
        unsigned int first;             /* offset to first sample in bits */
        unsigned int step;              /* samples distance in bits */
 };
@@ -789,7 +789,7 @@ struct snd_ctl_elem_info {
        snd_ctl_elem_type_t type;       /* R: value type - SNDRV_CTL_ELEM_TYPE_* */
        unsigned int access;            /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */
        unsigned int count;             /* count of values */
-       pid_t owner;                    /* owner's PID of this control */
+       __kernel_pid_t owner;           /* owner's PID of this control */
        union {
                struct {
                        long min;               /* R: minimum value */