Thank you, Mike. You show great skill:)
I won't touch Google code here. I just fixed it this way (learn from
external/sqlite/dist/sqlite3.c):
/*
** Use the fdatasync() API only if the HAVE_FDATASYNC macro is
defined.
** Otherwise use fsync() in its place.
*/
#ifndef HAVE_FDATASYNC
# define fdatasync fsync
#endif

Reading bionic/libc/include/sys/linux-unistd.h (generated by Google as
you mentioned), I found only fsync() was implemented.

Kenny

On Jul 2, 8:29 pm, Michael Trimarchi <[email protected]>
wrote:
> Hi,
>
> Kenny wrote:
> > Yes, it is. The linker "ld" fails to find the symbol fdatasync. How to
> > get it found? And trick in Android.mk?
> > Kenny
>
> Add to the bionic SYSCALL.txt and call the python script gensyscall.py.
> I hope
> that it fix your issue
>
> Michael
>
>
>
> > On Jul 2, 8:16 pm, Michael Trimarchi <[email protected]>
> > wrote:
>
> >> Kenny Yu wrote:
>
> >>> I am porting a C program. Very simple - it refers to a C function
> >>> declared in BIONIC libc:
>
> >>> device/bionic/libc/include/unistd.h
> >>> at line 142 (CUPCAKE version) as
> >>> extern int fdatasync(int);
>
> >>> Link failure is seen because libc.so doesn't have the implementation:
> >>> external/sysstat/sadc.c:901: undefined reference to `fdatasync'
> >>> collect2: ld returned 1 exit status
>
> >>> Can anyone figure out where the function fdatasync() is implemented?
>
> >> I think that is a syscall so just add to the syscall list.
> >> Michael
>
> >>> It should call syscall fdatasync eventually.
>
> >>> Kenny- Hide quoted text -
>
> >> - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---


Reply via email to