openat on 10.6.8?
macports at raf.org
Sun Jan 30 22:00:49 UTC 2022
On Sun, Jan 30, 2022 at 09:30:02PM +0100, Christopher Chavez <chrischavez at gmx.us> wrote:
> > Sent: Sunday, January 30, 2022 at 2:59 AM
> > From: raf
> > I just tried to compile (/usr/bin/cc) something (not a
> > port) that uses openat(2) on 10.6.8 (with current
> > macports and Xcode 3.2.6 (1761)) but it wasn't there. I
> > expected it to be, because openat() was standardized by
> > 2008 and the 10.6.8 system is from 2010. Did I compile
> > it wrong (e.g., old default compiler), or did openat()
> > just not appear until a later version of macOS?
> Note that MacPorts legacy support provides an implementation
> of openat() for 10.9 and earlier. Using it from a port is
> usually easy: see bfs for an example. Using it outside of
> MacPorts should still be possible, but could require digging in
> for the needed include header and linker flags.
> Christopher A. Chavez
Thanks for that. That's very helpful. Macports is amazing.
I think creating a Portfile sounds like the best approach.
I can see from bfs's Portfile that unlinkat() and fdopendir()
# Need openat(), unlinkat(), fdopendir()
Are faccessat(), readlinkat(), and fstatat() also there?
More information about the macports-users