View | Details | Raw Unified | Return to bug 205957 | Differences between
and this patch

Collapse All | Expand All

(-)a/linux-headers/asm-arm/unistd-common.h (+1 lines)
Lines 390-394 Link Here
390
#define __NR_fspick (__NR_SYSCALL_BASE + 433)
390
#define __NR_fspick (__NR_SYSCALL_BASE + 433)
391
#define __NR_pidfd_open (__NR_SYSCALL_BASE + 434)
391
#define __NR_pidfd_open (__NR_SYSCALL_BASE + 434)
392
#define __NR_clone3 (__NR_SYSCALL_BASE + 435)
392
#define __NR_clone3 (__NR_SYSCALL_BASE + 435)
393
#define __NR_getdents64_x32 (__NR_SYSCALL_BASE + 436)
393
394
394
#endif /* _ASM_ARM_UNISTD_COMMON_H */
395
#endif /* _ASM_ARM_UNISTD_COMMON_H */
(-)a/linux-headers/asm-generic/unistd.h (-1 / +5 lines)
Lines 851-858 __SYSCALL(__NR_pidfd_open, sys_pidfd_open) Link Here
851
__SYSCALL(__NR_clone3, sys_clone3)
851
__SYSCALL(__NR_clone3, sys_clone3)
852
#endif
852
#endif
853
853
854
/* fs/readdir.c */
855
#define __NR_getdents64_x32 436
856
__SYSCALL(__NR_getdents64_x32, sys_getdents64_x32)
857
854
#undef __NR_syscalls
858
#undef __NR_syscalls
855
#define __NR_syscalls 436
859
#define __NR_syscalls 437
856
860
857
/*
861
/*
858
 * 32 bit systems traditionally used different
862
 * 32 bit systems traditionally used different
(-)a/linux-headers/asm-mips/unistd_n32.h (+1 lines)
Lines 364-369 Link Here
364
#define __NR_fsmount	(__NR_Linux + 432)
364
#define __NR_fsmount	(__NR_Linux + 432)
365
#define __NR_fspick	(__NR_Linux + 433)
365
#define __NR_fspick	(__NR_Linux + 433)
366
#define __NR_pidfd_open	(__NR_Linux + 434)
366
#define __NR_pidfd_open	(__NR_Linux + 434)
367
#define __NR_getdents64_x32	(__NR_Linux + 436)
367
368
368
369
369
#endif /* _ASM_MIPS_UNISTD_N32_H */
370
#endif /* _ASM_MIPS_UNISTD_N32_H */
(-)a/linux-headers/asm-mips/unistd_n64.h (+1 lines)
Lines 340-345 Link Here
340
#define __NR_fsmount	(__NR_Linux + 432)
340
#define __NR_fsmount	(__NR_Linux + 432)
341
#define __NR_fspick	(__NR_Linux + 433)
341
#define __NR_fspick	(__NR_Linux + 433)
342
#define __NR_pidfd_open	(__NR_Linux + 434)
342
#define __NR_pidfd_open	(__NR_Linux + 434)
343
#define __NR_getdents64_x32	(__NR_Linux + 436)
343
344
344
345
345
#endif /* _ASM_MIPS_UNISTD_N64_H */
346
#endif /* _ASM_MIPS_UNISTD_N64_H */
(-)a/linux-headers/asm-mips/unistd_o32.h (+1 lines)
Lines 410-415 Link Here
410
#define __NR_fsmount	(__NR_Linux + 432)
410
#define __NR_fsmount	(__NR_Linux + 432)
411
#define __NR_fspick	(__NR_Linux + 433)
411
#define __NR_fspick	(__NR_Linux + 433)
412
#define __NR_pidfd_open	(__NR_Linux + 434)
412
#define __NR_pidfd_open	(__NR_Linux + 434)
413
#define __NR_getdents64_x32	(__NR_Linux + 436)
413
414
414
415
415
#endif /* _ASM_MIPS_UNISTD_O32_H */
416
#endif /* _ASM_MIPS_UNISTD_O32_H */
(-)a/linux-headers/asm-powerpc/unistd_32.h (+1 lines)
Lines 418-423 Link Here
418
#define __NR_fspick	433
418
#define __NR_fspick	433
419
#define __NR_pidfd_open	434
419
#define __NR_pidfd_open	434
420
#define __NR_clone3	435
420
#define __NR_clone3	435
421
#define __NR_getdents64_x32 436
421
422
422
423
423
#endif /* _ASM_POWERPC_UNISTD_32_H */
424
#endif /* _ASM_POWERPC_UNISTD_32_H */
(-)a/linux-headers/asm-powerpc/unistd_64.h (+1 lines)
Lines 390-395 Link Here
390
#define __NR_fspick	433
390
#define __NR_fspick	433
391
#define __NR_pidfd_open	434
391
#define __NR_pidfd_open	434
392
#define __NR_clone3	435
392
#define __NR_clone3	435
393
#define __NR_getdents64_x32 436
393
394
394
395
395
#endif /* _ASM_POWERPC_UNISTD_64_H */
396
#endif /* _ASM_POWERPC_UNISTD_64_H */
(-)a/linux-headers/asm-s390/unistd_32.h (+1 lines)
Lines 408-412 Link Here
408
#define __NR_fspick 433
408
#define __NR_fspick 433
409
#define __NR_pidfd_open 434
409
#define __NR_pidfd_open 434
410
#define __NR_clone3 435
410
#define __NR_clone3 435
411
#define __NR_getdents64_x32 436
411
412
412
#endif /* _ASM_S390_UNISTD_32_H */
413
#endif /* _ASM_S390_UNISTD_32_H */
(-)a/linux-headers/asm-s390/unistd_64.h (+1 lines)
Lines 356-360 Link Here
356
#define __NR_fspick 433
356
#define __NR_fspick 433
357
#define __NR_pidfd_open 434
357
#define __NR_pidfd_open 434
358
#define __NR_clone3 435
358
#define __NR_clone3 435
359
#define __NR_getdents64_x32 436
359
360
360
#endif /* _ASM_S390_UNISTD_64_H */
361
#endif /* _ASM_S390_UNISTD_64_H */
(-)a/linux-headers/asm-x86/unistd_32.h (+1 lines)
Lines 426-430 Link Here
426
#define __NR_fspick 433
426
#define __NR_fspick 433
427
#define __NR_pidfd_open 434
427
#define __NR_pidfd_open 434
428
#define __NR_clone3 435
428
#define __NR_clone3 435
429
#define __NR_getdents64_x32 436
429
430
430
#endif /* _ASM_X86_UNISTD_32_H */
431
#endif /* _ASM_X86_UNISTD_32_H */
(-)a/linux-headers/asm-x86/unistd_64.h (+1 lines)
Lines 348-352 Link Here
348
#define __NR_fspick 433
348
#define __NR_fspick 433
349
#define __NR_pidfd_open 434
349
#define __NR_pidfd_open 434
350
#define __NR_clone3 435
350
#define __NR_clone3 435
351
#define __NR_getdents64_x32 436
351
352
352
#endif /* _ASM_X86_UNISTD_64_H */
353
#endif /* _ASM_X86_UNISTD_64_H */
(-)a/linux-headers/asm-x86/unistd_x32.h (+1 lines)
Lines 337-341 Link Here
337
#define __NR_execveat (__X32_SYSCALL_BIT + 545)
337
#define __NR_execveat (__X32_SYSCALL_BIT + 545)
338
#define __NR_preadv2 (__X32_SYSCALL_BIT + 546)
338
#define __NR_preadv2 (__X32_SYSCALL_BIT + 546)
339
#define __NR_pwritev2 (__X32_SYSCALL_BIT + 547)
339
#define __NR_pwritev2 (__X32_SYSCALL_BIT + 547)
340
#define __NR_getdents64_x32 (__X32_SYSCALL_BIT + 548)
340
341
341
#endif /* _ASM_X86_UNISTD_X32_H */
342
#endif /* _ASM_X86_UNISTD_X32_H */
(-)a/linux-user/aarch64/syscall_nr.h (+1 lines)
Lines 276-280 Link Here
276
#define TARGET_NR_membarrier 283
276
#define TARGET_NR_membarrier 283
277
#define TARGET_NR_mlock2 284
277
#define TARGET_NR_mlock2 284
278
#define TARGET_NR_copy_file_range 285
278
#define TARGET_NR_copy_file_range 285
279
#define TARGET_NR_getdents64_x32 436
279
280
280
#endif
281
#endif
(-)a/linux-user/alpha/syscall_nr.h (+1 lines)
Lines 453-457 Link Here
453
#define TARGET_NR_getrandom                     511
453
#define TARGET_NR_getrandom                     511
454
#define TARGET_NR_memfd_create                  512
454
#define TARGET_NR_memfd_create                  512
455
#define TARGET_NR_execveat                      513
455
#define TARGET_NR_execveat                      513
456
#define TARGET_NR_getdents64_x32			546
456
457
457
#endif
458
#endif
(-)a/linux-user/arm/syscall_nr.h (+1 lines)
Lines 399-403 Link Here
399
#define TARGET_NR_userfaultfd                  (388)
399
#define TARGET_NR_userfaultfd                  (388)
400
#define TARGET_NR_membarrier                   (389)
400
#define TARGET_NR_membarrier                   (389)
401
#define TARGET_NR_mlock2                       (390)
401
#define TARGET_NR_mlock2                       (390)
402
#define TARGET_NR_getdents64_x32			   (436)
402
403
403
#endif
404
#endif
(-)a/linux-user/cris/syscall_nr.h (+1 lines)
Lines 363-367 Link Here
363
#define TARGET_NR_memfd_create       357
363
#define TARGET_NR_memfd_create       357
364
#define TARGET_NR_bpf                358
364
#define TARGET_NR_bpf                358
365
#define TARGET_NR_execveat           359
365
#define TARGET_NR_execveat           359
366
#define TARGET_NR_getdents64_x32     436
366
367
367
#endif
368
#endif
(-)a/linux-user/hppa/syscall_nr.h (+1 lines)
Lines 354-358 Link Here
354
#define TARGET_NR_copy_file_range   346
354
#define TARGET_NR_copy_file_range   346
355
#define TARGET_NR_preadv2           347
355
#define TARGET_NR_preadv2           347
356
#define TARGET_NR_pwritev2          348
356
#define TARGET_NR_pwritev2          348
357
#define TARGET_NR_getdents64_x32    436
357
358
358
#endif
359
#endif
(-)a/linux-user/i386/syscall_nr.h (+1 lines)
Lines 383-387 Link Here
383
#define TARGET_NR_membarrier            375
383
#define TARGET_NR_membarrier            375
384
#define TARGET_NR_mlock2                376
384
#define TARGET_NR_mlock2                376
385
#define TARGET_NR_copy_file_range       377
385
#define TARGET_NR_copy_file_range       377
386
#define TARGET_NR_getdents64_x32		436
386
387
387
#endif
388
#endif
(-)a/linux-user/m68k/syscall_nr.h (+1 lines)
Lines 382-386 Link Here
382
#define TARGET_NR_copy_file_range       376
382
#define TARGET_NR_copy_file_range       376
383
#define TARGET_NR_preadv2               377
383
#define TARGET_NR_preadv2               377
384
#define TARGET_NR_pwritev2              378
384
#define TARGET_NR_pwritev2              378
385
#define TARGET_NR_getdents64_x32        436
385
386
386
#endif
387
#endif
(-)a/linux-user/microblaze/syscall_nr.h (+1 lines)
Lines 393-397 Link Here
393
#define TARGET_NR_memfd_create          386
393
#define TARGET_NR_memfd_create          386
394
#define TARGET_NR_bpf                   387
394
#define TARGET_NR_bpf                   387
395
#define TARGET_NR_execveat              388
395
#define TARGET_NR_execveat              388
396
#define TARGET_NR_getdents64_x32		436
396
397
397
#endif
398
#endif
(-)a/linux-user/mips/cpu_loop.c (+1 lines)
Lines 390-395 static const uint8_t mips_syscall_args[] = { Link Here
390
        MIPS_SYS(sys_copy_file_range, 6) /* 360 */
390
        MIPS_SYS(sys_copy_file_range, 6) /* 360 */
391
        MIPS_SYS(sys_preadv2, 6)
391
        MIPS_SYS(sys_preadv2, 6)
392
        MIPS_SYS(sys_pwritev2, 6)
392
        MIPS_SYS(sys_pwritev2, 6)
393
        MIPS_SYS(sys_getdents64_x32, 3)
393
};
394
};
394
#  undef MIPS_SYS
395
#  undef MIPS_SYS
395
# endif /* O32 */
396
# endif /* O32 */
(-)a/linux-user/mips/syscall_nr.h (+1 lines)
Lines 376-380 Link Here
376
#define TARGET_NR_statx                 (TARGET_NR_Linux + 366)
376
#define TARGET_NR_statx                 (TARGET_NR_Linux + 366)
377
#define TARGET_NR_rseq                  (TARGET_NR_Linux + 367)
377
#define TARGET_NR_rseq                  (TARGET_NR_Linux + 367)
378
#define TARGET_NR_io_pgetevents         (TARGET_NR_Linux + 368)
378
#define TARGET_NR_io_pgetevents         (TARGET_NR_Linux + 368)
379
#define TARGET_NR_getdents64_x32		(TARGET_NR_Linux + 436)
379
380
380
#endif
381
#endif
(-)a/linux-user/mips64/syscall_nr.h (+2 lines)
Lines 339-344 Link Here
339
#define TARGET_NR_statx                 (TARGET_NR_Linux + 330)
339
#define TARGET_NR_statx                 (TARGET_NR_Linux + 330)
340
#define TARGET_NR_rseq                  (TARGET_NR_Linux + 331)
340
#define TARGET_NR_rseq                  (TARGET_NR_Linux + 331)
341
#define TARGET_NR_io_pgetevents         (TARGET_NR_Linux + 332)
341
#define TARGET_NR_io_pgetevents         (TARGET_NR_Linux + 332)
342
#define TARGET_NR_getdents64_x32        (TARGET_NR_Linux + 436)
342
343
343
#else
344
#else
344
/*
345
/*
Lines 674-679 Link Here
674
#define TARGET_NR_statx                 (TARGET_NR_Linux + 326)
675
#define TARGET_NR_statx                 (TARGET_NR_Linux + 326)
675
#define TARGET_NR_rseq                  (TARGET_NR_Linux + 327)
676
#define TARGET_NR_rseq                  (TARGET_NR_Linux + 327)
676
#define TARGET_NR_io_pgetevents         (TARGET_NR_Linux + 328)
677
#define TARGET_NR_io_pgetevents         (TARGET_NR_Linux + 328)
678
#define TARGET_NR_getdents64_x32        (TARGET_NR_Linux + 436)
677
#endif
679
#endif
678
680
679
#endif
681
#endif
(-)a/linux-user/nios2/syscall_nr.h (+1 lines)
Lines 274-279 Link Here
274
#define TARGET_NR_copy_file_range           285
274
#define TARGET_NR_copy_file_range           285
275
#define TARGET_NR_preadv2                   286
275
#define TARGET_NR_preadv2                   286
276
#define TARGET_NR_pwritev2                  287
276
#define TARGET_NR_pwritev2                  287
277
#define TARGET_NR_getdents64_x32            436
277
#define TARGET_NR_open                      1024
278
#define TARGET_NR_open                      1024
278
#define TARGET_NR_link                      1025
279
#define TARGET_NR_link                      1025
279
#define TARGET_NR_unlink                    1026
280
#define TARGET_NR_unlink                    1026
(-)a/linux-user/openrisc/syscall_nr.h (+3 lines)
Lines 398-403 Link Here
398
#define TARGET_NR_mlock2 284
398
#define TARGET_NR_mlock2 284
399
#define TARGET_NR_copy_file_range 285
399
#define TARGET_NR_copy_file_range 285
400
400
401
/* fs/readdir.c */
402
#define TARGET_NR_getdents64_x32 436
403
401
/*
404
/*
402
 * All syscalls below here should go away really,
405
 * All syscalls below here should go away really,
403
 * these are provided for both review and as a porting
406
 * these are provided for both review and as a porting
(-)a/linux-user/ppc/syscall_nr.h (+1 lines)
Lines 398-402 Link Here
398
#define TARGET_NR_shmget                376
398
#define TARGET_NR_shmget                376
399
#define TARGET_NR_shmctl                377
399
#define TARGET_NR_shmctl                377
400
#define TARGET_NR_mlock2                378
400
#define TARGET_NR_mlock2                378
401
#define TARGET_NR_getdents64_x32        436
401
402
402
#endif
403
#endif
(-)a/linux-user/riscv/syscall_nr.h (+1 lines)
Lines 299-304 Link Here
299
#define TARGET_NR_io_pgetevents 292
299
#define TARGET_NR_io_pgetevents 292
300
#define TARGET_NR_rseq 293
300
#define TARGET_NR_rseq 293
301
#define TARGET_NR_kexec_file_load 294
301
#define TARGET_NR_kexec_file_load 294
302
#define TARGET_NR_getdents64_x32 436
302
303
303
#define TARGET_NR_syscalls (TARGET_NR_kexec_file_load + 1)
304
#define TARGET_NR_syscalls (TARGET_NR_kexec_file_load + 1)
304
305
(-)a/linux-user/s390x/syscall_nr.h (+1 lines)
Lines 304-309 Link Here
304
#define TARGET_NR_recvmsg               372
304
#define TARGET_NR_recvmsg               372
305
#define TARGET_NR_shutdown              373
305
#define TARGET_NR_shutdown              373
306
#define TARGET_NR_mlock2                374
306
#define TARGET_NR_mlock2                374
307
#define TARGET_NR_getdents64_x32		436
307
308
308
/*
309
/*
309
 * There are some system calls that are not present on 64 bit, some
310
 * There are some system calls that are not present on 64 bit, some
(-)a/linux-user/sh4/syscall_nr.h (+1 lines)
Lines 389-393 Link Here
389
#define TARGET_NR_copy_file_range       380
389
#define TARGET_NR_copy_file_range       380
390
#define TARGET_NR_preadv2               381
390
#define TARGET_NR_preadv2               381
391
#define TARGET_NR_pwritev2              382
391
#define TARGET_NR_pwritev2              382
392
#define TARGET_NR_getdents64_x32        436
392
393
393
#endif
394
#endif
(-)a/linux-user/sparc/syscall_nr.h (+1 lines)
Lines 359-363 Link Here
359
#define TARGET_NR_preadv2               358
359
#define TARGET_NR_preadv2               358
360
#define TARGET_NR_pwritev2              359
360
#define TARGET_NR_pwritev2              359
361
#define TARGET_NR_statx                 360
361
#define TARGET_NR_statx                 360
362
#define TARGET_NR_getdents64_x32        436
362
363
363
#endif
364
#endif
(-)a/linux-user/sparc64/syscall_nr.h (+1 lines)
Lines 362-366 Link Here
362
#define TARGET_NR_preadv2               358
362
#define TARGET_NR_preadv2               358
363
#define TARGET_NR_pwritev2              359
363
#define TARGET_NR_pwritev2              359
364
#define TARGET_NR_statx                 360
364
#define TARGET_NR_statx                 360
365
#define TARGET_NR_getdents64_x32        436
365
366
366
#endif
367
#endif
(-)a/linux-user/strace.list (+3 lines)
Lines 1656-1658 Link Here
1656
#ifdef TARGET_NR_statx
1656
#ifdef TARGET_NR_statx
1657
{ TARGET_NR_statx, "statx", NULL, print_statx, NULL },
1657
{ TARGET_NR_statx, "statx", NULL, print_statx, NULL },
1658
#endif
1658
#endif
1659
#ifdef TARGET_NR_getdents64_x32
1660
{ TARGET_NR_getdents64_x32, "getdents64_x32" , NULL, NULL, NULL },
1661
#endif
(-)a/linux-user/syscall.c (-12 / +46 lines)
Lines 235-240 static type name (type1 arg1,type2 arg2,type3 arg3,type4 arg4,type5 arg5, \ Link Here
235
#define __NR_sys_getcwd1 __NR_getcwd
235
#define __NR_sys_getcwd1 __NR_getcwd
236
#define __NR_sys_getdents __NR_getdents
236
#define __NR_sys_getdents __NR_getdents
237
#define __NR_sys_getdents64 __NR_getdents64
237
#define __NR_sys_getdents64 __NR_getdents64
238
#define __NR_sys_getdents64_x32 __NR_getdents64_x32
238
#define __NR_sys_getpriority __NR_getpriority
239
#define __NR_sys_getpriority __NR_getpriority
239
#define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
240
#define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
240
#define __NR_sys_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
241
#define __NR_sys_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
Lines 275-280 _syscall3(int, sys_getdents, uint, fd, struct linux_dirent *, dirp, uint, count) Link Here
275
    (defined(TARGET_NR_getdents64) && defined(__NR_getdents64))
276
    (defined(TARGET_NR_getdents64) && defined(__NR_getdents64))
276
_syscall3(int, sys_getdents64, uint, fd, struct linux_dirent64 *, dirp, uint, count);
277
_syscall3(int, sys_getdents64, uint, fd, struct linux_dirent64 *, dirp, uint, count);
277
#endif
278
#endif
279
#if (defined(TARGET_NR_getdents) && \
280
      !defined(EMULATE_GETDENTS_WITH_GETDENTS)) || \
281
    (defined(TARGET_NR_getdents64_x32) && defined(__NR_getdents64_x32))
282
_syscall3(int, sys_getdents64_x32, uint, fd, struct linux_dirent64 *, dirp, uint, count);
283
#endif
278
#if defined(TARGET_NR__llseek) && defined(__NR_llseek)
284
#if defined(TARGET_NR__llseek) && defined(__NR_llseek)
279
_syscall5(int, _llseek,  uint,  fd, ulong, hi, ulong, lo,
285
_syscall5(int, _llseek,  uint,  fd, ulong, hi, ulong, lo,
280
          loff_t *, res, uint, wh);
286
          loff_t *, res, uint, wh);
Lines 1062-1068 static inline rlim_t target_to_host_rlim(abi_ulong target_rlim) Link Here
1062
{
1068
{
1063
    abi_ulong target_rlim_swap;
1069
    abi_ulong target_rlim_swap;
1064
    rlim_t result;
1070
    rlim_t result;
1065
    
1071
1066
    target_rlim_swap = tswapal(target_rlim);
1072
    target_rlim_swap = tswapal(target_rlim);
1067
    if (target_rlim_swap == TARGET_RLIM_INFINITY)
1073
    if (target_rlim_swap == TARGET_RLIM_INFINITY)
1068
        return RLIM_INFINITY;
1074
        return RLIM_INFINITY;
Lines 1070-1076 static inline rlim_t target_to_host_rlim(abi_ulong target_rlim) Link Here
1070
    result = target_rlim_swap;
1076
    result = target_rlim_swap;
1071
    if (target_rlim_swap != (rlim_t)result)
1077
    if (target_rlim_swap != (rlim_t)result)
1072
        return RLIM_INFINITY;
1078
        return RLIM_INFINITY;
1073
    
1079
1074
    return result;
1080
    return result;
1075
}
1081
}
1076
1082
Lines 1078-1090 static inline abi_ulong host_to_target_rlim(rlim_t rlim) Link Here
1078
{
1084
{
1079
    abi_ulong target_rlim_swap;
1085
    abi_ulong target_rlim_swap;
1080
    abi_ulong result;
1086
    abi_ulong result;
1081
    
1087
1082
    if (rlim == RLIM_INFINITY || rlim != (abi_long)rlim)
1088
    if (rlim == RLIM_INFINITY || rlim != (abi_long)rlim)
1083
        target_rlim_swap = TARGET_RLIM_INFINITY;
1089
        target_rlim_swap = TARGET_RLIM_INFINITY;
1084
    else
1090
    else
1085
        target_rlim_swap = rlim;
1091
        target_rlim_swap = rlim;
1086
    result = tswapal(target_rlim_swap);
1092
    result = tswapal(target_rlim_swap);
1087
    
1093
1088
    return result;
1094
    return result;
1089
}
1095
}
1090
1096
Lines 1526-1534 static inline abi_long target_to_host_cmsg(struct msghdr *msgh, Link Here
1526
    abi_ulong target_cmsg_addr;
1532
    abi_ulong target_cmsg_addr;
1527
    struct target_cmsghdr *target_cmsg, *target_cmsg_start;
1533
    struct target_cmsghdr *target_cmsg, *target_cmsg_start;
1528
    socklen_t space = 0;
1534
    socklen_t space = 0;
1529
    
1535
1530
    msg_controllen = tswapal(target_msgh->msg_controllen);
1536
    msg_controllen = tswapal(target_msgh->msg_controllen);
1531
    if (msg_controllen < sizeof (struct target_cmsghdr)) 
1537
    if (msg_controllen < sizeof (struct target_cmsghdr))
1532
        goto the_end;
1538
        goto the_end;
1533
    target_cmsg_addr = tswapal(target_msgh->msg_control);
1539
    target_cmsg_addr = tswapal(target_msgh->msg_control);
1534
    target_cmsg = lock_user(VERIFY_READ, target_cmsg_addr, msg_controllen, 1);
1540
    target_cmsg = lock_user(VERIFY_READ, target_cmsg_addr, msg_controllen, 1);
Lines 1610-1616 static inline abi_long host_to_target_cmsg(struct target_msghdr *target_msgh, Link Here
1610
    socklen_t space = 0;
1616
    socklen_t space = 0;
1611
1617
1612
    msg_controllen = tswapal(target_msgh->msg_controllen);
1618
    msg_controllen = tswapal(target_msgh->msg_controllen);
1613
    if (msg_controllen < sizeof (struct target_cmsghdr)) 
1619
    if (msg_controllen < sizeof (struct target_cmsghdr))
1614
        goto the_end;
1620
        goto the_end;
1615
    target_cmsg_addr = tswapal(target_msgh->msg_control);
1621
    target_cmsg_addr = tswapal(target_msgh->msg_control);
1616
    target_cmsg = lock_user(VERIFY_WRITE, target_cmsg_addr, msg_controllen, 0);
1622
    target_cmsg = lock_user(VERIFY_WRITE, target_cmsg_addr, msg_controllen, 0);
Lines 5592-5598 abi_long do_set_thread_area(CPUX86State *env, abi_ulong ptr) Link Here
5592
    }
5598
    }
5593
    unlock_user_struct(target_ldt_info, ptr, 1);
5599
    unlock_user_struct(target_ldt_info, ptr, 1);
5594
5600
5595
    if (ldt_info.entry_number < TARGET_GDT_ENTRY_TLS_MIN || 
5601
    if (ldt_info.entry_number < TARGET_GDT_ENTRY_TLS_MIN ||
5596
        ldt_info.entry_number > TARGET_GDT_ENTRY_TLS_MAX)
5602
        ldt_info.entry_number > TARGET_GDT_ENTRY_TLS_MAX)
5597
           return -TARGET_EINVAL;
5603
           return -TARGET_EINVAL;
5598
    seg_32bit = ldt_info.flags & 1;
5604
    seg_32bit = ldt_info.flags & 1;
Lines 5670-5676 static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr) Link Here
5670
    lp = (uint32_t *)(gdt_table + idx);
5676
    lp = (uint32_t *)(gdt_table + idx);
5671
    entry_1 = tswap32(lp[0]);
5677
    entry_1 = tswap32(lp[0]);
5672
    entry_2 = tswap32(lp[1]);
5678
    entry_2 = tswap32(lp[1]);
5673
    
5679
5674
    read_exec_only = ((entry_2 >> 9) & 1) ^ 1;
5680
    read_exec_only = ((entry_2 >> 9) & 1) ^ 1;
5675
    contents = (entry_2 >> 10) & 3;
5681
    contents = (entry_2 >> 10) & 3;
5676
    seg_not_present = ((entry_2 >> 15) & 1) ^ 1;
5682
    seg_not_present = ((entry_2 >> 15) & 1) ^ 1;
Lines 5686-5693 static abi_long do_get_thread_area(CPUX86State *env, abi_ulong ptr) Link Here
5686
        (read_exec_only << 3) | (limit_in_pages << 4) |
5692
        (read_exec_only << 3) | (limit_in_pages << 4) |
5687
        (seg_not_present << 5) | (useable << 6) | (lm << 7);
5693
        (seg_not_present << 5) | (useable << 6) | (lm << 7);
5688
    limit = (entry_1 & 0xffff) | (entry_2  & 0xf0000);
5694
    limit = (entry_1 & 0xffff) | (entry_2  & 0xf0000);
5689
    base_addr = (entry_1 >> 16) | 
5695
    base_addr = (entry_1 >> 16) |
5690
        (entry_2 & 0xff000000) | 
5696
        (entry_2 & 0xff000000) |
5691
        ((entry_2 & 0xff) << 16);
5697
        ((entry_2 & 0xff) << 16);
5692
    target_ldt_info->base_addr = tswapal(base_addr);
5698
    target_ldt_info->base_addr = tswapal(base_addr);
5693
    target_ldt_info->limit = tswap32(limit);
5699
    target_ldt_info->limit = tswap32(limit);
Lines 9619-9624 static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, Link Here
9619
        }
9625
        }
9620
        return ret;
9626
        return ret;
9621
#endif /* TARGET_NR_getdents64 */
9627
#endif /* TARGET_NR_getdents64 */
9628
#if defined(TARGET_NR_getdents64_x32) && defined(__NR_getdents64_x32)
9629
    case TARGET_NR_getdents64_x32:
9630
        {
9631
            struct linux_dirent64 *dirp;
9632
            abi_long count = arg3;
9633
            if (!(dirp = lock_user(VERIFY_WRITE, arg2, count, 0)))
9634
                return -TARGET_EFAULT;
9635
            ret = get_errno(sys_getdents64_x32(arg1, dirp, count));
9636
            if (!is_error(ret)) {
9637
                struct linux_dirent64 *de;
9638
                int len = ret;
9639
                int reclen;
9640
                de = dirp;
9641
                while (len > 0) {
9642
                    reclen = de->d_reclen;
9643
                    if (reclen > len)
9644
                        break;
9645
                    de->d_reclen = tswap16(reclen);
9646
                    tswap64s((uint64_t *)&de->d_ino);
9647
                    tswap64s((uint64_t *)&de->d_off);
9648
                    de = (struct linux_dirent64 *)((char *)de + reclen);
9649
                    len -= reclen;
9650
                }
9651
            }
9652
            unlock_user(dirp, arg2, ret);
9653
        }
9654
        return ret;
9655
#endif /* TARGET_NR_getdents64_x32 */
9622
#if defined(TARGET_NR__newselect)
9656
#if defined(TARGET_NR__newselect)
9623
    case TARGET_NR__newselect:
9657
    case TARGET_NR__newselect:
9624
        return do_select(arg1, arg2, arg3, arg4, arg5);
9658
        return do_select(arg1, arg2, arg3, arg4, arg5);
Lines 10554-10560 static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, Link Here
10554
        return get_errno(fchown(arg1, low2highuid(arg2), low2highgid(arg3)));
10588
        return get_errno(fchown(arg1, low2highuid(arg2), low2highgid(arg3)));
10555
#if defined(TARGET_NR_fchownat)
10589
#if defined(TARGET_NR_fchownat)
10556
    case TARGET_NR_fchownat:
10590
    case TARGET_NR_fchownat:
10557
        if (!(p = lock_user_string(arg2))) 
10591
        if (!(p = lock_user_string(arg2)))
10558
            return -TARGET_EFAULT;
10592
            return -TARGET_EFAULT;
10559
        ret = get_errno(fchownat(arg1, p, low2highuid(arg3),
10593
        ret = get_errno(fchownat(arg1, p, low2highuid(arg3),
10560
                                 low2highgid(arg4), arg5));
10594
                                 low2highgid(arg4), arg5));
(-)a/linux-user/tilegx/syscall_nr.h (+1 lines)
Lines 278-283 Link Here
278
#define TARGET_NR_membarrier                    283
278
#define TARGET_NR_membarrier                    283
279
#define TARGET_NR_mlock2                        284
279
#define TARGET_NR_mlock2                        284
280
#define TARGET_NR_copy_file_range               285
280
#define TARGET_NR_copy_file_range               285
281
#define TARGET_NR_getdents64_x32                436
281
282
282
#define TARGET_NR_open                          1024
283
#define TARGET_NR_open                          1024
283
#define TARGET_NR_link                          1025
284
#define TARGET_NR_link                          1025
(-)a/linux-user/x86_64/syscall_nr.h (+1 lines)
Lines 328-332 Link Here
328
#define TARGET_NR_membarrier            324
328
#define TARGET_NR_membarrier            324
329
#define TARGET_NR_mlock2                325
329
#define TARGET_NR_mlock2                325
330
#define TARGET_NR_copy_file_range       326
330
#define TARGET_NR_copy_file_range       326
331
#define TARGET_NR_getdents64_x32        436
331
332
332
#endif
333
#endif
(-)a/linux-user/xtensa/syscall_nr.h (+2 lines)
Lines 434-437 Link Here
434
434
435
#define TARGET_NR_syscall_count                      352
435
#define TARGET_NR_syscall_count                      352
436
436
437
#define TARGET_NR_getdents64_x32                     436
438
437
#endif /* XTENSA_SYSCALL_NR_H */
439
#endif /* XTENSA_SYSCALL_NR_H */

Return to bug 205957