On Tue, Mar 6, 2012 at 10:50 PM, Vaugha Brewchuk <vaugha_brewchuk@xxxxxxxx> wrote: > > On 2012-03-06, at 4:51 PM, Jonathan Wakely wrote: > >> On 6 March 2012 20:53, Vaugha Brewchuk wrote: >>> >>> >>> [SNIP] >>> >>> On the other hand access() and write() are in the NeXT libraries, but are defined in header libc.h, that libstdc++ does not recognize out of the box... >> >> I doubt those functions are defined in a header, note the error you're >> getting is an undefined reference - meaning the library containing the >> functions hasn't been found. Not finding a header isn't the problem. >> Which library defines them? > > It looks like the actual objects for access() and write() reside in /usr/shlib/libsys_s.B.shlib, which is a shared library that is automatically loaded, if needed, by the standard NeXT static library /lib/libsys_s.a. To confirm I just created a short test program in C that uses write() and compiled it with my C only port of gcc-3.2.3 using the following command: > Be careful with access(2) - I believe its a TOCTOU lying in wait. My man pages tell me "access() is a potential security hole and should never be used."