Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

make exported headers use strict posix types

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>

authored by

Arnd Bergmann and committed by
Ingo Molnar
85efde6f 9d50638b

+67 -66
+6 -6
include/asm-generic/fcntl.h
··· 117 117 struct flock { 118 118 short l_type; 119 119 short l_whence; 120 - off_t l_start; 121 - off_t l_len; 122 - pid_t l_pid; 120 + __kernel_off_t l_start; 121 + __kernel_off_t l_len; 122 + __kernel_pid_t l_pid; 123 123 __ARCH_FLOCK_PAD 124 124 }; 125 125 #endif ··· 140 140 struct flock64 { 141 141 short l_type; 142 142 short l_whence; 143 - loff_t l_start; 144 - loff_t l_len; 145 - pid_t l_pid; 143 + __kernel_loff_t l_start; 144 + __kernel_loff_t l_len; 145 + __kernel_pid_t l_pid; 146 146 __ARCH_FLOCK64_PAD 147 147 }; 148 148 #endif
+7 -7
include/asm-generic/siginfo.h
··· 23 23 #endif 24 24 25 25 #ifndef __ARCH_SI_UID_T 26 - #define __ARCH_SI_UID_T uid_t 26 + #define __ARCH_SI_UID_T __kernel_uid32_t 27 27 #endif 28 28 29 29 /* ··· 47 47 48 48 /* kill() */ 49 49 struct { 50 - pid_t _pid; /* sender's pid */ 50 + __kernel_pid_t _pid; /* sender's pid */ 51 51 __ARCH_SI_UID_T _uid; /* sender's uid */ 52 52 } _kill; 53 53 54 54 /* POSIX.1b timers */ 55 55 struct { 56 - timer_t _tid; /* timer id */ 56 + __kernel_timer_t _tid; /* timer id */ 57 57 int _overrun; /* overrun count */ 58 58 char _pad[sizeof( __ARCH_SI_UID_T) - sizeof(int)]; 59 59 sigval_t _sigval; /* same as below */ ··· 62 62 63 63 /* POSIX.1b signals */ 64 64 struct { 65 - pid_t _pid; /* sender's pid */ 65 + __kernel_pid_t _pid; /* sender's pid */ 66 66 __ARCH_SI_UID_T _uid; /* sender's uid */ 67 67 sigval_t _sigval; 68 68 } _rt; 69 69 70 70 /* SIGCHLD */ 71 71 struct { 72 - pid_t _pid; /* which child */ 72 + __kernel_pid_t _pid; /* which child */ 73 73 __ARCH_SI_UID_T _uid; /* sender's uid */ 74 74 int _status; /* exit code */ 75 - clock_t _utime; 76 - clock_t _stime; 75 + __kernel_clock_t _utime; 76 + __kernel_clock_t _stime; 77 77 } _sigchld; 78 78 79 79 /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+7 -7
include/linux/agpgart.h
··· 77 77 * The "prot" down below needs still a "sleep" flag somehow ... 78 78 */ 79 79 typedef struct _agp_segment { 80 - off_t pg_start; /* starting page to populate */ 81 - size_t pg_count; /* number of pages */ 82 - int prot; /* prot flags for mmap */ 80 + __kernel_off_t pg_start; /* starting page to populate */ 81 + __kernel_size_t pg_count; /* number of pages */ 82 + int prot; /* prot flags for mmap */ 83 83 } agp_segment; 84 84 85 85 typedef struct _agp_region { 86 - pid_t pid; /* pid of process */ 87 - size_t seg_count; /* number of segments */ 86 + __kernel_pid_t pid; /* pid of process */ 87 + __kernel_size_t seg_count; /* number of segments */ 88 88 struct _agp_segment *seg_list; 89 89 } agp_region; 90 90 91 91 typedef struct _agp_allocate { 92 92 int key; /* tag of allocation */ 93 - size_t pg_count; /* number of pages */ 93 + __kernel_size_t pg_count;/* number of pages */ 94 94 __u32 type; /* 0 == normal, other devspec */ 95 95 __u32 physical; /* device specific (some devices 96 96 * need a phys address of the ··· 100 100 101 101 typedef struct _agp_bind { 102 102 int key; /* tag of allocation */ 103 - off_t pg_start; /* starting page to populate */ 103 + __kernel_off_t pg_start;/* starting page to populate */ 104 104 } agp_bind; 105 105 106 106 typedef struct _agp_unbind {
+10 -10
include/linux/cn_proc.h
··· 65 65 } ack; 66 66 67 67 struct fork_proc_event { 68 - pid_t parent_pid; 69 - pid_t parent_tgid; 70 - pid_t child_pid; 71 - pid_t child_tgid; 68 + __kernel_pid_t parent_pid; 69 + __kernel_pid_t parent_tgid; 70 + __kernel_pid_t child_pid; 71 + __kernel_pid_t child_tgid; 72 72 } fork; 73 73 74 74 struct exec_proc_event { 75 - pid_t process_pid; 76 - pid_t process_tgid; 75 + __kernel_pid_t process_pid; 76 + __kernel_pid_t process_tgid; 77 77 } exec; 78 78 79 79 struct id_proc_event { 80 - pid_t process_pid; 81 - pid_t process_tgid; 80 + __kernel_pid_t process_pid; 81 + __kernel_pid_t process_tgid; 82 82 union { 83 83 __u32 ruid; /* task uid */ 84 84 __u32 rgid; /* task gid */ ··· 90 90 } id; 91 91 92 92 struct exit_proc_event { 93 - pid_t process_pid; 94 - pid_t process_tgid; 93 + __kernel_pid_t process_pid; 94 + __kernel_pid_t process_tgid; 95 95 __u32 exit_code, exit_signal; 96 96 } exit; 97 97 } event_data;
+3 -3
include/linux/cyclades.h
··· 82 82 * open) 83 83 */ 84 84 struct cyclades_idle_stats { 85 - time_t in_use; /* Time device has been in use (secs) */ 86 - time_t recv_idle; /* Time since last char received (secs) */ 87 - time_t xmit_idle; /* Time since last char transmitted (secs) */ 85 + __kernel_time_t in_use; /* Time device has been in use (secs) */ 86 + __kernel_time_t recv_idle; /* Time since last char received (secs) */ 87 + __kernel_time_t xmit_idle; /* Time since last char transmitted (secs) */ 88 88 unsigned long recv_bytes; /* Bytes received */ 89 89 unsigned long xmit_bytes; /* Bytes transmitted */ 90 90 unsigned long overruns; /* Input overruns */
+1 -1
include/linux/dvb/video.h
··· 137 137 #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 138 138 #define VIDEO_EVENT_DECODER_STOPPED 3 139 139 #define VIDEO_EVENT_VSYNC 4 140 - time_t timestamp; 140 + __kernel_time_t timestamp; 141 141 union { 142 142 video_size_t size; 143 143 unsigned int frame_rate; /* in frames per 1000sec */
+1 -1
include/linux/if_pppol2tp.h
··· 26 26 */ 27 27 struct pppol2tp_addr 28 28 { 29 - pid_t pid; /* pid that owns the fd. 29 + __kernel_pid_t pid; /* pid that owns the fd. 30 30 * 0 => current */ 31 31 int fd; /* FD of UDP socket to use */ 32 32
+1 -1
include/linux/mroute6.h
··· 65 65 mifi_t mif6c_mifi; /* Index of MIF */ 66 66 unsigned char mif6c_flags; /* MIFF_ flags */ 67 67 unsigned char vifc_threshold; /* ttl limit */ 68 - u_short mif6c_pifi; /* the index of the physical IF */ 68 + __u16 mif6c_pifi; /* the index of the physical IF */ 69 69 unsigned int vifc_rate_limit; /* Rate limiter values (NI) */ 70 70 }; 71 71
+4 -4
include/linux/netfilter_ipv4/ipt_owner.h
··· 9 9 #define IPT_OWNER_COMM 0x10 10 10 11 11 struct ipt_owner_info { 12 - uid_t uid; 13 - gid_t gid; 14 - pid_t pid; 15 - pid_t sid; 12 + __kernel_uid32_t uid; 13 + __kernel_gid32_t gid; 14 + __kernel_pid_t pid; 15 + __kernel_pid_t sid; 16 16 char comm[16]; 17 17 u_int8_t match, invert; /* flags */ 18 18 };
+4 -4
include/linux/netfilter_ipv6/ip6t_owner.h
··· 8 8 #define IP6T_OWNER_SID 0x08 9 9 10 10 struct ip6t_owner_info { 11 - uid_t uid; 12 - gid_t gid; 13 - pid_t pid; 14 - pid_t sid; 11 + __kernel_uid32_t uid; 12 + __kernel_gid32_t gid; 13 + __kernel_pid_t pid; 14 + __kernel_pid_t sid; 15 15 u_int8_t match, invert; /* flags */ 16 16 }; 17 17
+2 -2
include/linux/ppp_defs.h
··· 177 177 * the last NP packet was sent or received. 178 178 */ 179 179 struct ppp_idle { 180 - time_t xmit_idle; /* time since last NP packet sent */ 181 - time_t recv_idle; /* time since last NP packet received */ 180 + __kernel_time_t xmit_idle; /* time since last NP packet sent */ 181 + __kernel_time_t recv_idle; /* time since last NP packet received */ 182 182 }; 183 183 184 184 #endif /* _PPP_DEFS_H_ */
+6 -5
include/linux/suspend_ioctls.h
··· 1 1 #ifndef _LINUX_SUSPEND_IOCTLS_H 2 2 #define _LINUX_SUSPEND_IOCTLS_H 3 3 4 + #include <linux/types.h> 4 5 /* 5 6 * This structure is used to pass the values needed for the identification 6 7 * of the resume swap area from a user space to the kernel via the 7 8 * SNAPSHOT_SET_SWAP_AREA ioctl 8 9 */ 9 10 struct resume_swap_area { 10 - loff_t offset; 11 - u_int32_t dev; 11 + __kernel_loff_t offset; 12 + __u32 dev; 12 13 } __attribute__((packed)); 13 14 14 15 #define SNAPSHOT_IOC_MAGIC '3' ··· 21 20 #define SNAPSHOT_S2RAM _IO(SNAPSHOT_IOC_MAGIC, 11) 22 21 #define SNAPSHOT_SET_SWAP_AREA _IOW(SNAPSHOT_IOC_MAGIC, 13, \ 23 22 struct resume_swap_area) 24 - #define SNAPSHOT_GET_IMAGE_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 14, loff_t) 23 + #define SNAPSHOT_GET_IMAGE_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 14, __kernel_loff_t) 25 24 #define SNAPSHOT_PLATFORM_SUPPORT _IO(SNAPSHOT_IOC_MAGIC, 15) 26 25 #define SNAPSHOT_POWER_OFF _IO(SNAPSHOT_IOC_MAGIC, 16) 27 26 #define SNAPSHOT_CREATE_IMAGE _IOW(SNAPSHOT_IOC_MAGIC, 17, int) 28 27 #define SNAPSHOT_PREF_IMAGE_SIZE _IO(SNAPSHOT_IOC_MAGIC, 18) 29 - #define SNAPSHOT_AVAIL_SWAP_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 19, loff_t) 30 - #define SNAPSHOT_ALLOC_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 20, loff_t) 28 + #define SNAPSHOT_AVAIL_SWAP_SIZE _IOR(SNAPSHOT_IOC_MAGIC, 19, __kernel_loff_t) 29 + #define SNAPSHOT_ALLOC_SWAP_PAGE _IOR(SNAPSHOT_IOC_MAGIC, 20, __kernel_loff_t) 31 30 #define SNAPSHOT_IOC_MAXNR 20 32 31 33 32 #endif /* _LINUX_SUSPEND_IOCTLS_H */
+4 -4
include/linux/time.h
··· 12 12 #ifndef _STRUCT_TIMESPEC 13 13 #define _STRUCT_TIMESPEC 14 14 struct timespec { 15 - time_t tv_sec; /* seconds */ 16 - long tv_nsec; /* nanoseconds */ 15 + __kernel_time_t tv_sec; /* seconds */ 16 + long tv_nsec; /* nanoseconds */ 17 17 }; 18 18 #endif 19 19 20 20 struct timeval { 21 - time_t tv_sec; /* seconds */ 22 - suseconds_t tv_usec; /* microseconds */ 21 + __kernel_time_t tv_sec; /* seconds */ 22 + __kernel_suseconds_t tv_usec; /* microseconds */ 23 23 }; 24 24 25 25 struct timezone {
+4 -4
include/linux/times.h
··· 4 4 #include <linux/types.h> 5 5 6 6 struct tms { 7 - clock_t tms_utime; 8 - clock_t tms_stime; 9 - clock_t tms_cutime; 10 - clock_t tms_cstime; 7 + __kernel_clock_t tms_utime; 8 + __kernel_clock_t tms_stime; 9 + __kernel_clock_t tms_cutime; 10 + __kernel_clock_t tms_cstime; 11 11 }; 12 12 13 13 #endif
+2 -2
include/linux/utime.h
··· 4 4 #include <linux/types.h> 5 5 6 6 struct utimbuf { 7 - time_t actime; 8 - time_t modtime; 7 + __kernel_time_t actime; 8 + __kernel_time_t modtime; 9 9 }; 10 10 11 11 #endif
+1 -1
include/linux/xfrm.h
··· 58 58 __u8 prefixlen_s; 59 59 __u8 proto; 60 60 int ifindex; 61 - uid_t user; 61 + __kernel_uid32_t user; 62 62 }; 63 63 64 64 #define XFRM_INF (~(__u64)0)
+2 -2
include/mtd/mtd-abi.h
··· 84 84 #define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user) 85 85 #define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo) 86 86 #define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo) 87 - #define MEMGETBADBLOCK _IOW('M', 11, loff_t) 88 - #define MEMSETBADBLOCK _IOW('M', 12, loff_t) 87 + #define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t) 88 + #define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t) 89 89 #define OTPSELECT _IOR('M', 13, int) 90 90 #define OTPGETREGIONCOUNT _IOW('M', 14, int) 91 91 #define OTPGETREGIONINFO _IOW('M', 15, struct otp_info)
+2 -2
include/sound/asound.h
··· 385 385 386 386 struct snd_pcm_channel_info { 387 387 unsigned int channel; 388 - off_t offset; /* mmap offset */ 388 + __kernel_off_t offset; /* mmap offset */ 389 389 unsigned int first; /* offset to first sample in bits */ 390 390 unsigned int step; /* samples distance in bits */ 391 391 }; ··· 789 789 snd_ctl_elem_type_t type; /* R: value type - SNDRV_CTL_ELEM_TYPE_* */ 790 790 unsigned int access; /* R: value access (bitmask) - SNDRV_CTL_ELEM_ACCESS_* */ 791 791 unsigned int count; /* count of values */ 792 - pid_t owner; /* owner's PID of this control */ 792 + __kernel_pid_t owner; /* owner's PID of this control */ 793 793 union { 794 794 struct { 795 795 long min; /* R: minimum value */