Current problem reports assigned to freebsd-emulation@FreeBSD.org

Roman Divacky rdivacky at freebsd.org
Tue Jun 3 21:38:14 UTC 2008


>  struct l_dirent {
> -	l_long		d_ino;
> +	l_ino_t		d_ino;
>  	l_off_t		d_off;
>  	l_ushort	d_reclen;
>  	char		d_name[LINUX_NAME_MAX + 1];

this part is correct... linux indeed uses unsigned long
which is l_ino_t.

> @@ -536,6 +538,7 @@ linux_getdents64(struct thread *td, struct 
> linux_getdents64_args *args)
>  	return (getdents_common(td, args, 1));
>  }
> 
> +
>  /*
>   * These exist mainly for hooks for doing /compat/linux translation.
>   */
> @@ -905,6 +908,7 @@ linux_truncate(struct thread *td, struct 
> linux_truncate_args *args)
>  	return (error);
>  }
> 
> +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
>  int
>  linux_truncate64(struct thread *td, struct linux_truncate64_args *args)
>  {
> @@ -922,6 +926,8 @@ linux_truncate64(struct thread *td, struct 
> linux_truncate64_args *args)
>  	LFREEPATH(path);
>  	return (error);
>  }
> +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
> +
>  int
>  linux_ftruncate(struct thread *td, struct linux_ftruncate_args *args)
>  {
> @@ -1119,6 +1125,7 @@ linux_mount(struct thread *td, struct 
> linux_mount_args *args)
>  	return (error);
>  }
> 
> +#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
>  int
>  linux_oldumount(struct thread *td, struct linux_oldumount_args *args)
>  {
> @@ -1128,6 +1135,7 @@ linux_oldumount(struct thread *td, struct 
> linux_oldumount_args *args)
>  	args2.flags = 0;
>  	return (linux_umount(td, &args2));
>  }
> +#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
> 
>  int
>  linux_umount(struct thread *td, struct linux_umount_args *args)
> @@ -1258,7 +1266,7 @@ bsd_to_linux_flock64(struct flock *bsd_flock, struct 
> l_flock64 *linux_flock)
>  #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
> 
>  static int
> -fcntl_common(struct thread *td, struct linux_fcntl64_args *args)
> +fcntl_common(struct thread *td, struct linux_fcntl_args *args)
>  {
>  	struct l_flock linux_flock;
>  	struct flock bsd_flock;
> @@ -1382,17 +1390,13 @@ fcntl_common(struct thread *td, struct 
> linux_fcntl64_args *args)
>  int
>  linux_fcntl(struct thread *td, struct linux_fcntl_args *args)
>  {
> -	struct linux_fcntl64_args args64;
> 
>  #ifdef DEBUG
>  	if (ldebug(fcntl))
>  		printf(ARGS(fcntl, "%d, %08x, *"), args->fd, args->cmd);
>  #endif
> 
> -	args64.fd = args->fd;
> -	args64.cmd = args->cmd;
> -	args64.arg = args->arg;
> -	return (fcntl_common(td, &args64));
> +	return (fcntl_common(td, args));
>  }
> 
>  #if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
> @@ -1401,6 +1405,7 @@ linux_fcntl64(struct thread *td, struct 
> linux_fcntl64_args *args)
>  {
>  	struct l_flock64 linux_flock;
>  	struct flock bsd_flock;
> +	struct linux_fcntl_args fcntl_args;
>  	int error;
> 
>  #ifdef DEBUG
> @@ -1441,7 +1446,10 @@ linux_fcntl64(struct thread *td, struct 
> linux_fcntl64_args *args)
>  		    (intptr_t)&bsd_flock));
>  	}
> 
> -	return (fcntl_common(td, args));
> +	fcntl_args.fd = args->fd;
> +	fcntl_args.cmd = args->cmd;
> +	fcntl_args.arg = args->arg;
> +	return (fcntl_common(td, &fcntl_args));
>  }
>  #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */

the replacement of fcntl64 with fcntl does not make any sense to me.
those structures are exactly the same...

can you test if just the first fix (long -> unsigned long) is sufficient
to make the problem go away?

thnx!

roman


More information about the freebsd-emulation mailing list