Commit 27725c1d74a6dc754830ecccbc19c3d4cd63678c

Authored by bellard
1 parent e026db58

ia64 support - fcntl uses TARGET_ constants


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@112 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 12 additions and 8 deletions
linux-user/syscall.c
... ... @@ -85,7 +85,7 @@ long do_rt_sigreturn(CPUX86State *env);
85 85 #define __NR_sys_getdents64 __NR_getdents64
86 86 #define __NR_sys_rt_sigqueueinfo __NR_rt_sigqueueinfo
87 87  
88   -#ifdef __alpha__
  88 +#if defined(__alpha__) || defined (__ia64__)
89 89 #define __NR__llseek __NR_lseek
90 90 #endif
91 91  
... ... @@ -1163,7 +1163,11 @@ int do_fork(CPUX86State *env, unsigned int flags, unsigned long newsp)
1163 1163 new_env->regs[R_ESP] = newsp;
1164 1164 new_env->regs[R_EAX] = 0;
1165 1165 new_env->opaque = ts;
1166   - ret = clone(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env);
  1166 +#ifdef __ia64__
  1167 + ret = clone2(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env);
  1168 +#else
  1169 + ret = clone(clone_func, new_stack + NEW_STACK_SIZE, flags, new_env);
  1170 +#endif
1167 1171 } else {
1168 1172 /* if no CLONE_VM, we consider it is a fork */
1169 1173 if ((flags & ~CSIGNAL) != 0)
... ... @@ -1419,7 +1423,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
1419 1423 struct target_flock *target_fl = (void *)arg3;
1420 1424  
1421 1425 switch(arg2) {
1422   - case F_GETLK:
  1426 + case TARGET_F_GETLK:
1423 1427 ret = get_errno(fcntl(arg1, arg2, &fl));
1424 1428 if (ret == 0) {
1425 1429 target_fl->l_type = tswap16(fl.l_type);
... ... @@ -1430,8 +1434,8 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
1430 1434 }
1431 1435 break;
1432 1436  
1433   - case F_SETLK:
1434   - case F_SETLKW:
  1437 + case TARGET_F_SETLK:
  1438 + case TARGET_F_SETLKW:
1435 1439 fl.l_type = tswap16(target_fl->l_type);
1436 1440 fl.l_whence = tswap16(target_fl->l_whence);
1437 1441 fl.l_start = tswapl(target_fl->l_start);
... ... @@ -1440,9 +1444,9 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3,
1440 1444 ret = get_errno(fcntl(arg1, arg2, &fl));
1441 1445 break;
1442 1446  
1443   - case F_GETLK64:
1444   - case F_SETLK64:
1445   - case F_SETLKW64:
  1447 + case TARGET_F_GETLK64:
  1448 + case TARGET_F_SETLK64:
  1449 + case TARGET_F_SETLKW64:
1446 1450 goto unimplemented;
1447 1451 default:
1448 1452 ret = get_errno(fcntl(arg1, arg2, arg3));
... ...