<div dir="ltr">futimens() is available in Android KitKat. We work extensively with LLVM and this allowed us to remove our ugly workaround for not having this functionality.<div><br></div><div>Steve</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, Nov 25, 2013 at 8:30 AM, James Lyon <span dir="ltr"><<a href="mailto:jameslyon0@gmail.com" target="_blank">jameslyon0@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

  

    
  
  <div text="#000000" bgcolor="#FFFFFF">
    Hi,<br>
    <br>
    I've been trying to get LLVM working as a JIT compiler on Android
    for a while. It works now, except that the
    setLastModificationAndAccessTime function won't build because the
    Bionic C library lacks both futimes and futimens. There doesn't
    appear to be any "nice" workaround for this problem: the only ways I
    can think of to make setLastModificationAndAccessTime work are
    either to go by /proc/self/fd or invoke the system call directly
    (the second option isn't helped by the fact that the Android headers
    don't define the relevant system call number and it varies between
    platforms).<br>
    <br>
    Right now the only part of LLVM that uses this function is llvm-ar,
    so it's not as if lack of support for this function is a serious
    shortcoming. I don't really know the history of PathV1/PathV2 but I
    think the simplest solutions are:<br>
    <ol>
      <li>Have setLastModificationAndAccessTime fail on platforms
        without futimes/futimens (by ENOSYS). This is pretty ugly
        because having a function which can never succeed seems likely
        to confuse users.</li>
      <li>Only declare setLastModificationAndAccessTime if it is
        actually available (add something to llvm-config.h to indicate
        this). The downside here is that (in theory at least) users need
        to know that setLastModificationAndAccessTime might be missing,
        although in practise they can probably ignore the issue.<br>
      </li>
    </ol>
    (1) is trivial to implement and is what I'm doing now; I can also
    create a patch to do (2), I just thought I'd ask for opinions first.<br>
    <br>
    Regards,<br>
    <br>
    James<br>
  </div>

<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>