Re: syscall problem on Android x86

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 26 2013, Akers, Jason B wrote:
> Unfortunately android x86 doesn't have a syscall number for the shm*
> functions. They are not exposed by x86 bionic libc. So there's nothing
> to fill in for a/b/c/d.
> 
> The only way I see to get syscall numbers is to patch x86 android libc
> and recompile. This should work for me today but, since the syscall
> numbers are not standardized, it will not work for anyone with an
> unmodified libc.
> 
> So I propose something like:
> 
> #ifndef __NR_shmget
> #if defined(__ANDROID__)
> #error "__NR_shmget not defined. See bionic libc SYSCALLS.TXT for more information."
> #else
> #define __NR_shmget		 29
> #define __NR_shmat		 30
> #define __NR_shmctl		 31
> #define __NR_shmdt		 67
> #endif
> #endif
> 
> This will "break the build" for unmodified x86 android platforms, but
> I think that's better than compiling and not working.

The syscall has nothing to do with the libc installed. The libc headers
might not DEFINE the numbers. As long as the syscall is wired up in the
given kernel (which I'm assuming it is, but I really know nothing about
android), then that is enough.

> The other (probably better long-term) option is to use ashmem for
> allocating shared memory on android.

I'll gladly take patches :-)

Please stop top-posting, btw, it goes against the normal net etiquette
on this forum (and most others in the open source world).

-- 
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux