This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Attachment: signature.asc
Description: This is a digitally signed message part.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]