No mkdir in glibgloss/syscall.h? (Was:Re: RFA: Add Epiphany newlib & libgloss port)

Mike Frysinger vapier@gentoo.org
Sun Nov 6 22:48:00 GMT 2011


On Sunday 06 November 2011 09:35:36 Joern Rennecke wrote:
> Quoting Jim Meyering <jim@meyering.net>:
> > stat always succeeds.  Even with a very rudimentary file system,
> > shouldn't
> > 
> >   stat be able to fail with ENOENT, EFAULT, ENAMETOOLONG, ENOTDIR, etc?
> > 
> > fstat always succeeds.  What about EBADF, EFAULT, etc.?
> 
> The file system would be the host file system of the simulator.  However,
> there is currently no interface for stat in the simulator.

i'm jumping in in the middle here, but i know stat() works in the sim.  it's a 
bit undocumented to be sure, but support is there.

check out sim/bfin/interp.c and look at the stat_map defines.  set your 
callback's stat_map pointer to the string layout for your port before calling 
the common cb_syscall(), and that'll take care of the rest for you.

> I thought using libgloss/syscall.h would be a good choice for a bare-metal
> port.

it'd be nice if we could convert everyone over to that.  new ports at least 
should be using that by default.

also note that we need to stay in sync with include/gdb/callback.h

> However, one thing I'd also like to get from such an interface is mkdir -
> that's needed for fully-functional profiling with gcc, otherwise it will
> only work if the profile output pathname is in an existing directory.
> 
> Can we add mkdir to libgloss/syscalls.h ?
> Or is every port that needs more that what's provided there supposed to
> roll their own?

i'm all for adding mkdir to libgloss/syscall.h and extending 
sim/common/callback.c
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/newlib/attachments/20111106/deac3341/attachment-0001.sig>


More information about the Newlib mailing list