Subject: Re: syscalls return values
To: None <p99dreyf@criens.u-psud.fr, tech-kern@netbsd.org>
From: None <eeh@netbsd.org>
List: tech-kern
Date: 01/19/2001 19:40:01
	I have a problem with the lstat system call in Linux emulation.
	According to Linux, it should return a long. 

	If I write with a printf the return value in the kernel, at the end od
	linux_sys_lstat, I can see that everything went fine, and that the
	return value is 0. But the user process get a non zero return value. I
	think this is caused by a size mismatch: the kernel sets up a 32 bits
	long result, and the process reads a 64 bits value.

	Is there any way of returning a long after a syscall? If I just change
	in syscalls.master the return value from int to long, when I generate
	linux_syscallargs.h, the system call still have a int result and not a
	long. 

	Any idea about how to fix this?

You never mention what architecture you're running on.  Unless
you're on a 64-bit machine (right now that consists of the rather
short list of (alpha, sparc64)) `long' is only 32-bits wide.  To
get 64-bits you need to use `quad_t' or `long long'.

Eduardo