49
49
#define TARGET_IOC_TYPEBITS 8
51
51
#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SH4) \
52
|| defined(TARGET_M68K)
52
|| defined(TARGET_M68K) || defined(TARGET_ALPHA)
54
54
#define TARGET_IOC_SIZEBITS 14
55
55
#define TARGET_IOC_DIRBITS 2
176
176
static __inline__ struct target_cmsghdr *
177
177
__target_cmsg_nxthdr (struct target_msghdr *__mhdr, struct target_cmsghdr *__cmsg)
179
if (tswapl(__cmsg->cmsg_len) < sizeof (struct target_cmsghdr))
180
/* The kernel header does this so there may be a reason. */
179
struct target_cmsghdr *__ptr;
183
__cmsg = (struct target_cmsghdr *) ((unsigned char *) __cmsg
184
+ TARGET_CMSG_ALIGN (tswapl(__cmsg->cmsg_len)));
185
if ((unsigned char *) (__cmsg + 1) > ((unsigned char *) tswapl(__mhdr->msg_control)
186
+ tswapl(__mhdr->msg_controllen))
187
|| ((unsigned char *) __cmsg + TARGET_CMSG_ALIGN (tswapl(__cmsg->cmsg_len))
188
> ((unsigned char *) tswapl(__mhdr->msg_control)
189
+ tswapl(__mhdr->msg_controllen))))
181
__ptr = (struct target_cmsghdr *)((unsigned char *) __cmsg
182
+ TARGET_CMSG_ALIGN (tswapl(__cmsg->cmsg_len)));
183
if ((unsigned long)((char *)(__ptr+1) - (char *)(size_t)tswapl(__mhdr->msg_control))
184
> tswapl(__mhdr->msg_controllen))
190
185
/* No more entries. */
186
return (struct target_cmsghdr *)0;
294
289
int do_sigaction(int sig, const struct target_sigaction *act,
295
290
struct target_sigaction *oact);
297
#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_MIPS) || defined (TARGET_SH4) || defined(TARGET_M68K)
292
#if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_MIPS) || defined (TARGET_SH4) || defined(TARGET_M68K) || defined(TARGET_ALPHA)
299
294
#if defined(TARGET_SPARC)
300
295
#define TARGET_SA_NOCLDSTOP 8u
967
962
} __attribute__ ((packed));
965
#elif defined(TARGET_SPARC64)
969
unsigned int st_mode;
970
unsigned int st_nlink;
973
unsigned int st_rdev;
975
target_long target_st_atime;
976
target_long target_st_mtime;
977
target_long target_st_ctime;
978
target_long st_blksize;
979
target_long st_blocks;
980
target_ulong __unused4[2];
983
struct target_stat64 {
984
unsigned char __pad0[6];
985
unsigned short st_dev;
990
unsigned int st_mode;
995
unsigned char __pad2[6];
996
unsigned short st_rdev;
1001
unsigned char __pad4[4];
1002
unsigned int st_blocks;
1004
target_ulong target_st_atime;
1005
target_ulong __unused1;
1007
target_ulong target_st_mtime;
1008
target_ulong __unused2;
1010
target_ulong target_st_ctime;
1011
target_ulong __unused3;
1013
target_ulong __unused4[3];
970
1016
#elif defined(TARGET_SPARC)
972
1018
struct target_stat {
1204
1250
int64_t st_blocks;
1253
#elif defined(TARGET_ALPHA)
1255
struct target_stat {
1256
unsigned int st_dev;
1257
unsigned int st_ino;
1258
unsigned int st_mode;
1259
unsigned int st_nlink;
1260
unsigned int st_uid;
1261
unsigned int st_gid;
1262
unsigned int st_rdev;
1263
target_long st_size;
1264
target_ulong target_st_atime;
1265
target_ulong target_st_mtime;
1266
target_ulong target_st_ctime;
1267
unsigned int st_blksize;
1268
unsigned int st_blocks;
1269
unsigned int st_flags;
1270
unsigned int st_gen;
1273
struct target_stat64 {
1274
target_ulong st_dev;
1275
target_ulong st_ino;
1276
target_ulong st_rdev;
1277
target_long st_size;
1278
target_ulong st_blocks;
1280
unsigned int st_mode;
1281
unsigned int st_uid;
1282
unsigned int st_gid;
1283
unsigned int st_blksize;
1284
unsigned int st_nlink;
1285
unsigned int __pad0;
1287
target_ulong target_st_atime;
1288
target_ulong target_st_atime_nsec;
1289
target_ulong target_st_mtime;
1290
target_ulong target_st_mtime_nsec;
1291
target_ulong target_st_ctime;
1292
target_ulong target_st_ctime_nsec;
1293
target_long __unused[3];
1296
#elif defined(TARGET_SH4)
1298
struct target_stat {
1299
target_ulong st_dev;
1300
target_ulong st_ino;
1301
unsigned short st_mode;
1302
unsigned short st_nlink;
1303
unsigned short st_uid;
1304
unsigned short st_gid;
1305
target_ulong st_rdev;
1306
target_ulong st_size;
1307
target_ulong st_blksize;
1308
target_ulong st_blocks;
1309
target_ulong target_st_atime;
1310
target_ulong target_st_atime_nsec;
1311
target_ulong target_st_mtime;
1312
target_ulong target_st_mtime_nsec;
1313
target_ulong target_st_ctime;
1314
target_ulong target_st_ctime_nsec;
1315
target_ulong __unused4;
1316
target_ulong __unused5;
1319
/* This matches struct stat64 in glibc2.1, hence the absolutely
1320
* insane amounts of padding around dev_t's.
1322
struct target_stat64 {
1323
unsigned long long st_dev;
1324
unsigned char __pad0[4];
1326
#define TARGET_STAT64_HAS_BROKEN_ST_INO 1
1327
target_ulong __st_ino;
1329
unsigned int st_mode;
1330
unsigned int st_nlink;
1332
target_ulong st_uid;
1333
target_ulong st_gid;
1335
unsigned long long st_rdev;
1336
unsigned char __pad3[4];
1339
target_ulong st_blksize;
1341
unsigned long long st_blocks; /* Number 512-byte blocks allocated. */
1343
target_ulong target_st_atime;
1344
target_ulong target_st_atime_nsec;
1346
target_ulong target_st_mtime;
1347
target_ulong target_st_mtime_nsec;
1349
target_ulong target_st_ctime;
1350
target_ulong target_st_ctime_nsec;
1352
unsigned long long st_ino;
1207
1356
#error unsupported CPU
1210
1363
#ifdef TARGET_MIPS
1211
1364
struct target_statfs {
1212
1365
target_long f_type;