openat on 10.6.8?

Christopher Chavez chrischavez at
Sun Jan 30 20:30:02 UTC 2022

> 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

More information about the macports-users mailing list