title: How to force linkage to older libc `fcntl` instead of `fcntl64`?
body: <p>It seems <a href="https://savannah.gnu.org/forum/forum.php?forum_id=9205" rel="noreferrer">GLIBC 2.28 (released August 2018)</a> made a fairly aggressive change to fcntl.  The definition was changed in <code>&lt;fcntl.h&gt;</code> to no longer be an external function, <a href="https://sourceware.org/git/?p=glibc.git;a=blob;f=io/fcntl.h;h=6b0e9fa1fa2a2d8872b1adb5c0861410756a9e52;hb=3c03baca37fdcb52c3881e653ca392bba7a99c2b#l180" rel="noreferrer">but a <code>#define</code> to fcntl64</a>.</p>
  
  <p>The upshot is that if you compile your code on a system with this glibc--if it uses fcntl() <em>at all</em>--the resulting binary will not execute on a system from before August 2018.  This affects quite a variety of applications...the manual page for fcntl() shows that it's the entry point for a small universe of sub-functions:</p>
  
  <p><a href="https://linux.die.net/man/2/fcntl" rel="noreferrer">https://linux.die.net/man/2/fcntl</a></p>
  
  <p>It would be nice if you could tell the linker what specific version of a GLIBC function you wanted.  But the closest I found was this trick described in an answer to another post:</p>
  
  <p><a href="https://stackoverflow.com/a/8862631/">Answer to "Linking against older symbol version in a .so file"</a></p>
  
  <p>This is a bit more complicated.  <code>fcntl</code> is variadic without a <code>vffcntl</code> that takes a va_list.  In such situations <a href="https://stackoverflow.com/questions/150543/forward-an-invocation-of-a-variadic-function-in-c">you cannot forward an invocation of a variadic function</a>.  :-(</p>
  
  <p>When one has stable code with purposefully low dependencies, it's a let-down to build it on a current Ubuntu...then and have the executable refuse to run on another Ubuntu released only one year prior (nearly to the day).  What recourse does one have for this?</p>