This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: problem with synth. target: error 38


On Fri, Nov 19, 2004 at 01:33:36AM +0100, Alexander Neundorf wrote:
> Hi,
> 
> I'm trying to get the shmget/shmat/shmdt system calls working under the 
> synthetic target. I didn't find much documentation, only that the calls just 
> take one argument which is a pointer to an array of six integers. So here's 
> what I tried:
> 
> SYSCALL1(ipc)  //defines cyg_hal_sys_ipc
> 
> int cyg_syscall_ipc(unsigned int call, int first, int second, int third, void 
> *ptr, unsigned int fifth)
> {
>    int ipc_args[6];
>    ipc_args[0]=call;
>    ipc_args[1]=first;
>    ipc_args[2]=second;
>    ipc_args[3]=third;
>    ipc_args[4]=(int)ptr;
>    ipc_args[5]=fifth;
>    return cyg_hal_sys_ipc(ipc_args);
> }
> 
> int cyg_hal_sys_shmget (int key, int size, int shmflg)
> {
>   return cyg_syscall_ipc(CYG_HAL_SYS_IPCOP_shmget, key, size, shmflg, NULL, 
> 0);
> }
> 
> void * cyg_hal_sys_shmat (int shmid, const void* shmaddr, int shmflg)
> {
>   void * result;
>   void * raddr;
>   result = (void *) cyg_syscall_ipc(CYG_HAL_SYS_IPCOP_shmat, shmid, shmflg,
> 					       (int) (&raddr), (void*)shmaddr, 0);
>   return result;
> }
> 
> when calling this cyg_hal_sys_shmget() with a valid key, it returns -38, the 
> same for cyg_hal_sys_shmat() also -38 is returned. Error 38 is ENOSYS.
> The system call id is 117, which should be correct.
> Any hints what I'm doing wrong ?

User the source luke....

linux-2.6.9/arch/i386/kernel/sys_i386.c: sys_ipc()

The default case for the switch returns -ENOSYS so first check you are
passing the correct call parameter. However, what i suspect your real
problem is, is that the syscall does not take one parameter as you
have coded, but actually 6. 

        Andrew



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]